fixed compilation prob
[wmaker-crm.git] / aclocal.m4
blobecc563fec04c144e97bb1858877c3a8942b12aaf
1 dnl aclocal.m4 generated automatically by aclocal 1.4
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.
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.
13 #!/bin/sh
15 dnl
16 dnl WM_CHECK_LIB(NAME, FUNCTION, EXTRALIBS)
17 dnl
18 AC_DEFUN(WM_CHECK_LIB,
20 LDFLAGS_old="$LDFLAGS"
21 LDFLAGS="$LDFLAGS $lib_search_path"
22 AC_CHECK_LIB([$1],[$2],yes=yes,no=no,[$3])
23 LDFLAGS="$LDFLAGS_old"
27 dnl
28 dnl WM_CHECK_HEADER(NAME)
29 dnl
30 AC_DEFUN(WM_CHECK_HEADER,
32 CPPFLAGS_old="$CPPFLAGS"
33 CPPFLAGS="$CPPFLAGS $inc_search_path"
34 AC_CHECK_HEADER([$1])
35 CPPFLAGS="$CPPFLAGS_old"
39 dnl
40 dnl WM_CHECK_REDCRAP_BUGS(prefix,bindir,libdir)
41 dnl
42 AC_DEFUN(WM_CHECK_REDCRAP_BUGS,
44 AC_MSG_CHECKING(for RedHat system)
45 wm_check_flag='no :)'
46 rh_is_redhat=no
47 if test -f /etc/redhat-release; then
48     wm_check_flag=yes
49     rh_is_redhat=yes
51 AC_MSG_RESULT($wm_check_flag)
53 mins_found=no
54 bugs_found=no
55 if test "$wm_check_flag" = yes; then
56 echo
57 AC_MSG_WARN([Red Hat system; checking for Red-Hat-specific bugs.])
58 echo
60 # Check old wmaker from RedHat
62 if test "[$1]" != "/usr/X11R6" -a "$prefix" != "/usr/X11"; then
63 AC_MSG_CHECKING(for multiple installed wmaker versions)
64 if test -f /usr/X11R6/bin/wmaker; then
65 AC_MSG_RESULT(uh oh)
66 mins_found=yes
67 rh_old_wmaker=yes
68 else 
69 rh_old_wmaker=no
70 AC_MSG_RESULT(no apparent problems)
74 # Check for infamous en_RN bug 
75 # Wont work because autoconf will change LANG in the beginning of the
76 # script.
79 #AC_MSG_CHECKING(for silly en_RN joke that only causes headaches)
80 #echo $LANG
81 #if test "x$LANG" = xen_RN; then
82 #AC_MSG_RESULT(uh oh)
83 #AC_MSG_WARN([the LANG environment variable is set to the en_RN 
84 #locale. Please unset it or you will have mysterious problems when 
85 #using various software packages.])
86 #bugs_found=yes
87 #else
88 #AC_MSG_RESULT(no problem)
89 #fi
91 # If binary installation path is /usr/local/bin, check if it's in PATH
93 if test "[$2]" = "/usr/local/bin"; then
94 AC_MSG_CHECKING(if /usr/local/bin is in the search PATH)
95 wm_check_flag=no
96 rh_missing_usr_local_bin=yes
97 old_IFS="$IFS"
98 IFS=":"
99 for i in $PATH; do 
100         if test "x$i" = "x/usr/local/bin"; then
101                 wm_check_flag=yes
102                 rh_missing_usr_local_bin=no
103                 break;
104         fi
105 done
106 IFS="$old_IFS"
107 if test "$wm_check_flag" = no; then
108 AC_MSG_RESULT(uh oh)
109 bugs_found=yes
110 else
111 AC_MSG_RESULT(no problem)
115 # If library installation path is /usr/local/lib, 
116 # check if it's in /etc/ld.so.conf
118 if test "[$3]" = "/usr/local/lib"; then
119 wm_check_flag=yes
120 rh_missing_usr_local_lib=no
121 AC_MSG_CHECKING(if /usr/local/lib is in /etc/ld.so.conf)
122 test -z "`grep /usr/local/lib /etc/ld.so.conf`"
123 test "$?" -eq 0 && wm_check_flag=no
124 if test "$wm_check_flag" = no; then
125 AC_MSG_RESULT(uh oh)
126 rh_missing_usr_local_lib=yes
127 bugs_found=yes
128 else
129 AC_MSG_RESULT(no problem)
133 # Check for symbolic links
135 AC_MSG_CHECKING(for /usr/include/X11 symbolic link)
136 rh_missing_usr_include_x11=no
137 if test -d "/usr/include/X11"; then
138 AC_MSG_RESULT(found)
139 else
140 AC_MSG_RESULT(uh oh)
141 rh_missing_usr_include_x11=yes
142 mins_found=yes
146 # Check for /lib/cpp
148 AC_MSG_CHECKING(for /lib/cpp)
149 rh_missing_lib_cpp=no
150 if test -f "/lib/cpp"; then
151 AC_MSG_RESULT(found)
152 else
153 AC_MSG_RESULT(uh oh)
154 rh_missing_lib_cpp=yes
155 bugs_found=yes
158 echo
164 dnl WM_PRINT_REDCRAP_BUG_STATUS()
166 AC_DEFUN(WM_PRINT_REDCRAP_BUG_STATUS,
168 if test "$rh_is_redhat" = yes; then
169 if test "$mins_found" = yes -o "$bugs_found" = yes; then
170 echo
171 AC_MSG_WARN([It seems you are using a system packaged by Red Hat.
172 I have done some checks for Red-Hat-specific bugs, and I found some
173 problems.  Please read the INSTALL file regarding Red Hat, resolve
174 the problems, and try to run configure again.
176 Here are the problems I found:
178 if test "x$rh_old_wmaker" = xyes; then
179 echo "Problem:     Old version of Window Maker in /usr/X11R6/bin."
180 echo "Description: You seem to have an old version of Window Maker"
181 echo "             installed in /usr/X11R6/bin. It is recommended"
182 echo "             that you uninstall any previously installed"
183 echo "             packages of WindowMaker before installing a new one."
184 echo
186 if test "x$rh_missing_usr_local_bin" = xyes; then
187 echo "Problem:     PATH is missing /usr/local/bin."
188 echo "Description: Your PATH environment variable does not appear to"
189 echo "             contain the directory /usr/local/bin.  Please add it."
190 echo
192 if test "x$rh_missing_usr_local_lib" = xyes; then
193 echo "Problem:     /etc/ld.so.conf missing /usr/local/lib"
194 echo "Description: Your /etc/ld.so.conf file does not appear to contain"
195 echo "             the directory /usr/local/lib.  Please add it."
196 echo
198 if test "x$rh_missing_usr_x11" = xyes; then
199 echo "Problem:     Missing /usr/X11 symbolic link."
200 echo "Description: Your system is missing a symbolic link from"
201 echo "             /usr/X11R6 to /usr/X11.  Please create one."
202 echo
204 if test "x$rh_missing_usr_include_x11" = xyes; then
205 echo "Problem:     Missing /usr/include/X11 symbolic link."
206 echo "Description: Your system is missing a symbolic link from"
207 echo "             /usr/X11R6/include/X11 to /usr/include/X11."
208 echo "             Please create one."
209 echo
211 if test "x$rh_missing_lib_cpp" = xyes; then
212 echo "Problem:     Missing /lib/cpp symbolic link."
213 echo "Description: Your system is missing a symbolic link from the"
214 echo "             cpp (C preprocessor) program to /lib/cpp."
215 echo "             Please create one."
216 echo
218 if test "x$bugs_found" = xyes; then
219 AC_MSG_ERROR([One or more of the problems above can potentially
220 cause Window Maker not to install or run properly.  Please resolve
221 the problems and try to run configure again.])
222 exit 1
223 elif test "x$mins_found" = xyes; then
224 AC_MSG_WARN([The problems above may or may not cause Window Maker
225 not to install or run properly.  If you have any problems during 
226 installation or execution, please resolve the problems and try to
227 install Window Maker again.])
228 echo
230 else
231 echo
232 echo "You appear to have a system packaged by Red Hat, but I could"
233 echo "not find any Red-Hat-specific problems that I know about."
234 echo
240 # Do all the work for Automake.  This macro actually does too much --
241 # some checks are only needed if your package does certain things.
242 # But this isn't really a big deal.
244 # serial 1
246 dnl Usage:
247 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
249 AC_DEFUN(AM_INIT_AUTOMAKE,
250 [AC_REQUIRE([AC_PROG_INSTALL])
251 PACKAGE=[$1]
252 AC_SUBST(PACKAGE)
253 VERSION=[$2]
254 AC_SUBST(VERSION)
255 dnl test to see if srcdir already configured
256 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
257   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
259 ifelse([$3],,
260 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
261 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
262 AC_REQUIRE([AM_SANITY_CHECK])
263 AC_REQUIRE([AC_ARG_PROGRAM])
264 dnl FIXME This is truly gross.
265 missing_dir=`cd $ac_aux_dir && pwd`
266 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
267 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
268 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
269 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
270 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
271 AC_REQUIRE([AC_PROG_MAKE_SET])])
274 # Check to make sure that the build environment is sane.
277 AC_DEFUN(AM_SANITY_CHECK,
278 [AC_MSG_CHECKING([whether build environment is sane])
279 # Just in case
280 sleep 1
281 echo timestamp > conftestfile
282 # Do `set' in a subshell so we don't clobber the current shell's
283 # arguments.  Must try -L first in case configure is actually a
284 # symlink; some systems play weird games with the mod time of symlinks
285 # (eg FreeBSD returns the mod time of the symlink's containing
286 # directory).
287 if (
288    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
289    if test "[$]*" = "X"; then
290       # -L didn't work.
291       set X `ls -t $srcdir/configure conftestfile`
292    fi
293    if test "[$]*" != "X $srcdir/configure conftestfile" \
294       && test "[$]*" != "X conftestfile $srcdir/configure"; then
296       # If neither matched, then we have a broken ls.  This can happen
297       # if, for instance, CONFIG_SHELL is bash and it inherits a
298       # broken ls alias from the environment.  This has actually
299       # happened.  Such a system could not be considered "sane".
300       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
301 alias in your environment])
302    fi
304    test "[$]2" = conftestfile
305    )
306 then
307    # Ok.
308    :
309 else
310    AC_MSG_ERROR([newly created file is older than distributed files!
311 Check your system clock])
313 rm -f conftest*
314 AC_MSG_RESULT(yes)])
316 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
317 dnl The program must properly implement --version.
318 AC_DEFUN(AM_MISSING_PROG,
319 [AC_MSG_CHECKING(for working $2)
320 # Run test in a subshell; some versions of sh will print an error if
321 # an executable is not found, even if stderr is redirected.
322 # Redirect stdin to placate older versions of autoconf.  Sigh.
323 if ($2 --version) < /dev/null > /dev/null 2>&1; then
324    $1=$2
325    AC_MSG_RESULT(found)
326 else
327    $1="$3/missing $2"
328    AC_MSG_RESULT(missing)
330 AC_SUBST($1)])
333 # serial 39 AC_PROG_LIBTOOL
334 AC_DEFUN(AC_PROG_LIBTOOL,
335 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
337 # Save cache, so that ltconfig can load it
338 AC_CACHE_SAVE
340 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
341 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
342 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
343 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
344 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
345 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
346 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
347 || AC_MSG_ERROR([libtool configure failed])
349 # Reload cache, that may have been modified by ltconfig
350 AC_CACHE_LOAD
352 # This can be used to rebuild libtool when needed
353 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
355 # Always use our own libtool.
356 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
357 AC_SUBST(LIBTOOL)dnl
359 # Redirect the config.log output again, so that the ltconfig log is not
360 # clobbered by the next message.
361 exec 5>>./config.log
364 AC_DEFUN(AC_LIBTOOL_SETUP,
365 [AC_PREREQ(2.13)dnl
366 AC_REQUIRE([AC_ENABLE_SHARED])dnl
367 AC_REQUIRE([AC_ENABLE_STATIC])dnl
368 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
369 AC_REQUIRE([AC_CANONICAL_HOST])dnl
370 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
371 AC_REQUIRE([AC_PROG_RANLIB])dnl
372 AC_REQUIRE([AC_PROG_CC])dnl
373 AC_REQUIRE([AC_PROG_LD])dnl
374 AC_REQUIRE([AC_PROG_NM])dnl
375 AC_REQUIRE([AC_PROG_LN_S])dnl
378 # Check for any special flags to pass to ltconfig.
379 libtool_flags="--cache-file=$cache_file"
380 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
381 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
382 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
383 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
384 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
385 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
386 [libtool_flags="$libtool_flags --enable-dlopen"])
387 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
388 [libtool_flags="$libtool_flags --enable-win32-dll"])
389 AC_ARG_ENABLE(libtool-lock,
390   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
391 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
392 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
394 # Some flags need to be propagated to the compiler or linker for good
395 # libtool support.
396 case "$host" in
397 *-*-irix6*)
398   # Find out which ABI we are using.
399   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
400   if AC_TRY_EVAL(ac_compile); then
401     case "`/usr/bin/file conftest.o`" in
402     *32-bit*)
403       LD="${LD-ld} -32"
404       ;;
405     *N32*)
406       LD="${LD-ld} -n32"
407       ;;
408     *64-bit*)
409       LD="${LD-ld} -64"
410       ;;
411     esac
412   fi
413   rm -rf conftest*
414   ;;
416 *-*-sco3.2v5*)
417   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
418   SAVE_CFLAGS="$CFLAGS"
419   CFLAGS="$CFLAGS -belf"
420   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
421     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
422   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
423     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
424     CFLAGS="$SAVE_CFLAGS"
425   fi
426   ;;
428 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
429 [*-*-cygwin* | *-*-mingw*)
430   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
431   AC_CHECK_TOOL(AS, as, false)
432   AC_CHECK_TOOL(OBJDUMP, objdump, false)
433   ;;
435 esac
438 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
439 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
441 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
442 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
444 # AC_ENABLE_SHARED - implement the --enable-shared flag
445 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
446 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
447 #   `yes'.
448 AC_DEFUN(AC_ENABLE_SHARED, [dnl
449 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
450 AC_ARG_ENABLE(shared,
451 changequote(<<, >>)dnl
452 <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
453 changequote([, ])dnl
454 [p=${PACKAGE-default}
455 case "$enableval" in
456 yes) enable_shared=yes ;;
457 no) enable_shared=no ;;
459   enable_shared=no
460   # Look at the argument we got.  We use all the common list separators.
461   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
462   for pkg in $enableval; do
463     if test "X$pkg" = "X$p"; then
464       enable_shared=yes
465     fi
466   done
467   IFS="$ac_save_ifs"
468   ;;
469 esac],
470 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
473 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
474 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
475 AC_ENABLE_SHARED(no)])
477 # AC_ENABLE_STATIC - implement the --enable-static flag
478 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
479 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
480 #   `yes'.
481 AC_DEFUN(AC_ENABLE_STATIC, [dnl
482 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
483 AC_ARG_ENABLE(static,
484 changequote(<<, >>)dnl
485 <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
486 changequote([, ])dnl
487 [p=${PACKAGE-default}
488 case "$enableval" in
489 yes) enable_static=yes ;;
490 no) enable_static=no ;;
492   enable_static=no
493   # Look at the argument we got.  We use all the common list separators.
494   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
495   for pkg in $enableval; do
496     if test "X$pkg" = "X$p"; then
497       enable_static=yes
498     fi
499   done
500   IFS="$ac_save_ifs"
501   ;;
502 esac],
503 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
506 # AC_DISABLE_STATIC - set the default static flag to --disable-static
507 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
508 AC_ENABLE_STATIC(no)])
511 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
512 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
513 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
514 #   `yes'.
515 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
516 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
517 AC_ARG_ENABLE(fast-install,
518 changequote(<<, >>)dnl
519 <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
520 changequote([, ])dnl
521 [p=${PACKAGE-default}
522 case "$enableval" in
523 yes) enable_fast_install=yes ;;
524 no) enable_fast_install=no ;;
526   enable_fast_install=no
527   # Look at the argument we got.  We use all the common list separators.
528   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
529   for pkg in $enableval; do
530     if test "X$pkg" = "X$p"; then
531       enable_fast_install=yes
532     fi
533   done
534   IFS="$ac_save_ifs"
535   ;;
536 esac],
537 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
540 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
541 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
542 AC_ENABLE_FAST_INSTALL(no)])
544 # AC_PROG_LD - find the path to the GNU or non-GNU linker
545 AC_DEFUN(AC_PROG_LD,
546 [AC_ARG_WITH(gnu-ld,
547 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
548 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
549 AC_REQUIRE([AC_PROG_CC])dnl
550 AC_REQUIRE([AC_CANONICAL_HOST])dnl
551 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
552 ac_prog=ld
553 if test "$ac_cv_prog_gcc" = yes; then
554   # Check if gcc -print-prog-name=ld gives a path.
555   AC_MSG_CHECKING([for ld used by GCC])
556   ac_prog=`($CC -print-prog-name=ld) 2>&5`
557   case "$ac_prog" in
558     # Accept absolute paths.
559 changequote(,)dnl
560     [\\/]* | [A-Za-z]:[\\/]*)
561       re_direlt='/[^/][^/]*/\.\./'
562 changequote([,])dnl
563       # Canonicalize the path of ld
564       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
565       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
566         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
567       done
568       test -z "$LD" && LD="$ac_prog"
569       ;;
570   "")
571     # If it fails, then pretend we aren't using GCC.
572     ac_prog=ld
573     ;;
574   *)
575     # If it is relative, then search for the first ld in PATH.
576     with_gnu_ld=unknown
577     ;;
578   esac
579 elif test "$with_gnu_ld" = yes; then
580   AC_MSG_CHECKING([for GNU ld])
581 else
582   AC_MSG_CHECKING([for non-GNU ld])
584 AC_CACHE_VAL(ac_cv_path_LD,
585 [if test -z "$LD"; then
586   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
587   for ac_dir in $PATH; do
588     test -z "$ac_dir" && ac_dir=.
589     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
590       ac_cv_path_LD="$ac_dir/$ac_prog"
591       # Check to see if the program is GNU ld.  I'd rather use --version,
592       # but apparently some GNU ld's only accept -v.
593       # Break only if it was the GNU/non-GNU ld that we prefer.
594       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
595         test "$with_gnu_ld" != no && break
596       else
597         test "$with_gnu_ld" != yes && break
598       fi
599     fi
600   done
601   IFS="$ac_save_ifs"
602 else
603   ac_cv_path_LD="$LD" # Let the user override the test with a path.
604 fi])
605 LD="$ac_cv_path_LD"
606 if test -n "$LD"; then
607   AC_MSG_RESULT($LD)
608 else
609   AC_MSG_RESULT(no)
611 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
612 AC_SUBST(LD)
613 AC_PROG_LD_GNU
616 AC_DEFUN(AC_PROG_LD_GNU,
617 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
618 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
619 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
620   ac_cv_prog_gnu_ld=yes
621 else
622   ac_cv_prog_gnu_ld=no
623 fi])
626 # AC_PROG_NM - find the path to a BSD-compatible name lister
627 AC_DEFUN(AC_PROG_NM,
628 [AC_MSG_CHECKING([for BSD-compatible nm])
629 AC_CACHE_VAL(ac_cv_path_NM,
630 [if test -n "$NM"; then
631   # Let the user override the test.
632   ac_cv_path_NM="$NM"
633 else
634   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
635   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
636     test -z "$ac_dir" && ac_dir=.
637     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
638       # Check to see if the nm accepts a BSD-compat flag.
639       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
640       #   nm: unknown option "B" ignored
641       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
642         ac_cv_path_NM="$ac_dir/nm -B"
643         break
644       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
645         ac_cv_path_NM="$ac_dir/nm -p"
646         break
647       else
648         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
649         continue # so that we can try to find one that supports BSD flags
650       fi
651     fi
652   done
653   IFS="$ac_save_ifs"
654   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
655 fi])
656 NM="$ac_cv_path_NM"
657 AC_MSG_RESULT([$NM])
658 AC_SUBST(NM)
661 # AC_CHECK_LIBM - check for math library
662 AC_DEFUN(AC_CHECK_LIBM,
663 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
664 LIBM=
665 case "$host" in
666 *-*-beos* | *-*-cygwin*)
667   # These system don't have libm
668   ;;
669 *-ncr-sysv4.3*)
670   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
671   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
672   ;;
674   AC_CHECK_LIB(m, main, LIBM="-lm")
675   ;;
676 esac
679 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
680 # the libltdl convenience library, adds --enable-ltdl-convenience to
681 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
682 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
683 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
684 # '${top_builddir}/' (note the single quotes!) if your package is not
685 # flat, and, if you're not using automake, define top_builddir as
686 # appropriate in the Makefiles.
687 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
688   case "$enable_ltdl_convenience" in
689   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
690   "") enable_ltdl_convenience=yes
691       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
692   esac
693   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
696 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
697 # the libltdl installable library, and adds --enable-ltdl-install to
698 # the configure arguments.  Note that LIBLTDL is not AC_SUBSTed, nor
699 # is AC_CONFIG_SUBDIRS called.  If DIR is not provided, it is assumed
700 # to be `${top_builddir}/libltdl'.  Make sure you start DIR with
701 # '${top_builddir}/' (note the single quotes!) if your package is not
702 # flat, and, if you're not using automake, define top_builddir as
703 # appropriate in the Makefiles.
704 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
705 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
706   AC_CHECK_LIB(ltdl, main,
707   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
708   [if test x"$enable_ltdl_install" = xno; then
709      AC_MSG_WARN([libltdl not installed, but installation disabled])
710    else
711      enable_ltdl_install=yes
712    fi
713   ])
714   if test x"$enable_ltdl_install" = x"yes"; then
715     ac_configure_args="$ac_configure_args --enable-ltdl-install"
716     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
717   else
718     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
719     LIBLTDL="-lltdl"
720   fi
723 dnl old names
724 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
725 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
726 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
727 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
728 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
729 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
730 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
732 dnl This is just to quiet aclocal about the macro not being used
733 if(a,b,[AC_DISABLE_FAST_INSTALL])dnl
735 # Like AC_CONFIG_HEADER, but automatically create stamp file.
737 AC_DEFUN(AM_CONFIG_HEADER,
738 [AC_PREREQ([2.12])
739 AC_CONFIG_HEADER([$1])
740 dnl When config.status generates a header, we must update the stamp-h file.
741 dnl This file resides in the same directory as the config header
742 dnl that is generated.  We must strip everything past the first ":",
743 dnl and everything past the last "/".
744 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
745 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
746 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
747 <<am_indx=1
748 for am_file in <<$1>>; do
749   case " <<$>>CONFIG_HEADERS " in
750   *" <<$>>am_file "*<<)>>
751     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
752     ;;
753   esac
754   am_indx=`expr "<<$>>am_indx" + 1`
755 done<<>>dnl>>)
756 changequote([,]))])