Author: dumindu
Date: Wed Feb 27 22:41:50 2008
New Revision: 14280

Log:

1. Removed unnecessary cspace_debug.h
2. Added --with-apr-config option to configure script.



Added:
   trunk/solutions/identity/modules/mod-cspace/acinclude.d/
   trunk/solutions/identity/modules/mod-cspace/acinclude.d/ax_with_apxs.m4
Removed:
   trunk/solutions/identity/modules/mod-cspace/cspace_debug.h
Modified:
   trunk/solutions/identity/modules/mod-cspace/Makefile.am
   trunk/solutions/identity/modules/mod-cspace/autogen.sh
   trunk/solutions/identity/modules/mod-cspace/build.sh
   trunk/solutions/identity/modules/mod-cspace/configure.ac
   trunk/solutions/identity/modules/mod-cspace/process_request.c

Modified: trunk/solutions/identity/modules/mod-cspace/Makefile.am
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/Makefile.am     (original)
+++ trunk/solutions/identity/modules/mod-cspace/Makefile.am     Wed Feb 27 
22:41:50 2008
@@ -1,4 +1,7 @@
-lib_LTLIBRARIES=libmod_cspace.la libdummy_ppid_validator.la
+ACLOCAL_AMFLAGS=-I ${top_srcdir}/acinclude.d/
+
+noinst_LTLIBRARIES=libmod_cspace.la libdummy_ppid_validator.la
+noinst_DATA = mod_cspace.la
 
 libmod_cspace_la_SOURCES= cspace_config.c \
                          cspace_utils.c \
@@ -10,6 +13,12 @@
 
 libdummy_ppid_validator_la_SOURCES= dummy_ppid_validator.c
 
+install-exec-local:
+           ${APXS} -i -a -n 'cspace' mod_cspace.la
+
+mod_cspace.la: libmod_cspace.la
+           ${APXS} -c -o $@ $< ${CFLAGS}
+
 EXTRA_DIST = INSTALL ChangeLog LICENSE build build.sh AUTHORS NOTICE *.c *.h
 
 dist-hook:

