]>
Commit | Line | Data |
---|---|---|
f069a9f2 KK |
1 | diff -U 3 -H -d -r -N -- evas-0.9.9.015.orig/acinclude.m4 evas-0.9.9.015/acinclude.m4 |
2 | --- evas-0.9.9.015.orig/acinclude.m4 1970-01-01 01:00:00.000000000 +0100 | |
3 | +++ evas-0.9.9.015/acinclude.m4 2005-09-29 16:44:50.000000000 +0200 | |
4 | @@ -0,0 +1,136 @@ | |
5 | +dnl @synopsis AC_PATH_GENERIC(LIBRARY [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
6 | +dnl | |
7 | +dnl Runs a LIBRARY-config script and defines LIBRARY_CFLAGS and LIBRARY_LIBS | |
8 | +dnl | |
9 | +dnl The script must support `--cflags' and `--libs' args. | |
10 | +dnl If MINIMUM-VERSION is specified, the script must also support the | |
11 | +dnl `--version' arg. | |
12 | +dnl If the `--with-library-[exec-]prefix' arguments to ./configure are given, | |
13 | +dnl it must also support `--prefix' and `--exec-prefix'. | |
14 | +dnl (In other words, it must be like gtk-config.) | |
15 | +dnl | |
16 | +dnl For example: | |
17 | +dnl | |
18 | +dnl AC_PATH_GENERIC(Foo, 1.0.0) | |
19 | +dnl | |
20 | +dnl would run `foo-config --version' and check that it is at least 1.0.0 | |
21 | +dnl | |
22 | +dnl If so, the following would then be defined: | |
23 | +dnl | |
24 | +dnl FOO_CFLAGS to `foo-config --cflags` | |
25 | +dnl FOO_LIBS to `foo-config --libs` | |
26 | +dnl | |
27 | +dnl At present there is no support for additional "MODULES" (see AM_PATH_GTK) | |
28 | +dnl (shamelessly stolen from gtk.m4 and then hacked around a fair amount) | |
29 | +dnl | |
30 | +dnl @author Angus Lees <gusl@cse.unsw.edu.au> | |
31 | +dnl @version $Id$ | |
32 | + | |
33 | +AC_DEFUN([AC_PATH_GENERIC], | |
34 | +[dnl | |
35 | +dnl we're going to need uppercase, lowercase and user-friendly versions of the | |
36 | +dnl string `LIBRARY' | |
37 | +pushdef([UP], translit([$1], [a-z], [A-Z]))dnl | |
38 | +pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl | |
39 | + | |
40 | +dnl | |
41 | +dnl Get the cflags and libraries from the LIBRARY-config script | |
42 | +dnl | |
43 | +AC_ARG_WITH(DOWN-prefix,[ --with-]DOWN[-prefix=PFX Prefix where $1 is installed (optional)], | |
44 | + DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="") | |
45 | +AC_ARG_WITH(DOWN-exec-prefix,[ --with-]DOWN[-exec-prefix=PFX Exec prefix where $1 is installed (optional)], | |
46 | + DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="") | |
47 | + | |
48 | + if test x$DOWN[]_config_exec_prefix != x ; then | |
49 | + DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix" | |
50 | + if test x${UP[]_CONFIG+set} != xset ; then | |
51 | + UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config | |
52 | + fi | |
53 | + fi | |
54 | + if test x$DOWN[]_config_prefix != x ; then | |
55 | + DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix" | |
56 | + if test x${UP[]_CONFIG+set} != xset ; then | |
57 | + UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config | |
58 | + fi | |
59 | + fi | |
60 | + | |
61 | + AC_PATH_PROG(UP[]_CONFIG, DOWN-config, no) | |
62 | + ifelse([$2], , | |
63 | + AC_MSG_CHECKING(for $1), | |
64 | + AC_MSG_CHECKING(for $1 - version >= $2) | |
65 | + ) | |
66 | + no_[]DOWN="" | |
67 | + if test "$UP[]_CONFIG" = "no" ; then | |
68 | + no_[]DOWN=yes | |
69 | + else | |
70 | + UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`" | |
71 | + UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`" | |
72 | + ifelse([$2], , ,[ | |
73 | + DOWN[]_config_major_version=`$UP[]_CONFIG $DOWN[]_config_args \ | |
74 | + --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
75 | + DOWN[]_config_minor_version=`$UP[]_CONFIG $DOWN[]_config_args \ | |
76 | + --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
77 | + DOWN[]_config_micro_version=`$UP[]_CONFIG $DOWN[]_config_args \ | |
78 | + --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
79 | + DOWN[]_wanted_major_version="regexp($2, [\<\([0-9]*\)], [\1])" | |
80 | + DOWN[]_wanted_minor_version="regexp($2, [\<\([0-9]*\)\.\([0-9]*\)], [\2])" | |
81 | + DOWN[]_wanted_micro_version="regexp($2, [\<\([0-9]*\).\([0-9]*\).\([0-9]*\)], [\3])" | |
82 | + | |
83 | + # Compare wanted version to what config script returned. | |
84 | + # If I knew what library was being run, i'd probably also compile | |
85 | + # a test program at this point (which also extracted and tested | |
86 | + # the version in some library-specific way) | |
87 | + if test "$DOWN[]_config_major_version" -lt \ | |
88 | + "$DOWN[]_wanted_major_version" \ | |
89 | + -o \( "$DOWN[]_config_major_version" -eq \ | |
90 | + "$DOWN[]_wanted_major_version" \ | |
91 | + -a "$DOWN[]_config_minor_version" -lt \ | |
92 | + "$DOWN[]_wanted_minor_version" \) \ | |
93 | + -o \( "$DOWN[]_config_major_version" -eq \ | |
94 | + "$DOWN[]_wanted_major_version" \ | |
95 | + -a "$DOWN[]_config_minor_version" -eq \ | |
96 | + "$DOWN[]_wanted_minor_version" \ | |
97 | + -a "$DOWN[]_config_micro_version" -lt \ | |
98 | + "$DOWN[]_wanted_micro_version" \) ; then | |
99 | + # older version found | |
100 | + no_[]DOWN=yes | |
101 | + echo -n "*** An old version of $1 " | |
102 | + echo -n "($DOWN[]_config_major_version" | |
103 | + echo -n ".$DOWN[]_config_minor_version" | |
104 | + echo ".$DOWN[]_config_micro_version) was found." | |
105 | + echo -n "*** You need a version of $1 newer than " | |
106 | + echo -n "$DOWN[]_wanted_major_version" | |
107 | + echo -n ".$DOWN[]_wanted_minor_version" | |
108 | + echo ".$DOWN[]_wanted_micro_version." | |
109 | + echo "***" | |
110 | + echo "*** If you have already installed a sufficiently new version, this error" | |
111 | + echo "*** probably means that the wrong copy of the DOWN-config shell script is" | |
112 | + echo "*** being found. The easiest way to fix this is to remove the old version" | |
113 | + echo "*** of $1, but you can also set the UP[]_CONFIG environment to point to the" | |
114 | + echo "*** correct copy of DOWN-config. (In this case, you will have to" | |
115 | + echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf" | |
116 | + echo "*** so that the correct libraries are found at run-time)" | |
117 | + fi | |
118 | + ]) | |
119 | + fi | |
120 | + if test "x$no_[]DOWN" = x ; then | |
121 | + AC_MSG_RESULT(yes) | |
122 | + ifelse([$3], , :, [$3]) | |
123 | + else | |
124 | + AC_MSG_RESULT(no) | |
125 | + if test "$UP[]_CONFIG" = "no" ; then | |
126 | + echo "*** The DOWN-config script installed by $1 could not be found" | |
127 | + echo "*** If $1 was installed in PREFIX, make sure PREFIX/bin is in" | |
128 | + echo "*** your path, or set the UP[]_CONFIG environment variable to the" | |
129 | + echo "*** full path to DOWN-config." | |
130 | + fi | |
131 | + UP[]_CFLAGS="" | |
132 | + UP[]_LIBS="" | |
133 | + ifelse([$4], , :, [$4]) | |
134 | + fi | |
135 | + AC_SUBST(UP[]_CFLAGS) | |
136 | + AC_SUBST(UP[]_LIBS) | |
137 | + | |
138 | + popdef([UP]) | |
139 | + popdef([DOWN]) | |
140 | +]) |