Mercurial > sdl-ios-xcode
annotate acinclude.m4 @ 723:1e8865a3e127
Files now copied to build directory instead of source directory while configuring
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Wed, 24 Sep 2003 21:45:27 +0000 |
parents | cf2af46e9e2a |
children | dac996d69abb |
rev | line source |
---|---|
0 | 1 # Local macros for the SDL configure.in script |
2 | |
3 dnl Function to link an architecture specific file | |
4 dnl LINK_ARCH_SRC(source_dir, arch, source_file) | |
5 AC_DEFUN(COPY_ARCH_SRC, | |
6 [ | |
7 old="$srcdir/$1/$2/$3" | |
723
1e8865a3e127
Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents:
1
diff
changeset
|
8 new="$1/$3" |
1e8865a3e127
Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents:
1
diff
changeset
|
9 if test ! -d $1; then |
1e8865a3e127
Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents:
1
diff
changeset
|
10 echo "Creating directory $1" |
1e8865a3e127
Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents:
1
diff
changeset
|
11 mkdir -p $1 |
1e8865a3e127
Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents:
1
diff
changeset
|
12 fi |
1e8865a3e127
Files now copied to build directory instead of source directory while configuring
Patrice Mandin <patmandin@gmail.com>
parents:
1
diff
changeset
|
13 echo "Copying $old -> $new" |
0 | 14 cat >$new <<__EOF__ |
15 /* WARNING: This file was automatically generated! | |
16 * Original: $old | |
17 */ | |
18 __EOF__ | |
19 cat >>$new <$old | |
20 ]) | |
21 | |
22 # | |
23 # --- esd.m4 --- | |
24 # | |
25 # Configure paths for ESD | |
26 # Manish Singh 98-9-30 | |
27 # stolen back from Frank Belew | |
28 # stolen from Manish Singh | |
29 # Shamelessly stolen from Owen Taylor | |
30 | |
31 dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) | |
32 dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS | |
33 dnl | |
34 AC_DEFUN(AM_PATH_ESD, | |
35 [dnl | |
36 dnl Get the cflags and libraries from the esd-config script | |
37 dnl | |
38 AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], | |
39 esd_prefix="$withval", esd_prefix="") | |
40 AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], | |
41 esd_exec_prefix="$withval", esd_exec_prefix="") | |
42 AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], | |
43 , enable_esdtest=yes) | |
44 | |
45 if test x$esd_exec_prefix != x ; then | |
46 esd_args="$esd_args --exec-prefix=$esd_exec_prefix" | |
47 if test x${ESD_CONFIG+set} != xset ; then | |
48 ESD_CONFIG=$esd_exec_prefix/bin/esd-config | |
49 fi | |
50 fi | |
51 if test x$esd_prefix != x ; then | |
52 esd_args="$esd_args --prefix=$esd_prefix" | |
53 if test x${ESD_CONFIG+set} != xset ; then | |
54 ESD_CONFIG=$esd_prefix/bin/esd-config | |
55 fi | |
56 fi | |
57 | |
58 AC_PATH_PROG(ESD_CONFIG, esd-config, no) | |
59 min_esd_version=ifelse([$1], ,0.2.7,$1) | |
60 AC_MSG_CHECKING(for ESD - version >= $min_esd_version) | |
61 no_esd="" | |
62 if test "$ESD_CONFIG" = "no" ; then | |
63 no_esd=yes | |
64 else | |
65 ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` | |
66 ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` | |
67 | |
68 esd_major_version=`$ESD_CONFIG $esd_args --version | \ | |
69 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` | |
70 esd_minor_version=`$ESD_CONFIG $esd_args --version | \ | |
71 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` | |
72 esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ | |
73 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` | |
74 if test "x$enable_esdtest" = "xyes" ; then | |
75 ac_save_CFLAGS="$CFLAGS" | |
76 ac_save_LIBS="$LIBS" | |
77 CFLAGS="$CFLAGS $ESD_CFLAGS" | |
78 LIBS="$LIBS $ESD_LIBS" | |
79 dnl | |
80 dnl Now check if the installed ESD is sufficiently new. (Also sanity | |
81 dnl checks the results of esd-config to some extent | |
82 dnl | |
83 rm -f conf.esdtest | |
84 AC_TRY_RUN([ | |
85 #include <stdio.h> | |
86 #include <stdlib.h> | |
87 #include <string.h> | |
88 #include <esd.h> | |
89 | |
90 char* | |
91 my_strdup (char *str) | |
92 { | |
93 char *new_str; | |
94 | |
95 if (str) | |
96 { | |
97 new_str = malloc ((strlen (str) + 1) * sizeof(char)); | |
98 strcpy (new_str, str); | |
99 } | |
100 else | |
101 new_str = NULL; | |
102 | |
103 return new_str; | |
104 } | |
105 | |
106 int main () | |
107 { | |
108 int major, minor, micro; | |
109 char *tmp_version; | |
110 | |
111 system ("touch conf.esdtest"); | |
112 | |
113 /* HP/UX 9 (%@#!) writes to sscanf strings */ | |
114 tmp_version = my_strdup("$min_esd_version"); | |
115 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { | |
116 printf("%s, bad version string\n", "$min_esd_version"); | |
117 exit(1); | |
118 } | |
119 | |
120 if (($esd_major_version > major) || | |
121 (($esd_major_version == major) && ($esd_minor_version > minor)) || | |
122 (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) | |
123 { | |
124 return 0; | |
125 } | |
126 else | |
127 { | |
128 printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); | |
129 printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); | |
130 printf("*** best to upgrade to the required version.\n"); | |
131 printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); | |
132 printf("*** to point to the correct copy of esd-config, and remove the file\n"); | |
133 printf("*** config.cache before re-running configure\n"); | |
134 return 1; | |
135 } | |
136 } | |
137 | |
138 ],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) | |
139 CFLAGS="$ac_save_CFLAGS" | |
140 LIBS="$ac_save_LIBS" | |
141 fi | |
142 fi | |
143 if test "x$no_esd" = x ; then | |
144 AC_MSG_RESULT(yes) | |
145 ifelse([$2], , :, [$2]) | |
146 else | |
147 AC_MSG_RESULT(no) | |
148 if test "$ESD_CONFIG" = "no" ; then | |
149 echo "*** The esd-config script installed by ESD could not be found" | |
150 echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" | |
151 echo "*** your path, or set the ESD_CONFIG environment variable to the" | |
152 echo "*** full path to esd-config." | |
153 else | |
154 if test -f conf.esdtest ; then | |
155 : | |
156 else | |
157 echo "*** Could not run ESD test program, checking why..." | |
158 CFLAGS="$CFLAGS $ESD_CFLAGS" | |
159 LIBS="$LIBS $ESD_LIBS" | |
160 AC_TRY_LINK([ | |
161 #include <stdio.h> | |
162 #include <esd.h> | |
163 ], [ return 0; ], | |
164 [ echo "*** The test program compiled, but did not run. This usually means" | |
165 echo "*** that the run-time linker is not finding ESD or finding the wrong" | |
166 echo "*** version of ESD. If it is not finding ESD, you'll need to set your" | |
167 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" | |
168 echo "*** to the installed location Also, make sure you have run ldconfig if that" | |
169 echo "*** is required on your system" | |
170 echo "***" | |
171 echo "*** If you have an old version installed, it is best to remove it, although" | |
172 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], | |
173 [ echo "*** The test program failed to compile or link. See the file config.log for the" | |
174 echo "*** exact error that occured. This usually means ESD was incorrectly installed" | |
175 echo "*** or that you have moved ESD since it was installed. In the latter case, you" | |
176 echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) | |
177 CFLAGS="$ac_save_CFLAGS" | |
178 LIBS="$ac_save_LIBS" | |
179 fi | |
180 fi | |
181 ESD_CFLAGS="" | |
182 ESD_LIBS="" | |
183 ifelse([$3], , :, [$3]) | |
184 fi | |
185 AC_SUBST(ESD_CFLAGS) | |
186 AC_SUBST(ESD_LIBS) | |
187 rm -f conf.esdtest | |
188 ]) | |
189 | |
190 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*- | |
191 ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc. | |
192 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 | |
193 ## | |
194 ## This program is free software; you can redistribute it and/or modify | |
195 ## it under the terms of the GNU General Public License as published by | |
196 ## the Free Software Foundation; either version 2 of the License, or | |
197 ## (at your option) any later version. | |
198 ## | |
199 ## This program is distributed in the hope that it will be useful, but | |
200 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
201 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
202 ## General Public License for more details. | |
203 ## | |
204 ## You should have received a copy of the GNU General Public License | |
205 ## along with this program; if not, write to the Free Software | |
206 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
207 ## | |
208 ## As a special exception to the GNU General Public License, if you | |
209 ## distribute this file as part of a program that contains a | |
210 ## configuration script generated by Autoconf, you may include it under | |
211 ## the same distribution terms that you use for the rest of that program. | |
212 | |
213 # serial 40 AC_PROG_LIBTOOL | |
214 AC_DEFUN(AC_PROG_LIBTOOL, | |
215 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl | |
216 | |
217 # Save cache, so that ltconfig can load it | |
218 AC_CACHE_SAVE | |
219 | |
220 # Actually configure libtool. ac_aux_dir is where install-sh is found. | |
221 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ | |
222 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ | |
223 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ | |
224 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ | |
225 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ | |
226 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ | |
227 || AC_MSG_ERROR([libtool configure failed]) | |
228 | |
229 # Reload cache, that may have been modified by ltconfig | |
230 AC_CACHE_LOAD | |
231 | |
232 # This can be used to rebuild libtool when needed | |
233 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" | |
234 | |
235 # Always use our own libtool. | |
236 LIBTOOL='$(SHELL) $(top_builddir)/libtool' | |
237 AC_SUBST(LIBTOOL)dnl | |
238 | |
239 # Redirect the config.log output again, so that the ltconfig log is not | |
240 # clobbered by the next message. | |
241 exec 5>>./config.log | |
242 ]) | |
243 | |
244 AC_DEFUN(AC_LIBTOOL_SETUP, | |
245 [AC_PREREQ(2.13)dnl | |
246 AC_REQUIRE([AC_ENABLE_SHARED])dnl | |
247 AC_REQUIRE([AC_ENABLE_STATIC])dnl | |
248 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl | |
249 AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
250 AC_REQUIRE([AC_CANONICAL_BUILD])dnl | |
251 AC_REQUIRE([AC_PROG_RANLIB])dnl | |
252 AC_REQUIRE([AC_PROG_CC])dnl | |
253 AC_REQUIRE([AC_PROG_LD])dnl | |
254 AC_REQUIRE([AC_PROG_NM])dnl | |
255 AC_REQUIRE([AC_PROG_LN_S])dnl | |
256 dnl | |
257 | |
258 case "$target" in | |
259 NONE) lt_target="$host" ;; | |
260 *) lt_target="$target" ;; | |
261 esac | |
262 | |
263 # Check for any special flags to pass to ltconfig. | |
264 libtool_flags="--cache-file=$cache_file" | |
265 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" | |
266 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" | |
267 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" | |
268 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" | |
269 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" | |
270 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], | |
271 [libtool_flags="$libtool_flags --enable-dlopen"]) | |
272 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], | |
273 [libtool_flags="$libtool_flags --enable-win32-dll"]) | |
274 AC_ARG_ENABLE(libtool-lock, | |
275 [ --disable-libtool-lock avoid locking (might break parallel builds)]) | |
276 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" | |
277 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" | |
278 | |
279 # Some flags need to be propagated to the compiler or linker for good | |
280 # libtool support. | |
281 case "$lt_target" in | |
282 *-*-irix6*) | |
283 # Find out which ABI we are using. | |
284 echo '[#]line __oline__ "configure"' > conftest.$ac_ext | |
285 if AC_TRY_EVAL(ac_compile); then | |
286 case "`/usr/bin/file conftest.o`" in | |
287 *32-bit*) | |
288 LD="${LD-ld} -32" | |
289 ;; | |
290 *N32*) | |
291 LD="${LD-ld} -n32" | |
292 ;; | |
293 *64-bit*) | |
294 LD="${LD-ld} -64" | |
295 ;; | |
296 esac | |
297 fi | |
298 rm -rf conftest* | |
299 ;; | |
300 | |
301 *-*-sco3.2v5*) | |
302 # On SCO OpenServer 5, we need -belf to get full-featured binaries. | |
303 SAVE_CFLAGS="$CFLAGS" | |
304 CFLAGS="$CFLAGS -belf" | |
305 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, | |
306 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) | |
307 if test x"$lt_cv_cc_needs_belf" != x"yes"; then | |
308 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf | |
309 CFLAGS="$SAVE_CFLAGS" | |
310 fi | |
311 ;; | |
312 | |
313 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], | |
314 [*-*-cygwin* | *-*-mingw*) | |
315 AC_CHECK_TOOL(DLLTOOL, dlltool, false) | |
316 AC_CHECK_TOOL(AS, as, false) | |
317 AC_CHECK_TOOL(OBJDUMP, objdump, false) | |
318 ;; | |
319 ]) | |
320 esac | |
321 ]) | |
322 | |
323 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support | |
324 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) | |
325 | |
326 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's | |
327 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) | |
328 | |
329 # AC_ENABLE_SHARED - implement the --enable-shared flag | |
330 # Usage: AC_ENABLE_SHARED[(DEFAULT)] | |
331 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
332 # `yes'. | |
333 AC_DEFUN(AC_ENABLE_SHARED, [dnl | |
334 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl | |
335 AC_ARG_ENABLE(shared, | |
336 changequote(<<, >>)dnl | |
337 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], | |
338 changequote([, ])dnl | |
339 [p=${PACKAGE-default} | |
340 case "$enableval" in | |
341 yes) enable_shared=yes ;; | |
342 no) enable_shared=no ;; | |
343 *) | |
344 enable_shared=no | |
345 # Look at the argument we got. We use all the common list separators. | |
346 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
347 for pkg in $enableval; do | |
348 if test "X$pkg" = "X$p"; then | |
349 enable_shared=yes | |
350 fi | |
351 done | |
352 IFS="$ac_save_ifs" | |
353 ;; | |
354 esac], | |
355 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl | |
356 ]) | |
357 | |
358 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared | |
359 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
360 AC_ENABLE_SHARED(no)]) | |
361 | |
362 # AC_ENABLE_STATIC - implement the --enable-static flag | |
363 # Usage: AC_ENABLE_STATIC[(DEFAULT)] | |
364 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
365 # `yes'. | |
366 AC_DEFUN(AC_ENABLE_STATIC, [dnl | |
367 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl | |
368 AC_ARG_ENABLE(static, | |
369 changequote(<<, >>)dnl | |
370 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], | |
371 changequote([, ])dnl | |
372 [p=${PACKAGE-default} | |
373 case "$enableval" in | |
374 yes) enable_static=yes ;; | |
375 no) enable_static=no ;; | |
376 *) | |
377 enable_static=no | |
378 # Look at the argument we got. We use all the common list separators. | |
379 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
380 for pkg in $enableval; do | |
381 if test "X$pkg" = "X$p"; then | |
382 enable_static=yes | |
383 fi | |
384 done | |
385 IFS="$ac_save_ifs" | |
386 ;; | |
387 esac], | |
388 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl | |
389 ]) | |
390 | |
391 # AC_DISABLE_STATIC - set the default static flag to --disable-static | |
392 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
393 AC_ENABLE_STATIC(no)]) | |
394 | |
395 | |
396 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag | |
397 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] | |
398 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to | |
399 # `yes'. | |
400 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl | |
401 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl | |
402 AC_ARG_ENABLE(fast-install, | |
403 changequote(<<, >>)dnl | |
404 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], | |
405 changequote([, ])dnl | |
406 [p=${PACKAGE-default} | |
407 case "$enableval" in | |
408 yes) enable_fast_install=yes ;; | |
409 no) enable_fast_install=no ;; | |
410 *) | |
411 enable_fast_install=no | |
412 # Look at the argument we got. We use all the common list separators. | |
413 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," | |
414 for pkg in $enableval; do | |
415 if test "X$pkg" = "X$p"; then | |
416 enable_fast_install=yes | |
417 fi | |
418 done | |
419 IFS="$ac_save_ifs" | |
420 ;; | |
421 esac], | |
422 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl | |
423 ]) | |
424 | |
425 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install | |
426 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
427 AC_ENABLE_FAST_INSTALL(no)]) | |
428 | |
429 # AC_PROG_LD - find the path to the GNU or non-GNU linker | |
430 AC_DEFUN(AC_PROG_LD, | |
431 [AC_ARG_WITH(gnu-ld, | |
432 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], | |
433 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) | |
434 AC_REQUIRE([AC_PROG_CC])dnl | |
435 AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
436 AC_REQUIRE([AC_CANONICAL_BUILD])dnl | |
437 ac_prog=ld | |
438 if test "$ac_cv_prog_gcc" = yes; then | |
439 # Check if gcc -print-prog-name=ld gives a path. | |
440 AC_MSG_CHECKING([for ld used by GCC]) | |
1
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
441 DELCR='tr -d \015' |
cf2af46e9e2a
Changes since SDL 1.2.0 release
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
442 ac_prog=`($CC -print-prog-name=ld | $DELCR) 2>&5` |
0 | 443 case "$ac_prog" in |
444 # Accept absolute paths. | |
445 changequote(,)dnl | |
446 [\\/]* | [A-Za-z]:[\\/]*) | |
447 re_direlt='/[^/][^/]*/\.\./' | |
448 changequote([,])dnl | |
449 # Canonicalize the path of ld | |
450 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` | |
451 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do | |
452 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` | |
453 done | |
454 test -z "$LD" && LD="$ac_prog" | |
455 ;; | |
456 "") | |
457 # If it fails, then pretend we aren't using GCC. | |
458 ac_prog=ld | |
459 ;; | |
460 *) | |
461 # If it is relative, then search for the first ld in PATH. | |
462 with_gnu_ld=unknown | |
463 ;; | |
464 esac | |
465 elif test "$with_gnu_ld" = yes; then | |
466 AC_MSG_CHECKING([for GNU ld]) | |
467 else | |
468 AC_MSG_CHECKING([for non-GNU ld]) | |
469 fi | |
470 AC_CACHE_VAL(ac_cv_path_LD, | |
471 [if test -z "$LD"; then | |
472 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" | |
473 for ac_dir in $PATH; do | |
474 test -z "$ac_dir" && ac_dir=. | |
475 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then | |
476 ac_cv_path_LD="$ac_dir/$ac_prog" | |
477 # Check to see if the program is GNU ld. I'd rather use --version, | |
478 # but apparently some GNU ld's only accept -v. | |
479 # Break only if it was the GNU/non-GNU ld that we prefer. | |
480 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then | |
481 test "$with_gnu_ld" != no && break | |
482 else | |
483 test "$with_gnu_ld" != yes && break | |
484 fi | |
485 fi | |
486 done | |
487 IFS="$ac_save_ifs" | |
488 else | |
489 ac_cv_path_LD="$LD" # Let the user override the test with a path. | |
490 fi]) | |
491 LD="$ac_cv_path_LD" | |
492 if test -n "$LD"; then | |
493 AC_MSG_RESULT($LD) | |
494 else | |
495 AC_MSG_RESULT(no) | |
496 fi | |
497 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) | |
498 AC_PROG_LD_GNU | |
499 ]) | |
500 | |
501 AC_DEFUN(AC_PROG_LD_GNU, | |
502 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, | |
503 [# I'd rather use --version here, but apparently some GNU ld's only accept -v. | |
504 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then | |
505 ac_cv_prog_gnu_ld=yes | |
506 else | |
507 ac_cv_prog_gnu_ld=no | |
508 fi]) | |
509 ]) | |
510 | |
511 # AC_PROG_NM - find the path to a BSD-compatible name lister | |
512 AC_DEFUN(AC_PROG_NM, | |
513 [AC_MSG_CHECKING([for BSD-compatible nm]) | |
514 AC_CACHE_VAL(ac_cv_path_NM, | |
515 [if test -n "$NM"; then | |
516 # Let the user override the test. | |
517 ac_cv_path_NM="$NM" | |
518 else | |
519 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" | |
520 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do | |
521 test -z "$ac_dir" && ac_dir=. | |
522 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then | |
523 # Check to see if the nm accepts a BSD-compat flag. | |
524 # Adding the `sed 1q' prevents false positives on HP-UX, which says: | |
525 # nm: unknown option "B" ignored | |
526 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then | |
527 ac_cv_path_NM="$ac_dir/nm -B" | |
528 break | |
529 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then | |
530 ac_cv_path_NM="$ac_dir/nm -p" | |
531 break | |
532 else | |
533 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but | |
534 continue # so that we can try to find one that supports BSD flags | |
535 fi | |
536 fi | |
537 done | |
538 IFS="$ac_save_ifs" | |
539 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm | |
540 fi]) | |
541 NM="$ac_cv_path_NM" | |
542 AC_MSG_RESULT([$NM]) | |
543 ]) | |
544 | |
545 # AC_CHECK_LIBM - check for math library | |
546 AC_DEFUN(AC_CHECK_LIBM, | |
547 [AC_REQUIRE([AC_CANONICAL_HOST])dnl | |
548 LIBM= | |
549 case "$lt_target" in | |
550 *-*-beos* | *-*-cygwin*) | |
551 # These system don't have libm | |
552 ;; | |
553 *-ncr-sysv4.3*) | |
554 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") | |
555 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") | |
556 ;; | |
557 *) | |
558 AC_CHECK_LIB(m, main, LIBM="-lm") | |
559 ;; | |
560 esac | |
561 ]) | |
562 | |
563 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for | |
564 # the libltdl convenience library and INCLTDL to the include flags for | |
565 # the libltdl header and adds --enable-ltdl-convenience to the | |
566 # configure arguments. Note that LIBLTDL and INCLTDL are not | |
567 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not | |
568 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed | |
569 # with '${top_builddir}/' and INCLTDL will be prefixed with | |
570 # '${top_srcdir}/' (note the single quotes!). If your package is not | |
571 # flat and you're not using automake, define top_builddir and | |
572 # top_srcdir appropriately in the Makefiles. | |
573 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
574 case "$enable_ltdl_convenience" in | |
575 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; | |
576 "") enable_ltdl_convenience=yes | |
577 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; | |
578 esac | |
579 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la | |
580 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) | |
581 ]) | |
582 | |
583 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for | |
584 # the libltdl installable library and INCLTDL to the include flags for | |
585 # the libltdl header and adds --enable-ltdl-install to the configure | |
586 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is | |
587 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed | |
588 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will | |
589 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed | |
590 # with '${top_srcdir}/' (note the single quotes!). If your package is | |
591 # not flat and you're not using automake, define top_builddir and | |
592 # top_srcdir appropriately in the Makefiles. | |
593 # In the future, this macro may have to be called after AC_PROG_LIBTOOL. | |
594 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl | |
595 AC_CHECK_LIB(ltdl, main, | |
596 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], | |
597 [if test x"$enable_ltdl_install" = xno; then | |
598 AC_MSG_WARN([libltdl not installed, but installation disabled]) | |
599 else | |
600 enable_ltdl_install=yes | |
601 fi | |
602 ]) | |
603 if test x"$enable_ltdl_install" = x"yes"; then | |
604 ac_configure_args="$ac_configure_args --enable-ltdl-install" | |
605 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la | |
606 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) | |
607 else | |
608 ac_configure_args="$ac_configure_args --enable-ltdl-install=no" | |
609 LIBLTDL="-lltdl" | |
610 INCLTDL= | |
611 fi | |
612 ]) | |
613 | |
614 dnl old names | |
615 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl | |
616 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl | |
617 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl | |
618 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl | |
619 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl | |
620 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl | |
621 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl | |
622 | |
623 dnl This is just to silence aclocal about the macro not being used | |
624 ifelse([AC_DISABLE_FAST_INSTALL])dnl |