1 |
dnl aclocal.m4 generated automatically by aclocal 1.4 |
2 |
|
3 |
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. |
4 |
dnl This file is free software; the Free Software Foundation |
5 |
dnl gives unlimited permission to copy and/or distribute it, |
6 |
dnl with or without modifications, as long as this notice is preserved. |
7 |
|
8 |
dnl This program is distributed in the hope that it will be useful, |
9 |
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without |
10 |
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
11 |
dnl PARTICULAR PURPOSE. |
12 |
|
13 |
# Configure paths for GTK+ |
14 |
# Owen Taylor 97-11-3 |
15 |
|
16 |
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) |
17 |
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS |
18 |
dnl |
19 |
AC_DEFUN(AM_PATH_GTK, |
20 |
[dnl |
21 |
dnl Get the cflags and libraries from the gtk-config script |
22 |
dnl |
23 |
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], |
24 |
gtk_config_prefix="$withval", gtk_config_prefix="") |
25 |
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], |
26 |
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") |
27 |
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], |
28 |
, enable_gtktest=yes) |
29 |
|
30 |
for module in . $4 |
31 |
do |
32 |
case "$module" in |
33 |
gthread) |
34 |
gtk_config_args="$gtk_config_args gthread" |
35 |
;; |
36 |
esac |
37 |
done |
38 |
|
39 |
if test x$gtk_config_exec_prefix != x ; then |
40 |
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" |
41 |
if test x${GTK_CONFIG+set} != xset ; then |
42 |
GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config |
43 |
fi |
44 |
fi |
45 |
if test x$gtk_config_prefix != x ; then |
46 |
gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" |
47 |
if test x${GTK_CONFIG+set} != xset ; then |
48 |
GTK_CONFIG=$gtk_config_prefix/bin/gtk-config |
49 |
fi |
50 |
fi |
51 |
|
52 |
AC_PATH_PROG(GTK_CONFIG, gtk-config, no) |
53 |
min_gtk_version=ifelse([$1], ,0.99.7,$1) |
54 |
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) |
55 |
no_gtk="" |
56 |
if test "$GTK_CONFIG" = "no" ; then |
57 |
no_gtk=yes |
58 |
else |
59 |
GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` |
60 |
GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` |
61 |
gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ |
62 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
63 |
gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ |
64 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
65 |
gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ |
66 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
67 |
if test "x$enable_gtktest" = "xyes" ; then |
68 |
ac_save_CFLAGS="$CFLAGS" |
69 |
ac_save_LIBS="$LIBS" |
70 |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
71 |
LIBS="$GTK_LIBS $LIBS" |
72 |
dnl |
73 |
dnl Now check if the installed GTK is sufficiently new. (Also sanity |
74 |
dnl checks the results of gtk-config to some extent |
75 |
dnl |
76 |
rm -f conf.gtktest |
77 |
AC_TRY_RUN([ |
78 |
#include <gtk/gtk.h> |
79 |
#include <stdio.h> |
80 |
#include <stdlib.h> |
81 |
|
82 |
int |
83 |
main () |
84 |
{ |
85 |
int major, minor, micro; |
86 |
char *tmp_version; |
87 |
|
88 |
system ("touch conf.gtktest"); |
89 |
|
90 |
/* HP/UX 9 (%@#!) writes to sscanf strings */ |
91 |
tmp_version = g_strdup("$min_gtk_version"); |
92 |
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
93 |
printf("%s, bad version string\n", "$min_gtk_version"); |
94 |
exit(1); |
95 |
} |
96 |
|
97 |
if ((gtk_major_version != $gtk_config_major_version) || |
98 |
(gtk_minor_version != $gtk_config_minor_version) || |
99 |
(gtk_micro_version != $gtk_config_micro_version)) |
100 |
{ |
101 |
printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", |
102 |
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, |
103 |
gtk_major_version, gtk_minor_version, gtk_micro_version); |
104 |
printf ("*** was found! If gtk-config was correct, then it is best\n"); |
105 |
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); |
106 |
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); |
107 |
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); |
108 |
printf("*** required on your system.\n"); |
109 |
printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); |
110 |
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); |
111 |
printf("*** before re-running configure\n"); |
112 |
} |
113 |
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) |
114 |
else if ((gtk_major_version != GTK_MAJOR_VERSION) || |
115 |
(gtk_minor_version != GTK_MINOR_VERSION) || |
116 |
(gtk_micro_version != GTK_MICRO_VERSION)) |
117 |
{ |
118 |
printf("*** GTK+ header files (version %d.%d.%d) do not match\n", |
119 |
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); |
120 |
printf("*** library (version %d.%d.%d)\n", |
121 |
gtk_major_version, gtk_minor_version, gtk_micro_version); |
122 |
} |
123 |
#endif /* defined (GTK_MAJOR_VERSION) ... */ |
124 |
else |
125 |
{ |
126 |
if ((gtk_major_version > major) || |
127 |
((gtk_major_version == major) && (gtk_minor_version > minor)) || |
128 |
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) |
129 |
{ |
130 |
return 0; |
131 |
} |
132 |
else |
133 |
{ |
134 |
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", |
135 |
gtk_major_version, gtk_minor_version, gtk_micro_version); |
136 |
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", |
137 |
major, minor, micro); |
138 |
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); |
139 |
printf("***\n"); |
140 |
printf("*** If you have already installed a sufficiently new version, this error\n"); |
141 |
printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); |
142 |
printf("*** being found. The easiest way to fix this is to remove the old version\n"); |
143 |
printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); |
144 |
printf("*** correct copy of gtk-config. (In this case, you will have to\n"); |
145 |
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); |
146 |
printf("*** so that the correct libraries are found at run-time))\n"); |
147 |
} |
148 |
} |
149 |
return 1; |
150 |
} |
151 |
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
152 |
CFLAGS="$ac_save_CFLAGS" |
153 |
LIBS="$ac_save_LIBS" |
154 |
fi |
155 |
fi |
156 |
if test "x$no_gtk" = x ; then |
157 |
AC_MSG_RESULT(yes) |
158 |
ifelse([$2], , :, [$2]) |
159 |
else |
160 |
AC_MSG_RESULT(no) |
161 |
if test "$GTK_CONFIG" = "no" ; then |
162 |
echo "*** The gtk-config script installed by GTK could not be found" |
163 |
echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" |
164 |
echo "*** your path, or set the GTK_CONFIG environment variable to the" |
165 |
echo "*** full path to gtk-config." |
166 |
else |
167 |
if test -f conf.gtktest ; then |
168 |
: |
169 |
else |
170 |
echo "*** Could not run GTK test program, checking why..." |
171 |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
172 |
LIBS="$LIBS $GTK_LIBS" |
173 |
AC_TRY_LINK([ |
174 |
#include <gtk/gtk.h> |
175 |
#include <stdio.h> |
176 |
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], |
177 |
[ echo "*** The test program compiled, but did not run. This usually means" |
178 |
echo "*** that the run-time linker is not finding GTK or finding the wrong" |
179 |
echo "*** version of GTK. If it is not finding GTK, you'll need to set your" |
180 |
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
181 |
echo "*** to the installed location Also, make sure you have run ldconfig if that" |
182 |
echo "*** is required on your system" |
183 |
echo "***" |
184 |
echo "*** If you have an old version installed, it is best to remove it, although" |
185 |
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" |
186 |
echo "***" |
187 |
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" |
188 |
echo "*** came with the system with the command" |
189 |
echo "***" |
190 |
echo "*** rpm --erase --nodeps gtk gtk-devel" ], |
191 |
[ echo "*** The test program failed to compile or link. See the file config.log for the" |
192 |
echo "*** exact error that occured. This usually means GTK was incorrectly installed" |
193 |
echo "*** or that you have moved GTK since it was installed. In the latter case, you" |
194 |
echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) |
195 |
CFLAGS="$ac_save_CFLAGS" |
196 |
LIBS="$ac_save_LIBS" |
197 |
fi |
198 |
fi |
199 |
GTK_CFLAGS="" |
200 |
GTK_LIBS="" |
201 |
ifelse([$3], , :, [$3]) |
202 |
fi |
203 |
AC_SUBST(GTK_CFLAGS) |
204 |
AC_SUBST(GTK_LIBS) |
205 |
rm -f conf.gtktest |
206 |
]) |
207 |
|
208 |
# Configure paths for ESD |
209 |
# Manish Singh 98-9-30 |
210 |
# stolen back from Frank Belew |
211 |
# stolen from Manish Singh |
212 |
# Shamelessly stolen from Owen Taylor |
213 |
|
214 |
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) |
215 |
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS |
216 |
dnl |
217 |
AC_DEFUN(AM_PATH_ESD, |
218 |
[dnl |
219 |
dnl Get the cflags and libraries from the esd-config script |
220 |
dnl |
221 |
AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], |
222 |
esd_prefix="$withval", esd_prefix="") |
223 |
AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], |
224 |
esd_exec_prefix="$withval", esd_exec_prefix="") |
225 |
AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], |
226 |
, enable_esdtest=yes) |
227 |
|
228 |
if test x$esd_exec_prefix != x ; then |
229 |
esd_args="$esd_args --exec-prefix=$esd_exec_prefix" |
230 |
if test x${ESD_CONFIG+set} != xset ; then |
231 |
ESD_CONFIG=$esd_exec_prefix/bin/esd-config |
232 |
fi |
233 |
fi |
234 |
if test x$esd_prefix != x ; then |
235 |
esd_args="$esd_args --prefix=$esd_prefix" |
236 |
if test x${ESD_CONFIG+set} != xset ; then |
237 |
ESD_CONFIG=$esd_prefix/bin/esd-config |
238 |
fi |
239 |
fi |
240 |
|
241 |
AC_PATH_PROG(ESD_CONFIG, esd-config, no) |
242 |
min_esd_version=ifelse([$1], ,0.2.7,$1) |
243 |
AC_MSG_CHECKING(for ESD - version >= $min_esd_version) |
244 |
no_esd="" |
245 |
if test "$ESD_CONFIG" = "no" ; then |
246 |
no_esd=yes |
247 |
else |
248 |
AC_LANG_SAVE |
249 |
AC_LANG_C |
250 |
ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` |
251 |
ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` |
252 |
|
253 |
esd_major_version=`$ESD_CONFIG $esd_args --version | \ |
254 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` |
255 |
esd_minor_version=`$ESD_CONFIG $esd_args --version | \ |
256 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` |
257 |
esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ |
258 |
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` |
259 |
if test "x$enable_esdtest" = "xyes" ; then |
260 |
ac_save_CFLAGS="$CFLAGS" |
261 |
ac_save_LIBS="$LIBS" |
262 |
CFLAGS="$CFLAGS $ESD_CFLAGS" |
263 |
LIBS="$LIBS $ESD_LIBS" |
264 |
dnl |
265 |
dnl Now check if the installed ESD is sufficiently new. (Also sanity |
266 |
dnl checks the results of esd-config to some extent |
267 |
dnl |
268 |
rm -f conf.esdtest |
269 |
AC_TRY_RUN([ |
270 |
#include <stdio.h> |
271 |
#include <stdlib.h> |
272 |
#include <string.h> |
273 |
#include <esd.h> |
274 |
|
275 |
char* |
276 |
my_strdup (char *str) |
277 |
{ |
278 |
char *new_str; |
279 |
|
280 |
if (str) |
281 |
{ |
282 |
new_str = malloc ((strlen (str) + 1) * sizeof(char)); |
283 |
strcpy (new_str, str); |
284 |
} |
285 |
else |
286 |
new_str = NULL; |
287 |
|
288 |
return new_str; |
289 |
} |
290 |
|
291 |
int main () |
292 |
{ |
293 |
int major, minor, micro; |
294 |
char *tmp_version; |
295 |
|
296 |
system ("touch conf.esdtest"); |
297 |
|
298 |
/* HP/UX 9 (%@#!) writes to sscanf strings */ |
299 |
tmp_version = my_strdup("$min_esd_version"); |
300 |
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { |
301 |
printf("%s, bad version string\n", "$min_esd_version"); |
302 |
exit(1); |
303 |
} |
304 |
|
305 |
if (($esd_major_version > major) || |
306 |
(($esd_major_version == major) && ($esd_minor_version > minor)) || |
307 |
(($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) |
308 |
{ |
309 |
return 0; |
310 |
} |
311 |
else |
312 |
{ |
313 |
printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); |
314 |
printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); |
315 |
printf("*** best to upgrade to the required version.\n"); |
316 |
printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); |
317 |
printf("*** to point to the correct copy of esd-config, and remove the file\n"); |
318 |
printf("*** config.cache before re-running configure\n"); |
319 |
return 1; |
320 |
} |
321 |
} |
322 |
|
323 |
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) |
324 |
CFLAGS="$ac_save_CFLAGS" |
325 |
LIBS="$ac_save_LIBS" |
326 |
AC_LANG_RESTORE |
327 |
fi |
328 |
fi |
329 |
if test "x$no_esd" = x ; then |
330 |
AC_MSG_RESULT(yes) |
331 |
ifelse([$2], , :, [$2]) |
332 |
else |
333 |
AC_MSG_RESULT(no) |
334 |
if test "$ESD_CONFIG" = "no" ; then |
335 |
echo "*** The esd-config script installed by ESD could not be found" |
336 |
echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" |
337 |
echo "*** your path, or set the ESD_CONFIG environment variable to the" |
338 |
echo "*** full path to esd-config." |
339 |
else |
340 |
if test -f conf.esdtest ; then |
341 |
: |
342 |
else |
343 |
echo "*** Could not run ESD test program, checking why..." |
344 |
CFLAGS="$CFLAGS $ESD_CFLAGS" |
345 |
LIBS="$LIBS $ESD_LIBS" |
346 |
AC_LANG_SAVE |
347 |
AC_LANG_C |
348 |
AC_TRY_LINK([ |
349 |
#include <stdio.h> |
350 |
#include <esd.h> |
351 |
], [ return 0; ], |
352 |
[ echo "*** The test program compiled, but did not run. This usually means" |
353 |
echo "*** that the run-time linker is not finding ESD or finding the wrong" |
354 |
echo "*** version of ESD. If it is not finding ESD, you'll need to set your" |
355 |
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" |
356 |
echo "*** to the installed location Also, make sure you have run ldconfig if that" |
357 |
echo "*** is required on your system" |
358 |
echo "***" |
359 |
echo "*** If you have an old version installed, it is best to remove it, although" |
360 |
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], |
361 |
[ echo "*** The test program failed to compile or link. See the file config.log for the" |
362 |
echo "*** exact error that occured. This usually means ESD was incorrectly installed" |
363 |
echo "*** or that you have moved ESD since it was installed. In the latter case, you" |
364 |
echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) |
365 |
CFLAGS="$ac_save_CFLAGS" |
366 |
LIBS="$ac_save_LIBS" |
367 |
AC_LANG_RESTORE |
368 |
fi |
369 |
fi |
370 |
ESD_CFLAGS="" |
371 |
ESD_LIBS="" |
372 |
ifelse([$3], , :, [$3]) |
373 |
fi |
374 |
AC_SUBST(ESD_CFLAGS) |
375 |
AC_SUBST(ESD_LIBS) |
376 |
rm -f conf.esdtest |
377 |
]) |
378 |
|