📄 configure.in
字号:
AC_INIT(include/socks.h)#set this to enable prerelease, changes some defaults (debug enabled)#prerelease="1"if test x$prerelease != x; then prename="-pre$prerelease"else prename=""fiAM_INIT_AUTOMAKE(dante, 1.1.1$prename)AM_CONFIG_HEADER(include/autoconf.h)#NOTE: save CFLAGS; wish to compile without -O2 when debuggingoCFLAGS=$CFLAGSunset CFLAGSAM_PROG_LIBTOOLautoconf_compflags=$CFLAGSCFLAGS=$oCFLAGSAC_CANONICAL_HOSTAM_CONDITIONAL(PRERELEASE, test x$prerelease != x)#known keywords for --enable/disable-foo(=yes/no)?KNOWN_KEYWORDS="shared|static|debug|warnings|diagnostic|profiling|linting|libwrap|preload"for keyword in `set | egrep '^enable_' | sed -e 's/^enable_\(.*\)=.*/\1/'`;do echo $keyword | egrep "^(${KNOWN_KEYWORDS})$" > /dev/null if test $? -ne 0; then AC_MSG_WARN(unknown option '$keyword', ignoring ...) sleep 10; fidone#solaris 2.5.1 is broken in many placescase $host in *-*-solaris2.5.1) AC_MSG_WARN(the server might not work properly on solaris 2.5.1) AC_DEFINE(HAVE_SOLARIS_2_5_1) ;;esac#disable acceptlock#XXX add proper test for this?case $host in *-*-*bsd*) no_acceptlock=t ;; alpha-dec-osf*) no_acceptlock=t ;; *-*-solaris2.6) no_acceptlock=t ;; *-*-solaris2.7) no_acceptlock=t ;;esaccase $host in alpha-dec-osf*) AC_DEFINE(HAVE_DEC_PROTO) AC_DEFINE(HAVE_EXTRA_OSF_SYMBOLS) PRELOAD="RLD" CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE_EXTENDED -DBYTE_ORDER=LITTLE_ENDIAN -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_OSF_SOURCE" ;; *-*-hpux*) #hpux needs _PROTOTYPES to include prototypes #for configure (at least when cc is used) CPPFLAGS="${CPPFLAGS} -D_PROTOTYPES" ;; *-*-sunos4*) #XXX hardcode library path (find better way to do this?) AC_DEFINE(LIBRARY_PATH, "/usr/lib/") base_library_path="/usr/lib/" AC_MSG_WARN("notice: hardcoding /usr/lib for dlopen") #nonstandard libfunction workaround #XXX proper test AC_DEFINE(HAVE_BROKEN_VSPRINTF) #link problems with libresolv, hardcode domainname if test -s /etc/resolv.conf; then domainname_hardcoded=`grep domain /etc/resolv.conf | awk '{ print $2 }'` fi no_res_init=t AC_DEFINE(HAVE_NO_RESOLVESTUFF) ;; *-*-solaris*) AC_DEFINE(HAVE_SENDMSG_DEADLOCK) AC_DEFINE(HAVE_SOLARIS_BUGS) AC_DEFINE(BSD_COMP) ;; *-*-linux-*) # XXX This might only concern 2.0.x kernels (add test?) AC_DEFINE(HAVE_DEFECT_RECVMSG) AC_DEFINE(HAVE_LINUX_BUGS) AC_DEFINE(SPT_PADCHAR, '\0') ;; *-*-openbsd*) #static sockd when profiling is enabled no_dynamic_profiled_sockd=t ;; *-*-irix*) PRELOAD="RLD" ;;esaccase $PRELOAD in RLD) PRELOAD_SEPERATOR=":" PRELOAD_VARIABLE="_RLD_LIST" PRELOAD_POSTFIX="DEFAULT" ;; *) PRELOAD_SEPERATOR=" " PRELOAD_VARIABLE="LD_PRELOAD" PRELOAD_POSTFIX="" ;;esacAC_SUBST(PRELOAD_SEPERATOR)AC_SUBST(PRELOAD_VARIABLE)AC_SUBST(PRELOAD_POSTFIX)#define hosttypeAC_DEFINE_UNQUOTED(HAVE_HOST_TYPE, "$host")#XXX add proper test for this?if test x$no_acceptlock != xt; then AC_DEFINE(NEED_ACCEPTLOCK)fiAC_MSG_CHECKING(for compiler flags)case $host in #XXX check for compiler type, not architecture *-*-solaris*) if test "x$GCC" = x; then #-xs provides allows easier debugging with gdb comp_flags="-Xt -xs" #XXX -Xt needed to compile? #XXX due to some problems with sockaddr alignment #XXX sun cc needs -misalign comp_flags="$comp_flags -misalign -xO0" AC_MSG_RESULT($comp_flags) AC_MSG_WARN(there might currenly be some performance problems with suncc - it needs -misalign) $CC 2>&1 | grep ucbcc > /dev/null if test $? -eq 0; then #XXX ucbcc uses includes from /usr/ucbinclude, but these are #not complete. add /usr/include to include path to get #all prototypes (read/write are missing) #XXX host_cc="solaris-ucbcc" CPPFLAGS="-I/usr/include $CPPFLAGS${CPPFLAGS:+ } " fi fi# AC_MSG_RESULT($comp_flags) ;; alpha-dec-osf*) #XXX is it possible to get it to work with -newc? if test "x$GCC" = x; then comp_flags="-std1 -oldc" fi AC_MSG_RESULT($comp_flags) ;; *) AC_MSG_RESULT(none) ;; #XXX make sure compiling with compiler options worksesacAC_MSG_CHECKING(for support for -pipe compiler flag)oCFLAGS=$CFLAGSCFLAGS="$CFLAGS -pipe"AC_TRY_RUN([int main(){ return 0;}], [AC_MSG_RESULT(yes) comp_flags="${comp_flags} -pipe"], AC_MSG_RESULT(no))CFLAGS="$oCFLAGS"AC_MSG_CHECKING(for compilation with debugging)AC_ARG_ENABLE(debug,[ --enable-debug compile with debugging support], debug_enabled=t, [if test x$prerelease != x; then debug_enabled=t fi])if test x$debug_enabled = xt; then #no optimalization wanted if test $ac_cv_prog_cc_g = yes; then CFLAGS="$CFLAGS -g" fi CPPFLAGS="-DDEBUG $CPPFLAGS" AC_MSG_RESULT(yes)else AC_MSG_RESULT(no) #autoconf_compflags is set to "-g -O2" with GCC CFLAGS="$CFLAGS $autoconf_compflags"fi#-Wall ?AC_MSG_CHECKING(for warning flags)AC_ARG_ENABLE(warnings,[ --enable-warnings show compilation warnings], [enable_warnings=t], [if test x$prerelease != x; then enable_warnings=t fi])#construct warning flags in $warnif test x$enable_warnings != x; then #try to enable compiler specific warning flags if test "x$GCC" = x; then case $host in *sunos4*) #sunos cc# warn="" true ;; alpha-dec-osf*) #osf cc# warn="-w0 -check -portable -warnprotos" true ;; *-*-solaris*) warn="-v" #XXX sun cc won't link with -vc defined true ;; *-*-irix*) #sgi cc warn="-fullwarn" ;; *) #try -Wall (gcc) warn="-Wall" ;; esac else #gcc warnings warn="-Wall -W -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wbad-function-cast -Wpointer-arith -Wundef" #warn="$warn -Wold-style-cast -Winline -Waggregate-return -Wconversion -Wwrite-strings -Wtraditional -Wshadow" fi oCFLAGS=$CFLAGS CFLAGS="$CFLAGS $warn" #make sure compilation is still possible AC_TRY_COMPILE([], [], [AC_MSG_RESULT($warn)], [AC_MSG_RESULT(none) unset warn]) CFLAGS=$oCFLAGSelse AC_MSG_RESULT(none)fi#NOTE: set warnings at the bottom; might interfere with testsCFLAGS="$CFLAGS $comp_flags"#-DDIAGNOSTICS?AC_MSG_CHECKING(for compliation with DIAGNOSTIC)AC_ARG_ENABLE(diagnostic,[ --enable-diagnostic enable diagnostic], [AC_DEFINE(DIAGNOSTIC) AC_MSG_RESULT(yes)], [if test x$prerelease != x; then AC_DEFINE(DIAGNOSTIC) AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi])AC_ARG_ENABLE(profiling,[ --enable-profiling compile with profiling support in server],[ AC_DEFINE(HAVE_PROFILING) s_profiling=t])AM_CONDITIONAL(SPROFIL, test x$s_profiling = xt)#static or dynamic sockd?AM_CONDITIONAL(STATIC_SOCKD, test x$no_dynamic_profiled_sockd = xt)if test x$no_dynamic_profiled_sockd = xt; then AC_MSG_WARN(sockd is built static when profiling is enabled)fiAC_ARG_ENABLE(linting,[ --enable-linting enable lint], s_linting=t)AM_CONDITIONAL(LINT, test x$s_linting = xt)AC_MSG_CHECKING(whether libwrap should be disabled)AC_ARG_ENABLE(libwrap,[ --disable-libwrap never use libwrap, even if it is available],[if test x$enableval = xno; then no_libwrap=t AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fi], AC_MSG_RESULT(no))#add /usr/local/include to directories to include path if tcpd.h#can be found there)for dir in /local/include /usr/local/include; do if test -f $dir/tcpd.h; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I${dir}" break fidonednl Checks for programs.AC_PROG_YACCAC_PROG_AWKAM_PROG_LEXdnl Checking variable sizesAC_CHECK_SIZEOF(char)AC_CHECK_SIZEOF(short)AC_CHECK_SIZEOF(int)AC_CHECK_SIZEOF(long)dnl Checks for header files.AC_HEADER_STDCAC_HEADER_SYS_WAITAC_CHECK_HEADERS(fcntl.h limits.h malloc.h paths.h strings.h syslog.h)AC_CHECK_HEADERS(unistd.h crypt.h sys/file.h sys/ioctl.h sys/time.h)AC_CHECK_HEADERS(netinet/ip_var.h tcpd.h)case $host in alpha-dec-osf*) AC_CHECK_HEADERS(netinet/ip.h) ;; *) ;;esac#build without support for preloading?AC_MSG_CHECKING(whether preloading should be disabled)AC_ARG_ENABLE(preload,[ --disable-preload disable support for preloading shared libraries],[if test x$enableval = xno; then no_preload=t AC_MSG_RESULT(yes)else AC_MSG_RESULT(no)fi], AC_MSG_RESULT(no))#allow manual specificationAC_MSG_CHECKING(for hardcoded domainname)AC_ARG_WITH(domainname,[ --with-domainname=NAME hardcode local domainname (only on broken platforms)], [domainname_hardcoded=$withval])if test x${domainname_hardcoded} != x; then AC_DEFINE_UNQUOTED(SOCKS_DOMAINNAME, "${domainname_hardcoded}") AC_MSG_RESULT(yes) AC_MSG_WARN(using hardcoded domainname ${domainname_hardcoded})else AC_MSG_RESULT(no) if test x${no_res_init} = xt; then AC_MSG_WARN(unable to locate domainname, specify if necessary) fifi#allow default file locations to be overriddenAC_MSG_CHECKING(for socks config file location)AC_ARG_WITH(socks-conf,[ --with-socks-conf=FILE change location of socks client configuration file],[AC_MSG_RESULT($withval) AC_DEFINE(HAVE_SOCKS_CONFIGFILE) AC_DEFINE_UNQUOTED(HAVE_ALT_SOCKS_CONFIGFILE, "$withval")], [AC_MSG_RESULT(default)])AC_MSG_CHECKING(for sockd config file location)AC_ARG_WITH(sockd-conf,[ --with-sockd-conf=FILE change location of socks server configuration file],[AC_MSG_RESULT($withval) AC_DEFINE(HAVE_SOCKD_CONFIGFILE) AC_DEFINE_UNQUOTED(HAVE_ALT_SOCKD_CONFIGFILE, "$withval")], [AC_MSG_RESULT(default)])AC_MSG_CHECKING(for pid file location)AC_ARG_WITH(pidfile,[ --with-pidfile=FILE change location of server pidfile],[AC_MSG_RESULT($withval) AC_DEFINE(HAVE_SOCKD_PIDFILE) AC_DEFINE_UNQUOTED(HAVE_ALT_SOCKD_PIDFILE, "$withval")], [AC_MSG_RESULT(default)])# SOCKSLIBRARY_DYNAMIC is set in the lib directory when preloading# is supported (and requested).# HAVE_DLFCN_H only determines if the include file existsAC_CHECK_HEADER(dlfcn.h,[AC_DEFINE(HAVE_DLFCN_H) have_dlfcn_h=t])#XXX only set conditional if building of shared libraries are enabledAM_CONDITIONAL(BUILD_PRELOAD_LIB, test x$have_dlfcn_h = xt)AC_CHECK_HEADER(sys/sockio.h,[AC_DEFINE(HAVE_SYS_SOCKIO_H) have_sys_sockio_h=t])dnl Checks for typedefs, structures, and compiler characteristics.AC_MSG_CHECKING(whether <sys/types.h> defines const)AC_EGREP_CPP(yes, [#include <sys/types.h>#ifdef constyes#endif], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) check_const="yes"])
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -