0.51.1 pre snapshot. Be careful, it may be buggy. It fixes some bugs though.
[wmaker-crm.git] / aclocal.m4
blobfa3d2b9dc7b4e7f29ea2e3635bd183ae89bafa32
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="-DBEGIN $LDFLAGS -DEND $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 if test -f /etc/redhat-release; then
47     wm_check_flag=yes
49 AC_MSG_RESULT($wm_check_flag)
51 mins_found=no
52 bugs_found=no
53 if test "$wm_check_flag" = yes; then
54 echo
55 AC_MSG_WARN([it seems you are using a system packaged by RedHat. 
56 I will now do some checks for RedHat specific bugs. If some check
57 fail, please read the INSTALL file regarding RedHat, resolve the
58 problem and retry to configure.])
59 echo
61 # Check old wmaker from RedHat
63 if test "[$1]" != "/usr/X11R6" -a "$prefix" != "/usr/X11"; then
64 AC_MSG_CHECKING(for multiple installed wmaker versions)
65 if test -f /usr/X11R6/bin/wmaker; then
66 AC_MSG_RESULT(uh oh)
67 AC_MSG_WARN([you seem to have an old version of Window Maker 
68 installed at /usr/X11R6/bin. It is recommended that you uninstall
69 any previously installed packages of WindowMaker before installing
70 a new one.])
71 mins_found=yes
72 else 
73 AC_MSG_RESULT(no apparent problems)
77 # Check for infamous en_RN bug 
78 # Wont work because autoconf will change LANG in the beginning of the
79 # script.
82 #AC_MSG_CHECKING(for silly en_RN joke that only causes headaches)
83 #echo $LANG
84 #if test "x$LANG" = xen_RN; then
85 #AC_MSG_RESULT(uh oh)
86 #AC_MSG_WARN([the LANG environment variable is set to the en_RN 
87 #locale. Please unset it or you will have mysterious problems when 
88 #using various software packages.])
89 #bugs_found=yes
90 #else
91 #AC_MSG_RESULT(no problem)
92 #fi
94 # If binary installation path is /usr/local/bin, check if it's in PATH
96 if test "[$2]" = "/usr/local/bin"; then
97 AC_MSG_CHECKING(if /usr/local/bin is in the search PATH)
98 wm_check_flag=no
99 old_IFS="$IFS"
100 IFS=":"
101 for i in $PATH; do 
102         if test "x$i" = "x/usr/local/bin"; then
103                 wm_check_flag=yes
104                 break;
105         fi
106 done
107 IFS="$old_IFS"
108 if test "$wm_check_flag" = no; then
109 AC_MSG_RESULT(uh oh)
110 AC_MSG_WARN([/usr/local/bin is not in the PATH environment variable. 
111 Please resolve the problem.])
112 bugs_found=yes
113 else
114 AC_MSG_RESULT(no problem)
118 # If library installation path is /usr/local/lib, 
119 # check if it's in /etc/ld.so.conf
121 if test "[$3]" = "/usr/local/lib"; then
122 wm_check_flag=yes
123 AC_MSG_CHECKING(if /usr/local/lib is in /etc/ld.so.conf)
124 test -z "`grep /usr/local/lib /etc/ld.so.conf`"
125 test "$?" -eq 0 && wm_check_flag=no
126 if test "$wm_check_flag" = no; then
127 AC_MSG_RESULT(uh oh)
128 AC_MSG_WARN([/usr/local/lib is not in the /etc/ld.so.conf file. 
129 Please add it there.])
130 bugs_found=yes
131 else
132 AC_MSG_RESULT(no problem)
136 # Check for symbolic links
138 AC_MSG_CHECKING(for /usr/X11 symbolic link)
139 if test -d "/usr/X11"; then
140 AC_MSG_RESULT(found)
141 else
142 AC_MSG_RESULT(uh oh)
143 AC_MSG_WARN([Please create a symbolic link from /usr/X11R6 to /usr/X11.])
144 mins_found=yes
146 AC_MSG_CHECKING(for /usr/include/X11 symbolic link)
147 if test -d "/usr/include/X11"; then
148 AC_MSG_RESULT(found)
149 else
150 AC_MSG_RESULT(uh oh)
151 AC_MSG_WARN([Please create a symbolic link from /usr/X11R6/include/X11
152 to /usr/include/X11.])
153 mins_found=yes
157 # Check for /lib/cpp
159 AC_MSG_CHECKING(for /lib/cpp)
160 if test -f "/lib/cpp"; then
161 AC_MSG_RESULT(found)
162 else
163 AC_MSG_RESULT(uh oh)
164 AC_MSG_WARN([Please create a symbolic link from the cpp (C preprocessor) 
165 program to /lib/cpp])
166 bugs_found=yes
169 if test "x$bugs_found" = xyes; then
170 AC_MSG_ERROR([Some bugs that can potentially cause problems during
171 installation/execution were found. Please correct these problems
172 and retry later.])
173 exit 1
174 elif test "x$mins_found" = xyes; then
175 AC_MSG_WARN([Some minor problems that might or might not cause 
176 problems were found. If you have any problems during 
177 installation/execution, please resolve the pointed problems and try
178 to reinstall.])
179 echo "Press <Return> to continue."
180 read blabla
181 else
182 echo
183 echo "None of the RedHat problems known to this script were found."
184 echo
190 # Do all the work for Automake.  This macro actually does too much --
191 # some checks are only needed if your package does certain things.
192 # But this isn't really a big deal.
194 # serial 1
196 dnl Usage:
197 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
199 AC_DEFUN(AM_INIT_AUTOMAKE,
200 [AC_REQUIRE([AC_PROG_INSTALL])
201 PACKAGE=[$1]
202 AC_SUBST(PACKAGE)
203 VERSION=[$2]
204 AC_SUBST(VERSION)
205 dnl test to see if srcdir already configured
206 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
207   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
209 ifelse([$3],,
210 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
211 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
212 AC_REQUIRE([AM_SANITY_CHECK])
213 AC_REQUIRE([AC_ARG_PROGRAM])
214 dnl FIXME This is truly gross.
215 missing_dir=`cd $ac_aux_dir && pwd`
216 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
217 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
218 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
219 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
220 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
221 AC_REQUIRE([AC_PROG_MAKE_SET])])
224 # Check to make sure that the build environment is sane.
227 AC_DEFUN(AM_SANITY_CHECK,
228 [AC_MSG_CHECKING([whether build environment is sane])
229 # Just in case
230 sleep 1
231 echo timestamp > conftestfile
232 # Do `set' in a subshell so we don't clobber the current shell's
233 # arguments.  Must try -L first in case configure is actually a
234 # symlink; some systems play weird games with the mod time of symlinks
235 # (eg FreeBSD returns the mod time of the symlink's containing
236 # directory).
237 if (
238    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
239    if test "[$]*" = "X"; then
240       # -L didn't work.
241       set X `ls -t $srcdir/configure conftestfile`
242    fi
243    if test "[$]*" != "X $srcdir/configure conftestfile" \
244       && test "[$]*" != "X conftestfile $srcdir/configure"; then
246       # If neither matched, then we have a broken ls.  This can happen
247       # if, for instance, CONFIG_SHELL is bash and it inherits a
248       # broken ls alias from the environment.  This has actually
249       # happened.  Such a system could not be considered "sane".
250       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
251 alias in your environment])
252    fi
254    test "[$]2" = conftestfile
255    )
256 then
257    # Ok.
258    :
259 else
260    AC_MSG_ERROR([newly created file is older than distributed files!
261 Check your system clock])
263 rm -f conftest*
264 AC_MSG_RESULT(yes)])
266 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
267 dnl The program must properly implement --version.
268 AC_DEFUN(AM_MISSING_PROG,
269 [AC_MSG_CHECKING(for working $2)
270 # Run test in a subshell; some versions of sh will print an error if
271 # an executable is not found, even if stderr is redirected.
272 # Redirect stdin to placate older versions of autoconf.  Sigh.
273 if ($2 --version) < /dev/null > /dev/null 2>&1; then
274    $1=$2
275    AC_MSG_RESULT(found)
276 else
277    $1="$3/missing $2"
278    AC_MSG_RESULT(missing)
280 AC_SUBST($1)])
283 # serial 24 AM_PROG_LIBTOOL
284 AC_DEFUN(AM_PROG_LIBTOOL,
285 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
286 AC_REQUIRE([AM_ENABLE_STATIC])dnl
287 AC_REQUIRE([AC_CANONICAL_HOST])dnl
288 AC_REQUIRE([AC_PROG_RANLIB])dnl
289 AC_REQUIRE([AC_PROG_CC])dnl
290 AC_REQUIRE([AM_PROG_LD])dnl
291 AC_REQUIRE([AM_PROG_NM])dnl
292 AC_REQUIRE([AC_PROG_LN_S])dnl
294 # Always use our own libtool.
295 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
296 AC_SUBST(LIBTOOL)dnl
298 # Check for any special flags to pass to ltconfig.
299 libtool_flags=
300 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
301 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
302 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
303 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
304 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
306 # Some flags need to be propagated to the compiler or linker for good
307 # libtool support.
308 case "$host" in
309 *-*-irix6*)
310   # Find out which ABI we are using.
311   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
312   if AC_TRY_EVAL(ac_compile); then
313     case "`/usr/bin/file conftest.o`" in
314     *32-bit*)
315       LD="${LD-ld} -32"
316       ;;
317     *N32*)
318       LD="${LD-ld} -n32"
319       ;;
320     *64-bit*)
321       LD="${LD-ld} -64"
322       ;;
323     esac
324   fi
325   rm -rf conftest*
326   ;;
328 *-*-sco3.2v5*)
329   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
330   CFLAGS="$CFLAGS -belf"
331   ;;
332 esac
334 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
335 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
336 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
337 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
338 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
339 || AC_MSG_ERROR([libtool configure failed])
342 # AM_ENABLE_SHARED - implement the --enable-shared flag
343 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
344 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
345 #   `yes'.
346 AC_DEFUN(AM_ENABLE_SHARED,
347 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
348 AC_ARG_ENABLE(shared,
349 changequote(<<, >>)dnl
350 <<  --enable-shared         build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
351 changequote([, ])dnl
352 [  --enable-shared=PKGS    only build shared libraries if the current package
353                           appears as an element in the PKGS list],
354 [p=${PACKAGE-default}
355 case "$enableval" in
356 yes) enable_shared=yes ;;
357 no) enable_shared=no ;;
359   enable_shared=no
360   # Look at the argument we got.  We use all the common list separators.
361   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
362   for pkg in $enableval; do
363     if test "X$pkg" = "X$p"; then
364       enable_shared=yes
365     fi
366   done
367   IFS="$ac_save_ifs"
368   ;;
369 esac],
370 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
373 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
374 AC_DEFUN(AM_DISABLE_SHARED,
375 [AM_ENABLE_SHARED(no)])
377 # AM_DISABLE_STATIC - set the default static flag to --disable-static
378 AC_DEFUN(AM_DISABLE_STATIC,
379 [AM_ENABLE_STATIC(no)])
381 # AM_ENABLE_STATIC - implement the --enable-static flag
382 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
383 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
384 #   `yes'.
385 AC_DEFUN(AM_ENABLE_STATIC,
386 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
387 AC_ARG_ENABLE(static,
388 changequote(<<, >>)dnl
389 <<  --enable-static         build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
390 changequote([, ])dnl
391 [  --enable-static=PKGS    only build shared libraries if the current package
392                           appears as an element in the PKGS list],
393 [p=${PACKAGE-default}
394 case "$enableval" in
395 yes) enable_static=yes ;;
396 no) enable_static=no ;;
398   enable_static=no
399   # Look at the argument we got.  We use all the common list separators.
400   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
401   for pkg in $enableval; do
402     if test "X$pkg" = "X$p"; then
403       enable_static=yes
404     fi
405   done
406   IFS="$ac_save_ifs"
407   ;;
408 esac],
409 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
413 # AM_PROG_LD - find the path to the GNU or non-GNU linker
414 AC_DEFUN(AM_PROG_LD,
415 [AC_ARG_WITH(gnu-ld,
416 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
417 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
418 AC_REQUIRE([AC_PROG_CC])
419 ac_prog=ld
420 if test "$ac_cv_prog_gcc" = yes; then
421   # Check if gcc -print-prog-name=ld gives a path.
422   AC_MSG_CHECKING([for ld used by GCC])
423   ac_prog=`($CC -print-prog-name=ld) 2>&5`
424   case "$ac_prog" in
425   # Accept absolute paths.
426   /* | [A-Za-z]:\\*)
427     test -z "$LD" && LD="$ac_prog"
428     ;;
429   "")
430     # If it fails, then pretend we aren't using GCC.
431     ac_prog=ld
432     ;;
433   *)
434     # If it is relative, then search for the first ld in PATH.
435     with_gnu_ld=unknown
436     ;;
437   esac
438 elif test "$with_gnu_ld" = yes; then
439   AC_MSG_CHECKING([for GNU ld])
440 else
441   AC_MSG_CHECKING([for non-GNU ld])
443 AC_CACHE_VAL(ac_cv_path_LD,
444 [if test -z "$LD"; then
445   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
446   for ac_dir in $PATH; do
447     test -z "$ac_dir" && ac_dir=.
448     if test -f "$ac_dir/$ac_prog"; then
449       ac_cv_path_LD="$ac_dir/$ac_prog"
450       # Check to see if the program is GNU ld.  I'd rather use --version,
451       # but apparently some GNU ld's only accept -v.
452       # Break only if it was the GNU/non-GNU ld that we prefer.
453       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
454         test "$with_gnu_ld" != no && break
455       else
456         test "$with_gnu_ld" != yes && break
457       fi
458     fi
459   done
460   IFS="$ac_save_ifs"
461 else
462   ac_cv_path_LD="$LD" # Let the user override the test with a path.
463 fi])
464 LD="$ac_cv_path_LD"
465 if test -n "$LD"; then
466   AC_MSG_RESULT($LD)
467 else
468   AC_MSG_RESULT(no)
470 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
471 AC_SUBST(LD)
472 AM_PROG_LD_GNU
475 AC_DEFUN(AM_PROG_LD_GNU,
476 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
477 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
478 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
479   ac_cv_prog_gnu_ld=yes
480 else
481   ac_cv_prog_gnu_ld=no
482 fi])
485 # AM_PROG_NM - find the path to a BSD-compatible name lister
486 AC_DEFUN(AM_PROG_NM,
487 [AC_MSG_CHECKING([for BSD-compatible nm])
488 AC_CACHE_VAL(ac_cv_path_NM,
489 [case "$NM" in
490 /* | [A-Za-z]:\\*)
491   ac_cv_path_NM="$NM" # Let the user override the test with a path.
492   ;;
494   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
495   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
496     test -z "$ac_dir" && ac_dir=.
497     if test -f $ac_dir/nm; then
498       # Check to see if the nm accepts a BSD-compat flag.
499       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
500       #   nm: unknown option "B" ignored
501       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
502         ac_cv_path_NM="$ac_dir/nm -B"
503       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
504         ac_cv_path_NM="$ac_dir/nm -p"
505       else
506         ac_cv_path_NM="$ac_dir/nm"
507       fi
508       break
509     fi
510   done
511   IFS="$ac_save_ifs"
512   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
513   ;;
514 esac])
515 NM="$ac_cv_path_NM"
516 AC_MSG_RESULT([$NM])
517 AC_SUBST(NM)
520 # Like AC_CONFIG_HEADER, but automatically create stamp file.
522 AC_DEFUN(AM_CONFIG_HEADER,
523 [AC_PREREQ([2.12])
524 AC_CONFIG_HEADER([$1])
525 dnl When config.status generates a header, we must update the stamp-h file.
526 dnl This file resides in the same directory as the config header
527 dnl that is generated.  We must strip everything past the first ":",
528 dnl and everything past the last "/".
529 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
530 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
531 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
532 <<am_indx=1
533 for am_file in <<$1>>; do
534   case " <<$>>CONFIG_HEADERS " in
535   *" <<$>>am_file "*<<)>>
536     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
537     ;;
538   esac
539   am_indx=`expr "<<$>>am_indx" + 1`
540 done<<>>dnl>>)
541 changequote([,]))])