ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/aclocal.m4
Revision: 1.12
Committed: 2002-01-22T16:07:29Z (22 years, 9 months ago) by cebix
Branch: MAIN
CVS Tags: HEAD
Changes since 1.11: +0 -0 lines
State: FILE REMOVED
Log Message:
aclocal.m4 is generated by aclocal via autogen.sh

File Contents

# Content
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, &micro) != 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 ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
249 ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
250
251 esd_major_version=`$ESD_CONFIG $esd_args --version | \
252 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
253 esd_minor_version=`$ESD_CONFIG $esd_args --version | \
254 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
255 esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
256 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
257 if test "x$enable_esdtest" = "xyes" ; then
258 ac_save_CFLAGS="$CFLAGS"
259 ac_save_LIBS="$LIBS"
260 CFLAGS="$CFLAGS $ESD_CFLAGS"
261 LIBS="$LIBS $ESD_LIBS"
262 dnl
263 dnl Now check if the installed ESD is sufficiently new. (Also sanity
264 dnl checks the results of esd-config to some extent
265 dnl
266 rm -f conf.esdtest
267 AC_TRY_RUN([
268 #include <stdio.h>
269 #include <stdlib.h>
270 #include <string.h>
271 #include <esd.h>
272
273 char*
274 my_strdup (char *str)
275 {
276 char *new_str;
277
278 if (str)
279 {
280 new_str = malloc ((strlen (str) + 1) * sizeof(char));
281 strcpy (new_str, str);
282 }
283 else
284 new_str = NULL;
285
286 return new_str;
287 }
288
289 int main ()
290 {
291 int major, minor, micro;
292 char *tmp_version;
293
294 system ("touch conf.esdtest");
295
296 /* HP/UX 9 (%@#!) writes to sscanf strings */
297 tmp_version = my_strdup("$min_esd_version");
298 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
299 printf("%s, bad version string\n", "$min_esd_version");
300 exit(1);
301 }
302
303 if (($esd_major_version > major) ||
304 (($esd_major_version == major) && ($esd_minor_version > minor)) ||
305 (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
306 {
307 return 0;
308 }
309 else
310 {
311 printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
312 printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
313 printf("*** best to upgrade to the required version.\n");
314 printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
315 printf("*** to point to the correct copy of esd-config, and remove the file\n");
316 printf("*** config.cache before re-running configure\n");
317 return 1;
318 }
319 }
320
321 ],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
322 CFLAGS="$ac_save_CFLAGS"
323 LIBS="$ac_save_LIBS"
324 fi
325 fi
326 if test "x$no_esd" = x ; then
327 AC_MSG_RESULT(yes)
328 ifelse([$2], , :, [$2])
329 else
330 AC_MSG_RESULT(no)
331 if test "$ESD_CONFIG" = "no" ; then
332 echo "*** The esd-config script installed by ESD could not be found"
333 echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
334 echo "*** your path, or set the ESD_CONFIG environment variable to the"
335 echo "*** full path to esd-config."
336 else
337 if test -f conf.esdtest ; then
338 :
339 else
340 echo "*** Could not run ESD test program, checking why..."
341 CFLAGS="$CFLAGS $ESD_CFLAGS"
342 LIBS="$LIBS $ESD_LIBS"
343 AC_TRY_LINK([
344 #include <stdio.h>
345 #include <esd.h>
346 ], [ return 0; ],
347 [ echo "*** The test program compiled, but did not run. This usually means"
348 echo "*** that the run-time linker is not finding ESD or finding the wrong"
349 echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
350 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
351 echo "*** to the installed location Also, make sure you have run ldconfig if that"
352 echo "*** is required on your system"
353 echo "***"
354 echo "*** If you have an old version installed, it is best to remove it, although"
355 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
356 [ echo "*** The test program failed to compile or link. See the file config.log for the"
357 echo "*** exact error that occured. This usually means ESD was incorrectly installed"
358 echo "*** or that you have moved ESD since it was installed. In the latter case, you"
359 echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
360 CFLAGS="$ac_save_CFLAGS"
361 LIBS="$ac_save_LIBS"
362 fi
363 fi
364 ESD_CFLAGS=""
365 ESD_LIBS=""
366 ifelse([$3], , :, [$3])
367 fi
368 AC_SUBST(ESD_CFLAGS)
369 AC_SUBST(ESD_LIBS)
370 rm -f conf.esdtest
371 ])
372
373 dnl AM_ESD_SUPPORTS_MULTIPLE_RECORD([ACTION-IF-SUPPORTS [, ACTION-IF-NOT-SUPPORTS]])
374 dnl Test, whether esd supports multiple recording clients (version >=0.2.21)
375 dnl
376 AC_DEFUN(AM_ESD_SUPPORTS_MULTIPLE_RECORD,
377 [dnl
378 AC_MSG_NOTICE([whether installed esd version supports multiple recording clients])
379 ac_save_ESD_CFLAGS="$ESD_CFLAGS"
380 ac_save_ESD_LIBS="$ESD_LIBS"
381 AM_PATH_ESD(0.2.21,
382 ifelse([$1], , [
383 AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, true)
384 AC_DEFINE(ESD_SUPPORTS_MULTIPLE_RECORD, 1,
385 [Define if you have esound with support of multiple recording clients.])],
386 [$1]),
387 ifelse([$2], , [AM_CONDITIONAL(ESD_SUPPORTS_MULTIPLE_RECORD, false)], [$2])
388 if test "x$ac_save_ESD_CFLAGS" != x ; then
389 ESD_CFLAGS="$ac_save_ESD_CFLAGS"
390 fi
391 if test "x$ac_save_ESD_LIBS" != x ; then
392 ESD_LIBS="$ac_save_ESD_LIBS"
393 fi
394 )
395 ])
396
397 # Define a conditional.
398
399 AC_DEFUN(AM_CONDITIONAL,
400 [AC_SUBST($1_TRUE)
401 AC_SUBST($1_FALSE)
402 if $2; then
403 $1_TRUE=
404 $1_FALSE='#'
405 else
406 $1_TRUE='#'
407 $1_FALSE=
408 fi])
409
410 dnl Check for socklen_t type
411
412 AC_DEFUN(TYPE_SOCKLEN_T,
413 [AC_REQUIRE([AC_HEADER_STDC])dnl
414 AC_MSG_CHECKING(for socklen_t)
415 AC_CACHE_VAL(ac_cv_type_socklen_t,
416 [AC_EGREP_CPP(dnl
417 changequote(<<,>>)dnl
418 <<(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]>>dnl
419 changequote([,]), [#include <sys/types.h>
420 #include <sys/socket.h>], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)])dnl
421 AC_MSG_RESULT($ac_cv_type_socklen_t)
422 if test $ac_cv_type_socklen_t = no; then
423 AC_DEFINE(socklen_t, int)
424 fi
425 ])