new/changelog fix
[wmaker-crm.git] / aclocal.m4
blob393706b26d3970a91bd9fea82bf7015a814f568b
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 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'
346 AC_SUBST(LIBTOOL)dnl
348 # Check for any special flags to pass to ltconfig.
349 libtool_flags=
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
357 # libtool support.
358 case "$host" in
359 *-*-irix6*)
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
364     *32-bit*)
365       LD="${LD-ld} -32"
366       ;;
367     *N32*)
368       LD="${LD-ld} -n32"
369       ;;
370     *64-bit*)
371       LD="${LD-ld} -64"
372       ;;
373     esac
374   fi
375   rm -rf conftest*
376   ;;
378 *-*-sco3.2v5*)
379   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
380   CFLAGS="$CFLAGS -belf"
381   ;;
382 esac
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
395 #   `yes'.
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]
401 changequote([, ])dnl
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}
405 case "$enableval" in
406 yes) enable_shared=yes ;;
407 no) enable_shared=no ;;
409   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
414       enable_shared=yes
415     fi
416   done
417   IFS="$ac_save_ifs"
418   ;;
419 esac],
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
434 #   `yes'.
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]
440 changequote([, ])dnl
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}
444 case "$enableval" in
445 yes) enable_static=yes ;;
446 no) enable_static=no ;;
448   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
453       enable_static=yes
454     fi
455   done
456   IFS="$ac_save_ifs"
457   ;;
458 esac],
459 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
463 # AM_PROG_LD - find the path to the GNU or non-GNU linker
464 AC_DEFUN(AM_PROG_LD,
465 [AC_ARG_WITH(gnu-ld,
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])
469 ac_prog=ld
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`
474   case "$ac_prog" in
475   # Accept absolute paths.
476   /* | [A-Za-z]:\\*)
477     test -z "$LD" && LD="$ac_prog"
478     ;;
479   "")
480     # If it fails, then pretend we aren't using GCC.
481     ac_prog=ld
482     ;;
483   *)
484     # If it is relative, then search for the first ld in PATH.
485     with_gnu_ld=unknown
486     ;;
487   esac
488 elif test "$with_gnu_ld" = yes; then
489   AC_MSG_CHECKING([for GNU ld])
490 else
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
505       else
506         test "$with_gnu_ld" != yes && break
507       fi
508     fi
509   done
510   IFS="$ac_save_ifs"
511 else
512   ac_cv_path_LD="$LD" # Let the user override the test with a path.
513 fi])
514 LD="$ac_cv_path_LD"
515 if test -n "$LD"; then
516   AC_MSG_RESULT($LD)
517 else
518   AC_MSG_RESULT(no)
520 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
521 AC_SUBST(LD)
522 AM_PROG_LD_GNU
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
530 else
531   ac_cv_prog_gnu_ld=no
532 fi])
535 # AM_PROG_NM - find the path to a BSD-compatible name lister
536 AC_DEFUN(AM_PROG_NM,
537 [AC_MSG_CHECKING([for BSD-compatible nm])
538 AC_CACHE_VAL(ac_cv_path_NM,
539 [case "$NM" in
540 /* | [A-Za-z]:\\*)
541   ac_cv_path_NM="$NM" # Let the user override the test with a path.
542   ;;
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"
555       else
556         ac_cv_path_NM="$ac_dir/nm"
557       fi
558       break
559     fi
560   done
561   IFS="$ac_save_ifs"
562   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
563   ;;
564 esac])
565 NM="$ac_cv_path_NM"
566 AC_MSG_RESULT([$NM])
567 AC_SUBST(NM)
570 # Like AC_CONFIG_HEADER, but automatically create stamp file.
572 AC_DEFUN(AM_CONFIG_HEADER,
573 [AC_PREREQ([2.12])
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>>,
582 <<am_indx=1
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
587     ;;
588   esac
589   am_indx=`expr "<<$>>am_indx" + 1`
590 done<<>>dnl>>)
591 changequote([,]))])