comparison acinclude.m4 @ 73:72b51548aeca

Added libtool stuff.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 25 Sep 2001 16:27:09 +0000
parents 0b53ace8b875
children 6d94441c854e
comparison
equal deleted inserted replaced
72:02bb616ba974 73:72b51548aeca
665 fi 665 fi
666 AC_SUBST(SMPEG_CFLAGS) 666 AC_SUBST(SMPEG_CFLAGS)
667 AC_SUBST(SMPEG_LIBS) 667 AC_SUBST(SMPEG_LIBS)
668 rm -f conf.smpegtest 668 rm -f conf.smpegtest
669 ]) 669 ])
670 ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
671 ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
672 ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
673 ##
674 ## This program is free software; you can redistribute it and/or modify
675 ## it under the terms of the GNU General Public License as published by
676 ## the Free Software Foundation; either version 2 of the License, or
677 ## (at your option) any later version.
678 ##
679 ## This program is distributed in the hope that it will be useful, but
680 ## WITHOUT ANY WARRANTY; without even the implied warranty of
681 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
682 ## General Public License for more details.
683 ##
684 ## You should have received a copy of the GNU General Public License
685 ## along with this program; if not, write to the Free Software
686 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
687 ##
688 ## As a special exception to the GNU General Public License, if you
689 ## distribute this file as part of a program that contains a
690 ## configuration script generated by Autoconf, you may include it under
691 ## the same distribution terms that you use for the rest of that program.
692
693 # serial 40 AC_PROG_LIBTOOL
694 AC_DEFUN(AC_PROG_LIBTOOL,
695 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
696
697 # Save cache, so that ltconfig can load it
698 AC_CACHE_SAVE
699
700 # Actually configure libtool. ac_aux_dir is where install-sh is found.
701 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
702 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
703 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
704 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
705 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
706 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
707 || AC_MSG_ERROR([libtool configure failed])
708
709 # Reload cache, that may have been modified by ltconfig
710 AC_CACHE_LOAD
711
712 # This can be used to rebuild libtool when needed
713 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
714
715 # Always use our own libtool.
716 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
717 AC_SUBST(LIBTOOL)dnl
718
719 # Redirect the config.log output again, so that the ltconfig log is not
720 # clobbered by the next message.
721 exec 5>>./config.log
722 ])
723
724 AC_DEFUN(AC_LIBTOOL_SETUP,
725 [AC_PREREQ(2.13)dnl
726 AC_REQUIRE([AC_ENABLE_SHARED])dnl
727 AC_REQUIRE([AC_ENABLE_STATIC])dnl
728 AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
729 AC_REQUIRE([AC_CANONICAL_HOST])dnl
730 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
731 AC_REQUIRE([AC_PROG_RANLIB])dnl
732 AC_REQUIRE([AC_PROG_CC])dnl
733 AC_REQUIRE([AC_PROG_LD])dnl
734 AC_REQUIRE([AC_PROG_NM])dnl
735 AC_REQUIRE([AC_PROG_LN_S])dnl
736 dnl
737
738 case "$target" in
739 NONE) lt_target="$host" ;;
740 *) lt_target="$target" ;;
741 esac
742
743 # Check for any special flags to pass to ltconfig.
744 libtool_flags="--cache-file=$cache_file"
745 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
746 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
747 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
748 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
749 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
750 ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
751 [libtool_flags="$libtool_flags --enable-dlopen"])
752 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
753 [libtool_flags="$libtool_flags --enable-win32-dll"])
754 AC_ARG_ENABLE(libtool-lock,
755 [ --disable-libtool-lock avoid locking (might break parallel builds)])
756 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
757 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
758
759 # Some flags need to be propagated to the compiler or linker for good
760 # libtool support.
761 case "$lt_target" in
762 *-*-irix6*)
763 # Find out which ABI we are using.
764 echo '[#]line __oline__ "configure"' > conftest.$ac_ext
765 if AC_TRY_EVAL(ac_compile); then
766 case "`/usr/bin/file conftest.o`" in
767 *32-bit*)
768 LD="${LD-ld} -32"
769 ;;
770 *N32*)
771 LD="${LD-ld} -n32"
772 ;;
773 *64-bit*)
774 LD="${LD-ld} -64"
775 ;;
776 esac
777 fi
778 rm -rf conftest*
779 ;;
780
781 *-*-sco3.2v5*)
782 # On SCO OpenServer 5, we need -belf to get full-featured binaries.
783 SAVE_CFLAGS="$CFLAGS"
784 CFLAGS="$CFLAGS -belf"
785 AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
786 [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
787 if test x"$lt_cv_cc_needs_belf" != x"yes"; then
788 # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
789 CFLAGS="$SAVE_CFLAGS"
790 fi
791 ;;
792
793 ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
794 [*-*-cygwin* | *-*-mingw*)
795 AC_CHECK_TOOL(DLLTOOL, dlltool, false)
796 AC_CHECK_TOOL(AS, as, false)
797 AC_CHECK_TOOL(OBJDUMP, objdump, false)
798 ;;
799 ])
800 esac
801 ])
802
803 # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
804 AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
805
806 # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
807 AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
808
809 # AC_ENABLE_SHARED - implement the --enable-shared flag
810 # Usage: AC_ENABLE_SHARED[(DEFAULT)]
811 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
812 # `yes'.
813 AC_DEFUN(AC_ENABLE_SHARED, [dnl
814 define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
815 AC_ARG_ENABLE(shared,
816 changequote(<<, >>)dnl
817 << --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
818 changequote([, ])dnl
819 [p=${PACKAGE-default}
820 case "$enableval" in
821 yes) enable_shared=yes ;;
822 no) enable_shared=no ;;
823 *)
824 enable_shared=no
825 # Look at the argument we got. We use all the common list separators.
826 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
827 for pkg in $enableval; do
828 if test "X$pkg" = "X$p"; then
829 enable_shared=yes
830 fi
831 done
832 IFS="$ac_save_ifs"
833 ;;
834 esac],
835 enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
836 ])
837
838 # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
839 AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
840 AC_ENABLE_SHARED(no)])
841
842 # AC_ENABLE_STATIC - implement the --enable-static flag
843 # Usage: AC_ENABLE_STATIC[(DEFAULT)]
844 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
845 # `yes'.
846 AC_DEFUN(AC_ENABLE_STATIC, [dnl
847 define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
848 AC_ARG_ENABLE(static,
849 changequote(<<, >>)dnl
850 << --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
851 changequote([, ])dnl
852 [p=${PACKAGE-default}
853 case "$enableval" in
854 yes) enable_static=yes ;;
855 no) enable_static=no ;;
856 *)
857 enable_static=no
858 # Look at the argument we got. We use all the common list separators.
859 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
860 for pkg in $enableval; do
861 if test "X$pkg" = "X$p"; then
862 enable_static=yes
863 fi
864 done
865 IFS="$ac_save_ifs"
866 ;;
867 esac],
868 enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
869 ])
870
871 # AC_DISABLE_STATIC - set the default static flag to --disable-static
872 AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
873 AC_ENABLE_STATIC(no)])
874
875
876 # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
877 # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
878 # Where DEFAULT is either `yes' or `no'. If omitted, it defaults to
879 # `yes'.
880 AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
881 define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
882 AC_ARG_ENABLE(fast-install,
883 changequote(<<, >>)dnl
884 << --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
885 changequote([, ])dnl
886 [p=${PACKAGE-default}
887 case "$enableval" in
888 yes) enable_fast_install=yes ;;
889 no) enable_fast_install=no ;;
890 *)
891 enable_fast_install=no
892 # Look at the argument we got. We use all the common list separators.
893 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
894 for pkg in $enableval; do
895 if test "X$pkg" = "X$p"; then
896 enable_fast_install=yes
897 fi
898 done
899 IFS="$ac_save_ifs"
900 ;;
901 esac],
902 enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
903 ])
904
905 # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
906 AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
907 AC_ENABLE_FAST_INSTALL(no)])
908
909 # AC_PROG_LD - find the path to the GNU or non-GNU linker
910 AC_DEFUN(AC_PROG_LD,
911 [AC_ARG_WITH(gnu-ld,
912 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
913 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
914 AC_REQUIRE([AC_PROG_CC])dnl
915 AC_REQUIRE([AC_CANONICAL_HOST])dnl
916 AC_REQUIRE([AC_CANONICAL_BUILD])dnl
917 ac_prog=ld
918 if test "$ac_cv_prog_gcc" = yes; then
919 # Check if gcc -print-prog-name=ld gives a path.
920 AC_MSG_CHECKING([for ld used by GCC])
921 ac_prog=`($CC -print-prog-name=ld) 2>&5`
922 case "$ac_prog" in
923 # Accept absolute paths.
924 changequote(,)dnl
925 [\\/]* | [A-Za-z]:[\\/]*)
926 re_direlt='/[^/][^/]*/\.\./'
927 changequote([,])dnl
928 # Canonicalize the path of ld
929 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
930 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
931 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
932 done
933 test -z "$LD" && LD="$ac_prog"
934 ;;
935 "")
936 # If it fails, then pretend we aren't using GCC.
937 ac_prog=ld
938 ;;
939 *)
940 # If it is relative, then search for the first ld in PATH.
941 with_gnu_ld=unknown
942 ;;
943 esac
944 elif test "$with_gnu_ld" = yes; then
945 AC_MSG_CHECKING([for GNU ld])
946 else
947 AC_MSG_CHECKING([for non-GNU ld])
948 fi
949 AC_CACHE_VAL(ac_cv_path_LD,
950 [if test -z "$LD"; then
951 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
952 for ac_dir in $PATH; do
953 test -z "$ac_dir" && ac_dir=.
954 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
955 ac_cv_path_LD="$ac_dir/$ac_prog"
956 # Check to see if the program is GNU ld. I'd rather use --version,
957 # but apparently some GNU ld's only accept -v.
958 # Break only if it was the GNU/non-GNU ld that we prefer.
959 if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
960 test "$with_gnu_ld" != no && break
961 else
962 test "$with_gnu_ld" != yes && break
963 fi
964 fi
965 done
966 IFS="$ac_save_ifs"
967 else
968 ac_cv_path_LD="$LD" # Let the user override the test with a path.
969 fi])
970 LD="$ac_cv_path_LD"
971 if test -n "$LD"; then
972 AC_MSG_RESULT($LD)
973 else
974 AC_MSG_RESULT(no)
975 fi
976 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
977 AC_PROG_LD_GNU
978 ])
979
980 AC_DEFUN(AC_PROG_LD_GNU,
981 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
982 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
983 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
984 ac_cv_prog_gnu_ld=yes
985 else
986 ac_cv_prog_gnu_ld=no
987 fi])
988 ])
989
990 # AC_PROG_NM - find the path to a BSD-compatible name lister
991 AC_DEFUN(AC_PROG_NM,
992 [AC_MSG_CHECKING([for BSD-compatible nm])
993 AC_CACHE_VAL(ac_cv_path_NM,
994 [if test -n "$NM"; then
995 # Let the user override the test.
996 ac_cv_path_NM="$NM"
997 else
998 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
999 for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
1000 test -z "$ac_dir" && ac_dir=.
1001 if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
1002 # Check to see if the nm accepts a BSD-compat flag.
1003 # Adding the `sed 1q' prevents false positives on HP-UX, which says:
1004 # nm: unknown option "B" ignored
1005 if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1006 ac_cv_path_NM="$ac_dir/nm -B"
1007 break
1008 elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
1009 ac_cv_path_NM="$ac_dir/nm -p"
1010 break
1011 else
1012 ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
1013 continue # so that we can try to find one that supports BSD flags
1014 fi
1015 fi
1016 done
1017 IFS="$ac_save_ifs"
1018 test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
1019 fi])
1020 NM="$ac_cv_path_NM"
1021 AC_MSG_RESULT([$NM])
1022 ])
1023
1024 # AC_CHECK_LIBM - check for math library
1025 AC_DEFUN(AC_CHECK_LIBM,
1026 [AC_REQUIRE([AC_CANONICAL_HOST])dnl
1027 LIBM=
1028 case "$lt_target" in
1029 *-*-beos* | *-*-cygwin*)
1030 # These system don't have libm
1031 ;;
1032 *-ncr-sysv4.3*)
1033 AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
1034 AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
1035 ;;
1036 *)
1037 AC_CHECK_LIB(m, main, LIBM="-lm")
1038 ;;
1039 esac
1040 ])
1041
1042 # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
1043 # the libltdl convenience library and INCLTDL to the include flags for
1044 # the libltdl header and adds --enable-ltdl-convenience to the
1045 # configure arguments. Note that LIBLTDL and INCLTDL are not
1046 # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
1047 # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
1048 # with '${top_builddir}/' and INCLTDL will be prefixed with
1049 # '${top_srcdir}/' (note the single quotes!). If your package is not
1050 # flat and you're not using automake, define top_builddir and
1051 # top_srcdir appropriately in the Makefiles.
1052 AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1053 case "$enable_ltdl_convenience" in
1054 no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
1055 "") enable_ltdl_convenience=yes
1056 ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
1057 esac
1058 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
1059 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1060 ])
1061
1062 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
1063 # the libltdl installable library and INCLTDL to the include flags for
1064 # the libltdl header and adds --enable-ltdl-install to the configure
1065 # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
1066 # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
1067 # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
1068 # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
1069 # with '${top_srcdir}/' (note the single quotes!). If your package is
1070 # not flat and you're not using automake, define top_builddir and
1071 # top_srcdir appropriately in the Makefiles.
1072 # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
1073 AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
1074 AC_CHECK_LIB(ltdl, main,
1075 [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
1076 [if test x"$enable_ltdl_install" = xno; then
1077 AC_MSG_WARN([libltdl not installed, but installation disabled])
1078 else
1079 enable_ltdl_install=yes
1080 fi
1081 ])
1082 if test x"$enable_ltdl_install" = x"yes"; then
1083 ac_configure_args="$ac_configure_args --enable-ltdl-install"
1084 LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
1085 INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
1086 else
1087 ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
1088 LIBLTDL="-lltdl"
1089 INCLTDL=
1090 fi
1091 ])
1092
1093 dnl old names
1094 AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
1095 AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
1096 AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
1097 AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
1098 AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
1099 AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
1100 AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
1101
1102 dnl This is just to silence aclocal about the macro not being used
1103 ifelse([AC_DISABLE_FAST_INSTALL])dnl