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