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