Annotation of parser3/src/lib/ltdl/acinclude.m4, revision 1.1
1.1 ! paf 1: ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
! 2: ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
! 3: ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
! 4: ##
! 5: ## This program is free software; you can redistribute it and/or modify
! 6: ## it under the terms of the GNU General Public License as published by
! 7: ## the Free Software Foundation; either version 2 of the License, or
! 8: ## (at your option) any later version.
! 9: ##
! 10: ## This program is distributed in the hope that it will be useful, but
! 11: ## WITHOUT ANY WARRANTY; without even the implied warranty of
! 12: ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! 13: ## General Public License for more details.
! 14: ##
! 15: ## You should have received a copy of the GNU General Public License
! 16: ## along with this program; if not, write to the Free Software
! 17: ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
! 18: ##
! 19: ## As a special exception to the GNU General Public License, if you
! 20: ## distribute this file as part of a program that contains a
! 21: ## configuration script generated by Autoconf, you may include it under
! 22: ## the same distribution terms that you use for the rest of that program.
! 23: ##
! 24: ## plus fake AC_PROG_LIBTOOL by PAF@design.ru
! 25:
! 26:
! 27: # serial 40 AC_PROG_LIBTOOL
! 28: AC_DEFUN(AC_PROG_LIBTOOL,
! 29: [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
! 30:
! 31: # Always use rootdir libtool.
! 32: LIBTOOL=paf-dont-use-libtool
! 33: AC_SUBST(LIBTOOL)dnl
! 34: ])
! 35:
! 36: AC_DEFUN(AC_LIBTOOL_SETUP,
! 37: [AC_PREREQ(2.13)dnl
! 38: AC_REQUIRE([AC_ENABLE_SHARED])dnl
! 39: AC_REQUIRE([AC_ENABLE_STATIC])dnl
! 40: AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
! 41: AC_REQUIRE([AC_CANONICAL_HOST])dnl
! 42: AC_REQUIRE([AC_CANONICAL_BUILD])dnl
! 43: AC_REQUIRE([AC_PROG_RANLIB])dnl
! 44: AC_REQUIRE([AC_PROG_CC])dnl
! 45: AC_REQUIRE([AC_PROG_LD])dnl
! 46: AC_REQUIRE([AC_PROG_NM])dnl
! 47: AC_REQUIRE([AC_PROG_LN_S])dnl
! 48: dnl
! 49:
! 50: case "$target" in
! 51: NONE) lt_target="$host" ;;
! 52: *) lt_target="$target" ;;
! 53: esac
! 54:
! 55: # Check for any special flags to pass to ltconfig.
! 56: libtool_flags="--cache-file=$cache_file"
! 57: test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
! 58: test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
! 59: test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
! 60: test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
! 61: test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
! 62: ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
! 63: [libtool_flags="$libtool_flags --enable-dlopen"])
! 64: ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
! 65: [libtool_flags="$libtool_flags --enable-win32-dll"])
! 66: AC_ARG_ENABLE(libtool-lock,
! 67: [ --disable-libtool-lock avoid locking (might break parallel builds)])
! 68: test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
! 69: test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
! 70:
! 71: # Some flags need to be propagated to the compiler or linker for good
! 72: # libtool support.
! 73: case "$lt_target" in
! 74: *-*-irix6*)
! 75: # Find out which ABI we are using.
! 76: echo '[#]line __oline__ "configure"' > conftest.$ac_ext
! 77: if AC_TRY_EVAL(ac_compile); then
! 78: case "`/usr/bin/file conftest.o`" in
! 79: *32-bit*)
! 80: LD="${LD-ld} -32"
! 81: ;;
! 82: *N32*)
! 83: LD="${LD-ld} -n32"
! 84: ;;
! 85: *64-bit*)
! 86: LD="${LD-ld} -64"
! 87: ;;
! 88: esac
! 89: fi
! 90: rm -rf conftest*
! 91: ;;
! 92:
! 93: *-*-sco3.2v5*)
! 94: # On SCO OpenServer 5, we need -belf to get full-featured binaries.
! 95: SAVE_CFLAGS="$CFLAGS"
! 96: CFLAGS="$CFLAGS -belf"
! 97: AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
! 98: [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
! 99: if test x"$lt_cv_cc_needs_belf" != x"yes"; then
! 100: # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
! 101: CFLAGS="$SAVE_CFLAGS"
! 102: fi
! 103: ;;
! 104:
! 105: ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
! 106: [*-*-cygwin* | *-*-mingw*)
! 107: AC_CHECK_TOOL(DLLTOOL, dlltool, false)
! 108: AC_CHECK_TOOL(AS, as, false)
! 109: AC_CHECK_TOOL(OBJDUMP, objdump, false)
! 110: ;;
! 111: ])
! 112: esac
! 113: ])
! 114:
! 115: # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
! 116: AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
! 117:
! 118: # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
! 119: AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
! 120:
! 121: # AC_ENABLE_SHARED - implement the --enable-shared flag
! 122: # Usage: AC_ENABLE_SHARED[(DEFAULT)]
! 123: # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
! 124: # `yes'.
! 125: AC_DEFUN(AC_ENABLE_SHARED, [dnl
! 126: define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
! 127: AC_ARG_ENABLE(shared,
! 128: changequote(<<, >>)dnl
! 129: << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
! 130: changequote([, ])dnl
! 131: [p=${PACKAGE-default}
! 132: case "$enableval" in
! 133: yes) enable_shared=yes ;;
! 134: no) enable_shared=no ;;
! 135: *)
! 136: enable_shared=no
! 137: # Look at the argument we got. We use all the common list separators.
! 138: IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
! 139: for pkg in $enableval; do
! 140: if test "X$pkg" = "X$p"; then
! 141: enable_shared=yes
! 142: fi
! 143: done
! 144: IFS="$ac_save_ifs"
! 145: ;;
! 146: esac],
! 147: enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
! 148: ])
! 149:
! 150: # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
! 151: AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
! 152: AC_ENABLE_SHARED(no)])
! 153:
! 154: # AC_ENABLE_STATIC - implement the --enable-static flag
! 155: # Usage: AC_ENABLE_STATIC[(DEFAULT)]
! 156: # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
! 157: # `yes'.
! 158: AC_DEFUN(AC_ENABLE_STATIC, [dnl
! 159: define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
! 160: AC_ARG_ENABLE(static,
! 161: changequote(<<, >>)dnl
! 162: << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
! 163: changequote([, ])dnl
! 164: [p=${PACKAGE-default}
! 165: case "$enableval" in
! 166: yes) enable_static=yes ;;
! 167: no) enable_static=no ;;
! 168: *)
! 169: enable_static=no
! 170: # Look at the argument we got. We use all the common list separators.
! 171: IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
! 172: for pkg in $enableval; do
! 173: if test "X$pkg" = "X$p"; then
! 174: enable_static=yes
! 175: fi
! 176: done
! 177: IFS="$ac_save_ifs"
! 178: ;;
! 179: esac],
! 180: enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
! 181: ])
! 182:
! 183: # AC_DISABLE_STATIC - set the default static flag to --disable-static
! 184: AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
! 185: AC_ENABLE_STATIC(no)])
! 186:
! 187:
! 188: # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
! 189: # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
! 190: # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
! 191: # `yes'.
! 192: AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
! 193: define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
! 194: AC_ARG_ENABLE(fast-install,
! 195: changequote(<<, >>)dnl
! 196: << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
! 197: changequote([, ])dnl
! 198: [p=${PACKAGE-default}
! 199: case "$enableval" in
! 200: yes) enable_fast_install=yes ;;
! 201: no) enable_fast_install=no ;;
! 202: *)
! 203: enable_fast_install=no
! 204: # Look at the argument we got. We use all the common list separators.
! 205: IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
! 206: for pkg in $enableval; do
! 207: if test "X$pkg" = "X$p"; then
! 208: enable_fast_install=yes
! 209: fi
! 210: done
! 211: IFS="$ac_save_ifs"
! 212: ;;
! 213: esac],
! 214: enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
! 215: ])
! 216:
! 217: # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
! 218: AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
! 219: AC_ENABLE_FAST_INSTALL(no)])
! 220:
! 221: # AC_PROG_LD - find the path to the GNU or non-GNU linker
! 222: AC_DEFUN(AC_PROG_LD,
! 223: [AC_ARG_WITH(gnu-ld,
! 224: [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
! 225: test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
! 226: AC_REQUIRE([AC_PROG_CC])dnl
! 227: AC_REQUIRE([AC_CANONICAL_HOST])dnl
! 228: AC_REQUIRE([AC_CANONICAL_BUILD])dnl
! 229: ac_prog=ld
! 230: if test "$ac_cv_prog_gcc" = yes; then
! 231: # Check if gcc -print-prog-name=ld gives a path.
! 232: AC_MSG_CHECKING([for ld used by GCC])
! 233: ac_prog=`($CC -print-prog-name=ld) 2>&5`
! 234: case "$ac_prog" in
! 235: # Accept absolute paths.
! 236: changequote(,)dnl
! 237: [\\/]* | [A-Za-z]:[\\/]*)
! 238: re_direlt='/[^/][^/]*/\.\./'
! 239: changequote([,])dnl
! 240: # Canonicalize the path of ld
! 241: ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
! 242: while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
! 243: ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
! 244: done
! 245: test -z "$LD" && LD="$ac_prog"
! 246: ;;
! 247: "")
! 248: # If it fails, then pretend we aren't using GCC.
! 249: ac_prog=ld
! 250: ;;
! 251: *)
! 252: # If it is relative, then search for the first ld in PATH.
! 253: with_gnu_ld=unknown
! 254: ;;
! 255: esac
! 256: elif test "$with_gnu_ld" = yes; then
! 257: AC_MSG_CHECKING([for GNU ld])
! 258: else
! 259: AC_MSG_CHECKING([for non-GNU ld])
! 260: fi
! 261: AC_CACHE_VAL(ac_cv_path_LD,
! 262: [if test -z "$LD"; then
! 263: IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
! 264: for ac_dir in $PATH; do
! 265: test -z "$ac_dir" && ac_dir=.
! 266: if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
! 267: ac_cv_path_LD="$ac_dir/$ac_prog"
! 268: # Check to see if the program is GNU ld. I'd rather use --version,
! 269: # but apparently some GNU ld's only accept -v.
! 270: # Break only if it was the GNU/non-GNU ld that we prefer.
! 271: if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
! 272: test "$with_gnu_ld" != no && break
! 273: else
! 274: test "$with_gnu_ld" != yes && break
! 275: fi
! 276: fi
! 277: done
! 278: IFS="$ac_save_ifs"
! 279: else
! 280: ac_cv_path_LD="$LD" # Let the user override the test with a path.
! 281: fi])
! 282: LD="$ac_cv_path_LD"
! 283: if test -n "$LD"; then
! 284: AC_MSG_RESULT($LD)
! 285: else
! 286: AC_MSG_RESULT(no)
! 287: fi
! 288: test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
! 289: AC_PROG_LD_GNU
! 290: ])
! 291:
! 292: AC_DEFUN(AC_PROG_LD_GNU,
! 293: [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
! 294: [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
! 295: if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
! 296: ac_cv_prog_gnu_ld=yes
! 297: else
! 298: ac_cv_prog_gnu_ld=no
! 299: fi])
! 300: ])
! 301:
! 302: # AC_PROG_NM - find the path to a BSD-compatible name lister
! 303: AC_DEFUN(AC_PROG_NM,
! 304: [AC_MSG_CHECKING([for BSD-compatible nm])
! 305: AC_CACHE_VAL(ac_cv_path_NM,
! 306: [if test -n "$NM"; then
! 307: # Let the user override the test.
! 308: ac_cv_path_NM="$NM"
! 309: else
! 310: IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
! 311: for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
! 312: test -z "$ac_dir" && ac_dir=.
! 313: if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
! 314: # Check to see if the nm accepts a BSD-compat flag.
! 315: # Adding the `sed 1q' prevents false positives on HP-UX, which says:
! 316: # nm: unknown option "B" ignored
! 317: if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
! 318: ac_cv_path_NM="$ac_dir/nm -B"
! 319: break
! 320: elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
! 321: ac_cv_path_NM="$ac_dir/nm -p"
! 322: break
! 323: else
! 324: ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
! 325: continue # so that we can try to find one that supports BSD flags
! 326: fi
! 327: fi
! 328: done
! 329: IFS="$ac_save_ifs"
! 330: test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
! 331: fi])
! 332: NM="$ac_cv_path_NM"
! 333: AC_MSG_RESULT([$NM])
! 334: ])
! 335:
! 336: # AC_CHECK_LIBM - check for math library
! 337: AC_DEFUN(AC_CHECK_LIBM,
! 338: [AC_REQUIRE([AC_CANONICAL_HOST])dnl
! 339: LIBM=
! 340: case "$lt_target" in
! 341: *-*-beos* | *-*-cygwin*)
! 342: # These system don't have libm
! 343: ;;
! 344: *-ncr-sysv4.3*)
! 345: AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
! 346: AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
! 347: ;;
! 348: *)
! 349: AC_CHECK_LIB(m, main, LIBM="-lm")
! 350: ;;
! 351: esac
! 352: ])
! 353:
! 354: # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
! 355: # the libltdl convenience library and INCLTDL to the include flags for
! 356: # the libltdl header and adds --enable-ltdl-convenience to the
! 357: # configure arguments. Note that LIBLTDL and INCLTDL are not
! 358: # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
! 359: # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
! 360: # with '${top_builddir}/' and INCLTDL will be prefixed with
! 361: # '${top_srcdir}/' (note the single quotes!). If your package is not
! 362: # flat and you're not using automake, define top_builddir and
! 363: # top_srcdir appropriately in the Makefiles.
! 364: AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
! 365: case "$enable_ltdl_convenience" in
! 366: no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
! 367: "") enable_ltdl_convenience=yes
! 368: ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
! 369: esac
! 370: LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
! 371: INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
! 372: ])
! 373:
! 374: # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
! 375: # the libltdl installable library and INCLTDL to the include flags for
! 376: # the libltdl header and adds --enable-ltdl-install to the configure
! 377: # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
! 378: # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
! 379: # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
! 380: # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
! 381: # with '${top_srcdir}/' (note the single quotes!). If your package is
! 382: # not flat and you're not using automake, define top_builddir and
! 383: # top_srcdir appropriately in the Makefiles.
! 384: # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
! 385: AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
! 386: AC_CHECK_LIB(ltdl, main,
! 387: [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
! 388: [if test x"$enable_ltdl_install" = xno; then
! 389: AC_MSG_WARN([libltdl not installed, but installation disabled])
! 390: else
! 391: enable_ltdl_install=yes
! 392: fi
! 393: ])
! 394: if test x"$enable_ltdl_install" = x"yes"; then
! 395: ac_configure_args="$ac_configure_args --enable-ltdl-install"
! 396: LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
! 397: INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
! 398: else
! 399: ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
! 400: LIBLTDL="-lltdl"
! 401: INCLTDL=
! 402: fi
! 403: ])
! 404:
! 405: dnl old names
! 406: AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
! 407: AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
! 408: AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
! 409: AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
! 410: AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
! 411: AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
! 412: AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
! 413:
! 414: dnl This is just to silence aclocal about the macro not being used
! 415: ifelse([AC_DISABLE_FAST_INSTALL])dnl
E-mail: