cvs: php4 /sapi/caudium config.m4

From: Date: Fri, 01 Dec 2000 22:23:37 +0000
Subject: cvs: php4 /sapi/caudium config.m4
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-2849@lists.php.net to get a copy of this message
neotron Fri Dec 1 14:23:37 2000 EDT Modified files: /php4/sapi/caudium config.m4 Log: Updated config test to also work with debian pike 7 cvs etc. Index: php4/sapi/caudium/config.m4 diff -u php4/sapi/caudium/config.m4:1.3 php4/sapi/caudium/config.m4:1.4 --- php4/sapi/caudium/config.m4:1.3 Sun Nov 19 01:10:16 2000 +++ php4/sapi/caudium/config.m4 Fri Dec 1 14:23:37 2000 @@ -1,4 +1,4 @@ -dnl ## $Id: config.m4,v 1.3 2000/11/19 09:10:16 neotron Exp $ -*- sh -*- +dnl ## $Id: config.m4,v 1.4 2000/12/01 22:23:37 neotron Exp $ -*- sh -*- RESULT=no AC_MSG_CHECKING(for Caudium support) @@ -7,8 +7,13 @@ DIR is the Caudium server dir, with the default value /usr/local/caudium/server.], [ + if test "$prefix" = "NONE"; then CPREF=/usr/local/; fi if test ! -d $withval ; then - withval=/usr/local/caudium/server + if test "$prefix" = "NONE"; then + withval=/usr/local/caudium/server/ + else + withval=$prefix/caudium/server/ + fi fi if test -f $withval/bin/caudium; then PIKE="$withval/bin/caudium" @@ -17,12 +22,53 @@ else AC_MSG_ERROR(Couldn't find a pike in $withval/bin/) fi + tmppike=ls -l $PIKE | awk -F ' -> ' '{ print $2 }' 2>/dev/null + if test -x "$tmppike"; then + PIKE=$tmppike + fi if $PIKE -e 'float v; int rel;sscanf(version(), "Pike v%f release %d", v, rel);v += rel/10000.0; if(v < 7.0) exit(1); exit(0);'; then PIKE_MODULE_DIR="$PIKE --show-paths 2>&1| grep '^Module' | sed -e 's/.*: //'" PIKE_INCLUDE_DIR="echo $PIKE_MODULE_DIR | sed -e 's,lib/pike/modules,include/pike,' -e 's,lib/modules,include/pike,'" if test -z "$PIKE_INCLUDE_DIR" -o -z "$PIKE_MODULE_DIR"; then AC_MSG_ERROR(Failed to figure out Pike module and include directories) fi + AC_MSG_RESULT(yes) + if test "$prefix" != "NONE"; then + PIKE_C_INCLUDE=$prefix/include/basename ${PIKE} + else + PIKE_C_INCLUDE=/usr/local/include/basename ${PIKE} + fi + AC_MSG_CHECKING(for C includes in ${PIKE_C_INCLUDE}) + if test -f $PIKE_C_INCLUDE/version.h; then + PIKE_TEST_VER=$PIKE -e 'string v; int rel;sscanf(version(), "Pike v%s release %d", v, rel); write(v+"."+rel);' + ###### VERSION MATCH CHECK ####### + PMAJOR="^#define PIKE_MAJOR_VERSION" + PMINOR="^#define PIKE_MINOR_VERSION" + PBUILD="^#define PIKE_BUILD_VERSION" + + PIKE_CMAJOR_VERSION=0 + PIKE_CMINOR_VERSION=0 + PIKE_CBUILD_VERSION=0 + + PIKE_CMAJOR_VERSION=grep "$PMAJOR" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/' + if test -z "$PIKE_CMAJOR_VERSION"; then + if test -n "grep f_version $PIKE_C_INCLUDE/version.h"; then + PIKE_CMAJOR_VERSION=6 + fi + else + PIKE_CMINOR_VERSION=grep "$PMINOR" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/' + PIKE_CBUILD_VERSION=grep "$PBUILD" $PIKE_C_INCLUDE/version.h | sed -e 's/\(#define.*N \)\(.*\)/\2/' + fi + + if test "$PIKE_TEST_VER" = "${PIKE_CMAJOR_VERSION}.${PIKE_CMINOR_VERSION}.${PIKE_CBUILD_VERSION}"; then + PIKE_INCLUDE_DIRS=" $PIKE_INCLUDE_DIRS -I$PIKE_C_INCLUDE" + AC_MSG_RESULT(found) + else + AC_MSG_RESULT(version mismatch) + fi + else + AC_MSG_RESULT(not found) + fi else AC_MSG_ERROR(Caudium PHP4 requires Pike 7.0 or newer) fi @@ -32,8 +78,7 @@ PHP_SAPI=caudium PHP_BUILD_SHARED INSTALL_IT="\$(INSTALL) -m 0755 $SAPI_SHARED $withval/lib/$PIKE_VERSION/PHP4.so" - RESULT="yes - *** Pike binary used: $PIKE + RESULT=" *** Pike binary used: $PIKE *** Pike include dir: $PIKE_INCLUDE_DIR *** Pike version: $PIKE_VERSION" PIKE_INCLUDE_DIR=" -I$PIKE_INCLUDE_DIR "

« previous php.cvs (#2849) next »