Added: trunk/solutions/identity/modules/mod-cspace/acinclude.d/ax_with_apxs.m4
==============================================================================
--- (empty file)
+++ trunk/solutions/identity/modules/mod-cspace/acinclude.d/ax_with_apxs.m4     
Wed Feb 27 22:41:50 2008
@@ -0,0 +1,43 @@
+# taken from mod_auth_openid 
(http://www.butterfat.net/wiki/Projects/ModAuthOpenID)
+# which inturn was taken from mod_python's (http://www.modpython.org/)
+
+AC_DEFUN([AX_WITH_APXS],
+[
+
+# check for --with-apxs
+AC_MSG_CHECKING(for --with-apxs)
+AC_ARG_WITH(apxs, AC_HELP_STRING([--with-apxs=PATH], [Path to apxs]),
+[
+  if test -x "$withval"
+  then
+    AC_MSG_RESULT([$withval executable, good])
+    APXS=$withval
+  else
+    echo
+    AC_MSG_ERROR([$withval not found or not executable])
+  fi
+],
+AC_MSG_RESULT(no))
+
+# find apxs
+if test -z "$APXS"; then
+  AC_PATH_PROGS([APXS],[apxs2 
apxs],[false],[${PATH}:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin])
+  test "${APXS}" = "false" && AC_MSG_ERROR([failed to find apxs. Try using 
--with-apxs])
+fi
+
+  # check Apache version
+  AC_MSG_CHECKING(Apache version)
+  HTTPD="`${APXS} -q SBINDIR`/`${APXS} -q TARGET`"
+  if test ! -x "$HTTPD"; then
+    AC_MSG_ERROR($APXS says that your apache binary lives at $HTTPD but that 
file isn't executable.  Specify the correct apxs location with --with-apxs)
+  fi
+  ver=`$HTTPD -v | /usr/bin/awk '/version/ {print $3}' | /usr/bin/awk -F/ 
'{print $2}'`
+  AC_MSG_RESULT($ver)
+
+  # make sure version begins with 2
+  if test -z "`$HTTPD -v | egrep 'Server version: Apache/2'`"; then
+    AC_MSG_ERROR([mod_auth_openid only works with Apache 2. The one you have 
seems to be $ver.])
+  fi
+
+AC_SUBST(APXS)
+])

Modified: trunk/solutions/identity/modules/mod-cspace/autogen.sh
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/autogen.sh      (original)
+++ trunk/solutions/identity/modules/mod-cspace/autogen.sh      Wed Feb 27 
22:41:50 2008
@@ -17,7 +17,7 @@
 fi
 
 echo -n 'Running aclocal...'
-if aclocal > /dev/null 2>&1; then
+if aclocal -I ./acinclude.d > /dev/null 2>&1; then
        echo 'done.'
 else
        echo 'failed.'

Modified: trunk/solutions/identity/modules/mod-cspace/build.sh
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/build.sh        (original)
+++ trunk/solutions/identity/modules/mod-cspace/build.sh        Wed Feb 27 
22:41:50 2008
@@ -1,6 +1,6 @@
 #!/bin/sh
 sh autogen.sh
-#./configure --with-apxs2
-./configure --with-apxs2=/home/dumindu/software/httpd-2.2.8/deploy/bin/apxs
+./configure 
+#./configure --with-apxs2=/home/dumindu/software/httpd-2.2.8/deploy/bin/apxs
 
 make

Modified: trunk/solutions/identity/modules/mod-cspace/configure.ac
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/configure.ac    (original)
+++ trunk/solutions/identity/modules/mod-cspace/configure.ac    Wed Feb 27 
22:41:50 2008
@@ -98,57 +98,86 @@
 CPPFLAGS="$CPPFLAGS $XMLSEC_CFLAGS"
 LDFLAGS="$LDFLAGS $XMLSEC_LIBS"
 
-AC_MSG_CHECKING(path to apxs)
-AC_ARG_WITH(apxs2,
-[  --with-apxs2[=PATH]    path to apxs ],
-[ case "$withval" in
-  no)
-    AC_MSG_RESULT(no)
-    ;;
-  *)
-    AC_MSG_RESULT(yes)
-    if test -f $withval; then
-        apxs2="$withval"
-        echo "$withval"
-    dnl else find the apache2 include dir in /usr/local/apache2
-    elif test -f '/usr/bin/apxs2'; then
-        apxs2="/usr/bin/apxs2"
-    elif test -f '/usr/sbin/apxs2'; then
-        apxs2="/usr/sbin/apxs2"
-    else
-        AC_MSG_ERROR(could not find apxs2. stop)
-    fi
-    ;;
-  esac ],
-  AC_MSG_RESULT(no)
+AX_WITH_APXS()
+
+AC_ARG_WITH(apr_config, AC_HELP_STRING([[--with-apr-config=FILE]], [Path to 
apr-config program]),
+            [ apr_config="$withval" ],
+            [AC_PATH_PROGS(apr_config,
+                [apr-config apr-0-config apr-1-config],
+                [no],
+                [$PATH:/usr/sbin/:/usr/local/apache2/bin]
+            )]
 )
 
-APR_CFG=`$apxs2 -q APR_CONFIG`
-APU_CFG=`$apxs2 -q APU_CONFIG`
-if test -z "$APR_CFG" || test -z "$APU_CFG"; then
-    PKG_CHECK_MODULES(APR1, apr-1)
-    CFLAGS="$CFLAGS $APR1_CFLAGS"
-    CPPFLAGS="$CPPFLAGS $APR1_CFLAGS"
-    
-    PKG_CHECK_MODULES(APRUTIL1, apr-util-1)
-    CFLAGS="$CFLAGS $APRUTIL1_CFLAGS"
-    CPPFLAGS="$CPPFLAGS $APRUTIL1_CFLAGS"
+if test -z "$apr_config"; then
+   PKG_CHECK_MODULES(APR1, apr-1)
+   CFLAGS="$CFLAGS $APR1_CFLAGS"
+   CPPFLAGS="$CPPFLAGS $APR1_CFLAGS"
+
+   PKG_CHECK_MODULES(APRUTIL1, apr-util-1)
+   CFLAGS="$CFLAGS $APRUTIL1_CFLAGS"
+   CPPFLAGS="$CPPFLAGS $APRUTIL1_CFLAGS"
 else
-    echo "APR: $APR_CFG"
-    echo "APU: $APU_CFG"
-    CFLAGS="$CFLAGS `$APR_CFG --cppflags`"
-    CFLAGS="$CFLAGS `$APR_CFG --cflags`"
-    CFLAGS="$CFLAGS `$APU_CFG --includes`"
+   $apr_config --cppflags &> /dev/null
+   if test "$?" != "0"; then
+     AC_MSG_ERROR($apr_config is not a valid apr-config program.)
+   fi
+   CFLAGS="$CFLAGS `${apr_config} --cflags` `${apr_config} --includes`"
+   CPPFLAGS="$CPPFLAGS `${apr_config} --cppflags`"
 fi
 
-APXS2=$apxs2
 
-CFLAGS="$CFLAGS `${APXS2} -q CFLAGS`"
-CFLAGS="$CFLAGS -I`${APXS2} -q INCLUDEDIR`"
+dnl AC_MSG_CHECKING(path to apxs)
+dnl AC_ARG_WITH(apxs2,
+dnl [  --with-apxs2[=PATH]    path to apxs ],
+dnl [ case "$withval" in
+dnl   no)
+dnl     AC_MSG_RESULT(no)
+dnl     ;;
+dnl   *)
+dnl     AC_MSG_RESULT(yes)
+dnl     if test -f $withval; then
+dnl         apxs2="$withval"
+dnl         echo "$withval"
+dnl     dnl else find the apache2 include dir in /usr/local/apache2
+dnl     elif test -f '/usr/bin/apxs2'; then
+dnl         apxs2="/usr/bin/apxs2"
+dnl     elif test -f '/usr/sbin/apxs2'; then
+dnl         apxs2="/usr/sbin/apxs2"
+dnl     else
+dnl         AC_MSG_ERROR(could not find apxs2. stop)
+dnl     fi
+dnl     ;;
+dnl   esac ],
+dnl   AC_MSG_RESULT(no)
+dnl )
+
+dnl APR_CFG=`$apxs2 -q APR_CONFIG`
+dnl APU_CFG=`$apxs2 -q APU_CONFIG`
+dnl if test -z "$APR_CFG" || test -z "$APU_CFG"; then
+dnl     PKG_CHECK_MODULES(APR1, apr-1)
+dnl     CFLAGS="$CFLAGS $APR1_CFLAGS"
+dnl     CPPFLAGS="$CPPFLAGS $APR1_CFLAGS"
+dnl     
+dnl     PKG_CHECK_MODULES(APRUTIL1, apr-util-1)
+dnl     CFLAGS="$CFLAGS $APRUTIL1_CFLAGS"
+dnl     CPPFLAGS="$CPPFLAGS $APRUTIL1_CFLAGS"
+dnl else
+dnl     echo "APR: $APR_CFG"
+dnl     echo "APU: $APU_CFG"
+dnl     CFLAGS="$CFLAGS `$APR_CFG --cppflags`"
+dnl     CFLAGS="$CFLAGS `$APR_CFG --cflags`"
+dnl     CFLAGS="$CFLAGS `$APU_CFG --includes`"
+dnl fi
+dnl 
+dnl APXS2=$apxs2
+
+CFLAGS="$CFLAGS `${APXS} -q CFLAGS`"
+CFLAGS="$CFLAGS -I`${APXS} -q INCLUDEDIR`"
 dnl CFLAGS="$CFLAGS -module -avoid-version"
 
 
-AC_SUBST(APXS2)
+AC_SUBST(APXS)
 dnl CFLAGS="$CFLAGS `$apxs2 -q CFLAGS`"
 dnl APACHE_INC=`$apxs2 -q INCLUDEDIR`
 dnl APACHE_LIBS=`$apxs2 -q LIBS_SHLIB`

Modified: trunk/solutions/identity/modules/mod-cspace/process_request.c
==============================================================================
--- trunk/solutions/identity/modules/mod-cspace/process_request.c       
(original)
+++ trunk/solutions/identity/modules/mod-cspace/process_request.c       Wed Feb 
27 22:41:50 2008
@@ -33,7 +33,6 @@
 #include <libxml/xpathInternals.h>
 #include <xmlsec/x509.h>
 
-#include "cspace_debug.h"
 #include "process_request.h"
 #include "process_request_defines.h"
 

_______________________________________________
Identity-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/identity-dev

Reply via email to