]> Pileus Git - ~andy/gtk/blob - glib/aclocal.m4
Initial revision
[~andy/gtk] / glib / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.2
2
3 # Do all the work for Automake.  This macro actually does too much --
4 # some checks are only needed if your package does certain things.
5 # But this isn't really a big deal.
6
7 # serial 1
8
9 dnl Usage:
10 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
11
12 AC_DEFUN(AM_INIT_AUTOMAKE,
13 [AC_REQUIRE([AM_PROG_INSTALL])
14 PACKAGE=[$1]
15 AC_SUBST(PACKAGE)
16 VERSION=[$2]
17 AC_SUBST(VERSION)
18 dnl test to see if srcdir already configured
19 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
20   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
21 fi
22 ifelse([$3],,
23 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
24 AC_DEFINE_UNQUOTED(VERSION, "$VERSION"))
25 AM_SANITY_CHECK
26 AC_ARG_PROGRAM
27 dnl FIXME This is truly gross.
28 missing_dir=`cd $ac_aux_dir && pwd`
29 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
30 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
31 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
32 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
33 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
34 AC_PROG_MAKE_SET])
35
36
37 # serial 1
38
39 AC_DEFUN(AM_PROG_INSTALL,
40 [AC_REQUIRE([AC_PROG_INSTALL])
41 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
42 AC_SUBST(INSTALL_SCRIPT)dnl
43 ])
44
45 #
46 # Check to make sure that the build environment is sane.
47 #
48
49 AC_DEFUN(AM_SANITY_CHECK,
50 [AC_MSG_CHECKING([whether build environment is sane])
51 # Just in case
52 sleep 1
53 echo timestamp > conftestfile
54 # Do `set' in a subshell so we don't clobber the current shell's
55 # arguments.  Must try -L first in case configure is actually a
56 # symlink; some systems play weird games with the mod time of symlinks
57 # (eg FreeBSD returns the mod time of the symlink's containing
58 # directory).
59 if (
60    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
61    if test "$@" = "X"; then
62       # -L didn't work.
63       set X `ls -t $srcdir/configure conftestfile`
64    fi
65    test "[$]2" = conftestfile
66    )
67 then
68    # Ok.
69    :
70 else
71    AC_MSG_ERROR([newly created file is older than distributed files!
72 Check your system clock])
73 fi
74 rm -f conftest*
75 AC_MSG_RESULT(yes)])
76
77 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
78 dnl The program must properly implement --version.
79 AC_DEFUN(AM_MISSING_PROG,
80 [AC_MSG_CHECKING(for working $2)
81 # Run test in a subshell; some versions of sh will print an error if
82 # an executable is not found, even if stderr is redirected.
83 # Redirect stdin to placate older versions of autoconf.  Sigh.
84 if ($2 --version) < /dev/null > /dev/null 2>&1; then
85    $1=$2
86    AC_MSG_RESULT(found)
87 else
88    $1="$3/missing $2"
89    AC_MSG_RESULT(missing)
90 fi
91 AC_SUBST($1)])
92
93 # Like AC_CONFIG_HEADER, but automatically create stamp file.
94
95 AC_DEFUN(AM_CONFIG_HEADER,
96 [AC_PREREQ([2.12])
97 AC_CONFIG_HEADER([$1])
98 dnl When config.status generates a header, we must update the stamp-h file.
99 dnl This file resides in the same directory as the config header
100 dnl that is generated.  We must strip everything past the first ":",
101 dnl and everything past the last "/".
102 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
103 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
104 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
105 <<am_indx=1
106 for am_file in <<$1>>; do
107   case " <<$>>CONFIG_HEADERS " in
108   *" <<$>>am_file "*<<)>>
109     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
110     ;;
111   esac
112   am_indx=`expr "<<$>>am_indx" + 1`
113 done<<>>dnl>>)
114 changequote([,]))])
115
116
117 # serial 17 AM_PROG_LIBTOOL
118 AC_DEFUN(AM_PROG_LIBTOOL,
119 [AC_REQUIRE([AC_CANONICAL_HOST])
120 AC_REQUIRE([AC_PROG_RANLIB])
121 AC_REQUIRE([AC_PROG_CC])
122 AC_REQUIRE([AM_PROG_LD])
123 AC_REQUIRE([AM_PROG_NM])
124 AC_REQUIRE([AC_PROG_LN_S])
125
126 # Always use our own libtool.
127 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
128 AC_SUBST(LIBTOOL)
129
130 dnl Allow the --disable-shared flag to stop us from building shared libs.
131 AC_ARG_ENABLE(shared,
132 [  --enable-shared         build shared libraries [default=yes]],
133 [if test "$enableval" = no; then
134   libtool_enable_shared=no
135 else
136   libtool_enable_shared=yes
137 fi])
138 test -n "$libtool_enable_shared" && enable_shared="$libtool_enable_shared"
139 libtool_shared=
140 test "$enable_shared" = no && libtool_shared=" --disable-shared"
141
142 dnl Allow the --disable-static flag to stop us from building static libs.
143 AC_ARG_ENABLE(static,
144 [  --enable-static         build static libraries [default=yes]],
145 [if test "$enableval" = no; then
146   libtool_enable_static=no
147 else
148   libtool_enable_static=yes
149 fi])
150 test -n "$libtool_enable_static" && enable_static="$libtool_enable_static"
151 libtool_static=
152 test "$enable_static" = no && libtool_static=" --disable-static"
153
154 libtool_flags="$libtool_shared$libtool_static"
155 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
156 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
157 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
158
159 # Some flags need to be propagated to the compiler or linker for good
160 # libtool support.
161 [case "$host" in
162 *-*-irix6*)
163   ac_save_CFLAGS="$CFLAGS"
164   flag_passed=no
165   for f in -32 -64 -n32 ABI -cckr -mips1 -mips2 -mips3 -mips4; do
166     case "$f" in
167     ABI)
168       test -n "$SGI_ABI" && flag_passed=yes
169       if test "$flag_passed" = no && test "$ac_cv_prog_gcc" = yes; then
170         # Choose the ABI flag according to GCC's specs.
171         if $CC -dumpspecs 2>&1 | sed '/^\*link:$/,/^$/!d' | egrep -e '[         ]-32' >/dev/null; then
172           LD="${LD-ld} -32"
173         else
174           LD="${LD-ld} -n32"
175         fi
176       fi
177       ;;
178
179     *)
180       if echo " $CC $CFLAGS " | egrep -e "[     ]$f[     ]" > /dev/null; then
181         flag_passed=yes
182         LD="${LD-ld} $f"
183       fi
184       ;;
185     esac
186   done
187   CFLAGS="$ac_save_CFLAGS"
188   ;;
189
190 *-*-sco3.2v5*)
191   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
192   CFLAGS="$CFLAGS -belf"
193   ;;
194 esac]
195
196 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
197 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
198 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
199 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
200 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
201 || AC_MSG_ERROR([libtool configure failed])
202 ])
203
204 # AM_PROG_LD - find the path to the GNU or non-GNU linker
205 AC_DEFUN(AM_PROG_LD,
206 [AC_ARG_WITH(gnu-ld,
207 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
208 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
209 AC_REQUIRE([AC_PROG_CC])
210 ac_prog=ld
211 if test "$ac_cv_prog_gcc" = yes; then
212   # Check if gcc -print-prog-name=ld gives a path.
213   AC_MSG_CHECKING([for ld used by GCC])
214   ac_prog=`($CC -print-prog-name=ld) 2>&5`
215   case "$ac_prog" in
216   # Accept absolute paths.
217   /*)
218     test -z "$LD" && LD="$ac_prog"
219     ;;
220   "")
221     # If it fails, then pretend we aren't using GCC.
222     ac_prog=ld
223     ;;
224   *)
225     # If it is relative, then search for the first ld in PATH.
226     with_gnu_ld=unknown
227     ;;
228   esac
229 elif test "$with_gnu_ld" = yes; then
230   AC_MSG_CHECKING([for GNU ld])
231 else
232   AC_MSG_CHECKING([for non-GNU ld])
233 fi
234 AC_CACHE_VAL(ac_cv_path_LD,
235 [if test -z "$LD"; then
236   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
237   for ac_dir in $PATH; do
238     test -z "$ac_dir" && ac_dir=.
239     if test -f "$ac_dir/$ac_prog"; then
240       ac_cv_path_LD="$ac_dir/$ac_prog"
241       # Check to see if the program is GNU ld.  I'd rather use --version,
242       # but apparently some GNU ld's only accept -v.
243       # Break only if it was the GNU/non-GNU ld that we prefer.
244       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
245         test "$with_gnu_ld" != no && break
246       else
247         test "$with_gnu_ld" != yes && break
248       fi
249     fi
250   done
251   IFS="$ac_save_ifs"
252 else
253   ac_cv_path_LD="$LD" # Let the user override the test with a path.
254 fi])
255 LD="$ac_cv_path_LD"
256 if test -n "$LD"; then
257   AC_MSG_RESULT($LD)
258 else
259   AC_MSG_RESULT(no)
260 fi
261 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
262 AC_SUBST(LD)
263 AM_PROG_LD_GNU
264 ])
265
266 AC_DEFUN(AM_PROG_LD_GNU,
267 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
268 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
269 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
270   ac_cv_prog_gnu_ld=yes
271 else
272   ac_cv_prog_gnu_ld=no
273 fi])
274 ])
275
276 # AM_PROG_NM - find the path to a BSD-compatible name lister
277 AC_DEFUN(AM_PROG_NM,
278 [AC_MSG_CHECKING([for BSD-compatible nm])
279 AC_CACHE_VAL(ac_cv_path_NM,
280 [case "$NM" in
281 /*)
282   ac_cv_path_NM="$NM" # Let the user override the test with a path.
283   ;;
284 *)
285   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
286   for ac_dir in /usr/ucb $PATH /bin; do
287     test -z "$ac_dir" && dir=.
288     if test -f $ac_dir/nm; then
289       # Check to see if the nm accepts a BSD-compat flag.
290       if ($ac_dir/nm -B /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
291         ac_cv_path_NM="$ac_dir/nm -B"
292       elif ($ac_dir/nm -p /dev/null 2>&1; exit 0) | grep /dev/null >/dev/null; then
293         ac_cv_path_NM="$ac_dir/nm -p"
294       else
295         ac_cv_path_NM="$ac_dir/nm"
296       fi
297       break
298     fi
299   done
300   IFS="$ac_save_ifs"
301   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
302   ;;
303 esac])
304 NM="$ac_cv_path_NM"
305 AC_MSG_RESULT([$NM])
306 AC_SUBST(NM)
307 ])
308
309 # Add --enable-maintainer-mode option to configure.
310 # From Jim Meyering
311
312 # serial 1
313
314 AC_DEFUN(AM_MAINTAINER_MODE,
315 [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
316   dnl maintainer-mode is disabled by default
317   AC_ARG_ENABLE(maintainer-mode,
318 [  --enable-maintainer-mode enable make rules and dependencies not useful
319                           (and sometimes confusing) to the casual installer],
320       USE_MAINTAINER_MODE=$enableval,
321       USE_MAINTAINER_MODE=no)
322   AC_MSG_RESULT($USE_MAINTAINER_MODE)
323   if test $USE_MAINTAINER_MODE = yes; then
324     MAINT=
325   else
326     MAINT='#M#'
327   fi
328   AC_SUBST(MAINT)dnl
329 ]
330 )
331
332
333 # serial 1
334
335 # @defmac AC_PROG_CC_STDC
336 # @maindex PROG_CC_STDC
337 # @ovindex CC
338 # If the C compiler in not in ANSI C mode by default, try to add an option
339 # to output variable @code{CC} to make it so.  This macro tries various
340 # options that select ANSI C on some system or another.  It considers the
341 # compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
342 # handles function prototypes correctly.
343 #
344 # If you use this macro, you should check after calling it whether the C
345 # compiler has been set to accept ANSI C; if not, the shell variable
346 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
347 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
348 # program @code{ansi2knr}, which comes with Ghostscript.
349 # @end defmac
350
351 AC_DEFUN(AM_PROG_CC_STDC,
352 [AC_REQUIRE([AC_PROG_CC])
353 AC_BEFORE([$0], [AC_C_INLINE])
354 AC_BEFORE([$0], [AC_C_CONST])
355 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
356 AC_CACHE_VAL(am_cv_prog_cc_stdc,
357 [am_cv_prog_cc_stdc=no
358 ac_save_CC="$CC"
359 # Don't try gcc -ansi; that turns off useful extensions and
360 # breaks some systems' header files.
361 # AIX                   -qlanglvl=ansi
362 # Ultrix and OSF/1      -std1
363 # HP-UX                 -Aa -D_HPUX_SOURCE
364 # SVR4                  -Xc -D__EXTENSIONS__
365 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
366 do
367   CC="$ac_save_CC $ac_arg"
368   AC_TRY_COMPILE(
369 [#if !defined(__STDC__) || __STDC__ != 1
370 choke me
371 #endif
372 /* DYNIX/ptx V4.1.3 can't compile sys/stat.h with -Xc -D__EXTENSIONS__. */
373 #ifdef _SEQUENT_
374 # include <sys/types.h>
375 # include <sys/stat.h>
376 #endif
377 ], [
378 int test (int i, double x);
379 struct s1 {int (*f) (int a);};
380 struct s2 {int (*f) (double a);};],
381 [am_cv_prog_cc_stdc="$ac_arg"; break])
382 done
383 CC="$ac_save_CC"
384 ])
385 if test -z "$am_cv_prog_cc_stdc"; then
386   AC_MSG_RESULT([none needed])
387 else
388   AC_MSG_RESULT($am_cv_prog_cc_stdc)
389 fi
390 case "x$am_cv_prog_cc_stdc" in
391   x|xno) ;;
392   *) CC="$CC $am_cv_prog_cc_stdc" ;;
393 esac
394 ])
395