📄 aclocal.m4
字号:
irix*) ac_symcode='[BCDEGRST]' ;;solaris*) ac_symcode='[BDT]' ;;esac# If we're using GNU nm, then use its standard symbol codes.if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then ac_symcode='[ABCDGISTW]'fichangequote([,])dnl# Try without a prefix undercore, then with it.for ac_symprfx in "" "_"; do ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'" # Check to see that the pipe works correctly. ac_pipe_works=no rm -f conftest.$ac_ext cat > conftest.$ac_ext <<EOF#ifdef __cplusplusextern "C" {#endifchar nm_test_var;void nm_test_func(){}#ifdef __cplusplus}#endifint main(){nm_test_var='a';nm_test_func;return 0;}EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # Try sorting and uniquifying the output. if sort "$ac_nlist" | uniq > "$ac_nlist"T; then mv -f "$ac_nlist"T "$ac_nlist" else rm -f "$ac_nlist"T fi # Make sure that we snagged all the symbols we need. if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then cat <<EOF > conftest.c#ifdef __cplusplusextern "C" {#endifEOF # Now generate the symbol file. eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c' cat <<EOF >> conftest.c#if defined (__STDC__) && __STDC__# define lt_ptr_t void *#else# define lt_ptr_t char *# define const#endif/* The mapping between symbol names and symbols. */const struct { const char *name; lt_ptr_t address;}changequote(,)dnllt_preloaded_symbols[] =changequote([,])dnl{EOF sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c cat <<\EOF >> conftest.c {0, (lt_ptr_t) 0}};#ifdef __cplusplus}#endifEOF # Now try linking the two files. mv conftest.$ac_objext conftestm.$ac_objext ac_save_LIBS="$LIBS" ac_save_CFLAGS="$CFLAGS" LIBS="conftestm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if AC_TRY_EVAL(ac_link) && test -s conftest; then ac_pipe_works=yes else echo "configure: failed program was:" >&AC_FD_CC cat conftest.c >&AC_FD_CC fi LIBS="$ac_save_LIBS" CFLAGS="$ac_save_CFLAGS" else echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC fi else echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC fi else echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC fi else echo "$progname: failed program was:" >&AC_FD_CC cat conftest.c >&AC_FD_CC fi rm -rf conftest* # Do not use the global_symbol_pipe unless it works. if test "$ac_pipe_works" = yes; then if test x"$ac_symprfx" = x"_"; then ac_cv_sys_symbol_underscore=yes else ac_cv_sys_symbol_underscore=no fi break else ac_cv_sys_global_symbol_pipe= fidone])ac_result=yesif test -z "$ac_cv_sys_global_symbol_pipe"; then ac_result=nofiAC_MSG_RESULT($ac_result)])# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwinAC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,[AC_CHECK_TOOL(DLLTOOL, dlltool, false)AC_CHECK_TOOL(AS, as, false)])# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols# with an underscore?AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,[AC_REQUIRE([AC_PROG_NM])dnlAC_REQUIRE([AC_SYS_NM_PARSE])dnlAC_MSG_CHECKING([for _ prefix in compiled symbols])AC_CACHE_VAL(ac_cv_sys_symbol_underscore,[ac_cv_sys_symbol_underscore=nocat > conftest.$ac_ext <<EOFvoid nm_test_func(){}int main(){nm_test_func;return 0;}EOFif AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. ac_nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then # See whether the symbols have a leading underscore. if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then ac_cv_sys_symbol_underscore=yes else if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then : else echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC fi fi else echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC fielse echo "configure: failed program was:" >&AC_FD_CC cat conftest.c >&AC_FD_CCfirm -rf conftest*])AC_MSG_RESULT($ac_cv_sys_symbol_underscore)USE_SYMBOL_UNDERSCORE=${ac_cv_sys_symbol_underscore=no}AC_SUBST(USE_SYMBOL_UNDERSCORE)dnl])# AC_CHECK_LIBM - check for math libraryAC_DEFUN(AC_CHECK_LIBM, [AC_CHECK_LIB(mw, _mwvalidcheckl)AC_CHECK_LIB(m, cos)])# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for# the libltdl convenience library, adds --enable-ltdl-convenience to# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed# to be `${top_builddir}/libltdl'. Make sure you start DIR with# '${top_builddir}/' (note the single quotes!) if your package is not# flat, and, if you're not using automake, define top_builddir as# appropriate in the Makefiles.AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [ case "$enable_ltdl_convenience" in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la])# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for# the libltdl installable library, and adds --enable-ltdl-install to# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed# to be `${top_builddir}/libltdl'. Make sure you start DIR with# '${top_builddir}/' (note the single quotes!) if your package is not# flat, and, if you're not using automake, define top_builddir as# appropriate in the Makefiles.# In the future, this macro may have to be called after AC_PROG_LIBTOOL.AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [ AC_CHECK_LIB(ltdl, main, LIBLTDL="-lltdl", [ case "$enable_ltdl_install" in no) AC_MSG_WARN([libltdl not installed, but installation disabled]) ;; "") enable_ltdl_install=yes ac_configure_args="$ac_configure_args --enable-ltdl-install" ;; esac ]) if test x"$enable_ltdl_install" != x"no"; then LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la fi])dnl old namesAC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnlAC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnlAC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnlAC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnlAC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnlAC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnlAC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnlAC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnlAC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnlAC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnldnl ----------------------------------------------------------------------dnl Amygdala checksAC_DEFUN(AMYG_SET_PREFIX,[ unset CDPATH if test "x$prefix" = "xNONE"; then prefix=$ac_default_prefix ac_configure_args="$ac_configure_args --prefix $prefix" fi])dnl Based on aclocal.m4 from KDevelop 2.0.1dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variablesdnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])dnl it's all white-space separatedAC_DEFUN(AC_REMOVE_FORBIDDEN,[ __val=$$1 __forbid=" $2 " if test -n "$__val"; then __new="" ac_save_IFS=$IFS IFS=" " for i in $__val; do case "$__forbid" in *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;; *) # Careful to not add spaces, where there were none, because otherwise # libtool gets confused, if we change e.g. CXX if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;; esac done IFS=$ac_save_IFS $1=$__new fi])dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have givenAC_DEFUN(AC_VALIDIFY_CXXFLAGS,[dnl AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath]) AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])])AC_DEFUN(AMYG_ADD_DEPENDENCIES,[ [A]M_DEPENDENCIES(CC) [A]M_DEPENDENCIES(CXX)])AC_DEFUN(AMYG_CHECK_COMPILER_FLAG,[ dnl AC_REQUIRE([AC_CHECK_COMPILERS]) <- breaks with autoconf 2.50 AC_MSG_CHECKING(whether $CXX supports -$1) amyg_cache=`echo $1 | sed 'y%.=/+-%___p_%'` AC_CACHE_VAL(amyg_cv_prog_cxx_$amyg_cache, [ echo 'int main() { return 0; }' >conftest.cc eval "amyg_cv_prog_cxx_$amyg_cache=no" if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then eval "amyg_cv_prog_cxx_$amyg_cache=yes" fi fi rm -f conftest* ]) if eval "test \"`echo '$amyg_cv_prog_cxx_'$amyg_cache`\" = yes"; then AC_MSG_RESULT(yes) : $2 else AC_MSG_RESULT(no) : $3 fi])AC_DEFUN(AC_CHECK_COMPILERS,[ AC_ARG_ENABLE(debug,[ --enable-debug enables debug symbols [default=no]], [ if test $enableval = "no"; dnl then amyg_use_debug_code="no" amyg_use_debug_define="yes" else amyg_use_debug_code="yes" amyg_use_debug_define="no" fi ], [amyg_use_debug_code="no" amyg_use_debug_define="no" ]) dnl Just for configure --help AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[]) dnl enable-strict is not yet implemented, but left in place for future (possible) development AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)], [ if test $enableval = "no"; then amyg_use_strict_options="no" else amyg_use_strict_options="yes" fi ], [amyg_use_strict_options="no"]) AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]], [amyg_use_profiling=$enableval], [amyg_use_profiling="no"] ) AC_ARG_ENABLE(optimize,[ --enable-optimize enables optimization flag [default=no]], [amyg_use_optimize=$enableval], [amyg_use_optimize="no"] ) AC_ARG_ENABLE(expensive,[ --enable-expensive enables expensive optimizations [default=no]], [amyg_use_expensive=$enableval], [amyg_use_expensive="no"] ) dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS CFLAGS=" $CFLAGS" AC_PROG_CC if test "$GCC" = "yes"; then if test "$amyg_use_debug_code" = "yes"; then CFLAGS="-g $CFLAGS" case $host in *-*-linux-gnu) CFLAGS="-ansi -W -Wall -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS" ;; esac else CFLAGS="-O2 $CFLAGS" fi fi if test "$amyg_use_debug_define" = "yes"; then CFLAGS="-DNDEBUG $CFLAGS" fi case "$host" in *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -