📄 aclocal.m4
字号:
dnl ##dnl ## GNU Pth - The GNU Portable Threadsdnl ## Copyright (c) 1999-2004 Ralf S. Engelschall <rse@engelschall.com>dnl ##dnl ## This file is part of GNU Pth, a non-preemptive thread schedulingdnl ## library which can be found at http://www.gnu.org/software/pth/.dnl ##dnl ## This library is free software; you can redistribute it and/ordnl ## modify it under the terms of the GNU Lesser General Publicdnl ## License as published by the Free Software Foundation; eitherdnl ## version 2.1 of the License, or (at your option) any later version.dnl ##dnl ## This library is distributed in the hope that it will be useful,dnl ## but WITHOUT ANY WARRANTY; without even the implied warranty ofdnl ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUdnl ## Lesser General Public License for more details.dnl ##dnl ## You should have received a copy of the GNU Lesser General Publicdnl ## License along with this library; if not, write to the Free Softwarednl ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307dnl ## USA, or contact Ralf S. Engelschall <rse@engelschall.com>.dnl ##dnl ## aclocal.m4: Pth Autoconf macrosdnl ## dnl # ``"Reuse an expert's code" is the right dnl # advice for most people. But it's a useless dnl # advice for the experts writing the code dnl # in the first place.' dnl # -- Dan J. Bernsteindnl ##dnl ## Display Configuration Headersdnl ##dnl ## configure.ac:dnl ## AC_MSG_PART(<text>)dnl ##m4_define(AC_MSG_PART,[dnlif test ".$enable_subdir" != .yes; then AC_MSG_RESULT() AC_MSG_RESULT(${TB}$1:${TN})fi])dnldnl ##dnl ## Display a message under --verbosednl ##dnl ## configure.ac:dnl ## AC_MSG_VERBOSE(<text>)dnl ##m4_define(AC_MSG_VERBOSE,[dnlif test ".$verbose" = .yes; then AC_MSG_RESULT([ $1])fi])dnl ##dnl ## Do not display message for a commanddnl ##dnl ## configure.ac:dnl ## AC_MSG_SILENT(...)dnl ##m4_define(AC_FD_TMP, 9)m4_define(AC_MSG_SILENT,[dnlexec AC_FD_TMP>&AC_FD_MSG AC_FD_MSG>/dev/null$1exec AC_FD_MSG>&AC_FD_TMP AC_FD_TMP>&-])dnl ##dnl ## Perform something only oncednl ##dnl ## configure.ac:dnl ## AC_ONCE(<action>)dnl ##m4_define(AC_ONCE,[ifelse(ac_once_$1, already_done, ,[ m4_define(ac_once_$1, already_done) $2])dnl])dnl ##dnl ## Support for $(S)dnl ##dnl ## configure.ac:dnl ## AC_SRCDIR_PREFIX(<varname>)dnl ##AC_DEFUN(AC_SRCDIR_PREFIX,[ac_prog=[$]0changequote(, )dnlac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'`changequote([, ])dnlif test ".$ac_srcdir" = ".$ac_prog"; then ac_srcdir=""elif test "x$ac_srcdir" = "x."; then ac_srcdir=""else if test ".$CFLAGS" = .; then CFLAGS="-I$ac_srcdir" else CFLAGS="$CFLAGS -I$ac_srcdir" fi ac_srcdir="$ac_srcdir/"fi$1="$ac_srcdir"AC_SUBST($1)])dnldnl ##dnl ## Support for --enable-subdir (for use with pth.m4)dnl ##dnl ## configure.ac:dnl ## AC_ENABLESUBDIRdnl ##AC_DEFUN(AC_ENABLESUBDIR,[AC_ARG_ENABLE(subdir,dnl[ --enable-subdir enable local building as subdirectory (default=no)],[dnl],[dnlenable_subdir=no])dnlif test ".$enable_subdir" = .yes; then enable_batch=yes enable_shared=nofi])dnldnl ##dnl ## Support for Configuration Headersdnl ##dnl ## configure.ac:dnl ## AC_HEADLINE(<short-name>, <long-name>,dnl ## <vers-var>, <vers-file>,dnl ## <copyright>)dnl ##AC_DEFUN(AC_HEADLINE,[dnl# configuration headerif test ".`echo dummy [$]@ | grep enable-subdir`" != .; then enable_subdir=yesfiif test ".`echo dummy [$]@ | grep help`" = .; then # bootstrapping shtool ac_prog=[$]0changequote(, )dnl ac_srcdir=`echo $ac_prog | sed -e 's%/[^/][^/]*$%%' -e 's%\([^/]\)/*$%\1%'`changequote([, ])dnl test ".$ac_srcdir" = ".$ac_prog" && ac_srcdir=. ac_shtool="${CONFIG_SHELL-/bin/sh} $ac_srcdir/shtool" # find out terminal sequences if test ".$enable_subdir" != .yes; then TB=`$ac_shtool echo -n -e %B 2>/dev/null` TN=`$ac_shtool echo -n -e %b 2>/dev/null` else TB='' TN='' fi # find out package version $3_STR="`$ac_shtool version -lc -dlong $ac_srcdir/$4`" AC_SUBST($3_STR) # friendly header ;) if test ".$enable_subdir" != .yes; then echo "Configuring ${TB}$1${TN} ($2), Version ${TB}${$3_STR}${TN}" echo "$5" fi # additionally find out hex version $3_HEX="`$ac_shtool version -lc -dhex $ac_srcdir/$4`" AC_SUBST($3_HEX)fi])dnldnl ##dnl ## Support for Platform IDsdnl ##dnl ## configure.ac:dnl ## AC_PLATFORM(<variable>)dnl ##AC_DEFUN(AC_PLATFORM,[if test ".$host" != .; then $1="$host"else $1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.guess`fi$1=`${CONFIG_SHELL-/bin/sh} $srcdir/config.sub $$1` || exit 1AC_SUBST($1)if test ".$enable_subdir" != .yes; then echo "Platform: ${TB}${$1}${TN}"fi])dnldnl ##dnl ## Support for config.param filesdnl ##dnl ## configure.ac:dnl ## AC_CONFIG_PARAM(<file>)dnl ##AC_DEFUN(AC_CONFIG_PARAM,[AC_DIVERT_PUSH(-1)AC_ARG_WITH(param,[ --with-param=ID[[,ID,..]] load parameters from $1])AC_DIVERT_POP()AC_DIVERT_PUSH(NOTICE)ac_prev=""ac_param=""if test -f $1; then ac_param="$1:common"fifor ac_optiondo if test ".$ac_prev" != .; then eval "$ac_prev=\$ac_option" ac_prev="" continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[[-_a-zA-Z0-9]]*=//'` ;; *) ac_optarg="" ;; esac case "$ac_option" in --with-param=* ) case $ac_optarg in *:* ) ac_from=`echo $ac_optarg | sed -e 's/:.*//'` ac_what=`echo $ac_optarg | sed -e 's/.*://'` ;; * ) ac_from="$1" ac_what="$ac_optarg" ;; esac if test ".$ac_param" = .; then ac_param="$ac_from:$ac_what" else ac_param="$ac_param,$ac_from:$ac_what" fi ;; esacdoneif test ".$ac_param" != .; then # echo "loading parameters" OIFS="$IFS" IFS="," pconf="/tmp/autoconf.$$" echo "ac_options=''" >$pconf ac_from="$1" for ac_section in $ac_param; do changequote(, ) case $ac_section in *:* ) ac_from=`echo "$ac_section" | sed -e 's/:.*//'` ac_section=`echo "$ac_section" | sed -e 's/.*://'` ;; esac (echo ''; cat $ac_from; echo '') |\ sed -e "1,/[ ]*[ ]*${ac_section}[ ]*{[ ]*/d" \ -e '/[ ]*}[ ]*/,$d' \ -e ':join' -e '/\\[ ]*$/N' -e 's/\\[ ]*\n[ ]*//' -e 'tjoin' \ -e 's/^[ ]*//g' \ -e 's/^\([^-].*=.*\) IF \(.*\)$/if \2; then \1; fi/' \ -e 's/^\(--.*=.*\) IF \(.*\)$/if \2; then ac_options="$ac_options \1"; fi/' \ -e 's/^\(--.*\) IF \(.*\)$/if \2; then ac_options="$ac_options \1"; fi/' \ -e 's/^\(--.*=.*\)$/ac_options="$ac_options \1"/' \ -e 's/^\(--.*\)$/ac_options="$ac_options \1"/' \ >>$pconf changequote([, ]) done IFS="$OIFS" . $pconf rm -f $pconf >/dev/null 2>&1 if test ".[$]*" = .; then set -- $ac_options else set -- "[$]@" $ac_options fifiAC_DIVERT_POP()])dnldnl ##dnl ## Check whether compiler option worksdnl ##dnl ## configure.ac:dnl ## AC_COMPILER_OPTION(<name>, <display>, <option>,dnl ## <action-success>, <action-failure>)dnl ##AC_DEFUN(AC_COMPILER_OPTION,[dnlAC_MSG_CHECKING(for compiler option $2)AC_CACHE_VAL(ac_cv_compiler_option_$1,[cat >conftest.$ac_ext <<EOFint main() { return 0; }EOF${CC-cc} -c $CFLAGS $CPPFLAGS $3 conftest.$ac_ext 1>conftest.out 2>conftest.errif test $? -ne 0 -o -s conftest.err; then ac_cv_compiler_option_$1=noelse ac_cv_compiler_option_$1=yesfirm -f conftest.$ac_ext conftest.out conftest.err])dnlif test ".$ac_cv_compiler_option_$1" = .yes; then ifelse([$4], , :, [$4])else ifelse([$5], , :, [$5])fiAC_MSG_RESULT([$ac_cv_compiler_option_$1])])dnldnl ##dnl ## Check whether `long long' and `long double' type existsdnl ##dnl ## configure.ac:dnl ## AC_CHECK_LONGLONGdnl ## AC_CHECK_LONGDOUBLEdnl ##AC_DEFUN(AC_CHECK_LONGLONG,[dnlAC_MSG_CHECKING(for built-in type long long) AC_CACHE_VAL(ac_cv_type_longlong,[dnl AC_TRY_LINK([#include <sys/types.h> ],[ long long X = 2, Y = 1, Z; Z = X / Y; ], ac_cv_type_longlong=yes, ac_cv_type_longlong=no )dnl ])dnlAC_MSG_RESULT([$ac_cv_type_longlong])if test ".$ac_cv_type_longlong" = .yes; then AC_DEFINE(HAVE_LONGLONG, 1, [define if "long long" type exists])fi])dnlAC_DEFUN(AC_CHECK_LONGDOUBLE,[dnlAC_MSG_CHECKING(for built-in type long double) AC_CACHE_VAL(ac_cv_type_longdouble,[dnl AC_TRY_LINK([#include <sys/types.h> ],[ long double X = 2, Y = 1, Z; Z = X / Y; ], ac_cv_type_longdouble=yes, ac_cv_type_longdouble=no )dnl ])dnlAC_MSG_RESULT([$ac_cv_type_longdouble])if test ".$ac_cv_type_longdouble" = .yes; then AC_DEFINE(HAVE_LONGDOUBLE, 1, [define if "long double" type exists])fi])dnldnl ##dnl ## Debugging Supportdnl ##dnl ## configure.ac:dnl ## AC_CHECK_DEBUGGINGdnl ##AC_DEFUN(AC_CHECK_DEBUGGING,[dnlAC_ARG_ENABLE(debug,dnl[ --enable-debug build for debugging (default=no)],[dnlif test ".$ac_cv_prog_gcc" = ".yes"; then case "$CFLAGS" in *-O* ) ;; * ) CFLAGS="$CFLAGS -O2" ;; esac case "$CFLAGS" in *-g* ) ;; * ) CFLAGS="$CFLAGS -g" ;; esac case "$CFLAGS" in *-pipe* ) ;; * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;; esac case $PLATFORM in *-*-freebsd*|*-*-solaris* ) CFLAGS="$CFLAGS -pedantic" ;; esac CFLAGS="$CFLAGS -Wall" WMORE="-Wshadow -Wpointer-arith -Wcast-align -Winline" WMORE="$WMORE -Wmissing-prototypes -Wmissing-declarations -Wnested-externs" AC_COMPILER_OPTION(wmore, -W<xxx>, $WMORE, CFLAGS="$CFLAGS $WMORE") AC_COMPILER_OPTION(wnolonglong, -Wno-long-long, -Wno-long-long, CFLAGS="$CFLAGS -Wno-long-long") AC_COMPILER_OPTION(fnostrictaliasing, -fno-strict-aliasing, -fno-strict-aliasing, CFLAGS="$CFLAGS -fno-strict-aliasing")else case "$CFLAGS" in *-g* ) ;; * ) CFLAGS="$CFLAGS -g" ;; esacfimsg="enabled"AC_DEFINE(PTH_DEBUG, 1, [define to enable Pth debugging])],[if test ".$ac_cv_prog_gcc" = ".yes"; thencase "$CFLAGS" in *-pipe* ) ;; * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;;esacficase "$CFLAGS" in *-g* ) CFLAGS=`echo "$CFLAGS" |\ sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;esaccase "$CXXFLAGS" in *-g* ) CXXFLAGS=`echo "$CXXFLAGS" |\ sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;esacmsg="disabled"])dnlAC_MSG_CHECKING(for compilation debug mode)AC_MSG_RESULT([$msg])if test ".$msg" = .enabled; then enable_shared=nofi])dnl ##dnl ## Profiling Supportdnl ##dnl ## configure.ac:dnl ## AC_CHECK_PROFILINGdnl ##AC_DEFUN(AC_CHECK_PROFILING,[dnlAC_MSG_CHECKING(for compilation profile mode)AC_ARG_ENABLE(profile,dnl[ --enable-profile build for profiling (default=no)],[dnlif test ".$ac_cv_prog_gcc" = ".no"; then AC_MSG_ERROR([profiling requires gcc and gprof])fiCFLAGS=`echo "$CFLAGS" | sed -e 's/-O2//g'`CFLAGS="$CFLAGS -O0 -pg"LDFLAGS="$LDFLAGS -pg"msg="enabled"],[msg="disabled"])dnlAC_MSG_RESULT([$msg])if test ".$msg" = .enabled; then enable_shared=nofi])dnl ##dnl ## Build Parametersdnl ##dnl ## configure.ac:dnl ## AC_CHECK_BUILDPARAMdnl ##AC_DEFUN(AC_CHECK_BUILDPARAM,[dnldnl # determine build modeAC_MSG_CHECKING(whether to activate batch build mode)AC_ARG_ENABLE(batch,dnl[ --enable-batch enable batch build mode (default=no)],[dnl],[dnlenable_batch=no])dnlif test ".$silent" = .yes; then enable_batch=yesfiAC_MSG_RESULT([$enable_batch])BATCH="$enable_batch"AC_SUBST(BATCH)dnl # determine build targetsTARGET_ALL='$(TARGET_PREQ) $(TARGET_LIBS)'AC_MSG_CHECKING(whether to activate maintainer build targets)AC_ARG_ENABLE(maintainer,dnl[ --enable-maintainer enable maintainer build targets (default=no)],[dnl],[dnlenable_maintainer=no])dnlAC_MSG_RESULT([$enable_maintainer])if test ".$enable_maintainer" = .yes; then TARGET_ALL="$TARGET_ALL \$(TARGET_MANS)"fiAC_MSG_CHECKING(whether to activate test build targets)AC_ARG_ENABLE(tests,dnl[ --enable-tests enable test build targets (default=yes)],[dnl],[dnlenable_tests=yes])dnlAC_MSG_RESULT([$enable_tests])if test ".$enable_tests" = .yes; then TARGET_ALL="$TARGET_ALL \$(TARGET_TEST)"fiAC_SUBST(TARGET_ALL)])dnl ##dnl ## Optimization Supportdnl ##dnl ## configure.ac:dnl ## AC_CHECK_OPTIMIZEdnl ##AC_DEFUN(AC_CHECK_OPTIMIZE,[dnlAC_ARG_ENABLE(optimize,dnl[ --enable-optimize build with optimization (default=no)],[dnlif test ".$ac_cv_prog_gcc" = ".yes"; then # compiler is gcc case "$CFLAGS" in *-O* ) ;; * ) CFLAGS="$CFLAGS -O2" ;; esac case "$CFLAGS" in *-pipe* ) ;; * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS="$CFLAGS -pipe") ;; esac OPT_CFLAGS='-funroll-loops -fstrength-reduce -fomit-frame-pointer -ffast-math' AC_COMPILER_OPTION(optimize_std, [-f<xxx> for optimizations], $OPT_CFLAGS, CFLAGS="$CFLAGS $OPT_CFLAGS") case $PLATFORM in i?86*-*-*|?86*-*-* ) OPT_CFLAGS='-malign-functions=4 -malign-jumps=4 -malign-loops=4' AC_COMPILER_OPTION(optimize_x86, [-f<xxx> for Intel x86 CPU], $OPT_CFLAGS, CFLAGS="$CFLAGS $OPT_CFLAGS") ;; esacelse # compiler is NOT gcc case "$CFLAGS" in *-O* ) ;; * ) CFLAGS="$CFLAGS -O" ;; esac case $PLATFORM in *-*-solaris* ) AC_COMPILER_OPTION(fast, -fast, -fast, CFLAGS="$CFLAGS -fast") ;; esacfi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -