configure.in

来自「RESIN 3.2 最新源码」· IN 代码 · 共 1,013 行 · 第 1/2 页

IN
1,013
字号
fi## Using Perl if it's available.#PERL=`which perl`if test -z "${LD_SHLIB}"; then  if test -z "${LD_SHLIB}" -a "x`$PERL -V:dlsrc 2>/dev/null | grep dlopen`" != "x"; then    PCC="`$PERL -V:cc | cut -d\' -f2`"    if test "${PCC}" = "${CC}"; then      CFLAGS_SHLIB="`$PERL -V:cccdlflags | cut -d\' -f2`"      LDFLAGS_SHLIB="`$PERL -V:lddlflags | cut -d\' -f2`"      LD_SHLIB="`$PERL -V:ld | cut -d\' -f2`"       has_clflags=1      echo "Using shared library flags from Perl"    fi  fifi#if test -z "${LD_SHLIB}"; then#  AC_MSG_ERROR([Can't determine compilation flags.]);#fi## OS which can handle the Resin launcher#resin_plugin=case "$target_cpu" in  i?86)	CPU=i386	resin_plugin="resin resinssl"	;;  sparc*)	if test -n "${b64}"; then  	  CPU=sparcv9	else  	  CPU=sparc	fi	resin_plugin="resin resinssl"	;;  *)	CPU=$target_cpu	;;esaccase "$target_os" in  linux*)	jni_os=linux        PROXY_LIBS='-lpthread'	;;  solaris*)	jni_os=solaris	CFLAGS="$CFLAGS -D__SOLARIS__"	PROXY_LIBS='-lnsl -lsocket -lthread'	;;  *freebsd*)	PROXY_LIBS='-lc_r'        jni_os=freebsd	;;  *darwin*)	LD=gcc	SO=jnilib	resin_plugin="resin resinssl"	;;  *hpux*)	if test -r "$JAVA_HOME/include/hpux/jni_md.h"; then	  jni_os=hpux        else	  jni_os=hp-ux        fi	;;esacAC_SUBST(CPU)AC_SUBST(OS)AC_SUBST(SO)AC_SUBST(CFLAGS)AC_SUBST(CFLAGS_SHLIB)AC_SUBST(LD_SHLIB)AC_SUBST(LDFLAGS_SHLIB)AC_SUBST(LIBS_SHLIB)AC_SUBST(PROXY_LIBS)AC_SUBST(SSL_LIBS)## --with-java-home#AC_ARG_WITH(java-home,[  --with-java-home=DIR  java home], [JAVA_HOME=${withval}])echo $ac_n "checking for JAVA_HOME... $ac_c"if test -z "$JAVA_HOME"; then  java=`which java 2>/dev/null`  if test $? = "0"; then    while test -h "$java"    do      head=`dirname $java`      tail=`/bin/ls -l $java | awk '{ print $NF; }'`      if test -f "$tail"; then        java=$tail      else        java=$head/$tail      fi    done    javabin=`dirname $java`    JAVA_HOME=`cd $javabin/..; pwd`    # we're in $JAVA_HOME/jre    if test -f "$JAVA_HOME/lib/rt.jar"; then      JAVA_HOME=`cd $JAVA_HOME/..; pwd`    elif test -d "/usr/java"; then      JAVA_HOME=/usr/java    elif test -f "/System/Library/Frameworks/JavaVM.framework"; then      JAVA_HOME="/System/Library/Frameworks/JavaVM.framework"    fi  elif test -d "/usr/java"; then    JAVA_HOME=/usr/java  elif test -f "/System/Library/Frameworks/JavaVM.framework"; then    JAVA_HOME="/System/Library/Frameworks/JavaVM.framework"  fifiecho $JAVA_HOMEif test ! -d "$JAVA_HOME"; then  AC_MSG_ERROR([Can't find valid JAVA_HOME ${JAVA_HOME}])fiAC_SUBST(JAVA_HOME)## --with-jni-include#AC_ARG_WITH(jni-include,[  --with-jni-include="-Idir -Idir"  jni include string], [JNI_INCLUDE=${withval}JNI="yes"])	## --enable-jni#AC_ARG_ENABLE(jni,[  --enable-jni    Turn on jni],[case "${enableval}" in yes) JNI=true ;; no)  JNI="" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-jni) ;; esac],[JNI=""])if test -n "$JNI_INCLUDE"; then  JNI=yeselif test -r "$JAVA_HOME/include/jni_md.h"; then  JNI_INCLUDE="-I$JAVA_HOME/include"  JNI=yes  echo "checking for JNI in $JAVA_HOME/include ... found"elif test -r "$JAVA_HOME/include/$jni_os/jni_md.h"; then  JNI_INCLUDE="-I$JAVA_HOME/include -I$JAVA_HOME/include/$jni_os"  JNI=yes  echo "checking for JNI in $JAVA_HOME/include/$jni_os ... found"elif test -r "/System/Library/Frameworks/JavaVM.framework/Headers/jni_md.h"; then  # Darwin  echo "checking for JNI in /System/Library/Frameworks/JavaVM.framework/Headers ... found"  JNI_INCLUDE="-I/System/Library/Frameworks/JavaVM.framework/Headers"  JNI=yeselse  JNI=""  AC_MSG_WARN([Can't find JNI directory ${JAVA_HOME}/include/$jni_os])fiif test -n "$JNI"; then  plugins="$plugins $resin_plugin"fiAC_SUBST(JNI)AC_SUBST(JNI_INCLUDE)## Resin home#resin_home=`pwd`AC_SUBST(resin_home)## Resin HardCore(tm) configuration#LINUX_SRC=smp=## --with-linux-src#AC_ARG_WITH(linux-src,[  --with-linux-src=DIR  Linux src dir], [LINUX_SRC=${withval}hardcore=1if test "${LINUX_SRC}" = "yes"; then    LINUX_SRC=fi])## --with-hardcore#AC_ARG_WITH(hardcore,[  --with-hardcore=DIR  Linux src dir], [LINUX_SRC=${withval}hardcore=1if test "${LINUX_SRC}" = "yes"; then    LINUX_SRC=fi])## --with-hardcore-cflags#AC_ARG_WITH(hardcore-cflags,[  --with-hardcore-cflags=flags  Linux src dir], [HARDCORE_CFLAGS=${withval}hardcore=1])## --enable-linux-smp#AC_ARG_ENABLE(linux-smp,[  --enable-linux-smp    Compile with smp],[case "${enableval}" in yes) smp=1 ;; no)  smp="" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-linux-smp) ;; esac],[smp=""])## looking for proper hardcore stuff##hardcore=""#if test -n "$hardcore"; then  kver=`uname -r`  if test -n "$LINUX_SRC"; then    zz=m  elif test -r "/usr/src/linux-$kver/include/linux/version.h"; then    LINUX_SRC="/usr/src/linux-$kver/include"  elif test -r "/usr/src/linux-2.4/include/linux/version.h"; then    LINUX_SRC="/usr/src/linux-2.4/include"  elif test -r "/usr/src/linux/include/linux/version.h"; then    LINUX_SRC="/usr/src/linux/include"  else    LINUX_SRC="/usr/src/linux-2.4/include"  fi  if test ! -r "$LINUX_SRC/linux/version.h"; then    AC_MSG_ERROR(HardCore can't find valid Linux source at \"${LINUX_SRC}\")  fi  cat /proc/version | grep SMP > /dev/null  if test -n "$smp"; then    zz=m  elif test ! $?; then    smp=1    HARDCORE_CFLAGS="$HARDCORE_CFLAGS -DSMP"  fi  plugins="$plugins hardcore"  echo "Using Linux src for Resin HardCore ... ${LINUX_SRC}"  if test -n "$smp"; then    echo "Resin HardCore(tm) using SMP"  fifiAC_SUBST(LINUX_SRC)AC_SUBST(HARDCORE_CFLAGS)	## --enable-ssl#AC_ARG_ENABLE(ssl,[  --enable-ssl    Turn on ssl],[case "${enableval}" in yes) ENABLE_SSL=true ;; no)  ENABLE_SSL="false" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-ssl) ;; esac],[ENABLE_SSL=""])## --with-openssl#AC_ARG_WITH(openssl,[  --with-openssl=DIR  Openssl directory], [OPENSSL=${withval}])## --with-openssl-include#AC_ARG_WITH(openssl-include,[  --with-openssl-include=DIR  Openssl include directory], [OPENSSL_INCLUDE=${withval}if test ! -r "${OPENSSL_INCLUDE}/openssl/ssl23.h"; then  AC_MSG_ERROR([Can't find valid OpenSSL include ${OPENSSL_INCLUDE}])fi])## --with-openssl-lib#AC_ARG_WITH(openssl-lib,[  --with-openssl-lib=DIR  Openssl lib directory], [OPENSSL_LIB=${withval}if test ! -r "${OPENSSL_LIB}/libssl.a" -a \        ! -r "${OPENSSL_LIB}/libssl.dylib" -a \	! -r "${OPENSSL_LIB}/libssl.so"; then  AC_MSG_ERROR([Can't find valid OpenSSL library ${OPENSSL_LIB}])fi])if test "${ENABLE_SSL}" = false; then	  foo=barelif test -n "${OPENSSL_INCLUDE}"; then  foo=barelif test -r ${OPENSSL}/include/openssl/ssl23.h; then  OPENSSL_INCLUDE=${OPENSSL}/includeelif test -r /usr/include/openssl/ssl23.h; then  OPENSSL_INCLUDE=/usr/includeelif test -r /usr/local/include/openssl/ssl23.h; then  OPENSSL_INCLUDE=/usr/local/includeelif test -r /usr/local/ssl/include/openssl/ssl23.h; then  OPENSSL_INCLUDE=/usr/local/ssl/includefiif test "${ENABLE_SSL}" = false; then	  foo=barelif test -n "${OPENSSL_LIB}"; then  SSL_LIBS="${SSL_LIBS} -lssl -lcrypto"elif test -r /lib/libssl.so; then  OPENSSL_LIB=/lib  SSL_LIBS="${SSL_LIBS} -lssl -lcrypto"elif test -r /usr/lib/libssl.so; then  OPENSSL_LIB=/usr/lib  SSL_LIBS="${SSL_LIBS} -lssl -lcrypto"elif test -r /usr/local/ssl/lib/libssl.so; then  OPENSSL_LIB=/usr/local/ssl/lib  SSL_LIBS="${SSL_LIBS} -lssl -lcrypto"elif test -r /usr/lib/libssl.dylib; then  OPENSSL_LIB=/usr/lib  SSL_LIBS="${SSL_LIBS} -lssl -lcrypto"elif test -r ${OPENSSL}/lib/libssl.a; then  OPENSSL_LIB=${OPENSSL}/lib  SSL_LIBS="${SSL_LIBS} ${OPENSSL_LIB}/libssl.a ${OPENSSL_LIB}/libcrypto.a"elif test -r /usr/local/ssl/lib/libssl.a; then  OPENSSL_LIB=/usr/local/ssl/lib  SSL_LIBS="${SSL_LIBS} ${OPENSSL_LIB}/libssl.a ${OPENSSL_LIB}/libcrypto.a"elif test -r /usr/local/lib/libssl.a; then  OPENSSL_LIB=/usr/local/lib  SSL_LIBS="${SSL_LIBS} ${OPENSSL_LIB}/libssl.a ${OPENSSL_LIB}/libcrypto.a"elif test -r /usr/lib/libssl.a; then  OPENSSL_LIB=/usr/lib  SSL_LIBS="${SSL_LIBS} ${OPENSSL_LIB}/libssl.a ${OPENSSL_LIB}/libcrypto.a"fiSSL_OBJ=ssl_stub.oif test "${ENABLE_SSL}" = false; then	  foo=barelif test -z "${OPENSSL_INCLUDE}"; then  foo=barelif test ! -r "${OPENSSL_LIB}/libssl.a" -a ! -r "${OPENSSL_LIB}/libssl.dylib"; then  AC_MSG_ERROR([Can't find valid OpenSSL library in ${OPENSSL_LIB}])elif test ! -r "${OPENSSL_INCLUDE}/openssl/ssl23.h"; then  AC_MSG_ERROR([Can't find valid OpenSSL include in ${OPENSSL_INCLUDE}])else  echo "Using openssl include in ... ${OPENSSL_INCLUDE}"  echo "Using openssl lib in ... ${OPENSSL_LIB}"  echo "Using openssl libraries in ... ${SSL_LIBS}"  if test -x "${apache_dir}/bin/httpd"; then    apache_ssl=`${apache_dir}/bin/httpd -l 2>&1 | grep ssl`    if test -n "$apache_ssl"; then      CFLAGS="$CFLAGS -DOPENSSL"      echo "Enabling ssl for mod_caucho"     fi  fi  if test -r "${OPENSSL_INCLUDE}/openssl/engine.h"; then    CFLAGS_OPENSSL="$OPENSSL_CFLAGS -DSSL_ENGINE"  fi  if test -n "${OPENSSL_INCLUDE}"; then    INCLUDES="$INCLUDES -I${OPENSSL_INCLUDE}"  fi  SSL_OBJ=ssl.o  LDFLAGS_SHLIB="${LDFLAGS_SHLIB} -L${OPENSSL_LIB}"  # PROXY_LIBS="$PROXY_LIBS ${OPENSSL_LIB}/libssl.a ${OPENSSL_LIB}/libcrypto.a"fiif test -d /usr/kerberos/include; then   INCLUDES="$INCLUDES -I/usr/kerberos/include"fi## test the open ssl#  		if test -n "${OPENSSL_INCLUDE}"; then	cat >conftest.$ac_ext <<_ACEOF#include <openssl/ssl.h>#include <openssl/rsa.h>       #include <openssl/err.h>int main(int argc, char **argv){  SSLeay_add_ssl_algorithms();  SSL_load_error_strings();  #if OPENSSL_VERSION_NUMBER >= 0x00907000L    if (0)      ERR_print_errors_cb(0, 0);#endif  return 0;}_ACEOF${CC} -o conftest ${CFLAGS_OPENSSL} ${CFLAGS} ${INCLUDES} conftest.$ac_ext -L${OPENSSL_LIB} ${SSL_LIBS}if test "$?" != 0; then  AC_MSG_ERROR(Can't compile SSL.  Check compilation flags: ${CFLAGS_OPENSSL} ${CFLAGS} ${INCLUDES} -L${OPENSSL_LIB} ${SSL_LIBS})  exit;fi  ./conftestif test "$?" != 0; then  AC_MSG_ERROR(Can't execute SSL.  Check that load version in the library path: ${LD_LIBRARY_PATH} matches the expected version. })  exit;fi  	rm -f conftest conftest.$ac_extfi   AC_SUBST(INCLUDES)AC_SUBST(CFLAGS_OPENSSL)AC_SUBST(SSL_OBJ)PERL="perl"## --with-perl#AC_ARG_WITH(perl,[  --with-perl=DIR  Perl binary location], [PERL=${withval}])AC_SUBST(PERL)## --enable-debug#AC_ARG_ENABLE(debug,[  --enable-debug    Turn on debugging],[case "${enableval}" in yes) debug=true ;; no)  debug=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac],[debug=false])if test "$debug" = true; then  CFLAGS="$CFLAGS -DDEBUG -Wall"  HARDCORE_CFLAGS="$HARDCORE_CFLAGS -DDEBUG"fiAC_OUTPUT([Makefilebin/wrapper.plsrc/c/plugin/Makefilesrc/c/plugin/common/Makefilesrc/c/plugin/apache/Makefilesrc/c/plugin/apache2/Makefilesrc/c/plugin/resin/Makefilesrc/c/plugin/resinssl/Makefilecontrib/init.resin], [])chmod +x bin/wrapper.pl

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?