Latest fixes for released 0.51.0
[wmaker-crm.git] / aclocal.m4
blob366c8ab8d84f01bbc58391e2707e97bf8ad45b18
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 # Do all the work for Automake.  This macro actually does too much --
14 # some checks are only needed if your package does certain things.
15 # But this isn't really a big deal.
17 # serial 1
19 dnl Usage:
20 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
22 AC_DEFUN(AM_INIT_AUTOMAKE,
23 [AC_REQUIRE([AC_PROG_INSTALL])
24 PACKAGE=[$1]
25 AC_SUBST(PACKAGE)
26 VERSION=[$2]
27 AC_SUBST(VERSION)
28 dnl test to see if srcdir already configured
29 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
30   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
32 ifelse([$3],,
33 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
34 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
35 AC_REQUIRE([AM_SANITY_CHECK])
36 AC_REQUIRE([AC_ARG_PROGRAM])
37 dnl FIXME This is truly gross.
38 missing_dir=`cd $ac_aux_dir && pwd`
39 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
40 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
41 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
42 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
43 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
44 AC_REQUIRE([AC_PROG_MAKE_SET])])
47 # Check to make sure that the build environment is sane.
50 AC_DEFUN(AM_SANITY_CHECK,
51 [AC_MSG_CHECKING([whether build environment is sane])
52 # Just in case
53 sleep 1
54 echo timestamp > conftestfile
55 # Do `set' in a subshell so we don't clobber the current shell's
56 # arguments.  Must try -L first in case configure is actually a
57 # symlink; some systems play weird games with the mod time of symlinks
58 # (eg FreeBSD returns the mod time of the symlink's containing
59 # directory).
60 if (
61    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
62    if test "[$]*" = "X"; then
63       # -L didn't work.
64       set X `ls -t $srcdir/configure conftestfile`
65    fi
66    if test "[$]*" != "X $srcdir/configure conftestfile" \
67       && test "[$]*" != "X conftestfile $srcdir/configure"; then
69       # If neither matched, then we have a broken ls.  This can happen
70       # if, for instance, CONFIG_SHELL is bash and it inherits a
71       # broken ls alias from the environment.  This has actually
72       # happened.  Such a system could not be considered "sane".
73       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
74 alias in your environment])
75    fi
77    test "[$]2" = conftestfile
78    )
79 then
80    # Ok.
81    :
82 else
83    AC_MSG_ERROR([newly created file is older than distributed files!
84 Check your system clock])
86 rm -f conftest*
87 AC_MSG_RESULT(yes)])
89 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
90 dnl The program must properly implement --version.
91 AC_DEFUN(AM_MISSING_PROG,
92 [AC_MSG_CHECKING(for working $2)
93 # Run test in a subshell; some versions of sh will print an error if
94 # an executable is not found, even if stderr is redirected.
95 # Redirect stdin to placate older versions of autoconf.  Sigh.
96 if ($2 --version) < /dev/null > /dev/null 2>&1; then
97    $1=$2
98    AC_MSG_RESULT(found)
99 else
100    $1="$3/missing $2"
101    AC_MSG_RESULT(missing)
103 AC_SUBST($1)])
106 # serial 24 AM_PROG_LIBTOOL
107 AC_DEFUN(AM_PROG_LIBTOOL,
108 [AC_REQUIRE([AM_ENABLE_SHARED])dnl
109 AC_REQUIRE([AM_ENABLE_STATIC])dnl
110 AC_REQUIRE([AC_CANONICAL_HOST])dnl
111 AC_REQUIRE([AC_PROG_RANLIB])dnl
112 AC_REQUIRE([AC_PROG_CC])dnl
113 AC_REQUIRE([AM_PROG_LD])dnl
114 AC_REQUIRE([AM_PROG_NM])dnl
115 AC_REQUIRE([AC_PROG_LN_S])dnl
117 # Always use our own libtool.
118 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
119 AC_SUBST(LIBTOOL)dnl
121 # Check for any special flags to pass to ltconfig.
122 libtool_flags=
123 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
124 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
125 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
126 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
127 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
129 # Some flags need to be propagated to the compiler or linker for good
130 # libtool support.
131 case "$host" in
132 *-*-irix6*)
133   # Find out which ABI we are using.
134   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
135   if AC_TRY_EVAL(ac_compile); then
136     case "`/usr/bin/file conftest.o`" in
137     *32-bit*)
138       LD="${LD-ld} -32"
139       ;;
140     *N32*)
141       LD="${LD-ld} -n32"
142       ;;
143     *64-bit*)
144       LD="${LD-ld} -64"
145       ;;
146     esac
147   fi
148   rm -rf conftest*
149   ;;
151 *-*-sco3.2v5*)
152   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
153   CFLAGS="$CFLAGS -belf"
154   ;;
155 esac
157 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
158 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
159 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
160 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
161 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
162 || AC_MSG_ERROR([libtool configure failed])
165 # AM_ENABLE_SHARED - implement the --enable-shared flag
166 # Usage: AM_ENABLE_SHARED[(DEFAULT)]
167 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
168 #   `yes'.
169 AC_DEFUN(AM_ENABLE_SHARED,
170 [define([AM_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
171 AC_ARG_ENABLE(shared,
172 changequote(<<, >>)dnl
173 <<  --enable-shared         build shared libraries [default=>>AM_ENABLE_SHARED_DEFAULT]
174 changequote([, ])dnl
175 [  --enable-shared=PKGS    only build shared libraries if the current package
176                           appears as an element in the PKGS list],
177 [p=${PACKAGE-default}
178 case "$enableval" in
179 yes) enable_shared=yes ;;
180 no) enable_shared=no ;;
182   enable_shared=no
183   # Look at the argument we got.  We use all the common list separators.
184   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
185   for pkg in $enableval; do
186     if test "X$pkg" = "X$p"; then
187       enable_shared=yes
188     fi
189   done
190   IFS="$ac_save_ifs"
191   ;;
192 esac],
193 enable_shared=AM_ENABLE_SHARED_DEFAULT)dnl
196 # AM_DISABLE_SHARED - set the default shared flag to --disable-shared
197 AC_DEFUN(AM_DISABLE_SHARED,
198 [AM_ENABLE_SHARED(no)])
200 # AM_DISABLE_STATIC - set the default static flag to --disable-static
201 AC_DEFUN(AM_DISABLE_STATIC,
202 [AM_ENABLE_STATIC(no)])
204 # AM_ENABLE_STATIC - implement the --enable-static flag
205 # Usage: AM_ENABLE_STATIC[(DEFAULT)]
206 #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
207 #   `yes'.
208 AC_DEFUN(AM_ENABLE_STATIC,
209 [define([AM_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
210 AC_ARG_ENABLE(static,
211 changequote(<<, >>)dnl
212 <<  --enable-static         build static libraries [default=>>AM_ENABLE_STATIC_DEFAULT]
213 changequote([, ])dnl
214 [  --enable-static=PKGS    only build shared libraries if the current package
215                           appears as an element in the PKGS list],
216 [p=${PACKAGE-default}
217 case "$enableval" in
218 yes) enable_static=yes ;;
219 no) enable_static=no ;;
221   enable_static=no
222   # Look at the argument we got.  We use all the common list separators.
223   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
224   for pkg in $enableval; do
225     if test "X$pkg" = "X$p"; then
226       enable_static=yes
227     fi
228   done
229   IFS="$ac_save_ifs"
230   ;;
231 esac],
232 enable_static=AM_ENABLE_STATIC_DEFAULT)dnl
236 # AM_PROG_LD - find the path to the GNU or non-GNU linker
237 AC_DEFUN(AM_PROG_LD,
238 [AC_ARG_WITH(gnu-ld,
239 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
240 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
241 AC_REQUIRE([AC_PROG_CC])
242 ac_prog=ld
243 if test "$ac_cv_prog_gcc" = yes; then
244   # Check if gcc -print-prog-name=ld gives a path.
245   AC_MSG_CHECKING([for ld used by GCC])
246   ac_prog=`($CC -print-prog-name=ld) 2>&5`
247   case "$ac_prog" in
248   # Accept absolute paths.
249   /* | [A-Za-z]:\\*)
250     test -z "$LD" && LD="$ac_prog"
251     ;;
252   "")
253     # If it fails, then pretend we aren't using GCC.
254     ac_prog=ld
255     ;;
256   *)
257     # If it is relative, then search for the first ld in PATH.
258     with_gnu_ld=unknown
259     ;;
260   esac
261 elif test "$with_gnu_ld" = yes; then
262   AC_MSG_CHECKING([for GNU ld])
263 else
264   AC_MSG_CHECKING([for non-GNU ld])
266 AC_CACHE_VAL(ac_cv_path_LD,
267 [if test -z "$LD"; then
268   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
269   for ac_dir in $PATH; do
270     test -z "$ac_dir" && ac_dir=.
271     if test -f "$ac_dir/$ac_prog"; then
272       ac_cv_path_LD="$ac_dir/$ac_prog"
273       # Check to see if the program is GNU ld.  I'd rather use --version,
274       # but apparently some GNU ld's only accept -v.
275       # Break only if it was the GNU/non-GNU ld that we prefer.
276       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
277         test "$with_gnu_ld" != no && break
278       else
279         test "$with_gnu_ld" != yes && break
280       fi
281     fi
282   done
283   IFS="$ac_save_ifs"
284 else
285   ac_cv_path_LD="$LD" # Let the user override the test with a path.
286 fi])
287 LD="$ac_cv_path_LD"
288 if test -n "$LD"; then
289   AC_MSG_RESULT($LD)
290 else
291   AC_MSG_RESULT(no)
293 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
294 AC_SUBST(LD)
295 AM_PROG_LD_GNU
298 AC_DEFUN(AM_PROG_LD_GNU,
299 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
300 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
301 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
302   ac_cv_prog_gnu_ld=yes
303 else
304   ac_cv_prog_gnu_ld=no
305 fi])
308 # AM_PROG_NM - find the path to a BSD-compatible name lister
309 AC_DEFUN(AM_PROG_NM,
310 [AC_MSG_CHECKING([for BSD-compatible nm])
311 AC_CACHE_VAL(ac_cv_path_NM,
312 [case "$NM" in
313 /* | [A-Za-z]:\\*)
314   ac_cv_path_NM="$NM" # Let the user override the test with a path.
315   ;;
317   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
318   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
319     test -z "$ac_dir" && ac_dir=.
320     if test -f $ac_dir/nm; then
321       # Check to see if the nm accepts a BSD-compat flag.
322       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
323       #   nm: unknown option "B" ignored
324       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
325         ac_cv_path_NM="$ac_dir/nm -B"
326       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
327         ac_cv_path_NM="$ac_dir/nm -p"
328       else
329         ac_cv_path_NM="$ac_dir/nm"
330       fi
331       break
332     fi
333   done
334   IFS="$ac_save_ifs"
335   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
336   ;;
337 esac])
338 NM="$ac_cv_path_NM"
339 AC_MSG_RESULT([$NM])
340 AC_SUBST(NM)
343 # Like AC_CONFIG_HEADER, but automatically create stamp file.
345 AC_DEFUN(AM_CONFIG_HEADER,
346 [AC_PREREQ([2.12])
347 AC_CONFIG_HEADER([$1])
348 dnl When config.status generates a header, we must update the stamp-h file.
349 dnl This file resides in the same directory as the config header
350 dnl that is generated.  We must strip everything past the first ":",
351 dnl and everything past the last "/".
352 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
353 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
354 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
355 <<am_indx=1
356 for am_file in <<$1>>; do
357   case " <<$>>CONFIG_HEADERS " in
358   *" <<$>>am_file "*<<)>>
359     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
360     ;;
361   esac
362   am_indx=`expr "<<$>>am_indx" + 1`
363 done<<>>dnl>>)
364 changequote([,]))])