OSDN Git Service

* public snapshot of sid simulator
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / aclocal.m4
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 # Do all the work for Automake.  This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
16
17 # serial 1
18
19 dnl Usage:
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
21
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
24 PACKAGE=[$1]
25 AC_SUBST(PACKAGE)
26 VERSION=[$2]
27 AC_SUBST(VERSION)
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
31 fi
32 ifelse([$3],,
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
45
46 #
47 # Check to make sure that the build environment is sane.
48 #
49
50 AC_DEFUN(AM_SANITY_CHECK,
51 [AC_MSG_CHECKING([whether build environment is sane])
52 # Just in case
53 sleep 1
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments.  Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
59 # directory).
60 if (
61    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62    if test "[$]*" = "X"; then
63       # -L didn't work.
64       set X `ls -t $srcdir/configure conftestfile`
65    fi
66    if test "[$]*" != "X $srcdir/configure conftestfile" \
67       && test "[$]*" != "X conftestfile $srcdir/configure"; then
68
69       # If neither matched, then we have a broken ls.  This can happen
70       # if, for instance, CONFIG_SHELL is bash and it inherits a
71       # broken ls alias from the environment.  This has actually
72       # happened.  Such a system could not be considered "sane".
73       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
74 alias in your environment])
75    fi
76
77    test "[$]2" = conftestfile
78    )
79 then
80    # Ok.
81    :
82 else
83    AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
85 fi
86 rm -f conftest*
87 AC_MSG_RESULT(yes)])
88
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN(AM_MISSING_PROG,
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf.  Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
97    $1=$2
98    AC_MSG_RESULT(found)
99 else
100    $1="$3/missing $2"
101    AC_MSG_RESULT(missing)
102 fi
103 AC_SUBST($1)])
104
105 # Like AC_CONFIG_HEADER, but automatically create stamp file.
106
107 AC_DEFUN(AM_CONFIG_HEADER,
108 [AC_PREREQ([2.12])
109 AC_CONFIG_HEADER([$1])
110 dnl When config.status generates a header, we must update the stamp-h file.
111 dnl This file resides in the same directory as the config header
112 dnl that is generated.  We must strip everything past the first ":",
113 dnl and everything past the last "/".
114 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
115 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
116 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
117 <<am_indx=1
118 for am_file in <<$1>>; do
119   case " <<$>>CONFIG_HEADERS " in
120   *" <<$>>am_file "*<<)>>
121     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
122     ;;
123   esac
124   am_indx=`expr "<<$>>am_indx" + 1`
125 done<<>>dnl>>)
126 changequote([,]))])
127
128 # Add --enable-maintainer-mode option to configure.
129 # From Jim Meyering
130
131 # serial 1
132
133 AC_DEFUN(AM_MAINTAINER_MODE,
134 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
135   dnl maintainer-mode is disabled by default
136   AC_ARG_ENABLE(maintainer-mode,
137 [  --enable-maintainer-mode enable make rules and dependencies not useful
138                           (and sometimes confusing) to the casual installer],
139       USE_MAINTAINER_MODE=$enableval,
140       USE_MAINTAINER_MODE=no)
141   AC_MSG_RESULT($USE_MAINTAINER_MODE)
142   AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
143   MAINT=$MAINTAINER_MODE_TRUE
144   AC_SUBST(MAINT)dnl
145 ]
146 )
147
148 # Define a conditional.
149
150 AC_DEFUN(AM_CONDITIONAL,
151 [AC_SUBST($1_TRUE)
152 AC_SUBST($1_FALSE)
153 if $2; then
154   $1_TRUE=
155   $1_FALSE='#'
156 else
157   $1_TRUE='#'
158   $1_FALSE=
159 fi])
160
161
162 # serial 41 AC_PROG_LIBTOOL
163 AC_DEFUN(AC_PROG_LIBTOOL,
164 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
165
166 # Save cache, so that ltconfig can load it
167 AC_CACHE_SAVE
168
169 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
170 AR="$AR" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
171 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
172 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
173 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
174 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
175 $libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
176 || AC_MSG_ERROR([libtool configure failed])
177
178 # Reload cache, that may have been modified by ltconfig
179 AC_CACHE_LOAD
180
181 # This can be used to rebuild libtool when needed
182 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
183
184 # Always use our own libtool.
185 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
186 AC_SUBST(LIBTOOL)dnl
187
188 # Redirect the config.log output again, so that the ltconfig log is not
189 # clobbered by the next message.
190 exec 5>>./config.log
191 ])
192
193 AC_DEFUN(AC_LIBTOOL_SETUP,
194 [AC_PREREQ(2.13)dnl
195 AC_REQUIRE([AC_ENABLE_SHARED])dnl
196 AC_REQUIRE([AC_ENABLE_STATIC])dnl
197 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
198 AC_REQUIRE([AC_CANONICAL_HOST])dnl
199 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
200 AC_REQUIRE([AC_PROG_CC])dnl
201 AC_REQUIRE([AC_PROG_LD])dnl
202 AC_REQUIRE([AC_PROG_NM])dnl
203 AC_REQUIRE([AC_PROG_LN_S])dnl
204 dnl
205
206 AC_CHECK_TOOL(AR, ar)
207 AC_CHECK_TOOL(RANLIB, ranlib, :)
208
209 # Check for any special flags to pass to ltconfig.
210 libtool_flags="--cache-file=$cache_file"
211 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
212 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
213 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
214 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
215 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
216 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
217 [libtool_flags="$libtool_flags --enable-dlopen"])
218 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
219 [libtool_flags="$libtool_flags --enable-win32-dll"])
220 AC_ARG_ENABLE(libtool-lock,
221   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
222 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
223 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
224
225 AC_ARG_WITH(pic,
226   [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
227      pic_mode="$withval", pic_mode=default)
228 test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
229 test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
230
231 # Some flags need to be propagated to the compiler or linker for good
232 # libtool support.
233 case "$host" in
234 *-*-irix6*)
235   # Find out which ABI we are using.
236   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
237   if AC_TRY_EVAL(ac_compile); then
238     case "`/usr/bin/file conftest.o`" in
239     *32-bit*)
240       LD="${LD-ld} -32"
241       ;;
242     *N32*)
243       LD="${LD-ld} -n32"
244       ;;
245     *64-bit*)
246       LD="${LD-ld} -64"
247       ;;
248     esac
249   fi
250   rm -rf conftest*
251   ;;
252
253 *-*-sco3.2v5*)
254   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
255   SAVE_CFLAGS="$CFLAGS"
256   CFLAGS="$CFLAGS -belf"
257   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
258     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
259   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
260     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
261     CFLAGS="$SAVE_CFLAGS"
262   fi
263   ;;
264
265 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
266 [*-*-cygwin* | *-*-mingw*)
267   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
268   AC_CHECK_TOOL(AS, as, false)
269   AC_CHECK_TOOL(OBJDUMP, objdump, false)
270
271   # recent cygwin and mingw systems supply a stub DllMain which the user
272   # can override, but on older systems we have to supply one
273   AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
274     [AC_TRY_LINK([DllMain (0, 0, 0);],
275       [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);],
276       [lt_cv_need_dllmain=yes],[lt_cv_need_dllmain=no])])
277
278   case $host in
279   *-*-cygwin*)
280     # cygwin systems need to pass --dll to the linker, and not link
281     # crt.o which will require a WinMain@16 definition.
282     lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
283   *-*-mingw*)
284     # old mingw systems require "-dll" to link a DLL, while more recent ones
285     # require "-mdll"
286     SAVE_CFLAGS="$CFLAGS"
287     CFLAGS="$CFLAGS -mdll"
288     AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
289       [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
290     CFLAGS="$SAVE_CFLAGS" ;;
291   esac
292   ;;
293   ])
294 esac
295 ])
296
297 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
298 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
299
300 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
301 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
302
303 # AC_ENABLE_SHARED - implement the --enable-shared flag
304 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
305 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
306 #   `yes'.
307 AC_DEFUN(AC_ENABLE_SHARED, [dnl
308 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
309 AC_ARG_ENABLE(shared,
310 changequote(<<, >>)dnl
311 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
312 changequote([, ])dnl
313 [p=${PACKAGE-default}
314 case "$enableval" in
315 yes) enable_shared=yes ;;
316 no) enable_shared=no ;;
317 *)
318   enable_shared=no
319   # Look at the argument we got.  We use all the common list separators.
320   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
321   for pkg in $enableval; do
322     if test "X$pkg" = "X$p"; then
323       enable_shared=yes
324     fi
325   done
326   IFS="$ac_save_ifs"
327   ;;
328 esac],
329 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
330 ])
331
332 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
333 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
334 AC_ENABLE_SHARED(no)])
335
336 # AC_ENABLE_STATIC - implement the --enable-static flag
337 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
338 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
339 #   `yes'.
340 AC_DEFUN(AC_ENABLE_STATIC, [dnl
341 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
342 AC_ARG_ENABLE(static,
343 changequote(<<, >>)dnl
344 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
345 changequote([, ])dnl
346 [p=${PACKAGE-default}
347 case "$enableval" in
348 yes) enable_static=yes ;;
349 no) enable_static=no ;;
350 *)
351   enable_static=no
352   # Look at the argument we got.  We use all the common list separators.
353   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
354   for pkg in $enableval; do
355     if test "X$pkg" = "X$p"; then
356       enable_static=yes
357     fi
358   done
359   IFS="$ac_save_ifs"
360   ;;
361 esac],
362 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
363 ])
364
365 # AC_DISABLE_STATIC - set the default static flag to --disable-static
366 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
367 AC_ENABLE_STATIC(no)])
368
369
370 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
371 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
372 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
373 #   `yes'.
374 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
375 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
376 AC_ARG_ENABLE(fast-install,
377 changequote(<<, >>)dnl
378 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
379 changequote([, ])dnl
380 [p=${PACKAGE-default}
381 case "$enableval" in
382 yes) enable_fast_install=yes ;;
383 no) enable_fast_install=no ;;
384 *)
385   enable_fast_install=no
386   # Look at the argument we got.  We use all the common list separators.
387   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
388   for pkg in $enableval; do
389     if test "X$pkg" = "X$p"; then
390       enable_fast_install=yes
391     fi
392   done
393   IFS="$ac_save_ifs"
394   ;;
395 esac],
396 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
397 ])
398
399 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
400 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
401 AC_ENABLE_FAST_INSTALL(no)])
402
403 # AC_PROG_LD - find the path to the GNU or non-GNU linker
404 AC_DEFUN(AC_PROG_LD,
405 [AC_ARG_WITH(gnu-ld,
406 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
407 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
408 AC_REQUIRE([AC_PROG_CC])dnl
409 AC_REQUIRE([AC_CANONICAL_HOST])dnl
410 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
411 ac_prog=ld
412 if test "$ac_cv_prog_gcc" = yes; then
413   # Check if gcc -print-prog-name=ld gives a path.
414   AC_MSG_CHECKING([for ld used by GCC])
415   case $host in
416   *-*-mingw*)
417     # gcc leaves a trailing carriage return which upsets mingw
418     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
419   *)
420     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
421   esac
422   case "$ac_prog" in
423     # Accept absolute paths.
424 changequote(,)dnl
425     [\\/]* | [A-Za-z]:[\\/]*)
426       re_direlt='/[^/][^/]*/\.\./'
427 changequote([,])dnl
428       # Canonicalize the path of ld
429       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
430       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
431         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
432       done
433       test -z "$LD" && LD="$ac_prog"
434       ;;
435   "")
436     # If it fails, then pretend we aren't using GCC.
437     ac_prog=ld
438     ;;
439   *)
440     # If it is relative, then search for the first ld in PATH.
441     with_gnu_ld=unknown
442     ;;
443   esac
444 elif test "$with_gnu_ld" = yes; then
445   AC_MSG_CHECKING([for GNU ld])
446 else
447   AC_MSG_CHECKING([for non-GNU ld])
448 fi
449 AC_CACHE_VAL(ac_cv_path_LD,
450 [if test -z "$LD"; then
451   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
452   for ac_dir in $PATH; do
453     test -z "$ac_dir" && ac_dir=.
454     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
455       ac_cv_path_LD="$ac_dir/$ac_prog"
456       # Check to see if the program is GNU ld.  I'd rather use --version,
457       # but apparently some GNU ld's only accept -v.
458       # Break only if it was the GNU/non-GNU ld that we prefer.
459       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
460         test "$with_gnu_ld" != no && break
461       else
462         test "$with_gnu_ld" != yes && break
463       fi
464     fi
465   done
466   IFS="$ac_save_ifs"
467 else
468   ac_cv_path_LD="$LD" # Let the user override the test with a path.
469 fi])
470 LD="$ac_cv_path_LD"
471 if test -n "$LD"; then
472   AC_MSG_RESULT($LD)
473 else
474   AC_MSG_RESULT(no)
475 fi
476 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
477 AC_SUBST(LD)
478 AC_PROG_LD_GNU
479 ])
480
481 AC_DEFUN(AC_PROG_LD_GNU,
482 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
483 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
484 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
485   ac_cv_prog_gnu_ld=yes
486 else
487   ac_cv_prog_gnu_ld=no
488 fi])
489 ])
490
491 # AC_PROG_NM - find the path to a BSD-compatible name lister
492 AC_DEFUN(AC_PROG_NM,
493 [AC_MSG_CHECKING([for BSD-compatible nm])
494 AC_CACHE_VAL(ac_cv_path_NM,
495 [if test -n "$NM"; then
496   # Let the user override the test.
497   ac_cv_path_NM="$NM"
498 else
499   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
500   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
501     test -z "$ac_dir" && ac_dir=.
502     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
503       # Check to see if the nm accepts a BSD-compat flag.
504       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
505       #   nm: unknown option "B" ignored
506       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
507         ac_cv_path_NM="$ac_dir/nm -B"
508         break
509       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
510         ac_cv_path_NM="$ac_dir/nm -p"
511         break
512       else
513         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
514         continue # so that we can try to find one that supports BSD flags
515       fi
516     fi
517   done
518   IFS="$ac_save_ifs"
519   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
520 fi])
521 NM="$ac_cv_path_NM"
522 AC_MSG_RESULT([$NM])
523 AC_SUBST(NM)
524 ])
525
526 # AC_CHECK_LIBM - check for math library
527 AC_DEFUN(AC_CHECK_LIBM,
528 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
529 LIBM=
530 case "$host" in
531 *-*-beos* | *-*-cygwin*)
532   # These system don't have libm
533   ;;
534 *-ncr-sysv4.3*)
535   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
536   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
537   ;;
538 *)
539   AC_CHECK_LIB(m, main, LIBM="-lm")
540   ;;
541 esac
542 ])
543
544 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
545 # the libltdl convenience library, adds --enable-ltdl-convenience to
546 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
547 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
548 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
549 # '${top_builddir}/' (note the single quotes!) if your package is not
550 # flat, and, if you're not using automake, define top_builddir as
551 # appropriate in the Makefiles.
552 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
553   case "$enable_ltdl_convenience" in
554   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
555   "") enable_ltdl_convenience=yes
556       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
557   esac
558   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
559   INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
560 ])
561
562 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
563 # the libltdl installable library, and adds --enable-ltdl-install to
564 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
565 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
566 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
567 # '${top_builddir}/' (note the single quotes!) if your package is not
568 # flat, and, if you're not using automake, define top_builddir as
569 # appropriate in the Makefiles.
570 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
571 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
572   AC_CHECK_LIB(ltdl, main,
573   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
574   [if test x"$enable_ltdl_install" = xno; then
575      AC_MSG_WARN([libltdl not installed, but installation disabled])
576    else
577      enable_ltdl_install=yes
578    fi
579   ])
580   if test x"$enable_ltdl_install" = x"yes"; then
581     ac_configure_args="$ac_configure_args --enable-ltdl-install"
582     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
583     INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
584   else
585     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
586     LIBLTDL="-lltdl"
587     INCLTDL=
588   fi
589 ])
590
591 dnl old names
592 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
593 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
594 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
595 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
596 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
597 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
598 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
599
600 dnl This is just to silence aclocal about the macro not being used
601 ifelse([AC_DISABLE_FAST_INSTALL])dnl
602
603 dnl sidtargets.m4  -*- m4 -*-
604
605 dnl Copyright (C) 1999, 2000 Red Hat.
606 dnl This file is part of SID and is licensed under the GPL.
607 dnl See the file COPYING.SID for conditions for redistribution.
608
609 dnl Use CY_SIDTARGET_CHECK in configure.in to respond to the builder's
610 dnl selection of --target/--enable-targets
611
612 AC_DEFUN(CY_SIDTARGET_CHECK, [
613
614
615 dnl Assume all targets if $host==$target or $target==NONE
616 sid_host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host`
617 sid_target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target`
618
619 if test "$sid_host" = "$sid_target" -o "$target" = "NONE"
620 then
621     AC_MSG_WARN(Assuming --enable-targets=all)
622     all_targets=""
623     sidtarget_default=1
624 else
625     all_targets="$target"
626     sidtarget_default=0
627 fi
628
629
630 AC_ARG_ENABLE(targets,
631 [  --enable-targets=LIST   support given additional targets, or all],
632 [
633   case "${enable_targets}" in
634     all)  sidtarget_default=1 ;;
635     no)   sidtarget_default=0 ;;
636     *)    all_targets="${all_targets} `echo ${enable_targets} | sed -e 's-,- -g'`" ;;
637   esac
638 ])
639
640 dnl Enumerate known chip families
641 sidtarget_arm=$sidtarget_default
642 sidtarget_mips=$sidtarget_default
643 sidtarget_m32r=$sidtarget_default
644 sidtarget_m68k=$sidtarget_default
645 sidtarget_ppc=$sidtarget_default
646
647 dnl Iterate over all listed targets
648 for targ in $all_targets
649 do
650    case "$targ" in
651       arm*)   sidtarget_arm=1 ;;
652       thumb*) sidtarget_arm=1 ;;
653       mips*)  sidtarget_mips=1 ;;
654       m32r*)  sidtarget_m32r=1 ;;
655       m68k*)  sidtarget_m68k=1 ;;
656       powerpc*) sidtarget_ppc=1 ;;
657       ppc*)   sidtarget_ppc=1 ;;
658       *)      AC_MSG_WARN("Unknown target $targ") ;;
659    esac
660 done
661
662 dnl Ensure at least one of these variables is non-zero.
663 case 1 in
664   ${sidtarget_arm}) ;;
665   ${sidtarget_mips}) ;;
666   ${sidtarget_m32r}) ;;
667   ${sidtarget_m68k}) ;;
668   ${sidtarget_ppc}) ;;
669   *) AC_MSG_WARN([No selected sid targets: use --enable-targets or --target])
670         ;;
671 esac
672
673 dnl Report results SIDTARGET_family
674 dnl nb: Use "x$sidtarget_family" in the tested expression to prevent
675 dnl     syntax errors in configure when sidtarget_family is left unset.
676
677 AC_MSG_CHECKING(ARM family support)
678 AC_SUBST(sidtarget_arm)
679 AM_CONDITIONAL(SIDTARGET_ARM,[test "x$sidtarget_arm" = x1])
680 AC_MSG_RESULT($sidtarget_arm)
681
682
683 AC_MSG_CHECKING(MIPS family support)
684 AC_SUBST(sidtarget_mips)
685 AM_CONDITIONAL(SIDTARGET_MIPS,[test "x$sidtarget_mips" = x1])
686 AC_MSG_RESULT($sidtarget_mips)
687
688 AC_MSG_CHECKING(M32R family support)
689 AC_SUBST(sidtarget_m32r)
690 AM_CONDITIONAL(SIDTARGET_M32R,[test "x$sidtarget_m32r" = x1])
691 AC_MSG_RESULT($sidtarget_m32r)
692
693 AC_MSG_CHECKING(M68K family support)
694 AC_SUBST(sidtarget_m68k)
695 AM_CONDITIONAL(SIDTARGET_M68K,[test "x$sidtarget_m68k" = x1])
696 AC_MSG_RESULT($sidtarget_m68k)
697
698 AC_MSG_CHECKING(PPC family support)
699 AC_SUBST(sidtarget_ppc)
700 AM_CONDITIONAL(SIDTARGET_PPC,[test "x$sidtarget_ppc" = x1])
701 AC_MSG_RESULT($sidtarget_ppc)
702
703
704 ])
705