From df4ae09d872cacdb49b1f8e0654e87500b550893 Mon Sep 17 00:00:00 2001 From: konn Date: Sun, 23 Mar 2008 14:15:41 +0000 Subject: [PATCH] * Added Document and Save cookie to Mysql. git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/trunk@1903 1a406e8e-add9-4483-a2c8-d8cac5b7c224 --- configure | 100 ++++-- configure.ac | 65 +++- doc/modchxj.html | 75 ++++- doc/modchxj.sdoc | 59 +++- include/chxj_mysql.h | 33 +- include/mod_chxj.h | 9 + src/Makefile.am | 3 +- src/Makefile.in | 14 +- src/chxj_cookie.c | 419 ++++++++++++++++-------- src/chxj_mysql.c | 876 ++++++++++++++++++++++++++++++++++++++++++++++++++- src/mod_chxj.c | 302 +++++++++++++++++- 11 files changed, 1782 insertions(+), 173 deletions(-) diff --git a/configure b/configure index 46a8012e..e2e552c8 100755 --- a/configure +++ b/configure @@ -1491,6 +1491,7 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --enable-img-conv-f Please specify it when you change the file name of the image being written in the source by the automatic operation. + --enable-mysql-cookie Please specify it when you save Cookie in MySQL. --enable-dump-log When the log of conversion is output, it specifies it with the output file. Optional Packages: @@ -1504,6 +1505,8 @@ Optional Packages: --with-apxs=ARG Path of apxs program file. --with-apr-config=ARG Path of apr-config program file. --with-apu-config=ARG Path of apu-config program file. + --with-mysql-header=ARG Path of "mysql.h" + --with-mysql-lib-dir=ARG Path of libmysqlclient Some influential environment variables: CC C compiler command @@ -5462,7 +5465,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 5465 "configure"' > conftest.$ac_ext + echo '#line 5468 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -7958,11 +7961,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7961: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7964: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7965: \$? = $ac_status" >&5 + echo "$as_me:7968: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8226,11 +8229,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8229: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8232: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8233: \$? = $ac_status" >&5 + echo "$as_me:8236: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8330,11 +8333,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8333: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8336: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8337: \$? = $ac_status" >&5 + echo "$as_me:8340: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -10627,7 +10630,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:13069: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13070: \$? = $ac_status" >&5 + echo "$as_me:13073: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13167,11 +13170,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13170: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13173: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13174: \$? = $ac_status" >&5 + echo "$as_me:13177: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -14728,11 +14731,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14731: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14734: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:14735: \$? = $ac_status" >&5 + echo "$as_me:14738: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -14832,11 +14835,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14835: $lt_compile\"" >&5) + (eval echo "\"\$as_me:14838: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:14839: \$? = $ac_status" >&5 + echo "$as_me:14842: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17019,11 +17022,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17022: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17025: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17026: \$? = $ac_status" >&5 + echo "$as_me:17029: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17287,11 +17290,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17290: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17293: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:17294: \$? = $ac_status" >&5 + echo "$as_me:17297: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -17391,11 +17394,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17394: $lt_compile\"" >&5) + (eval echo "\"\$as_me:17397: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:17398: \$? = $ac_status" >&5 + echo "$as_me:17401: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -20188,7 +20191,6 @@ Please specify the --with-apu-config option. And, please specify the place of th { (exit 1); exit 1; }; } fi - # Check whether --enable-img-conv-f was given. if test "${enable_img_conv_f+set}" = set; then enableval=$enable_img_conv_f; @@ -20200,6 +20202,50 @@ else QDEFS="-DIMG_NOT_CONVERT_FILENAME" fi + +# Check whether --enable-mysql-cookie was given. +if test "${enable_mysql_cookie+set}" = set; then + enableval=$enable_mysql_cookie; +fi + + +# Check whether --with-mysql-header was given. +if test "${with_mysql_header+set}" = set; then + withval=$with_mysql_header; +fi + + +# Check whether --with-mysql-lib-dir was given. +if test "${with_mysql_lib_dir+set}" = set; then + withval=$with_mysql_lib_dir; +fi + +if test "x$enable_mysql_cookie" = "xyes"; then + if test "x$with_mysql_header" = "x" -o "x$with_mysql_header" = "xyes" ; then + { { echo "$as_me:$LINENO: error: +Please specify the --with-mysql-header And, please specify the place of the \"mysql.h\" header file. +" >&5 +echo "$as_me: error: +Please specify the --with-mysql-header And, please specify the place of the \"mysql.h\" header file. +" >&2;} + { (exit 1); exit 1; }; } + fi + if test "x$with_mysql_lib_dir" = "x" -o "x$with_mysql_lib_dir" = "xyes" ; then + { { echo "$as_me:$LINENO: error: +Please specify the --with-mysql-lib-dir And, please specify the place of mysql library directory. +" >&5 +echo "$as_me: error: +Please specify the --with-mysql-lib-dir And, please specify the place of mysql library directory. +" >&2;} + { (exit 1); exit 1; }; } + fi + MYSQL_COOKIE_DEFS="-DUSE_MYSQL_COOKIE -I${with_mysql_header}" + MYSQL_COOKIE_LIBS="-L${with_mysql_lib_dir} -lmysqlclient_r" +else + MYSQL_COOKIE_DEFS="" + MYSQL_COOKIE_LIBS="" +fi + # Check whether --enable-dump-log was given. if test "${enable_dump_log+set}" = set; then enableval=$enable_dump_log; @@ -20621,15 +20667,21 @@ case $host_os in esac + + LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` " LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` " LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` " +LIBS="${LIBS} ${MYSQL_COOKIE_LIBS}" CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`" CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`" CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`" CFLAGS="${CFLAGS} -I${with_apache_header}" +CFLAGS="${CFLAGS} ${MYSQL_COOKIE_DEFS}" CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` " CPPFLAGS="${CPPFLAGS} -I${with_apache_header}" +CPPFLAGS="${CPPFLAGS} ${MYSQL_COOKIE_DEFS}" + # Checks for header files. { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 diff --git a/configure.ac b/configure.ac index 5baa67ad..cbda940b 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,11 @@ Please specify the --with-apache-header option. And, please specify the place of ]) fi +dnl ================================================== +dnl +dnl apxs +dnl +dnl ================================================== AC_ARG_WITH(apxs, [ --with-apxs=ARG Path of apxs program file.]) if test "x$with_apxs" = "x" ; then APXS="" @@ -39,6 +44,11 @@ Please specify the --with-apxs option. And, please specify the place of the apxs ]) fi +dnl ================================================== +dnl +dnl apr-config +dnl +dnl ================================================== AC_ARG_WITH(apr-config, [ --with-apr-config=ARG Path of apr-config program file.]) if test "x$with_apr_config" = "xyes" ; then AC_MSG_ERROR([ @@ -46,6 +56,11 @@ Please specify the --with-apr-config option. And, please specify the place of th ]) fi +dnl ================================================== +dnl +dnl apu-config +dnl +dnl ================================================== AC_ARG_WITH(apu-config, [ --with-apu-config=ARG Path of apu-config program file.]) if test "x$with_apu_config" = "xyes" ; then AC_MSG_ERROR([ @@ -53,7 +68,11 @@ Please specify the --with-apu-config option. And, please specify the place of th ]) fi - +dnl ================================================== +dnl +dnl filename in img tag convertion. +dnl +dnl ================================================== AC_ARG_ENABLE(img-conv-f, [ --enable-img-conv-f Please specify it when you change the file name of the image being written in the source by the automatic operation.]) if test "x$enable_img_conv_f" = "xyes"; then @@ -62,6 +81,44 @@ else QDEFS="-DIMG_NOT_CONVERT_FILENAME" fi + +dnl ================================================== +dnl +dnl SAVE COOKIE to MySQL Mode +dnl +dnl ================================================== +AC_ARG_ENABLE(mysql-cookie, [ --enable-mysql-cookie Please specify it when you save Cookie in MySQL. ]) +AC_ARG_WITH(mysql-header, [ --with-mysql-header=ARG Path of "mysql.h"]) +AC_ARG_WITH(mysql-lib-dir, [ --with-mysql-lib-dir=ARG Path of libmysqlclient]) +if test "x$enable_mysql_cookie" = "xyes"; then + dnl ====================================== + dnl use MYSQL COOKIE + dnl ====================================== + if test "x$with_mysql_header" = "x" -o "x$with_mysql_header" = "xyes" ; then + AC_MSG_ERROR([ +Please specify the --with-mysql-header And, please specify the place of the "mysql.h" header file. +]) + fi + if test "x$with_mysql_lib_dir" = "x" -o "x$with_mysql_lib_dir" = "xyes" ; then + AC_MSG_ERROR([ +Please specify the --with-mysql-lib-dir And, please specify the place of mysql library directory. +]) + fi + MYSQL_COOKIE_DEFS="-DUSE_MYSQL_COOKIE -I${with_mysql_header}" + MYSQL_COOKIE_LIBS="-L${with_mysql_lib_dir} -lmysqlclient_r" +else + dnl ====================================== + dnl no use MYSQL COOKIE + dnl ====================================== + MYSQL_COOKIE_DEFS="" + MYSQL_COOKIE_LIBS="" +fi + +dnl ================================================== +dnl +dnl dump log for DEBUG +dnl +dnl ================================================== AC_ARG_ENABLE(dump-log, [ --enable-dump-log When the log of conversion is output, it specifies it with the output file. ]) if test "x$enable_dump_log" = "xyes"; then DDEFS="-DDUMP_LOG=\\\"/tmp/dump.log\\\"" @@ -145,15 +202,21 @@ case $host_os in esac + + LIBS="${LIBS} `${WAND_CONFIG} --ldflags` `${WAND_CONFIG} --libs | sed -e s/-ldpstk//` " LIBS="${LIBS} `${APR_CONFIG} --ldflags` `${APR_CONFIG} --libs` " LIBS="${LIBS} `${APU_CONFIG} --ldflags` `${APU_CONFIG} --libs` " +LIBS="${LIBS} ${MYSQL_COOKIE_LIBS}" CFLAGS="${CFLAGS} `${WAND_CONFIG} --cppflags` `${WAND_CONFIG} --cflags`" CFLAGS="${CFLAGS} `${APR_CONFIG} --includes` `${APR_CONFIG} --cflags` `${APR_CONFIG} --cppflags`" CFLAGS="${CFLAGS} `${APU_CONFIG} --includes`" CFLAGS="${CFLAGS} -I${with_apache_header}" +CFLAGS="${CFLAGS} ${MYSQL_COOKIE_DEFS}" CPPFLAGS="${CPPFLAGS} `${APR_CONFIG} --includes` " CPPFLAGS="${CPPFLAGS} -I${with_apache_header}" +CPPFLAGS="${CPPFLAGS} ${MYSQL_COOKIE_DEFS}" + # Checks for header files. AC_HEADER_STDC diff --git a/doc/modchxj.html b/doc/modchxj.html index 2684202d..b52b9ff6 100644 --- a/doc/modchxj.html +++ b/doc/modchxj.html @@ -7,7 +7,7 @@ - + mod_chxj