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.
16 dnl WM_CHECK_LIB(NAME, FUNCTION, EXTRALIBS)
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"
28 dnl WM_CHECK_HEADER(NAME)
30 AC_DEFUN(WM_CHECK_HEADER,
32 CPPFLAGS_old="$CPPFLAGS"
33 CPPFLAGS="$CPPFLAGS $inc_search_path"
35 CPPFLAGS="$CPPFLAGS_old"
40 dnl WM_CHECK_REDCRAP_BUGS(prefix,bindir,libdir)
42 AC_DEFUN(WM_CHECK_REDCRAP_BUGS,
44 AC_MSG_CHECKING(for RedHat system)
47 if test -f /etc/redhat-release; then
51 AC_MSG_RESULT($wm_check_flag)
55 if test "$wm_check_flag" = yes; then
57 AC_MSG_WARN([Red Hat system; checking for Red-Hat-specific bugs.])
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
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
79 #AC_MSG_CHECKING(for silly en_RN joke that only causes headaches)
81 #if test "x$LANG" = xen_RN; then
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.])
88 #AC_MSG_RESULT(no problem)
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)
96 rh_missing_usr_local_bin=yes
100 if test "x$i" = "x/usr/local/bin"; then
102 rh_missing_usr_local_bin=no
107 if test "$wm_check_flag" = no; then
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
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
126 rh_missing_usr_local_lib=yes
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
141 rh_missing_usr_include_x11=yes
148 AC_MSG_CHECKING(for /lib/cpp)
149 rh_missing_lib_cpp=no
150 if test -f "/lib/cpp"; then
154 rh_missing_lib_cpp=yes
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
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."
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."
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."
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."
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."
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."
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.])
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.])
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."
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.
247 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
249 AC_DEFUN(AM_INIT_AUTOMAKE,
250 [AC_REQUIRE([AC_PROG_INSTALL])
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])
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])
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
288 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
289 if test "[$]*" = "X"; then
291 set X `ls -t $srcdir/configure conftestfile`
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])
304 test "[$]2" = conftestfile
310 AC_MSG_ERROR([newly created file is older than distributed files!
311 Check your system clock])
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
328 AC_MSG_RESULT(missing)
333 # serial 24 AM_PROG_LIBTOOL
334 AC_DEFUN(AM_PROG_LIBTOOL,
335 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
336 AC_REQUIRE([AM_ENABLE_STATIC])dnl
337 AC_REQUIRE([AC_CANONICAL_HOST])dnl
338 AC_REQUIRE([AC_PROG_RANLIB])dnl
339 AC_REQUIRE([AC_PROG_CC])dnl
340 AC_REQUIRE([AM_PROG_LD])dnl
341 AC_REQUIRE([AM_PROG_NM])dnl
342 AC_REQUIRE([AC_PROG_LN_S])dnl
344 # Always use our own libtool.
345 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
348 # Check for any special flags to pass to ltconfig.
350 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
351 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
352 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
353 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
354 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
356 # Some flags need to be propagated to the compiler or linker for good
360 # Find out which ABI we are using.
361 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
362 if AC_TRY_EVAL(ac_compile); then
363 case "`/usr/bin/file conftest.o`" in
379 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
380 CFLAGS="$CFLAGS -belf"
384 # Actually configure libtool. ac_aux_dir is where install-sh is found.
385 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
386 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
387 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
388 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
389 || AC_MSG_ERROR([libtool configure failed])
392 # AM_ENABLE_SHARED - implement the --enable-shared flag
393 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
394 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
396 AC_DEFUN(AM_ENABLE_SHARED,
397 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
398 AC_ARG_ENABLE(shared,
399 changequote(<<, >>)dnl
400 << --enable-shared build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
402 [ --enable-shared=PKGS only build shared libraries if the current package
403 appears as an element in the PKGS list],
404 [p=${PACKAGE-default}
406 yes) enable_shared=yes ;;
407 no) enable_shared=no ;;
410 # Look at the argument we got. We use all the common list separators.
411 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
412 for pkg in $enableval; do
413 if test "X$pkg" = "X$p"; then
420 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
423 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
424 AC_DEFUN(AM_DISABLE_SHARED,
425 [AM_ENABLE_SHARED(no)])
427 # AM_DISABLE_STATIC - set the default static flag to --disable-static
428 AC_DEFUN(AM_DISABLE_STATIC,
429 [AM_ENABLE_STATIC(no)])
431 # AM_ENABLE_STATIC - implement the --enable-static flag
432 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
433 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
435 AC_DEFUN(AM_ENABLE_STATIC,
436 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
437 AC_ARG_ENABLE(static,
438 changequote(<<, >>)dnl
439 << --enable-static build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
441 [ --enable-static=PKGS only build shared libraries if the current package
442 appears as an element in the PKGS list],
443 [p=${PACKAGE-default}
445 yes) enable_static=yes ;;
446 no) enable_static=no ;;
449 # Look at the argument we got. We use all the common list separators.
450 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
451 for pkg in $enableval; do
452 if test "X$pkg" = "X$p"; then
459 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
463 # AM_PROG_LD - find the path to the GNU or non-GNU linker
466 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
467 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
468 AC_REQUIRE([AC_PROG_CC])
470 if test "$ac_cv_prog_gcc" = yes; then
471 # Check if gcc -print-prog-name=ld gives a path.
472 AC_MSG_CHECKING([for ld used by GCC])
473 ac_prog=`($CC -print-prog-name=ld) 2>&5`
475 # Accept absolute paths.
477 test -z "$LD" && LD="$ac_prog"
480 # If it fails, then pretend we aren't using GCC.
484 # If it is relative, then search for the first ld in PATH.
488 elif test "$with_gnu_ld" = yes; then
489 AC_MSG_CHECKING([for GNU ld])
491 AC_MSG_CHECKING([for non-GNU ld])
493 AC_CACHE_VAL(ac_cv_path_LD,
494 [if test -z "$LD"; then
495 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
496 for ac_dir in $PATH; do
497 test -z "$ac_dir" && ac_dir=.
498 if test -f "$ac_dir/$ac_prog"; then
499 ac_cv_path_LD="$ac_dir/$ac_prog"
500 # Check to see if the program is GNU ld. I'd rather use --version,
501 # but apparently some GNU ld's only accept -v.
502 # Break only if it was the GNU/non-GNU ld that we prefer.
503 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
504 test "$with_gnu_ld" != no && break
506 test "$with_gnu_ld" != yes && break
512 ac_cv_path_LD="$LD" # Let the user override the test with a path.
515 if test -n "$LD"; then
520 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
525 AC_DEFUN(AM_PROG_LD_GNU,
526 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
527 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
528 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
529 ac_cv_prog_gnu_ld=yes
535 # AM_PROG_NM - find the path to a BSD-compatible name lister
537 [AC_MSG_CHECKING([for BSD-compatible nm])
538 AC_CACHE_VAL(ac_cv_path_NM,
541 ac_cv_path_NM="$NM" # Let the user override the test with a path.
544 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
545 for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
546 test -z "$ac_dir" && ac_dir=.
547 if test -f $ac_dir/nm; then
548 # Check to see if the nm accepts a BSD-compat flag.
549 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
550 # nm: unknown option "B" ignored
551 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
552 ac_cv_path_NM="$ac_dir/nm -B"
553 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
554 ac_cv_path_NM="$ac_dir/nm -p"
556 ac_cv_path_NM="$ac_dir/nm"
562 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
570 # Like AC_CONFIG_HEADER, but automatically create stamp file.
572 AC_DEFUN(AM_CONFIG_HEADER,
574 AC_CONFIG_HEADER([$1])
575 dnl When config.status generates a header, we must update the stamp-h file.
576 dnl This file resides in the same directory as the config header
577 dnl that is generated. We must strip everything past the first ":",
578 dnl and everything past the last "/".
579 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
580 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
581 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
583 for am_file in <<$1>>; do
584 case " <<$>>CONFIG_HEADERS " in
585 *" <<$>>am_file "*<<)>>
586 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
589 am_indx=`expr "<<$>>am_indx" + 1`