source: trunk/third/ORBit/libIDL/aclocal.m4 @ 15271

Revision 15271, 27.8 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15270, which included commits to RCS files with non-trunk default branches.
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4
2
3dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl Autoconf extension macros for libIDL
14AC_DEFUN(AC_CPP_ACCEPT_IDL,
15        [AC_CACHE_CHECK([if C preprocessor likes IDL],
16                ac_cv_cpp_accept_idl,
17                [AC_TRY_CPP([
18                        #pragma prefix "foo.org"
19                        module FOO {
20                                typedef unsigned long long big;
21                                interface BAR {
22                                        readonly attribute big number;
23                                };
24                        };
25                ],
26                ac_cv_cpp_accept_idl=yes,
27                ac_cv_cpp_accept_idl=no)])])
28
29AC_DEFUN(AC_CPP_PIPE_STDIN,
30        [AC_CACHE_CHECK([if C preprocessor can read from stdin],
31                ac_cv_cpp_pipe_stdin,
32                [AC_REQUIRE_CPP
33                if echo | $CPP - 2>/dev/null 1>&2 ; then
34                        ac_cv_cpp_pipe_stdin=yes
35                else
36                        ac_cv_cpp_pipe_stdin=no
37                fi])
38        if test $ac_cv_cpp_pipe_stdin = yes ; then
39                AC_DEFINE(HAVE_CPP_PIPE_STDIN)
40        fi])
41
42AC_DEFUN(AC_UPDATE_IF_CHANGED,
43        [if test -f "$2"; then
44                if cmp -s "$1" "$2" 2>/dev/null; then
45                        echo "$1 is unchanged"
46                else
47                        echo "$1 has changed"
48                        rm -f "$1"
49                        cp "$2" "$1"
50                fi
51        fi])
52
53AC_DEFUN(AC_CPP_NOSTDINC,
54       [AC_CACHE_CHECK([how to ignore standard include path],
55               ac_cv_cpp_nostdinc,
56               [saved_CPPFLAGS="$CPPFLAGS"
57               CPPFLAGS="$CPPFLAGS -I-"
58               AC_TRY_CPP(,ac_cv_cpp_nostdinc=-I-,
59                       [CPPFLAGS="$saved_CPPFLAGS -I"
60                       AC_TRY_CPP(,ac_cv_cpp_nostdinc=-I,)])
61               CPPFLAGS="$saved_CPPFLAGS"])
62       AC_DEFINE_UNQUOTED(CPP_NOSTDINC, "$ac_cv_cpp_nostdinc")])
63
64# Do all the work for Automake.  This macro actually does too much --
65# some checks are only needed if your package does certain things.
66# But this isn't really a big deal.
67
68# serial 1
69
70dnl Usage:
71dnl AM_INIT_AUTOMAKE(package,version, [no-define])
72
73AC_DEFUN(AM_INIT_AUTOMAKE,
74[AC_REQUIRE([AC_PROG_INSTALL])
75PACKAGE=[$1]
76AC_SUBST(PACKAGE)
77VERSION=[$2]
78AC_SUBST(VERSION)
79dnl test to see if srcdir already configured
80if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
81  AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
82fi
83ifelse([$3],,
84AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
85AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
86AC_REQUIRE([AM_SANITY_CHECK])
87AC_REQUIRE([AC_ARG_PROGRAM])
88dnl FIXME This is truly gross.
89missing_dir=`cd $ac_aux_dir && pwd`
90AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
91AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
92AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
93AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
94AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
95AC_REQUIRE([AC_PROG_MAKE_SET])])
96
97#
98# Check to make sure that the build environment is sane.
99#
100
101AC_DEFUN(AM_SANITY_CHECK,
102[AC_MSG_CHECKING([whether build environment is sane])
103# Just in case
104sleep 1
105echo timestamp > conftestfile
106# Do `set' in a subshell so we don't clobber the current shell's
107# arguments.  Must try -L first in case configure is actually a
108# symlink; some systems play weird games with the mod time of symlinks
109# (eg FreeBSD returns the mod time of the symlink's containing
110# directory).
111if (
112   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
113   if test "[$]*" = "X"; then
114      # -L didn't work.
115      set X `ls -t $srcdir/configure conftestfile`
116   fi
117   if test "[$]*" != "X $srcdir/configure conftestfile" \
118      && test "[$]*" != "X conftestfile $srcdir/configure"; then
119
120      # If neither matched, then we have a broken ls.  This can happen
121      # if, for instance, CONFIG_SHELL is bash and it inherits a
122      # broken ls alias from the environment.  This has actually
123      # happened.  Such a system could not be considered "sane".
124      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
125alias in your environment])
126   fi
127
128   test "[$]2" = conftestfile
129   )
130then
131   # Ok.
132   :
133else
134   AC_MSG_ERROR([newly created file is older than distributed files!
135Check your system clock])
136fi
137rm -f conftest*
138AC_MSG_RESULT(yes)])
139
140dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
141dnl The program must properly implement --version.
142AC_DEFUN(AM_MISSING_PROG,
143[AC_MSG_CHECKING(for working $2)
144# Run test in a subshell; some versions of sh will print an error if
145# an executable is not found, even if stderr is redirected.
146# Redirect stdin to placate older versions of autoconf.  Sigh.
147if ($2 --version) < /dev/null > /dev/null 2>&1; then
148   $1=$2
149   AC_MSG_RESULT(found)
150else
151   $1="$3/missing $2"
152   AC_MSG_RESULT(missing)
153fi
154AC_SUBST($1)])
155
156
157dnl AM_PROG_LEX
158dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
159AC_DEFUN(AM_PROG_LEX,
160[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
161AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
162AC_PROG_LEX
163AC_DECL_YYTEXT])
164
165
166# serial 40 AC_PROG_LIBTOOL
167AC_DEFUN(AC_PROG_LIBTOOL,
168[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
169
170# Save cache, so that ltconfig can load it
171AC_CACHE_SAVE
172
173# Actually configure libtool.  ac_aux_dir is where install-sh is found.
174CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
175LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
176LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
177DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
178${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
179$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
180|| AC_MSG_ERROR([libtool configure failed])
181
182# Reload cache, that may have been modified by ltconfig
183AC_CACHE_LOAD
184
185# This can be used to rebuild libtool when needed
186LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
187
188# Always use our own libtool.
189LIBTOOL='$(SHELL) $(top_builddir)/libtool'
190AC_SUBST(LIBTOOL)dnl
191
192# Redirect the config.log output again, so that the ltconfig log is not
193# clobbered by the next message.
194exec 5>>./config.log
195])
196
197AC_DEFUN(AC_LIBTOOL_SETUP,
198[AC_PREREQ(2.13)dnl
199AC_REQUIRE([AC_ENABLE_SHARED])dnl
200AC_REQUIRE([AC_ENABLE_STATIC])dnl
201AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
202AC_REQUIRE([AC_CANONICAL_HOST])dnl
203AC_REQUIRE([AC_CANONICAL_BUILD])dnl
204AC_REQUIRE([AC_PROG_RANLIB])dnl
205AC_REQUIRE([AC_PROG_CC])dnl
206AC_REQUIRE([AC_PROG_LD])dnl
207AC_REQUIRE([AC_PROG_NM])dnl
208AC_REQUIRE([AC_PROG_LN_S])dnl
209dnl
210
211case "$target" in
212NONE) lt_target="$host" ;;
213*) lt_target="$target" ;;
214esac
215
216# Check for any special flags to pass to ltconfig.
217#
218# the following will cause an existing older ltconfig to fail, so
219# we ignore this at the expense of the cache file... Checking this
220# will just take longer ... bummer!
221#libtool_flags="--cache-file=$cache_file"
222#
223test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
224test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
225test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
226test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
227test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
228ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
229[libtool_flags="$libtool_flags --enable-dlopen"])
230ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
231[libtool_flags="$libtool_flags --enable-win32-dll"])
232AC_ARG_ENABLE(libtool-lock,
233  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
234test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
235test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
236
237# Some flags need to be propagated to the compiler or linker for good
238# libtool support.
239case "$lt_target" in
240*-*-irix6*)
241  # Find out which ABI we are using.
242  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
243  if AC_TRY_EVAL(ac_compile); then
244    case "`/usr/bin/file conftest.o`" in
245    *32-bit*)
246      LD="${LD-ld} -32"
247      ;;
248    *N32*)
249      LD="${LD-ld} -n32"
250      ;;
251    *64-bit*)
252      LD="${LD-ld} -64"
253      ;;
254    esac
255  fi
256  rm -rf conftest*
257  ;;
258
259*-*-sco3.2v5*)
260  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
261  SAVE_CFLAGS="$CFLAGS"
262  CFLAGS="$CFLAGS -belf"
263  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
264    [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
265  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
266    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
267    CFLAGS="$SAVE_CFLAGS"
268  fi
269  ;;
270
271ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
272[*-*-cygwin* | *-*-mingw*)
273  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
274  AC_CHECK_TOOL(AS, as, false)
275  AC_CHECK_TOOL(OBJDUMP, objdump, false)
276  ;;
277])
278esac
279])
280
281# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
282AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
283
284# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
285AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
286
287# AC_ENABLE_SHARED - implement the --enable-shared flag
288# Usage: AC_ENABLE_SHARED[(DEFAULT)]
289#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
290#   `yes'.
291AC_DEFUN(AC_ENABLE_SHARED, [dnl
292define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
293AC_ARG_ENABLE(shared,
294changequote(<<, >>)dnl
295<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
296changequote([, ])dnl
297[p=${PACKAGE-default}
298case "$enableval" in
299yes) enable_shared=yes ;;
300no) enable_shared=no ;;
301*)
302  enable_shared=no
303  # Look at the argument we got.  We use all the common list separators.
304  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
305  for pkg in $enableval; do
306    if test "X$pkg" = "X$p"; then
307      enable_shared=yes
308    fi
309  done
310  IFS="$ac_save_ifs"
311  ;;
312esac],
313enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
314])
315
316# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
317AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
318AC_ENABLE_SHARED(no)])
319
320# AC_ENABLE_STATIC - implement the --enable-static flag
321# Usage: AC_ENABLE_STATIC[(DEFAULT)]
322#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
323#   `yes'.
324AC_DEFUN(AC_ENABLE_STATIC, [dnl
325define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
326AC_ARG_ENABLE(static,
327changequote(<<, >>)dnl
328<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
329changequote([, ])dnl
330[p=${PACKAGE-default}
331case "$enableval" in
332yes) enable_static=yes ;;
333no) enable_static=no ;;
334*)
335  enable_static=no
336  # Look at the argument we got.  We use all the common list separators.
337  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
338  for pkg in $enableval; do
339    if test "X$pkg" = "X$p"; then
340      enable_static=yes
341    fi
342  done
343  IFS="$ac_save_ifs"
344  ;;
345esac],
346enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
347])
348
349# AC_DISABLE_STATIC - set the default static flag to --disable-static
350AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
351AC_ENABLE_STATIC(no)])
352
353
354# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
355# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
356#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
357#   `yes'.
358AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
359define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
360AC_ARG_ENABLE(fast-install,
361changequote(<<, >>)dnl
362<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
363changequote([, ])dnl
364[p=${PACKAGE-default}
365case "$enableval" in
366yes) enable_fast_install=yes ;;
367no) enable_fast_install=no ;;
368*)
369  enable_fast_install=no
370  # Look at the argument we got.  We use all the common list separators.
371  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
372  for pkg in $enableval; do
373    if test "X$pkg" = "X$p"; then
374      enable_fast_install=yes
375    fi
376  done
377  IFS="$ac_save_ifs"
378  ;;
379esac],
380enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
381])
382
383# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
384AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
385AC_ENABLE_FAST_INSTALL(no)])
386
387# AC_PROG_LD - find the path to the GNU or non-GNU linker
388AC_DEFUN(AC_PROG_LD,
389[AC_ARG_WITH(gnu-ld,
390[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
391test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
392AC_REQUIRE([AC_PROG_CC])dnl
393AC_REQUIRE([AC_CANONICAL_HOST])dnl
394AC_REQUIRE([AC_CANONICAL_BUILD])dnl
395ac_prog=ld
396if test "$ac_cv_prog_gcc" = yes; then
397  # Check if gcc -print-prog-name=ld gives a path.
398  AC_MSG_CHECKING([for ld used by GCC])
399  ac_prog=`($CC -print-prog-name=ld) 2>&5`
400  case "$ac_prog" in
401    # Accept absolute paths.
402changequote(,)dnl
403    [\\/]* | [A-Za-z]:[\\/]*)
404      re_direlt='/[^/][^/]*/\.\./'
405changequote([,])dnl
406      # Canonicalize the path of ld
407      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
408      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
409        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
410      done
411      test -z "$LD" && LD="$ac_prog"
412      ;;
413  "")
414    # If it fails, then pretend we aren't using GCC.
415    ac_prog=ld
416    ;;
417  *)
418    # If it is relative, then search for the first ld in PATH.
419    with_gnu_ld=unknown
420    ;;
421  esac
422elif test "$with_gnu_ld" = yes; then
423  AC_MSG_CHECKING([for GNU ld])
424else
425  AC_MSG_CHECKING([for non-GNU ld])
426fi
427AC_CACHE_VAL(ac_cv_path_LD,
428[if test -z "$LD"; then
429  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
430  for ac_dir in $PATH; do
431    test -z "$ac_dir" && ac_dir=.
432    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
433      ac_cv_path_LD="$ac_dir/$ac_prog"
434      # Check to see if the program is GNU ld.  I'd rather use --version,
435      # but apparently some GNU ld's only accept -v.
436      # Break only if it was the GNU/non-GNU ld that we prefer.
437      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
438        test "$with_gnu_ld" != no && break
439      else
440        test "$with_gnu_ld" != yes && break
441      fi
442    fi
443  done
444  IFS="$ac_save_ifs"
445else
446  ac_cv_path_LD="$LD" # Let the user override the test with a path.
447fi])
448LD="$ac_cv_path_LD"
449if test -n "$LD"; then
450  AC_MSG_RESULT($LD)
451else
452  AC_MSG_RESULT(no)
453fi
454test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
455AC_PROG_LD_GNU
456])
457
458AC_DEFUN(AC_PROG_LD_GNU,
459[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
460[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
461if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
462  ac_cv_prog_gnu_ld=yes
463else
464  ac_cv_prog_gnu_ld=no
465fi])
466])
467
468# AC_PROG_NM - find the path to a BSD-compatible name lister
469AC_DEFUN(AC_PROG_NM,
470[AC_MSG_CHECKING([for BSD-compatible nm])
471AC_CACHE_VAL(ac_cv_path_NM,
472[if test -n "$NM"; then
473  # Let the user override the test.
474  ac_cv_path_NM="$NM"
475else
476  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
477  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
478    test -z "$ac_dir" && ac_dir=.
479    if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
480      # Check to see if the nm accepts a BSD-compat flag.
481      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
482      #   nm: unknown option "B" ignored
483      if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
484        ac_cv_path_NM="$ac_dir/nm -B"
485        break
486      elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
487        ac_cv_path_NM="$ac_dir/nm -p"
488        break
489      else
490        ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
491        continue # so that we can try to find one that supports BSD flags
492      fi
493    fi
494  done
495  IFS="$ac_save_ifs"
496  test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
497fi])
498NM="$ac_cv_path_NM"
499AC_MSG_RESULT([$NM])
500])
501
502# AC_CHECK_LIBM - check for math library
503AC_DEFUN(AC_CHECK_LIBM,
504[AC_REQUIRE([AC_CANONICAL_HOST])dnl
505LIBM=
506case "$lt_target" in
507*-*-beos* | *-*-cygwin*)
508  # These system don't have libm
509  ;;
510*-ncr-sysv4.3*)
511  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
512  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
513  ;;
514*)
515  AC_CHECK_LIB(m, main, LIBM="-lm")
516  ;;
517esac
518])
519
520# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
521# the libltdl convenience library and INCLTDL to the include flags for
522# the libltdl header and adds --enable-ltdl-convenience to the
523# configure arguments.  Note that LIBLTDL and INCLTDL are not
524# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
525# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
526# with '${top_builddir}/' and INCLTDL will be prefixed with
527# '${top_srcdir}/' (note the single quotes!).  If your package is not
528# flat and you're not using automake, define top_builddir and
529# top_srcdir appropriately in the Makefiles.
530AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
531  case "$enable_ltdl_convenience" in
532  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
533  "") enable_ltdl_convenience=yes
534      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
535  esac
536  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
537  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
538])
539
540# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
541# the libltdl installable library and INCLTDL to the include flags for
542# the libltdl header and adds --enable-ltdl-install to the configure
543# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
544# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
545# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
546# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
547# with '${top_srcdir}/' (note the single quotes!).  If your package is
548# not flat and you're not using automake, define top_builddir and
549# top_srcdir appropriately in the Makefiles.
550# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
551AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
552  AC_CHECK_LIB(ltdl, main,
553  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
554  [if test x"$enable_ltdl_install" = xno; then
555     AC_MSG_WARN([libltdl not installed, but installation disabled])
556   else
557     enable_ltdl_install=yes
558   fi
559  ])
560  if test x"$enable_ltdl_install" = x"yes"; then
561    ac_configure_args="$ac_configure_args --enable-ltdl-install"
562    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
563    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
564  else
565    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
566    LIBLTDL="-lltdl"
567    INCLTDL=
568  fi
569])
570
571dnl old names
572AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
573AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
574AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
575AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
576AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
577AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
578AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
579
580dnl This is just to silence aclocal about the macro not being used
581ifelse([AC_DISABLE_FAST_INSTALL])dnl
582
583# Add --enable-maintainer-mode option to configure.
584# From Jim Meyering
585
586# serial 1
587
588AC_DEFUN(AM_MAINTAINER_MODE,
589[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
590  dnl maintainer-mode is disabled by default
591  AC_ARG_ENABLE(maintainer-mode,
592[  --enable-maintainer-mode enable make rules and dependencies not useful
593                          (and sometimes confusing) to the casual installer],
594      USE_MAINTAINER_MODE=$enableval,
595      USE_MAINTAINER_MODE=no)
596  AC_MSG_RESULT($USE_MAINTAINER_MODE)
597  AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
598  MAINT=$MAINTAINER_MODE_TRUE
599  AC_SUBST(MAINT)dnl
600]
601)
602
603# Define a conditional.
604
605AC_DEFUN(AM_CONDITIONAL,
606[AC_SUBST($1_TRUE)
607AC_SUBST($1_FALSE)
608if $2; then
609  $1_TRUE=
610  $1_FALSE='#'
611else
612  $1_TRUE='#'
613  $1_FALSE=
614fi])
615
616# Configure paths for GLIB
617# Owen Taylor     97-11-3
618
619dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
620dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
621dnl gthread is specified in MODULES, pass to glib-config
622dnl
623AC_DEFUN(AM_PATH_GLIB,
624[dnl
625dnl Get the cflags and libraries from the glib-config script
626dnl
627AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
628            glib_config_prefix="$withval", glib_config_prefix="")
629AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
630            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
631AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
632                    , enable_glibtest=yes)
633
634  if test x$glib_config_exec_prefix != x ; then
635     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
636     if test x${GLIB_CONFIG+set} != xset ; then
637        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
638     fi
639  fi
640  if test x$glib_config_prefix != x ; then
641     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
642     if test x${GLIB_CONFIG+set} != xset ; then
643        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
644     fi
645  fi
646
647  for module in . $4
648  do
649      case "$module" in
650         gmodule)
651             glib_config_args="$glib_config_args gmodule"
652         ;;
653         gthread)
654             glib_config_args="$glib_config_args gthread"
655         ;;
656      esac
657  done
658
659  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
660  min_glib_version=ifelse([$1], ,0.99.7,$1)
661  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
662  no_glib=""
663  if test "$GLIB_CONFIG" = "no" ; then
664    no_glib=yes
665  else
666    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
667    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
668    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
669           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
670    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
671           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
672    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
673           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
674    if test "x$enable_glibtest" = "xyes" ; then
675      ac_save_CFLAGS="$CFLAGS"
676      ac_save_LIBS="$LIBS"
677      CFLAGS="$CFLAGS $GLIB_CFLAGS"
678      LIBS="$GLIB_LIBS $LIBS"
679dnl
680dnl Now check if the installed GLIB is sufficiently new. (Also sanity
681dnl checks the results of glib-config to some extent
682dnl
683      rm -f conf.glibtest
684      AC_TRY_RUN([
685#include <glib.h>
686#include <stdio.h>
687#include <stdlib.h>
688
689int
690main ()
691{
692  int major, minor, micro;
693  char *tmp_version;
694
695  system ("touch conf.glibtest");
696
697  /* HP/UX 9 (%@#!) writes to sscanf strings */
698  tmp_version = g_strdup("$min_glib_version");
699  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
700     printf("%s, bad version string\n", "$min_glib_version");
701     exit(1);
702   }
703
704  if ((glib_major_version != $glib_config_major_version) ||
705      (glib_minor_version != $glib_config_minor_version) ||
706      (glib_micro_version != $glib_config_micro_version))
707    {
708      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
709             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
710             glib_major_version, glib_minor_version, glib_micro_version);
711      printf ("*** was found! If glib-config was correct, then it is best\n");
712      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
713      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
714      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
715      printf("*** required on your system.\n");
716      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
717      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
718      printf("*** before re-running configure\n");
719    }
720  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
721           (glib_minor_version != GLIB_MINOR_VERSION) ||
722           (glib_micro_version != GLIB_MICRO_VERSION))
723    {
724      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
725             GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
726      printf("*** library (version %d.%d.%d)\n",
727             glib_major_version, glib_minor_version, glib_micro_version);
728    }
729  else
730    {
731      if ((glib_major_version > major) ||
732        ((glib_major_version == major) && (glib_minor_version > minor)) ||
733        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
734      {
735        return 0;
736       }
737     else
738      {
739        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
740               glib_major_version, glib_minor_version, glib_micro_version);
741        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
742               major, minor, micro);
743        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
744        printf("***\n");
745        printf("*** If you have already installed a sufficiently new version, this error\n");
746        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
747        printf("*** being found. The easiest way to fix this is to remove the old version\n");
748        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
749        printf("*** correct copy of glib-config. (In this case, you will have to\n");
750        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
751        printf("*** so that the correct libraries are found at run-time))\n");
752      }
753    }
754  return 1;
755}
756],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
757       CFLAGS="$ac_save_CFLAGS"
758       LIBS="$ac_save_LIBS"
759     fi
760  fi
761  if test "x$no_glib" = x ; then
762     AC_MSG_RESULT(yes)
763     ifelse([$2], , :, [$2])     
764  else
765     AC_MSG_RESULT(no)
766     if test "$GLIB_CONFIG" = "no" ; then
767       echo "*** The glib-config script installed by GLIB could not be found"
768       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
769       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
770       echo "*** full path to glib-config."
771     else
772       if test -f conf.glibtest ; then
773        :
774       else
775          echo "*** Could not run GLIB test program, checking why..."
776          CFLAGS="$CFLAGS $GLIB_CFLAGS"
777          LIBS="$LIBS $GLIB_LIBS"
778          AC_TRY_LINK([
779#include <glib.h>
780#include <stdio.h>
781],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
782        [ echo "*** The test program compiled, but did not run. This usually means"
783          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
784          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
785          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
786          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
787          echo "*** is required on your system"
788          echo "***"
789          echo "*** If you have an old version installed, it is best to remove it, although"
790          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
791          echo "***"
792          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
793          echo "*** came with the system with the command"
794          echo "***"
795          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
796        [ echo "*** The test program failed to compile or link. See the file config.log for the"
797          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
798          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
799          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
800          CFLAGS="$ac_save_CFLAGS"
801          LIBS="$ac_save_LIBS"
802       fi
803     fi
804     GLIB_CFLAGS=""
805     GLIB_LIBS=""
806     ifelse([$3], , :, [$3])
807  fi
808  AC_SUBST(GLIB_CFLAGS)
809  AC_SUBST(GLIB_LIBS)
810  rm -f conf.glibtest
811])
812
Note: See TracBrowser for help on using the repository browser.