68
|
1 # Configure paths for SDL
|
|
2 # Sam Lantinga 9/21/99
|
|
3 # stolen from Manish Singh
|
|
4 # stolen back from Frank Belew
|
|
5 # stolen from Manish Singh
|
|
6 # Shamelessly stolen from Owen Taylor
|
|
7
|
|
8 dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
|
9 dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
|
|
10 dnl
|
|
11 AC_DEFUN(AM_PATH_SDL,
|
|
12 [dnl
|
|
13 dnl Get the cflags and libraries from the sdl-config script
|
|
14 dnl
|
|
15 AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
|
|
16 sdl_prefix="$withval", sdl_prefix="")
|
|
17 AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
|
|
18 sdl_exec_prefix="$withval", sdl_exec_prefix="")
|
|
19 AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
|
|
20 , enable_sdltest=yes)
|
|
21
|
|
22 if test x$sdl_exec_prefix != x ; then
|
|
23 sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
|
|
24 if test x${SDL_CONFIG+set} != xset ; then
|
|
25 SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
|
|
26 fi
|
|
27 fi
|
|
28 if test x$sdl_prefix != x ; then
|
|
29 sdl_args="$sdl_args --prefix=$sdl_prefix"
|
|
30 if test x${SDL_CONFIG+set} != xset ; then
|
|
31 SDL_CONFIG=$sdl_prefix/bin/sdl-config
|
|
32 fi
|
|
33 fi
|
|
34
|
|
35 AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
|
|
36 min_sdl_version=ifelse([$1], ,0.11.0,$1)
|
|
37 AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
|
|
38 no_sdl=""
|
|
39 if test "$SDL_CONFIG" = "no" ; then
|
|
40 no_sdl=yes
|
|
41 else
|
|
42 SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
|
|
43 SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
|
|
44
|
|
45 sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
|
|
46 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
|
47 sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
|
|
48 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
|
49 sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
|
|
50 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
|
51 if test "x$enable_sdltest" = "xyes" ; then
|
|
52 ac_save_CFLAGS="$CFLAGS"
|
|
53 ac_save_LIBS="$LIBS"
|
|
54 CFLAGS="$CFLAGS $SDL_CFLAGS"
|
|
55 LIBS="$LIBS $SDL_LIBS"
|
|
56 dnl
|
|
57 dnl Now check if the installed SDL is sufficiently new. (Also sanity
|
|
58 dnl checks the results of sdl-config to some extent
|
|
59 dnl
|
|
60 rm -f conf.sdltest
|
|
61 AC_TRY_RUN([
|
|
62 #include <stdio.h>
|
|
63 #include <stdlib.h>
|
|
64 #include <string.h>
|
|
65 #include "SDL.h"
|
|
66
|
|
67 char*
|
|
68 my_strdup (char *str)
|
|
69 {
|
|
70 char *new_str;
|
|
71
|
|
72 if (str)
|
|
73 {
|
|
74 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
|
|
75 strcpy (new_str, str);
|
|
76 }
|
|
77 else
|
|
78 new_str = NULL;
|
|
79
|
|
80 return new_str;
|
|
81 }
|
|
82
|
|
83 int main (int argc, char *argv[])
|
|
84 {
|
|
85 int major, minor, micro;
|
|
86 char *tmp_version;
|
|
87
|
|
88 /* This hangs on some systems (?)
|
|
89 system ("touch conf.sdltest");
|
|
90 */
|
|
91 { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
|
|
92
|
|
93 /* HP/UX 9 (%@#!) writes to sscanf strings */
|
|
94 tmp_version = my_strdup("$min_sdl_version");
|
|
95 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
|
96 printf("%s, bad version string\n", "$min_sdl_version");
|
|
97 exit(1);
|
|
98 }
|
|
99
|
|
100 if (($sdl_major_version > major) ||
|
|
101 (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
|
|
102 (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
|
|
103 {
|
|
104 return 0;
|
|
105 }
|
|
106 else
|
|
107 {
|
|
108 printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
|
|
109 printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
|
|
110 printf("*** best to upgrade to the required version.\n");
|
|
111 printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
|
|
112 printf("*** to point to the correct copy of sdl-config, and remove the file\n");
|
|
113 printf("*** config.cache before re-running configure\n");
|
|
114 return 1;
|
|
115 }
|
|
116 }
|
|
117
|
|
118 ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
119 CFLAGS="$ac_save_CFLAGS"
|
|
120 LIBS="$ac_save_LIBS"
|
|
121 fi
|
|
122 fi
|
|
123 if test "x$no_sdl" = x ; then
|
|
124 AC_MSG_RESULT(yes)
|
|
125 ifelse([$2], , :, [$2])
|
|
126 else
|
|
127 AC_MSG_RESULT(no)
|
|
128 if test "$SDL_CONFIG" = "no" ; then
|
|
129 echo "*** The sdl-config script installed by SDL could not be found"
|
|
130 echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
|
|
131 echo "*** your path, or set the SDL_CONFIG environment variable to the"
|
|
132 echo "*** full path to sdl-config."
|
|
133 else
|
|
134 if test -f conf.sdltest ; then
|
|
135 :
|
|
136 else
|
|
137 echo "*** Could not run SDL test program, checking why..."
|
|
138 CFLAGS="$CFLAGS $SDL_CFLAGS"
|
|
139 LIBS="$LIBS $SDL_LIBS"
|
|
140 AC_TRY_LINK([
|
|
141 #include <stdio.h>
|
|
142 #include "SDL.h"
|
|
143
|
|
144 int main(int argc, char *argv[])
|
|
145 { return 0; }
|
|
146 #undef main
|
|
147 #define main K_and_R_C_main
|
|
148 ], [ return 0; ],
|
|
149 [ echo "*** The test program compiled, but did not run. This usually means"
|
|
150 echo "*** that the run-time linker is not finding SDL or finding the wrong"
|
|
151 echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
|
|
152 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
|
153 echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
|
154 echo "*** is required on your system"
|
|
155 echo "***"
|
|
156 echo "*** If you have an old version installed, it is best to remove it, although"
|
|
157 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
|
158 [ echo "*** The test program failed to compile or link. See the file config.log for the"
|
|
159 echo "*** exact error that occured. This usually means SDL was incorrectly installed"
|
|
160 echo "*** or that you have moved SDL since it was installed. In the latter case, you"
|
|
161 echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
|
|
162 CFLAGS="$ac_save_CFLAGS"
|
|
163 LIBS="$ac_save_LIBS"
|
|
164 fi
|
|
165 fi
|
|
166 SDL_CFLAGS=""
|
|
167 SDL_LIBS=""
|
|
168 ifelse([$3], , :, [$3])
|
|
169 fi
|
|
170 AC_SUBST(SDL_CFLAGS)
|
|
171 AC_SUBST(SDL_LIBS)
|
|
172 rm -f conf.sdltest
|
|
173 ])
|
|
174 # Configure paths for libmikmod
|
|
175 #
|
|
176 # Derived from glib.m4 (Owen Taylor 97-11-3)
|
|
177 # Improved by Chris Butler
|
|
178 #
|
|
179
|
|
180 dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
|
|
181 dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and
|
|
182 dnl LIBMIKMOD_LDADD
|
|
183 dnl
|
|
184 AC_DEFUN(AM_PATH_LIBMIKMOD,
|
|
185 [dnl
|
|
186 dnl Get the cflags and libraries from the libmikmod-config script
|
|
187 dnl
|
|
188 AC_ARG_WITH(libmikmod-prefix,[ --with-libmikmod-prefix=PFX Prefix where libmikmod is installed (optional)],
|
|
189 libmikmod_config_prefix="$withval", libmikmod_config_prefix="")
|
|
190 AC_ARG_WITH(libmikmod-exec-prefix,[ --with-libmikmod-exec-prefix=PFX Exec prefix where libmikmod is installed (optional)],
|
|
191 libmikmod_config_exec_prefix="$withval", libmikmod_config_exec_prefix="")
|
|
192 AC_ARG_ENABLE(libmikmodtest, [ --disable-libmikmodtest Do not try to compile and run a test libmikmod program],
|
|
193 , enable_libmikmodtest=yes)
|
|
194
|
|
195 if test x$libmikmod_config_exec_prefix != x ; then
|
|
196 libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix"
|
|
197 if test x${LIBMIKMOD_CONFIG+set} != xset ; then
|
|
198 LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config
|
|
199 fi
|
|
200 fi
|
|
201 if test x$libmikmod_config_prefix != x ; then
|
|
202 libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix"
|
|
203 if test x${LIBMIKMOD_CONFIG+set} != xset ; then
|
|
204 LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config
|
|
205 fi
|
|
206 fi
|
|
207
|
|
208 AC_PATH_PROG(LIBMIKMOD_CONFIG, libmikmod-config, no)
|
|
209 min_libmikmod_version=ifelse([$1], ,3.1.5,$1)
|
|
210 AC_MSG_CHECKING(for libmikmod - version >= $min_libmikmod_version)
|
|
211 no_libmikmod=""
|
|
212 if test "$LIBMIKMOD_CONFIG" = "no" ; then
|
|
213 no_libmikmod=yes
|
|
214 else
|
|
215 LIBMIKMOD_CFLAGS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags`
|
|
216 LIBMIKMOD_LIBS=`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs`
|
|
217 LIBMIKMOD_LDADD=`$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd`
|
|
218 libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
|
|
219 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\1/'`
|
|
220 libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
|
|
221 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\2/'`
|
|
222 libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args --version | \
|
|
223 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\).*/\3/'`
|
|
224 if test "x$enable_libmikmodtest" = "xyes" ; then
|
|
225 ac_save_CFLAGS="$CFLAGS"
|
|
226 ac_save_LIBS="$LIBS"
|
|
227 AC_LANG_SAVE
|
|
228 AC_LANG_C
|
|
229 CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS $LIBMIKMOD_LDADD"
|
|
230 LIBS="$LIBMIKMOD_LIBS $LIBS"
|
|
231 dnl
|
|
232 dnl Now check if the installed libmikmod is sufficiently new. (Also sanity
|
|
233 dnl checks the results of libmikmod-config to some extent
|
|
234 dnl
|
|
235 rm -f conf.mikmodtest
|
|
236 AC_TRY_RUN([
|
|
237 #include <mikmod.h>
|
|
238 #include <stdio.h>
|
|
239 #include <stdlib.h>
|
|
240
|
|
241 char* my_strdup (char *str)
|
|
242 {
|
|
243 char *new_str;
|
|
244
|
|
245 if (str) {
|
|
246 new_str = malloc ((strlen (str) + 1) * sizeof(char));
|
|
247 strcpy (new_str, str);
|
|
248 } else
|
|
249 new_str = NULL;
|
|
250
|
|
251 return new_str;
|
|
252 }
|
|
253
|
|
254 int main()
|
|
255 {
|
|
256 int major,minor,micro;
|
|
257 int libmikmod_major_version,libmikmod_minor_version,libmikmod_micro_version;
|
|
258 char *tmp_version;
|
|
259
|
|
260 system("touch conf.mikmodtest");
|
|
261
|
|
262 /* HP/UX 9 (%@#!) writes to sscanf strings */
|
|
263 tmp_version = my_strdup("$min_libmikmod_version");
|
|
264 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
|
265 printf("%s, bad version string\n", "$min_libmikmod_version");
|
|
266 exit(1);
|
|
267 }
|
|
268
|
|
269 libmikmod_major_version=(MikMod_GetVersion() >> 16) & 255;
|
|
270 libmikmod_minor_version=(MikMod_GetVersion() >> 8) & 255;
|
|
271 libmikmod_micro_version=(MikMod_GetVersion() ) & 255;
|
|
272
|
|
273 if ((libmikmod_major_version != $libmikmod_config_major_version) ||
|
|
274 (libmikmod_minor_version != $libmikmod_config_minor_version) ||
|
|
275 (libmikmod_micro_version != $libmikmod_config_micro_version))
|
|
276 {
|
|
277 printf("\n*** 'libmikmod-config --version' returned %d.%d.%d, but libmikmod (%d.%d.%d)\n",
|
|
278 $libmikmod_config_major_version, $libmikmod_config_minor_version, $libmikmod_config_micro_version,
|
|
279 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
|
|
280 printf ("*** was found! If libmikmod-config was correct, then it is best\n");
|
|
281 printf ("*** to remove the old version of libmikmod. You may also be able to fix the error\n");
|
|
282 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
|
283 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
|
284 printf("*** required on your system.\n");
|
|
285 printf("*** If libmikmod-config was wrong, set the environment variable LIBMIKMOD_CONFIG\n");
|
|
286 printf("*** to point to the correct copy of libmikmod-config, and remove the file config.cache\n");
|
|
287 printf("*** before re-running configure\n");
|
|
288 }
|
|
289 else if ((libmikmod_major_version != LIBMIKMOD_VERSION_MAJOR) ||
|
|
290 (libmikmod_minor_version != LIBMIKMOD_VERSION_MINOR) ||
|
|
291 (libmikmod_micro_version != LIBMIKMOD_REVISION))
|
|
292 {
|
|
293 printf("*** libmikmod header files (version %d.%d.%d) do not match\n",
|
|
294 LIBMIKMOD_VERSION_MAJOR, LIBMIKMOD_VERSION_MINOR, LIBMIKMOD_REVISION);
|
|
295 printf("*** library (version %d.%d.%d)\n",
|
|
296 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
|
|
297 }
|
|
298 else
|
|
299 {
|
|
300 if ((libmikmod_major_version > major) ||
|
|
301 ((libmikmod_major_version == major) && (libmikmod_minor_version > minor)) ||
|
|
302 ((libmikmod_major_version == major) && (libmikmod_minor_version == minor) && (libmikmod_micro_version >= micro)))
|
|
303 {
|
|
304 return 0;
|
|
305 }
|
|
306 else
|
|
307 {
|
|
308 printf("\n*** An old version of libmikmod (%d.%d.%d) was found.\n",
|
|
309 libmikmod_major_version, libmikmod_minor_version, libmikmod_micro_version);
|
|
310 printf("*** You need a version of libmikmod newer than %d.%d.%d.\n",
|
|
311 major, minor, micro);
|
|
312 printf("***\n");
|
|
313 printf("*** If you have already installed a sufficiently new version, this error\n");
|
|
314 printf("*** probably means that the wrong copy of the libmikmod-config shell script is\n");
|
|
315 printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
|
316 printf("*** of libmikmod, but you can also set the LIBMIKMOD_CONFIG environment to point to the\n");
|
|
317 printf("*** correct copy of libmikmod-config. (In this case, you will have to\n");
|
|
318 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
|
319 printf("*** so that the correct libraries are found at run-time))\n");
|
|
320 }
|
|
321 }
|
|
322 return 1;
|
|
323 }
|
|
324 ],, no_libmikmod=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
325 CFLAGS="$ac_save_CFLAGS"
|
|
326 LIBS="$ac_save_LIBS"
|
|
327 AC_LANG_RESTORE
|
|
328 fi
|
|
329 fi
|
|
330 if test "x$no_libmikmod" = x ; then
|
|
331 AC_MSG_RESULT([yes, `$LIBMIKMOD_CONFIG --version`])
|
|
332 ifelse([$2], , :, [$2])
|
|
333 else
|
|
334 AC_MSG_RESULT(no)
|
|
335 if test "$LIBMIKMOD_CONFIG" = "no" ; then
|
|
336 echo "*** The libmikmod-config script installed by libmikmod could not be found"
|
|
337 echo "*** If libmikmod was installed in PREFIX, make sure PREFIX/bin is in"
|
|
338 echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the"
|
|
339 echo "*** full path to libmikmod-config."
|
|
340 else
|
|
341 if test -f conf.mikmodtest ; then
|
|
342 :
|
|
343 else
|
|
344 echo "*** Could not run libmikmod test program, checking why..."
|
|
345 CFLAGS="$CFLAGS $LIBMIKMOD_CFLAGS"
|
|
346 LIBS="$LIBS $LIBMIKMOD_LIBS"
|
|
347 AC_LANG_SAVE
|
|
348 AC_LANG_C
|
|
349 AC_TRY_LINK([
|
|
350 #include <mikmod.h>
|
|
351 #include <stdio.h>
|
|
352 ], [ return (MikMod_GetVersion()!=0); ],
|
|
353 [ echo "*** The test program compiled, but did not run. This usually means"
|
|
354 echo "*** that the run-time linker is not finding libmikmod or finding the wrong"
|
|
355 echo "*** version of libmikmod. If it is not finding libmikmod, you'll need to set your"
|
|
356 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
|
357 echo "*** to the installed location. Also, make sure you have run ldconfig if that"
|
|
358 echo "*** is required on your system."
|
|
359 echo "***"
|
|
360 echo "*** If you have an old version installed, it is best to remove it, although"
|
|
361 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
|
362 [ echo "*** The test program failed to compile or link. See the file config.log for the"
|
|
363 echo "*** exact error that occured. This usually means libmikmod was incorrectly installed"
|
|
364 echo "*** or that you have moved libmikmod since it was installed. In the latter case, you"
|
|
365 echo "*** may want to edit the libmikmod-config script: $LIBMIKMOD_CONFIG" ])
|
|
366 CFLAGS="$ac_save_CFLAGS"
|
|
367 LIBS="$ac_save_LIBS"
|
|
368 AC_LANG_RESTORE
|
|
369 fi
|
|
370 fi
|
|
371 LIBMIKMOD_CFLAGS=""
|
|
372 LIBMIKMOD_LIBS=""
|
|
373 LIBMIKMOD_LDADD=""
|
|
374 ifelse([$3], , :, [$3])
|
|
375 fi
|
|
376 AC_SUBST(LIBMIKMOD_CFLAGS)
|
|
377 AC_SUBST(LIBMIKMOD_LIBS)
|
|
378 AC_SUBST(LIBMIKMOD_LDADD)
|
|
379 rm -f conf.mikmodtest
|
|
380 ])
|
|
381 # Configure paths for libvorbis
|
|
382 # Jack Moffitt <jack@icecast.org> 10-21-2000
|
|
383 # Shamelessly stolen from Owen Taylor and Manish Singh
|
|
384
|
|
385 dnl AM_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
|
386 dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
|
|
387 dnl
|
|
388 AC_DEFUN(AM_PATH_VORBIS,
|
|
389 [dnl
|
|
390 dnl Get the cflags and libraries
|
|
391 dnl
|
|
392 AC_ARG_WITH(vorbis-prefix,[ --with-vorbis-prefix=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
|
|
393 AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
|
|
394
|
|
395 if test x$vorbis_prefix != x ; then
|
|
396 vorbis_args="$vorbis_args --prefix=$vorbis_prefix"
|
|
397 VORBIS_CFLAGS="-I$vorbis_prefix/include"
|
|
398 VORBIS_LIBDIR="-L$vorbis_prefix/lib"
|
|
399 fi
|
|
400
|
|
401 VORBIS_LIBS="$VORBIS_LIBDIR -lvorbis -lm"
|
|
402 VORBISFILE_LIBS="-lvorbisfile"
|
|
403 VORBISENC_LIBS="-lvorbisenc"
|
|
404
|
|
405 AC_MSG_CHECKING(for Vorbis)
|
|
406 no_vorbis=""
|
|
407
|
|
408
|
|
409 if test "x$enable_vorbistest" = "xyes" ; then
|
|
410 ac_save_CFLAGS="$CFLAGS"
|
|
411 ac_save_LIBS="$LIBS"
|
|
412 CFLAGS="$CFLAGS $VORBIS_CFLAGS"
|
|
413 LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
|
|
414 dnl
|
|
415 dnl Now check if the installed Vorbis is sufficiently new.
|
|
416 dnl
|
|
417 rm -f conf.vorbistest
|
|
418 AC_TRY_RUN([
|
|
419 #include <stdio.h>
|
|
420 #include <stdlib.h>
|
|
421 #include <string.h>
|
|
422 #include <vorbis/codec.h>
|
|
423
|
|
424 int main ()
|
|
425 {
|
|
426 system("touch conf.vorbistest");
|
|
427 return 0;
|
|
428 }
|
|
429
|
|
430 ],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
431 CFLAGS="$ac_save_CFLAGS"
|
|
432 LIBS="$ac_save_LIBS"
|
|
433 fi
|
|
434
|
|
435 if test "x$no_vorbis" = x ; then
|
|
436 AC_MSG_RESULT(yes)
|
|
437 ifelse([$1], , :, [$1])
|
|
438 else
|
|
439 AC_MSG_RESULT(no)
|
|
440 if test -f conf.vorbistest ; then
|
|
441 :
|
|
442 else
|
|
443 echo "*** Could not run Vorbis test program, checking why..."
|
|
444 CFLAGS="$CFLAGS $VORBIS_CFLAGS"
|
|
445 LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
|
|
446 AC_TRY_LINK([
|
|
447 #include <stdio.h>
|
|
448 #include <vorbis/codec.h>
|
|
449 ], [ return 0; ],
|
|
450 [ echo "*** The test program compiled, but did not run. This usually means"
|
|
451 echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
|
|
452 echo "*** version of Vorbis. If it is not finding Vorbis, you'll need to set your"
|
|
453 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
|
454 echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
|
455 echo "*** is required on your system"
|
|
456 echo "***"
|
|
457 echo "*** If you have an old version installed, it is best to remove it, although"
|
|
458 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
|
|
459 [ echo "*** The test program failed to compile or link. See the file config.log for the"
|
|
460 echo "*** exact error that occured. This usually means Vorbis was incorrectly installed"
|
|
461 echo "*** or that you have moved Vorbis since it was installed." ])
|
|
462 CFLAGS="$ac_save_CFLAGS"
|
|
463 LIBS="$ac_save_LIBS"
|
|
464 fi
|
|
465 VORBIS_CFLAGS=""
|
|
466 VORBIS_LIBS=""
|
|
467 VORBISFILE_LIBS=""
|
|
468 VORBISENC_LIBS=""
|
|
469 ifelse([$2], , :, [$2])
|
|
470 fi
|
|
471 AC_SUBST(VORBIS_CFLAGS)
|
|
472 AC_SUBST(VORBIS_LIBS)
|
|
473 AC_SUBST(VORBISFILE_LIBS)
|
|
474 AC_SUBST(VORBISENC_LIBS)
|
|
475 rm -f conf.vorbistest
|
|
476 ])
|
|
477 # Configure paths for SMPEG
|
|
478 # Nicolas Vignal 11/19/2000
|
|
479 # stolen from Sam Lantinga
|
|
480 # stolen from Manish Singh
|
|
481 # stolen back from Frank Belew
|
|
482 # stolen from Manish Singh
|
|
483 # Shamelessly stolen from Owen Taylor
|
|
484
|
|
485 dnl AM_PATH_SMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [,
|
|
486 ACTION-IF-NOT-FOUND]]])
|
|
487 dnl Test for SMPEG, and define SMPEG_CFLAGS and SMPEG_LIBS
|
|
488 dnl
|
|
489 AC_DEFUN(AM_PATH_SMPEG,
|
|
490 [dnl
|
|
491 dnl Get the cflags and libraries from the smpeg-config script
|
|
492 dnl
|
|
493 AC_ARG_WITH(smpeg-prefix,[ --with-smpeg-prefix=PFX Prefix where SMPEG is
|
|
494 installed (optional)],
|
|
495 smpeg_prefix="$withval", smpeg_prefix="")
|
|
496 AC_ARG_WITH(smpeg-exec-prefix,[ --with-smpeg-exec-prefix=PFX Exec prefix
|
|
497 where SMPEG is installed (optional)],
|
|
498 smpeg_exec_prefix="$withval", smpeg_exec_prefix="")
|
|
499 AC_ARG_ENABLE(smpegtest, [ --disable-smpegtest Do not try to compile
|
|
500 and run a test SMPEG program],
|
|
501 , enable_smpegtest=yes)
|
|
502
|
|
503 if test x$smpeg_exec_prefix != x ; then
|
|
504 smpeg_args="$smpeg_args --exec-prefix=$smpeg_exec_prefix"
|
|
505 if test x${SMPEG_CONFIG+set} != xset ; then
|
|
506 SMPEG_CONFIG=$smpeg_exec_prefix/bin/smpeg-config
|
|
507 fi
|
|
508 fi
|
|
509 if test x$smpeg_prefix != x ; then
|
|
510 smpeg_args="$smpeg_args --prefix=$smpeg_prefix"
|
|
511 if test x${SMPEG_CONFIG+set} != xset ; then
|
|
512 SMPEG_CONFIG=$smpeg_prefix/bin/smpeg-config
|
|
513 fi
|
|
514 fi
|
|
515
|
|
516 AC_PATH_PROG(SMPEG_CONFIG, smpeg-config, no)
|
|
517 min_smpeg_version=ifelse([$1], ,0.2.7,$1)
|
|
518 AC_MSG_CHECKING(for SMPEG - version >= $min_smpeg_version)
|
|
519 no_smpeg=""
|
|
520 if test "$SMPEG_CONFIG" = "no" ; then
|
|
521 no_smpeg=yes
|
|
522 else
|
|
523 SMPEG_CFLAGS=`$SMPEG_CONFIG $smpegconf_args --cflags`
|
|
524 SMPEG_LIBS=`$SMPEG_CONFIG $smpegconf_args --libs`
|
|
525
|
|
526 smpeg_major_version=`$SMPEG_CONFIG $smpeg_args --version | \
|
|
527 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
|
528 smpeg_minor_version=`$SMPEG_CONFIG $smpeg_args --version | \
|
|
529 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
|
530 smpeg_micro_version=`$SMPEG_CONFIG $smpeg_config_args --version | \
|
|
531 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
|
532 if test "x$enable_smpegtest" = "xyes" ; then
|
|
533 ac_save_CFLAGS="$CFLAGS"
|
|
534 ac_save_LIBS="$LIBS"
|
|
535 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
|
|
536 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
|
|
537 dnl
|
|
538 dnl Now check if the installed SMPEG is sufficiently new. (Also sanity
|
|
539 dnl checks the results of smpeg-config to some extent
|
|
540 dnl
|
|
541 rm -f conf.smpegtest
|
|
542 AC_TRY_RUN([
|
|
543 #include <stdio.h>
|
|
544 #include <stdlib.h>
|
|
545 #include <string.h>
|
|
546 #include "smpeg.h"
|
|
547
|
|
548 char*
|
|
549 my_strdup (char *str)
|
|
550 {
|
|
551 char *new_str;
|
|
552
|
|
553 if (str)
|
|
554 {
|
|
555 new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
|
|
556 strcpy (new_str, str);
|
|
557 }
|
|
558 else
|
|
559 new_str = NULL;
|
|
560
|
|
561 return new_str;
|
|
562 }
|
|
563
|
|
564 int main (int argc, char *argv[])
|
|
565 {
|
|
566 int major, minor, micro;
|
|
567 char *tmp_version;
|
|
568
|
|
569 /* This hangs on some systems (?)
|
|
570 system ("touch conf.smpegtest");
|
|
571 */
|
|
572 { FILE *fp = fopen("conf.smpegtest", "a"); if ( fp ) fclose(fp); }
|
|
573
|
|
574 /* HP/UX 9 (%@#!) writes to sscanf strings */
|
|
575 tmp_version = my_strdup("$min_smpeg_version");
|
|
576 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
|
577 printf("%s, bad version string\n", "$min_smpeg_version");
|
|
578 exit(1);
|
|
579 }
|
|
580
|
|
581 if (($smpeg_major_version > major) ||
|
|
582 (($smpeg_major_version == major) && ($smpeg_minor_version > minor)) ||
|
|
583 (($smpeg_major_version == major) && ($smpeg_minor_version == minor)
|
|
584 && ($smpeg_micro_version >= micro)))
|
|
585 {
|
|
586 return 0;
|
|
587 }
|
|
588 else
|
|
589 {
|
|
590 printf("\n*** 'smpeg-config --version' returned %d.%d.%d, but the
|
|
591 minimum version\n", $smpeg_major_version, $smpeg_minor_version,
|
|
592 $smpeg_micro_version);
|
|
593 printf("*** of SMPEG required is %d.%d.%d. If smpeg-config is
|
|
594 correct, then it is\n", major, minor, micro);
|
|
595 printf("*** best to upgrade to the required version.\n");
|
|
596 printf("*** If smpeg-config was wrong, set the environment variable
|
|
597 SMPEG_CONFIG\n");
|
|
598 printf("*** to point to the correct copy of smpeg-config, and remove
|
|
599 the file\n");
|
|
600 printf("*** config.cache before re-running configure\n");
|
|
601 return 1;
|
|
602 }
|
|
603 }
|
|
604
|
|
605 ],, no_smpeg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
606 CFLAGS="$ac_save_CFLAGS"
|
|
607 LIBS="$ac_save_LIBS"
|
|
608 fi
|
|
609 fi
|
|
610 if test "x$no_smpeg" = x ; then
|
|
611 AC_MSG_RESULT(yes)
|
|
612 ifelse([$2], , :, [$2])
|
|
613 else
|
|
614 AC_MSG_RESULT(no)
|
|
615 if test "$SMPEG_CONFIG" = "no" ; then
|
|
616 echo "*** The smpeg-config script installed by SMPEG could not be
|
|
617 found"
|
|
618 echo "*** If SMPEG was installed in PREFIX, make sure PREFIX/bin is
|
|
619 in"
|
|
620 echo "*** your path, or set the SMPEG_CONFIG environment variable to
|
|
621 the"
|
|
622 echo "*** full path to smpeg-config."
|
|
623 else
|
|
624 if test -f conf.smpegtest ; then
|
|
625 :
|
|
626 else
|
|
627 echo "*** Could not run SMPEG test program, checking why..."
|
|
628 CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
|
|
629 LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
|
|
630 AC_TRY_LINK([
|
|
631 #include <stdio.h>
|
|
632 #include "smpeg.h"
|
|
633 ], [ return 0; ],
|
|
634 [ echo "*** The test program compiled, but did not run. This
|
|
635 usually means"
|
|
636 echo "*** that the run-time linker is not finding SMPEG or
|
|
637 finding the wrong"
|
|
638 echo "*** version of SMPEG. If it is not finding SMPEG, you'll
|
|
639 need to set your"
|
|
640 echo "*** LD_LIBRARY_PATH environment variable, or edit
|
|
641 /etc/ld.so.conf to point"
|
|
642 echo "*** to the installed location Also, make sure you have run
|
|
643 ldconfig if that"
|
|
644 echo "*** is required on your system"
|
|
645 echo "***"
|
|
646 echo "*** If you have an old version installed, it is best to
|
|
647 remove it, although"
|
|
648 echo "*** you may also be able to get things to work by modifying
|
|
649 LD_LIBRARY_PATH"],
|
|
650 [ echo "*** The test program failed to compile or link. See the
|
|
651 file config.log for the"
|
|
652 echo "*** exact error that occured. This usually means SMPEG was
|
|
653 incorrectly installed"
|
|
654 echo "*** or that you have moved SMPEG since it was installed. In
|
|
655 the latter case, you"
|
|
656 echo "*** may want to edit the smpeg-config script:
|
|
657 $SMPEG_CONFIG" ])
|
|
658 CFLAGS="$ac_save_CFLAGS"
|
|
659 LIBS="$ac_save_LIBS"
|
|
660 fi
|
|
661 fi
|
|
662 SMPEG_CFLAGS=""
|
|
663 SMPEG_LIBS=""
|
|
664 ifelse([$3], , :, [$3])
|
|
665 fi
|
|
666 AC_SUBST(SMPEG_CFLAGS)
|
|
667 AC_SUBST(SMPEG_LIBS)
|
|
668 rm -f conf.smpegtest
|
|
669 ])
|
73
|
670 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
|
|
671 ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
|
|
672 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
|
673 ##
|
|
674 ## This program is free software; you can redistribute it and/or modify
|
|
675 ## it under the terms of the GNU General Public License as published by
|
|
676 ## the Free Software Foundation; either version 2 of the License, or
|
|
677 ## (at your option) any later version.
|
|
678 ##
|
|
679 ## This program is distributed in the hope that it will be useful, but
|
|
680 ## WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
681 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
682 ## General Public License for more details.
|
|
683 ##
|
|
684 ## You should have received a copy of the GNU General Public License
|
|
685 ## along with this program; if not, write to the Free Software
|
|
686 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
687 ##
|
|
688 ## As a special exception to the GNU General Public License, if you
|
|
689 ## distribute this file as part of a program that contains a
|
|
690 ## configuration script generated by Autoconf, you may include it under
|
|
691 ## the same distribution terms that you use for the rest of that program.
|
|
692
|
|
693 # serial 40 AC_PROG_LIBTOOL
|
|
694 AC_DEFUN(AC_PROG_LIBTOOL,
|
|
695 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
|
|
696
|
|
697 # Save cache, so that ltconfig can load it
|
|
698 AC_CACHE_SAVE
|
|
699
|
|
700 # Actually configure libtool. ac_aux_dir is where install-sh is found.
|
|
701 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
|
|
702 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
|
|
703 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
|
|
704 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
|
|
705 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
|
|
706 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
|
|
707 || AC_MSG_ERROR([libtool configure failed])
|
|
708
|
|
709 # Reload cache, that may have been modified by ltconfig
|
|
710 AC_CACHE_LOAD
|
|
711
|
|
712 # This can be used to rebuild libtool when needed
|
|
713 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
|
|
714
|
|
715 # Always use our own libtool.
|
|
716 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
|
|
717 AC_SUBST(LIBTOOL)dnl
|
|
718
|
|
719 # Redirect the config.log output again, so that the ltconfig log is not
|
|
720 # clobbered by the next message.
|
|
721 exec 5>>./config.log
|
|
722 ])
|
|
723
|
|
724 AC_DEFUN(AC_LIBTOOL_SETUP,
|
|
725 [AC_PREREQ(2.13)dnl
|
|
726 AC_REQUIRE([AC_ENABLE_SHARED])dnl
|
|
727 AC_REQUIRE([AC_ENABLE_STATIC])dnl
|
|
728 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
|
|
729 AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
730 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|
731 AC_REQUIRE([AC_PROG_RANLIB])dnl
|
|
732 AC_REQUIRE([AC_PROG_CC])dnl
|
|
733 AC_REQUIRE([AC_PROG_LD])dnl
|
|
734 AC_REQUIRE([AC_PROG_NM])dnl
|
|
735 AC_REQUIRE([AC_PROG_LN_S])dnl
|
|
736 dnl
|
|
737
|
|
738 case "$target" in
|
|
739 NONE) lt_target="$host" ;;
|
|
740 *) lt_target="$target" ;;
|
|
741 esac
|
|
742
|
|
743 # Check for any special flags to pass to ltconfig.
|
|
744 libtool_flags="--cache-file=$cache_file"
|
|
745 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
|
746 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
|
747 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
|
748 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
|
749 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
|
750 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
|
|
751 [libtool_flags="$libtool_flags --enable-dlopen"])
|
|
752 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
|
753 [libtool_flags="$libtool_flags --enable-win32-dll"])
|
|
754 AC_ARG_ENABLE(libtool-lock,
|
|
755 [ --disable-libtool-lock avoid locking (might break parallel builds)])
|
|
756 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
|
|
757 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
|
758
|
|
759 # Some flags need to be propagated to the compiler or linker for good
|
|
760 # libtool support.
|
|
761 case "$lt_target" in
|
|
762 *-*-irix6*)
|
|
763 # Find out which ABI we are using.
|
|
764 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
|
|
765 if AC_TRY_EVAL(ac_compile); then
|
|
766 case "`/usr/bin/file conftest.o`" in
|
|
767 *32-bit*)
|
|
768 LD="${LD-ld} -32"
|
|
769 ;;
|
|
770 *N32*)
|
|
771 LD="${LD-ld} -n32"
|
|
772 ;;
|
|
773 *64-bit*)
|
|
774 LD="${LD-ld} -64"
|
|
775 ;;
|
|
776 esac
|
|
777 fi
|
|
778 rm -rf conftest*
|
|
779 ;;
|
|
780
|
|
781 *-*-sco3.2v5*)
|
|
782 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
|
|
783 SAVE_CFLAGS="$CFLAGS"
|
|
784 CFLAGS="$CFLAGS -belf"
|
|
785 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
|
|
786 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
|
|
787 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
|
|
788 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
|
|
789 CFLAGS="$SAVE_CFLAGS"
|
|
790 fi
|
|
791 ;;
|
|
792
|
|
793 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
|
|
794 [*-*-cygwin* | *-*-mingw*)
|
|
795 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
|
796 AC_CHECK_TOOL(AS, as, false)
|
|
797 AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
|
798 ;;
|
|
799 ])
|
|
800 esac
|
|
801 ])
|
|
802
|
|
803 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
|
804 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
|
|
805
|
|
806 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
|
|
807 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
|
|
808
|
|
809 # AC_ENABLE_SHARED - implement the --enable-shared flag
|
|
810 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
|
|
811 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
812 # `yes'.
|
|
813 AC_DEFUN(AC_ENABLE_SHARED, [dnl
|
|
814 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
815 AC_ARG_ENABLE(shared,
|
|
816 changequote(<<, >>)dnl
|
|
817 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
|
|
818 changequote([, ])dnl
|
|
819 [p=${PACKAGE-default}
|
|
820 case "$enableval" in
|
|
821 yes) enable_shared=yes ;;
|
|
822 no) enable_shared=no ;;
|
|
823 *)
|
|
824 enable_shared=no
|
|
825 # Look at the argument we got. We use all the common list separators.
|
|
826 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
827 for pkg in $enableval; do
|
|
828 if test "X$pkg" = "X$p"; then
|
|
829 enable_shared=yes
|
|
830 fi
|
|
831 done
|
|
832 IFS="$ac_save_ifs"
|
|
833 ;;
|
|
834 esac],
|
|
835 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
|
|
836 ])
|
|
837
|
|
838 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
|
|
839 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
840 AC_ENABLE_SHARED(no)])
|
|
841
|
|
842 # AC_ENABLE_STATIC - implement the --enable-static flag
|
|
843 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
|
|
844 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
845 # `yes'.
|
|
846 AC_DEFUN(AC_ENABLE_STATIC, [dnl
|
|
847 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
848 AC_ARG_ENABLE(static,
|
|
849 changequote(<<, >>)dnl
|
|
850 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
|
|
851 changequote([, ])dnl
|
|
852 [p=${PACKAGE-default}
|
|
853 case "$enableval" in
|
|
854 yes) enable_static=yes ;;
|
|
855 no) enable_static=no ;;
|
|
856 *)
|
|
857 enable_static=no
|
|
858 # Look at the argument we got. We use all the common list separators.
|
|
859 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
860 for pkg in $enableval; do
|
|
861 if test "X$pkg" = "X$p"; then
|
|
862 enable_static=yes
|
|
863 fi
|
|
864 done
|
|
865 IFS="$ac_save_ifs"
|
|
866 ;;
|
|
867 esac],
|
|
868 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
|
|
869 ])
|
|
870
|
|
871 # AC_DISABLE_STATIC - set the default static flag to --disable-static
|
|
872 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
873 AC_ENABLE_STATIC(no)])
|
|
874
|
|
875
|
|
876 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
|
|
877 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
|
|
878 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
|
|
879 # `yes'.
|
|
880 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
|
|
881 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
|
|
882 AC_ARG_ENABLE(fast-install,
|
|
883 changequote(<<, >>)dnl
|
|
884 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
|
|
885 changequote([, ])dnl
|
|
886 [p=${PACKAGE-default}
|
|
887 case "$enableval" in
|
|
888 yes) enable_fast_install=yes ;;
|
|
889 no) enable_fast_install=no ;;
|
|
890 *)
|
|
891 enable_fast_install=no
|
|
892 # Look at the argument we got. We use all the common list separators.
|
|
893 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
|
|
894 for pkg in $enableval; do
|
|
895 if test "X$pkg" = "X$p"; then
|
|
896 enable_fast_install=yes
|
|
897 fi
|
|
898 done
|
|
899 IFS="$ac_save_ifs"
|
|
900 ;;
|
|
901 esac],
|
|
902 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
|
|
903 ])
|
|
904
|
|
905 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
|
|
906 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
907 AC_ENABLE_FAST_INSTALL(no)])
|
|
908
|
|
909 # AC_PROG_LD - find the path to the GNU or non-GNU linker
|
|
910 AC_DEFUN(AC_PROG_LD,
|
|
911 [AC_ARG_WITH(gnu-ld,
|
|
912 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
|
|
913 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
|
|
914 AC_REQUIRE([AC_PROG_CC])dnl
|
|
915 AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
916 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
|
|
917 ac_prog=ld
|
|
918 if test "$ac_cv_prog_gcc" = yes; then
|
|
919 # Check if gcc -print-prog-name=ld gives a path.
|
|
920 AC_MSG_CHECKING([for ld used by GCC])
|
|
921 ac_prog=`($CC -print-prog-name=ld) 2>&5`
|
|
922 case "$ac_prog" in
|
|
923 # Accept absolute paths.
|
|
924 changequote(,)dnl
|
|
925 [\\/]* | [A-Za-z]:[\\/]*)
|
|
926 re_direlt='/[^/][^/]*/\.\./'
|
|
927 changequote([,])dnl
|
|
928 # Canonicalize the path of ld
|
|
929 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
|
|
930 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
|
|
931 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
|
|
932 done
|
|
933 test -z "$LD" && LD="$ac_prog"
|
|
934 ;;
|
|
935 "")
|
|
936 # If it fails, then pretend we aren't using GCC.
|
|
937 ac_prog=ld
|
|
938 ;;
|
|
939 *)
|
|
940 # If it is relative, then search for the first ld in PATH.
|
|
941 with_gnu_ld=unknown
|
|
942 ;;
|
|
943 esac
|
|
944 elif test "$with_gnu_ld" = yes; then
|
|
945 AC_MSG_CHECKING([for GNU ld])
|
|
946 else
|
|
947 AC_MSG_CHECKING([for non-GNU ld])
|
|
948 fi
|
|
949 AC_CACHE_VAL(ac_cv_path_LD,
|
|
950 [if test -z "$LD"; then
|
|
951 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
952 for ac_dir in $PATH; do
|
|
953 test -z "$ac_dir" && ac_dir=.
|
|
954 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
|
|
955 ac_cv_path_LD="$ac_dir/$ac_prog"
|
|
956 # Check to see if the program is GNU ld. I'd rather use --version,
|
|
957 # but apparently some GNU ld's only accept -v.
|
|
958 # Break only if it was the GNU/non-GNU ld that we prefer.
|
|
959 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
|
|
960 test "$with_gnu_ld" != no && break
|
|
961 else
|
|
962 test "$with_gnu_ld" != yes && break
|
|
963 fi
|
|
964 fi
|
|
965 done
|
|
966 IFS="$ac_save_ifs"
|
|
967 else
|
|
968 ac_cv_path_LD="$LD" # Let the user override the test with a path.
|
|
969 fi])
|
|
970 LD="$ac_cv_path_LD"
|
|
971 if test -n "$LD"; then
|
|
972 AC_MSG_RESULT($LD)
|
|
973 else
|
|
974 AC_MSG_RESULT(no)
|
|
975 fi
|
|
976 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
|
|
977 AC_PROG_LD_GNU
|
|
978 ])
|
|
979
|
|
980 AC_DEFUN(AC_PROG_LD_GNU,
|
|
981 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
|
|
982 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
|
|
983 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
|
|
984 ac_cv_prog_gnu_ld=yes
|
|
985 else
|
|
986 ac_cv_prog_gnu_ld=no
|
|
987 fi])
|
|
988 ])
|
|
989
|
|
990 # AC_PROG_NM - find the path to a BSD-compatible name lister
|
|
991 AC_DEFUN(AC_PROG_NM,
|
|
992 [AC_MSG_CHECKING([for BSD-compatible nm])
|
|
993 AC_CACHE_VAL(ac_cv_path_NM,
|
|
994 [if test -n "$NM"; then
|
|
995 # Let the user override the test.
|
|
996 ac_cv_path_NM="$NM"
|
|
997 else
|
|
998 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
|
|
999 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
|
|
1000 test -z "$ac_dir" && ac_dir=.
|
|
1001 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
|
|
1002 # Check to see if the nm accepts a BSD-compat flag.
|
|
1003 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
|
1004 # nm: unknown option "B" ignored
|
|
1005 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
|
1006 ac_cv_path_NM="$ac_dir/nm -B"
|
|
1007 break
|
|
1008 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
|
1009 ac_cv_path_NM="$ac_dir/nm -p"
|
|
1010 break
|
|
1011 else
|
|
1012 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
|
|
1013 continue # so that we can try to find one that supports BSD flags
|
|
1014 fi
|
|
1015 fi
|
|
1016 done
|
|
1017 IFS="$ac_save_ifs"
|
|
1018 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
|
|
1019 fi])
|
|
1020 NM="$ac_cv_path_NM"
|
|
1021 AC_MSG_RESULT([$NM])
|
|
1022 ])
|
|
1023
|
|
1024 # AC_CHECK_LIBM - check for math library
|
|
1025 AC_DEFUN(AC_CHECK_LIBM,
|
|
1026 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
|
1027 LIBM=
|
|
1028 case "$lt_target" in
|
|
1029 *-*-beos* | *-*-cygwin*)
|
|
1030 # These system don't have libm
|
|
1031 ;;
|
|
1032 *-ncr-sysv4.3*)
|
|
1033 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
|
|
1034 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
|
|
1035 ;;
|
|
1036 *)
|
|
1037 AC_CHECK_LIB(m, main, LIBM="-lm")
|
|
1038 ;;
|
|
1039 esac
|
|
1040 ])
|
|
1041
|
|
1042 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
|
|
1043 # the libltdl convenience library and INCLTDL to the include flags for
|
|
1044 # the libltdl header and adds --enable-ltdl-convenience to the
|
|
1045 # configure arguments. Note that LIBLTDL and INCLTDL are not
|
|
1046 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
|
|
1047 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
|
|
1048 # with '${top_builddir}/' and INCLTDL will be prefixed with
|
|
1049 # '${top_srcdir}/' (note the single quotes!). If your package is not
|
|
1050 # flat and you're not using automake, define top_builddir and
|
|
1051 # top_srcdir appropriately in the Makefiles.
|
|
1052 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
1053 case "$enable_ltdl_convenience" in
|
|
1054 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
|
|
1055 "") enable_ltdl_convenience=yes
|
|
1056 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
|
|
1057 esac
|
|
1058 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
|
|
1059 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
|
1060 ])
|
|
1061
|
|
1062 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
|
|
1063 # the libltdl installable library and INCLTDL to the include flags for
|
|
1064 # the libltdl header and adds --enable-ltdl-install to the configure
|
|
1065 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
|
|
1066 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
|
|
1067 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
|
|
1068 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
|
|
1069 # with '${top_srcdir}/' (note the single quotes!). If your package is
|
|
1070 # not flat and you're not using automake, define top_builddir and
|
|
1071 # top_srcdir appropriately in the Makefiles.
|
|
1072 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
|
|
1073 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
|
|
1074 AC_CHECK_LIB(ltdl, main,
|
|
1075 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
|
|
1076 [if test x"$enable_ltdl_install" = xno; then
|
|
1077 AC_MSG_WARN([libltdl not installed, but installation disabled])
|
|
1078 else
|
|
1079 enable_ltdl_install=yes
|
|
1080 fi
|
|
1081 ])
|
|
1082 if test x"$enable_ltdl_install" = x"yes"; then
|
|
1083 ac_configure_args="$ac_configure_args --enable-ltdl-install"
|
|
1084 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
|
|
1085 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
|
|
1086 else
|
|
1087 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
|
|
1088 LIBLTDL="-lltdl"
|
|
1089 INCLTDL=
|
|
1090 fi
|
|
1091 ])
|
|
1092
|
|
1093 dnl old names
|
|
1094 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
|
|
1095 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
|
|
1096 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
|
|
1097 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
|
1098 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
|
1099 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
|
1100 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
|
1101
|
|
1102 dnl This is just to silence aclocal about the macro not being used
|
|
1103 ifelse([AC_DISABLE_FAST_INSTALL])dnl
|