home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / System / Mesa-3.1 / acinclude.m4 < prev    next >
Text File  |  1999-08-18  |  14KB  |  405 lines

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