📄 aclocal.m4
字号:
case $host_os in openbsd*) sfs_gnu_WFLAGS="-ansi -Wall -Wsign-compare -Wchar-subscripts -Werror" sfs_gnu_CXXWFLAGS="$sfs_gnu_WFLAGS" ;; linux*|freebsd*) sfs_gnu_WFLAGS="-Wall -Werror" sfs_gnu_CXXWFLAGS="$sfs_gnu_WFLAGS" ;; *) sfs_gnu_WFLAGS="-Wall" sfs_gnu_CXXWFLAGS="$sfs_gnu_WFLAGS" ;;esacexpr "x$DEBUG" : '.*-O' > /dev/null \ || sfs_gnu_WFLAGS="$sfs_gnu_WFLAGS -Wno-unused"expr "x$CXXDEBUG" : '.*-O' > /dev/null \ || sfs_gnu_CXXWFLAGS="$sfs_gnu_CXXWFLAGS -Wno-unused"NW='-w'test "$GCC" = yes -a -z "${WFLAGS+set}" && WFLAGS="$sfs_gnu_WFLAGS"test "$GXX" = yes -a -z "${CXXWFLAGS+set}" && CXXWFLAGS="$sfs_gnu_CXXWFLAGS"CXXNOERR=test "$GXX" = yes && CXXNOERR='-Wno-error'# Temporarily set CFLAGS to ansi so tests for things like __inline go correctlyif expr "x$DEBUG $WFLAGS $ECFLAGS" : '.*-ansi' > /dev/null; then CFLAGS="$CFLAGS -ansi" ac_cpp="$ac_cpp -ansi"fiexpr "x$CXXDEBUG $CXXWFLAGS $ECXXFLAGS" : '.*-ansi' > /dev/null \ && CXXFLAGS="$CXXFLAGS -ansi"])dnldnl SFS_CFLAGS puts the effects of SFS_WFLAGS into place.dnl This must be called after all tests have been run.dnlAC_DEFUN(SFS_CFLAGS,[unset CFLAGSunset CXXFLAGSCFLAGS='$(DEBUG) $(WFLAGS) $(ECFLAGS)'CXXFLAGS='$(CXXDEBUG) $(CXXWFLAGS) $(ECXXFLAGS)'])dnldnl Check for xdr_u_intNN_t, etcdnlAC_DEFUN(SFS_CHECK_XDR,[dnl AC_CACHE_CHECK([for a broken <rpc/xdr.h>], sfs_cv_xdr_broken,dnl AC_EGREP_HEADER(xdr_u_int32_t, [rpc/xdr.h], dnl sfs_cv_xdr_broken=no, sfs_cv_xdr_broken=yes))dnl if test "$sfs_cv_xdr_broken" = "yes"; thendnl AC_DEFINE(SFS_XDR_BROKEN)dnl dnl We need to know the following in order to fix rpc/xdr.h: dnl AC_CHECK_SIZEOF(short)dnl AC_CHECK_SIZEOF(int)dnl AC_CHECK_SIZEOF(long)dnl fiSFS_CHECK_DECL(xdr_callmsg, rpc/rpc.h)AC_CACHE_CHECK(what second xdr_getlong arg points to, sfs_cv_xdrlong_t,AC_EGREP_HEADER(\*x_getlong.* long *\*, [rpc/rpc.h], sfs_cv_xdrlong_t=long)if test -z "$sfs_cv_xdrlong_t"; then AC_EGREP_HEADER(\*x_getlong.* int *\*, [rpc/rpc.h], sfs_cv_xdrlong_t=int)fiif test -z "$sfs_cv_xdrlong_t"; then sfs_cv_xdrlong_t=u_int32_tfi)AC_DEFINE_UNQUOTED(xdrlong_t, $sfs_cv_xdrlong_t, What the second argument of xdr_getlong points to)])dnldnl Check for random devicednlAC_DEFUN(SFS_DEV_RANDOM,[AC_CACHE_CHECK([for kernel random number generator], sfs_cv_dev_random,for dev in /dev/urandom /dev/srandom /dev/random /dev/srnd /dev/rnd; do if test -c "$dev"; then sfs_cv_dev_random=$dev break fi test "$sfs_cv_dev_random" || sfs_cv_dev_random=nodone)if test "$sfs_cv_dev_random" != no; thenpushdef([SFS_DEV_RANDOM], [[SFS_DEV_RANDOM]]) AC_DEFINE_UNQUOTED([SFS_DEV_RANDOM], "$sfs_cv_dev_random", [Path to the strongest random number device, if any.])popdef([SFS_DEV_RANDOM])fi])dnldnl Check for getgrouplist functiondnlAC_DEFUN(SFS_GETGROUPLIST_TRYGID, [if test "$sfs_cv_grouplist_t" != gid_t; then AC_TRY_COMPILE([#include <sys/types.h>#include <unistd.h>#include <grp.h>int getgrouplist ([$*]); ], 0, sfs_cv_grouplist_t=gid_t)fi])AC_DEFUN(SFS_GETGROUPLIST,[AC_CHECK_FUNCS(getgrouplist)AC_CACHE_CHECK([whether getgrouplist uses int or gid_t], sfs_cv_grouplist_t, if test "$ac_cv_func_getgrouplist" = yes; then sfs_cv_grouplist_t=int AC_EGREP_HEADER(getgrouplist.*gid_t *\*, unistd.h, sfs_cv_grouplist_t=gid_t) if test "$sfs_cv_grouplist_t" != gid_t; then AC_EGREP_HEADER(getgrouplist.*gid_t *\*, grp.h, sfs_cv_grouplist_t=gid_t) fi SFS_GETGROUPLIST_TRYGID(const char *, gid_t, gid_t *, int *) SFS_GETGROUPLIST_TRYGID(const char *, int , gid_t *, int *) SFS_GETGROUPLIST_TRYGID(char *, gid_t, gid_t *, int *) SFS_GETGROUPLIST_TRYGID(char *, int, gid_t *, int *) else sfs_cv_grouplist_t=gid_t fi)AC_DEFINE_UNQUOTED([GROUPLIST_T], $sfs_cv_grouplist_t, [Type pointed to by 3rd argument of getgrouplist.])])dnldnl Check if <grp.h> is needed for setgroups declaration (linux)dnlAC_DEFUN(SFS_SETGROUPS,[AC_CACHE_CHECK([for setgroups declaration in grp.h], sfs_cv_setgroups_grp_h, AC_EGREP_HEADER(setgroups, grp.h, sfs_cv_setgroups_grp_h=yes, sfs_cv_setgroups_grp_h=no))if test "$sfs_cv_setgroups_grp_h" = yes; thenAC_DEFINE([SETGROUPS_NEEDS_GRP_H], 1, [Define if setgroups is declared in <grp.h>.])fi])dnldnl Check if authunix_create is broken and takes a gid_t *dnlAC_DEFUN(SFS_AUTHUNIX_GROUP_T,[AC_CACHE_CHECK([what last authunix_create arg points to], sfs_cv_authunix_group_t,AC_EGREP_HEADER([(authunix|authsys)_create.*(uid_t|gid_t)], rpc/rpc.h, sfs_cv_authunix_group_t=gid_t, sfs_cv_authunix_group_t=int))if test "$sfs_cv_authunix_group_t" = gid_t; then AC_DEFINE_UNQUOTED(AUTHUNIX_GID_T, 1, [Define if last argument of authunix_create is a gid_t *.])fi])dnldnl Check the type of the x_ops field in XDRdnlAC_DEFUN(SFS_XDR_OPS_T,[AC_CACHE_CHECK([type of XDR::x_ops], sfs_cv_xdr_ops_t,AC_EGREP_HEADER([xdr_ops *\* *x_ops;], rpc/xdr.h, sfs_cv_xdr_ops_t=xdr_ops, sfs_cv_xdr_ops_t=XDR::xdr_ops))AC_DEFINE_UNQUOTED(xdr_ops_t, $sfs_cv_xdr_ops_t, [The C++ type name of the x_ops field in struct XDR.])])dnldnl Find installed SFS librariesdnl This is not for SFS, but for other packages that use SFS.dnlAC_DEFUN(SFS_SFS,[AC_ARG_WITH(sfs,--with-sfs[[=PATH]] specify location of SFS libraries)if test "$with_sfs" = yes -o "$with_sfs" = ""; then for dir in "$prefix" /usr/local /usr; do if test -f $dir/lib/sfs/libasync.la; then with_sfs=$dir break fi doneficase "$with_sfs" in /*) ;; *) with_sfs="$PWD/$with_sfs" ;;esacif test -f ${with_sfs}/Makefile -a -f ${with_sfs}/autoconf.h; then if egrep '#define DMALLOC' ${with_sfs}/autoconf.h > /dev/null 2>&1; then test -z "$with_dmalloc" -o "$with_dmalloc" = no && with_dmalloc=yes elif test "$with_dmalloc" -a "$with_dmalloc" != no; then AC_MSG_ERROR("SFS libraries not compiled with dmalloc") fi sfssrcdir=`sed -ne 's/^srcdir *= *//p' ${with_sfs}/Makefile` case "$sfssrcdir" in /*) ;; *) sfssrcdir="${with_sfs}/${sfssrcdir}" ;; esac CPPFLAGS="$CPPFLAGS -I${with_sfs}" for lib in async arpc crypt sfsmisc; do CPPFLAGS="$CPPFLAGS -I${sfssrcdir}/$lib" done CPPFLAGS="$CPPFLAGS -I${with_sfs}/svc" LIBASYNC=${with_sfs}/async/libasync.la LIBARPC=${with_sfs}/arpc/libarpc.la LIBSFSCRYPT=${with_sfs}/crypt/libsfscrypt.la LIBSFSMISC=${with_sfs}/sfsmisc/libsfsmisc.la LIBSVC=${with_sfs}/svc/libsvc.la LIBSFS=${with_sfs}/libsfs/libsfs.la MALLOCK=${with_sfs}/sfsmisc/mallock.o RPCC=${with_sfs}/rpcc/rpccelif test -f ${with_sfs}/include/sfs/autoconf.h \ -a -f ${with_sfs}/lib/sfs/libasync.la; then sfsincludedir="${with_sfs}/include/sfs" sfslibdir=${with_sfs}/lib/sfs if egrep '#define DMALLOC' ${sfsincludedir}/autoconf.h > /dev/null; then test -z "$with_dmalloc" -o "$with_dmalloc" = no && with_dmalloc=yes else with_dmalloc=no fi CPPFLAGS="$CPPFLAGS -I${sfsincludedir}" LIBASYNC=${sfslibdir}/libasync.la LIBARPC=${sfslibdir}/libarpc.la LIBSFSCRYPT=${sfslibdir}/libsfscrypt.la LIBSFSMISC=${sfslibdir}/libsfsmisc.la LIBSVC=${sfslibdir}/libsvc.la LIBSFS=${with_sfs}/lib/libsfs.a MALLOCK=${sfslibdir}/mallock.o RPCC=${with_sfs}/bin/rpccelse AC_MSG_ERROR("Can\'t find SFS libraries")fiif test "$enable_static" = yes -a -z "${NOPAGING+set}"; then case "$host_os" in openbsd*) test "$ac_cv_prog_gcc" = yes && NOPAGING="-Wl,-Bstatic,-N" MALLOCK= # mallock.o panics the OpenBSD kernel ;; freebsd*) test "$ac_cv_prog_gcc" = yes && NOPAGING="-Wl,-Bstatic" ;; esacfisfslibdir='$(libdir)/sfs'sfsincludedir='$(libdir)/include'AC_SUBST(sfslibdir)AC_SUBST(sfsincludedir)AC_SUBST(LIBASYNC)AC_SUBST(LIBARPC)AC_SUBST(LIBSFSCRYPT)AC_SUBST(LIBSFSMISC)AC_SUBST(LIBSVC)AC_SUBST(LIBSFS)AC_SUBST(RPCC)AC_SUBST(MALLOCK)AC_SUBST(NOPAGING)SFS_GMPSFS_DMALLOCLDEPS='$(LIBSFSMISC) $(LIBSVC) $(LIBSFSCRYPT) $(LIBARPC) $(LIBASYNC)'LDADD="$LDEPS "'$(LIBGMP)'AC_SUBST(LDEPS)AC_SUBST(LDADD)])# Define a conditional.AC_DEFUN([AM_CONDITIONAL],[AC_SUBST($1_TRUE)AC_SUBST($1_FALSE)if $2; then $1_TRUE= $1_FALSE='#'else $1_TRUE='#' $1_FALSE=fi])# Do all the work for Automake. This macro actually does too much --# some checks are only needed if your package does certain things.# But this isn't really a big deal.# serial 1dnl Usage:dnl AM_INIT_AUTOMAKE(package,version, [no-define])AC_DEFUN([AM_INIT_AUTOMAKE],[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnlAC_REQUIRE([AC_PROG_INSTALL])PACKAGE=[$1]AC_SUBST(PACKAGE)VERSION=[$2]AC_SUBST(VERSION)dnl test to see if srcdir already configuredif test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first])fiifelse([$3],,AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))AC_REQUIRE([AM_SANITY_CHECK])AC_REQUIRE([AC_ARG_PROGRAM])dnl FIXME This is truly gross.missing_dir=`cd $ac_aux_dir && pwd`AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir)AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir)AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)AC_REQUIRE([AC_PROG_MAKE_SET])])# Copyright 2002 Free Software Foundation, Inc.# This program is free software; you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation; either version 2, or (at your option)# any later version.# This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA# AM_AUTOMAKE_VERSION(VERSION)# ----------------------------# Automake X.Y traces this macro to ensure aclocal.m4 has been# generated from the m4 files accompanying Automake X.Y.AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"])# AM_SET_CURRENT_AUTOMAKE_VERSION# -------------------------------# Call AM_AUTOMAKE_VERSION so it can be traced.# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.4-p6])])## Check to make sure that the build environment is sane.#AC_DEFUN([AM_SANITY_CHECK],[AC_MSG_CHECKING([whether build environment is sane])# Just in casesleep 1echo timestamp > conftestfile# Do `set' in a subshell so we don't clobber the current shell's# arguments. Must try -L first in case configure is actually a# symlink; some systems play weird games with the mod time of symlinks# (eg FreeBSD returns the mod time of the symlink's containing# directory).if ( set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` if test "[$]*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftestfile` fi if test "[$]*" != "X $srcdir/configure conftestfile" \ && test "[$]*" != "X conftestfile $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a brokenalias in your environment]) fi test "[$]2" = conftestfile )then # Ok. :else AC_MSG_ERROR([newly created file is older than distributed files!Check your system clock])firm -f conftest*AC_MSG_RESULT(yes)])dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)dnl The program must properly implement --version.AC_DEFUN([AM_MISSING_PROG],[AC_MSG_CHECKING(for working $2)# Run test in a subshell; some versions of sh will print an error if# an executable is not found, even if stderr is redirected.# Redirect stdin to placate older versions of autoconf. Sigh.if ($2 --version) < /dev/null > /dev/null 2>&1; then $1=$2 AC_MSG_RESULT(found)else $1="$3/missing $2" AC_MSG_RESULT(missing)fiAC_SUBST($1)])# Like AC_CONFIG_HEADER, but automatically create stamp file.AC_DEFUN([AM_CONFIG_HEADER],[AC_PREREQ([2.12])AC_CONFIG_HEADER([$1])dnl When config.status generates a header, we must update the stamp-h file.dnl This file resides in the same directory as the config headerdnl that is generated. We must strip everything past the first ":",dnl and everything past the last "/".AC_OUTPUT_COMMANDS(changequote(<<,>>)dnlifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,<<am_indx=1for am_file in <<$1>>; do case " <<$>>CONFIG_HEADERS " in *" <<$>>am_file "*<<)>> echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx ;; esac am_indx=`expr "<<$>>am_indx" + 1`done<<>>dnl>>)changequote([,]))])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -