Update for 0.51.2-pre2
[wmaker-crm.git] / aclocal.m4
blobdbb17dde70dceec8e5e7cdb511f10f1a4312c876
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/X11 symbolic link)
136 rh_missing_usr_x11=no
137 if test -d "/usr/X11"; then
138 AC_MSG_RESULT(found)
139 else
140 AC_MSG_RESULT(uh oh)
141 rh_missing_usr_x11=yes
142 mins_found=yes
144 AC_MSG_CHECKING(for /usr/include/X11 symbolic link)
145 rh_missing_usr_include_x11=no
146 if test -d "/usr/include/X11"; then
147 AC_MSG_RESULT(found)
148 else
149 AC_MSG_RESULT(uh oh)
150 rh_missing_usr_include_x11=yes
151 mins_found=yes
155 # Check for /lib/cpp
157 AC_MSG_CHECKING(for /lib/cpp)
158 rh_missing_lib_cpp=no
159 if test -f "/lib/cpp"; then
160 AC_MSG_RESULT(found)
161 else
162 AC_MSG_RESULT(uh oh)
163 rh_missing_lib_cpp=yes
164 bugs_found=yes
167 echo
173 dnl WM_PRINT_REDCRAP_BUG_STATUS()
175 AC_DEFUN(WM_PRINT_REDCRAP_BUG_STATUS,
177 if test "$rh_is_redhat" = yes; then
178 if test "$mins_found" = yes -o "$bugs_found" = yes; then
179 echo
180 AC_MSG_WARN([It seems you are using a system packaged by Red Hat.
181 I have done some checks for Red-Hat-specific bugs, and I found some
182 problems.  Please read the INSTALL file regarding Red Hat, resolve
183 the problems, and try to run configure again.
185 Here are the problems I found:
187 if test "x$rh_old_wmaker" = xyes; then
188 echo "Problem:     Old version of Window Maker in /usr/X11R6/bin."
189 echo "Description: You seem to have an old version of Window Maker"
190 echo "             installed in /usr/X11R6/bin. It is recommended"
191 echo "             that you uninstall any previously installed"
192 echo "             packages of WindowMaker before installing a new one."
193 echo
195 if test "x$rh_missing_usr_local_bin" = xyes; then
196 echo "Problem:     PATH is missing /usr/local/bin."
197 echo "Description: Your PATH environment variable does not appear to"
198 echo "             contain the directory /usr/local/bin.  Please add it."
199 echo
201 if test "x$rh_missing_usr_local_lib" = xyes; then
202 echo "Problem:     /etc/ld.so.conf missing /usr/local/lib"
203 echo "Description: Your /etc/ld.so.conf file does not appear to contain"
204 echo "             the directory /usr/local/lib.  Please add it."
205 echo
207 if test "x$rh_missing_usr_x11" = xyes; then
208 echo "Problem:     Missing /usr/X11 symbolic link."
209 echo "Description: Your system is missing a symbolic link from"
210 echo "             /usr/X11R6 to /usr/X11.  Please create one."
211 echo
213 if test "x$rh_missing_usr_include_x11" = xyes; then
214 echo "Problem:     Missing /usr/include/X11 symbolic link."
215 echo "Description: Your system is missing a symbolic link from"
216 echo "             /usr/X11R6/include/X11 to /usr/include/X11."
217 echo "             Please create one."
218 echo
220 if test "x$rh_missing_lib_cpp" = xyes; then
221 echo "Problem:     Missing /lib/cpp symbolic link."
222 echo "Description: Your system is missing a symbolic link from the"
223 echo "             cpp (C preprocessor) program to /lib/cpp."
224 echo "             Please create one."
225 echo
227 if test "x$bugs_found" = xyes; then
228 AC_MSG_ERROR([One or more of the problems above can potentially
229 cause Window Maker not to install or run properly.  Please resolve
230 the problems and try to run configure again.])
231 exit 1
232 elif test "x$mins_found" = xyes; then
233 AC_MSG_WARN([The problems above may or may not cause Window Maker
234 not to install or run properly.  If you have any problems during 
235 installation or execution, please resolve the problems and try to
236 install Window Maker again.])
237 echo
239 else
240 echo
241 echo "You appear to have a system packaged by Red Hat, but I could"
242 echo "not find any Red-Hat-specific problems that I know about."
243 echo
249 # Do all the work for Automake.  This macro actually does too much --
250 # some checks are only needed if your package does certain things.
251 # But this isn't really a big deal.
253 # serial 1
255 dnl Usage:
256 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
258 AC_DEFUN(AM_INIT_AUTOMAKE,
259 [AC_REQUIRE([AC_PROG_INSTALL])
260 PACKAGE=[$1]
261 AC_SUBST(PACKAGE)
262 VERSION=[$2]
263 AC_SUBST(VERSION)
264 dnl test to see if srcdir already configured
265 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
266   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
268 ifelse([$3],,
269 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
270 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
271 AC_REQUIRE([AM_SANITY_CHECK])
272 AC_REQUIRE([AC_ARG_PROGRAM])
273 dnl FIXME This is truly gross.
274 missing_dir=`cd $ac_aux_dir && pwd`
275 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
276 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
277 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
278 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
279 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
280 AC_REQUIRE([AC_PROG_MAKE_SET])])
283 # Check to make sure that the build environment is sane.
286 AC_DEFUN(AM_SANITY_CHECK,
287 [AC_MSG_CHECKING([whether build environment is sane])
288 # Just in case
289 sleep 1
290 echo timestamp > conftestfile
291 # Do `set' in a subshell so we don't clobber the current shell's
292 # arguments.  Must try -L first in case configure is actually a
293 # symlink; some systems play weird games with the mod time of symlinks
294 # (eg FreeBSD returns the mod time of the symlink's containing
295 # directory).
296 if (
297    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
298    if test "[$]*" = "X"; then
299       # -L didn't work.
300       set X `ls -t $srcdir/configure conftestfile`
301    fi
302    if test "[$]*" != "X $srcdir/configure conftestfile" \
303       && test "[$]*" != "X conftestfile $srcdir/configure"; then
305       # If neither matched, then we have a broken ls.  This can happen
306       # if, for instance, CONFIG_SHELL is bash and it inherits a
307       # broken ls alias from the environment.  This has actually
308       # happened.  Such a system could not be considered "sane".
309       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
310 alias in your environment])
311    fi
313    test "[$]2" = conftestfile
314    )
315 then
316    # Ok.
317    :
318 else
319    AC_MSG_ERROR([newly created file is older than distributed files!
320 Check your system clock])
322 rm -f conftest*
323 AC_MSG_RESULT(yes)])
325 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
326 dnl The program must properly implement --version.
327 AC_DEFUN(AM_MISSING_PROG,
328 [AC_MSG_CHECKING(for working $2)
329 # Run test in a subshell; some versions of sh will print an error if
330 # an executable is not found, even if stderr is redirected.
331 # Redirect stdin to placate older versions of autoconf.  Sigh.
332 if ($2 --version) < /dev/null > /dev/null 2>&1; then
333    $1=$2
334    AC_MSG_RESULT(found)
335 else
336    $1="$3/missing $2"
337    AC_MSG_RESULT(missing)
339 AC_SUBST($1)])
342 # serial 24 AM_PROG_LIBTOOL
343 AC_DEFUN(AM_PROG_LIBTOOL,
344 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
345 AC_REQUIRE([AM_ENABLE_STATIC])dnl
346 AC_REQUIRE([AC_CANONICAL_HOST])dnl
347 AC_REQUIRE([AC_PROG_RANLIB])dnl
348 AC_REQUIRE([AC_PROG_CC])dnl
349 AC_REQUIRE([AM_PROG_LD])dnl
350 AC_REQUIRE([AM_PROG_NM])dnl
351 AC_REQUIRE([AC_PROG_LN_S])dnl
353 # Always use our own libtool.
354 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
355 AC_SUBST(LIBTOOL)dnl
357 # Check for any special flags to pass to ltconfig.
358 libtool_flags=
359 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
360 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
361 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
362 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
363 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
365 # Some flags need to be propagated to the compiler or linker for good
366 # libtool support.
367 case "$host" in
368 *-*-irix6*)
369   # Find out which ABI we are using.
370   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
371   if AC_TRY_EVAL(ac_compile); then
372     case "`/usr/bin/file conftest.o`" in
373     *32-bit*)
374       LD="${LD-ld} -32"
375       ;;
376     *N32*)
377       LD="${LD-ld} -n32"
378       ;;
379     *64-bit*)
380       LD="${LD-ld} -64"
381       ;;
382     esac
383   fi
384   rm -rf conftest*
385   ;;
387 *-*-sco3.2v5*)
388   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
389   CFLAGS="$CFLAGS -belf"
390   ;;
391 esac
393 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
394 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
395 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
396 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
397 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
398 || AC_MSG_ERROR([libtool configure failed])
401 # AM_ENABLE_SHARED - implement the --enable-shared flag
402 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
403 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
404 #   `yes'.
405 AC_DEFUN(AM_ENABLE_SHARED,
406 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
407 AC_ARG_ENABLE(shared,
408 changequote(<<, >>)dnl
409 <<  --enable-shared         build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
410 changequote([, ])dnl
411 [  --enable-shared=PKGS    only build shared libraries if the current package
412                           appears as an element in the PKGS list],
413 [p=${PACKAGE-default}
414 case "$enableval" in
415 yes) enable_shared=yes ;;
416 no) enable_shared=no ;;
418   enable_shared=no
419   # Look at the argument we got.  We use all the common list separators.
420   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
421   for pkg in $enableval; do
422     if test "X$pkg" = "X$p"; then
423       enable_shared=yes
424     fi
425   done
426   IFS="$ac_save_ifs"
427   ;;
428 esac],
429 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
432 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
433 AC_DEFUN(AM_DISABLE_SHARED,
434 [AM_ENABLE_SHARED(no)])
436 # AM_DISABLE_STATIC - set the default static flag to --disable-static
437 AC_DEFUN(AM_DISABLE_STATIC,
438 [AM_ENABLE_STATIC(no)])
440 # AM_ENABLE_STATIC - implement the --enable-static flag
441 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
442 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
443 #   `yes'.
444 AC_DEFUN(AM_ENABLE_STATIC,
445 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
446 AC_ARG_ENABLE(static,
447 changequote(<<, >>)dnl
448 <<  --enable-static         build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
449 changequote([, ])dnl
450 [  --enable-static=PKGS    only build shared libraries if the current package
451                           appears as an element in the PKGS list],
452 [p=${PACKAGE-default}
453 case "$enableval" in
454 yes) enable_static=yes ;;
455 no) enable_static=no ;;
457   enable_static=no
458   # Look at the argument we got.  We use all the common list separators.
459   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
460   for pkg in $enableval; do
461     if test "X$pkg" = "X$p"; then
462       enable_static=yes
463     fi
464   done
465   IFS="$ac_save_ifs"
466   ;;
467 esac],
468 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
472 # AM_PROG_LD - find the path to the GNU or non-GNU linker
473 AC_DEFUN(AM_PROG_LD,
474 [AC_ARG_WITH(gnu-ld,
475 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
476 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
477 AC_REQUIRE([AC_PROG_CC])
478 ac_prog=ld
479 if test "$ac_cv_prog_gcc" = yes; then
480   # Check if gcc -print-prog-name=ld gives a path.
481   AC_MSG_CHECKING([for ld used by GCC])
482   ac_prog=`($CC -print-prog-name=ld) 2>&5`
483   case "$ac_prog" in
484   # Accept absolute paths.
485   /* | [A-Za-z]:\\*)
486     test -z "$LD" && LD="$ac_prog"
487     ;;
488   "")
489     # If it fails, then pretend we aren't using GCC.
490     ac_prog=ld
491     ;;
492   *)
493     # If it is relative, then search for the first ld in PATH.
494     with_gnu_ld=unknown
495     ;;
496   esac
497 elif test "$with_gnu_ld" = yes; then
498   AC_MSG_CHECKING([for GNU ld])
499 else
500   AC_MSG_CHECKING([for non-GNU ld])
502 AC_CACHE_VAL(ac_cv_path_LD,
503 [if test -z "$LD"; then
504   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
505   for ac_dir in $PATH; do
506     test -z "$ac_dir" && ac_dir=.
507     if test -f "$ac_dir/$ac_prog"; then
508       ac_cv_path_LD="$ac_dir/$ac_prog"
509       # Check to see if the program is GNU ld.  I'd rather use --version,
510       # but apparently some GNU ld's only accept -v.
511       # Break only if it was the GNU/non-GNU ld that we prefer.
512       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
513         test "$with_gnu_ld" != no && break
514       else
515         test "$with_gnu_ld" != yes && break
516       fi
517     fi
518   done
519   IFS="$ac_save_ifs"
520 else
521   ac_cv_path_LD="$LD" # Let the user override the test with a path.
522 fi])
523 LD="$ac_cv_path_LD"
524 if test -n "$LD"; then
525   AC_MSG_RESULT($LD)
526 else
527   AC_MSG_RESULT(no)
529 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
530 AC_SUBST(LD)
531 AM_PROG_LD_GNU
534 AC_DEFUN(AM_PROG_LD_GNU,
535 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
536 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
537 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
538   ac_cv_prog_gnu_ld=yes
539 else
540   ac_cv_prog_gnu_ld=no
541 fi])
544 # AM_PROG_NM - find the path to a BSD-compatible name lister
545 AC_DEFUN(AM_PROG_NM,
546 [AC_MSG_CHECKING([for BSD-compatible nm])
547 AC_CACHE_VAL(ac_cv_path_NM,
548 [case "$NM" in
549 /* | [A-Za-z]:\\*)
550   ac_cv_path_NM="$NM" # Let the user override the test with a path.
551   ;;
553   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
554   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
555     test -z "$ac_dir" && ac_dir=.
556     if test -f $ac_dir/nm; then
557       # Check to see if the nm accepts a BSD-compat flag.
558       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
559       #   nm: unknown option "B" ignored
560       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
561         ac_cv_path_NM="$ac_dir/nm -B"
562       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
563         ac_cv_path_NM="$ac_dir/nm -p"
564       else
565         ac_cv_path_NM="$ac_dir/nm"
566       fi
567       break
568     fi
569   done
570   IFS="$ac_save_ifs"
571   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
572   ;;
573 esac])
574 NM="$ac_cv_path_NM"
575 AC_MSG_RESULT([$NM])
576 AC_SUBST(NM)
579 # Like AC_CONFIG_HEADER, but automatically create stamp file.
581 AC_DEFUN(AM_CONFIG_HEADER,
582 [AC_PREREQ([2.12])
583 AC_CONFIG_HEADER([$1])
584 dnl When config.status generates a header, we must update the stamp-h file.
585 dnl This file resides in the same directory as the config header
586 dnl that is generated.  We must strip everything past the first ":",
587 dnl and everything past the last "/".
588 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
589 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
590 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
591 <<am_indx=1
592 for am_file in <<$1>>; do
593   case " <<$>>CONFIG_HEADERS " in
594   *" <<$>>am_file "*<<)>>
595     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
596     ;;
597   esac
598   am_indx=`expr "<<$>>am_indx" + 1`
599 done<<>>dnl>>)
600 changequote([,]))])