OSDN Git Service

* Changed Z2hOn Features.
[modchxj/mod_chxj.git] / configure.ac
index eddcf4f..66126b4 100644 (file)
@@ -1,6 +1,6 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
-AC_INIT([mod_chxj],[0.10.0-1])
+AC_INIT([mod_chxj],[0.12.35],[konn@users.sourceforge.jp])
 AC_PREREQ(2.59)
 AC_CONFIG_SRCDIR([src/mod_chxj.c])
 AC_CANONICAL_TARGET
@@ -93,25 +93,31 @@ dnl
 dnl SAVE COOKIE to memcached Mode
 dnl
 dnl ==================================================
-AC_ARG_ENABLE(memcache-cookie, [  --enable-memcache-cookie Please specify it when you save Cookie in memcached. ])
-AC_ARG_WITH(apr-memcache-header,   [  --with-apr-memcache-header Path of "apr_memcache.h"])
-AC_ARG_WITH(apr-memcache-lib-dir,   [  --with-apr-memcache-lib-dir Path of "libapr_memcache.so"])
+AC_ARG_ENABLE(memcache-cookie,   [  --enable-memcache-cookie Please specify it when you save Cookie in memcached. ])
+AC_ARG_ENABLE(memcached-static,  [  --enable-memcached-static use static link. ])
+AC_ARG_WITH(memcached-header,    [  --with-memcached-header Path of "memcached.h"])
+AC_ARG_WITH(memcached-lib-dir,   [  --with-memcached-lib-dir Path of "libmemcached.so"])
 if test "x$enable_memcache_cookie" = "xyes" ; then
   dnl ======================================
   dnl use MEMCACHE COOKIE
   dnl ======================================
-  if test "x$with_apr_memcache_header" = "x" -o "x$with_apr_memcache_header" = "xyes" ; then
+  if test "x${with_memcached_header}" = "x" -o "x${with_memcached_header}" = "xyes" ; then
     AC_MSG_ERROR([
-Please specify the --with-apr-memcache-header And, please specify the place of the "apr_memcache.h" header file directory. 
+Please specify the --with-memcached-header And, please specify the place of the "memcached.h" header file directory. 
 ])
   fi
-  if test "x$with_apr_memcache_lib_dir" = "x" -o "x$with_apr_memcache_lib_dir" = "xyes" ; then
+  if test "x${with_memcached_lib_dir}" = "x" -o "x${with_memcached_lib_dir}" = "xyes" ; then
     AC_MSG_ERROR([
-Please specify the --with-apr-memcache-lib-dir And, please specify the place of apr-memcache library directory. 
+Please specify the --with-memcached-lib-dir And, please specify the place of libmemcached library directory. 
 ])
   fi
-  MEMCACHE_COOKIE_DEFS="-DUSE_MEMCACHE_COOKIE -I${with_apr_memcache_header}"
-  MEMCACHE_COOKIE_LIBS="-L${with_apr_memcache_lib_dir} -lapr_memcache"
+  if test "x$enable_memcached_static" = "xyes" ; then
+    MEMCACHE_COOKIE_DEFS="-DUSE_MEMCACHE_COOKIE -I${with_memcached_header} "
+    MEMCACHE_COOKIE_LIBS=" ${with_memcached_lib_dir}/libmemcached.a "
+  else
+    MEMCACHE_COOKIE_DEFS="-DUSE_MEMCACHE_COOKIE -I${with_memcached_header} "
+    MEMCACHE_COOKIE_LIBS="-L${with_memcached_lib_dir} -lmemcached "
+  fi
 else
   dnl ======================================
   dnl no use MEMCACHE COOKIE
@@ -153,6 +159,35 @@ fi
 
 dnl ==================================================
 dnl
+dnl OpenSSL
+dnl
+dnl ==================================================
+OPENSSL_PATH=""
+AC_ARG_WITH(openssl,
+  APR_HELP_STRING([--with-openssl=PATH],[Path to OpenSSL (eg. /usr/local/ssl)]),
+[
+  if test "$withval" = "yes"; then
+    AC_MSG_ERROR([--with-openssl requires a path])
+  else
+    openssl_prefix=$withval
+
+    if test "x$openssl_prefix" != "x" -a ! -d "$openssl_prefix"; then
+      AC_MSG_ERROR('--with-openssl requires a path to a directory')
+    fi
+
+    CPPFLAGS="${CPPFLAGS} -I${openssl_prefix}/include"
+    LDFLAGS="${LDFLAGS} -L${openssl_prefix}/lib"
+    LDFLAGS="${LDFLAGS} -R${openssl_prefix}/lib"
+    OPENSSL_PATH="--with-openssl ${openssl_prefix}"
+  fi
+])
+
+dnl Look for OpenSSL
+AC_CHECK_HEADER([openssl/opensslv.h], [],
+                [AC_MSG_ERROR([We require OpenSSL; try --with-openssl])])
+
+dnl ==================================================
+dnl
 dnl dump log for DEBUG
 dnl
 dnl ==================================================
@@ -240,7 +275,8 @@ LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldps
 LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` "
 LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` "
 LIBS="${LIBS} ${MYSQL_COOKIE_LIBS}"
-LIBS="${LIBS} ${MEMCACHE_COOKIE_LIBS}"
+LIBS="${LIBS} ${MEMCACHE_COOKIE_LIBS} "
+LIBS="${LIBS} -lcrypto -lssl "
 CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`"
 CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`"
 CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`"
@@ -267,7 +303,14 @@ AC_CHECK_HEADERS([ap_config.h])
 ##include "ap_config.h"
 ##endif
 #]])
-AC_CHECK_HEADERS([ap_regex.h],use_pcre_flag="no",use_pcre_flag="yes")
+AC_CHECK_HEADERS([ap_regex.h],use_pcre_flag="no",use_pcre_flag="yes",
+[[#ifdef HAVE_APR_H
+# include "apr.h"
+#endif
+#ifdef HAVE_AP_CONFIG_H
+# include "ap_config.h"
+#endif
+]])
 if test "x$use_pcre_flag" = "xyes" ; then
   if test "x$with_pcre_config" = "x" ; then
     AC_PATH_PROG(PCRE_CONFIG, pcre-config, no, /usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin)
@@ -285,7 +328,7 @@ if test "x$use_pcre_flag" = "xyes" ; then
   fi
   CFLAGS="${CFLAGS} `${PCRE_CONFIG} --cflags`"
 else
-  AC_DEFINE([HAVE_AP_REGEX_H], [], [Define to 1 if you have the <ap_regex.h> header file.])
+  AC_DEFINE([HAVE_AP_REGEX_H], [1], [Define to 1 if you have the <ap_regex.h> header file.])
 fi
 
 # Checks for typedefs, structures, and compiler characteristics.
@@ -301,7 +344,8 @@ AC_SUBST(QDEFS)
 AC_SUBST(DDEFS)
 AC_SUBST(LIBS)
 AC_SUBST(CFLAGS)
+AC_SUBST(OPENSSL_PATH)
 
 
-AC_CONFIG_FILES([Makefile src/Makefile])
+AC_CONFIG_FILES([Makefile src/Makefile support/centos/mod-chxj.spec])
 AC_OUTPUT