From ccaa7d219bdb902601266f82ead900d6cb9b7f35 Mon Sep 17 00:00:00 2001 From: Michael Lum Date: Sat, 16 Aug 2008 18:49:00 +0000 Subject: [PATCH] using php build system git-svn-id: https://lwes.svn.sourceforge.net/svnroot/lwes/lwes-php/trunk@52 a2f82657-cdd2-4550-bd36-68a8e7111808 --- .svnignore | 6 ++++ bootstrap | 105 +++-------------------------------------------------------- config.m4 | 19 +++++++++++ configure.ac | 47 -------------------------- lwes_wrap.c | 3 ++ php_lwes.h | 1 + 6 files changed, 33 insertions(+), 148 deletions(-) rewrite bootstrap (99%) create mode 100644 config.m4 delete mode 100644 configure.ac diff --git a/.svnignore b/.svnignore index 3294956..67b85aa 100644 --- a/.svnignore +++ b/.svnignore @@ -8,17 +8,22 @@ .*.out .deps .libs +CREDITS INSTALL Makefile Makefile.in +Makefile.global +acinclude.m4 aclocal.m4 autom4te.cache +build compile config.guess config.log config.status config.sub configure +configure.in depcomp doc doxygen.config @@ -30,6 +35,7 @@ missing mkinstalldirs mygettimeofday.h pkgconfig-template.pc +run-tests.php stamp-h stamp-h.in stamp-h1 diff --git a/bootstrap b/bootstrap dissimilarity index 99% index e8435b3..8e86c79 100755 --- a/bootstrap +++ b/bootstrap @@ -1,101 +1,4 @@ -#!/bin/sh - -# libtool and autoheader checks are not always necessary, so check to see if -# we need to use them -references_libtool=`perl -ne 'print if (! m/^dnl/ && ! m/^#/ && m/PROG_LIBTOOL/)' configure.ac` -references_autoheader=`perl -ne 'print if (! m/^dnl/ && ! m/^#/ && m/CONFIG_HEADER/)' configure.ac` - -check_alternatives () \ - { - _check_save="$1" - - if test "x$_check_save" = x - then - echo "ERROR: bad call to check_alternatives" 1>&2 - exit 1 - fi - - shift - - _check_var="$1" - _check_rv="" - - while test "x$_check_var" != x - do - _check_rv=`which "$_check_var" 2> /dev/null` - if test "x$_check_rv" != x - then - break - fi - shift - _check_var="$1" - done - - if test "x$_check_rv" = x - then - echo "ERROR: can't find alternative for $_check_save" 1>&2 - exit 1 - fi - - eval $_check_save='"$_check_rv"' - } - -if test "x$references_libtool" != "x" ; then - check_alternatives mylibtoolize glibtoolize libtoolize libtoolize15 -fi -check_alternatives myaclocal aclocal19 aclocal -if test "x$references_autoheader" != "x" ; then - check_alternatives myautoheader autoheader259 autoheader257 autoheader -fi -check_alternatives myautomake automake19 automake -check_alternatives myautom4te autom4te259 autom4te257 autom4te -check_alternatives myautoconf autoconf259 autoconf257 autoconf - -if test "x$references_libtool" != "x" ; then - echo -n "Running $mylibtoolize ... " - "$mylibtoolize" --automake > .libtool.out 2>&1 - if test "x$?" != "x0" ; then - cat .libtool.out - exit 1 - fi - echo "done" -fi - -if test -d /usr/local/share/aclocal; then - aclocal_extra_dirs="$aclocal_extra_dirs -I /usr/local/share/aclocal" -fi - -echo -n "Running $myaclocal ... " -AUTOM4TE="$myautom4te" "$myaclocal" $aclocal_extra_dirs > .aclocal.out 2>&1 -if test "x$?" != "x0" ; then - cat .aclocal.out - exit 1 -fi -echo "done" - -if test "x$references_autoheader" != "x" ; then - echo -n "Running $myautoheader ... " - "$myautoheader" > .autoheader.out 2>&1 - if test "x$?" != "x0" ; then - cat .autoheader.out - exit 1 - fi - echo "done" -fi - -echo -n "Running $myautomake ... " -AUTOCONF="$myautoconf" "$myautomake" -a > .automake.out 2>&1 -if test "x$?" != "x0" ; then - cat .automake.out - exit 1 -fi -echo "done" - -echo -n "Running $myautoconf ... " -"$myautoconf" > .autoconf.out 2>&1 -if test "x$?" != "x0" ; then - cat .autoconf.out - exit 1 -fi -echo "done" - +#!/bin/sh + +phpize + diff --git a/config.m4 b/config.m4 new file mode 100644 index 0000000..8064871 --- /dev/null +++ b/config.m4 @@ -0,0 +1,19 @@ +dnl $Id: php4.cxx,v 1.10 2004/12/01 00:50:06 marcelomatus Exp $ +dnl *********************************************************************** +dnl ** THIS config.m4 is provided for PHPIZE and PHP's consumption NOT +dnl ** for any part of the rest of the lwes build system +dnl *********************************************************************** + +PHP_ARG_ENABLE(lwes, whether to enable lwes support, +[ --enable-lwes Enable lwes support]) + +if test "$PHP_LWES" != "no"; then + + PHP_SUBST(LWES_SHARED_LIBADD) + + AC_DEFINE(HAVE_LWES, 1, [ ]) +dnl AC_DEFINE_UNQUOTED(PHP_LWES_DIR, "$LWES_DIR", [ ]) +dnl PHP_EXTENSION(lwes, $ext_shared) + + PHP_NEW_EXTENSION(lwes, lwes_wrap.c, $ext_shared) +fi diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 2fb99db..0000000 --- a/configure.ac +++ /dev/null @@ -1,47 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -AC_INIT([lwes-php], [0.0.1], [lwes-devel@lists.sourceforge.net]) -AM_INIT_AUTOMAKE - -AC_CANONICAL_HOST - -MAJOR_VERSION=`echo "[$]PACKAGE_VERSION" | - perl -ne 'm%^(\d+)\.% && print "[$]1"'` -MINOR_VERSION=`echo "[$]PACKAGE_VERSION" | - perl -ne 'm%^\d+\.(\d+)% && print "[$]1"'` -RELEASE_NUMBER=`echo "[$]PACKAGE_VERSION" | - perl -ne 'm%^\d+\.\d+\.(\d+)% && print "[$]1"'` -MAJOR_VERSION_UNDERLINE=`echo "[$]MAJOR_VERSION" | perl -pe 'chomp; s/\W/_/g;'` -PACKAGE_UNDERLINE=`echo "[$]PACKAGE_NAME" | perl -pe 'chomp; s/\W/_/g;'` -PACKAGEPACKED=`echo "[$]PACKAGE_NAME" | perl -pe 'chomp; s/\W//g;'` -VERSION_UNDERLINE=`echo "[$]PACKAGE_VERSION" | perl -pe 'chomp; s/\W/_/g;'` - -AC_SUBST(MAJOR_VERSION) -AC_SUBST(MINOR_VERSION) -AC_SUBST(RELEASE_NUMBER) -AC_SUBST(SHORT_DESC) - -AC_SUBST(MAJOR_VERSION_UNDERLINE) -AC_SUBST(PACKAGE_UNDERLINE) -AC_SUBST(PACKAGEPACKED) -AC_SUBST(VERSION_UNDERLINE) - -dnl -- set maintainer mode -AM_MAINTAINER_MODE -AC_SUBST(USE_MAINTAINER_MODE) - -dnl -- make sure we have a C compiler -AC_PROG_CC - -dnl -- check for programs -AC_PATH_PROG([PHPCONFIG], [php-config]) - -dnl -- check for library -PKG_CHECK_MODULES(DEPS, lwes-0 >= 0.22.1) -AC_SUBST(DEPS_CFLAGS) -AC_SUBST(DEPS_LIBS) - -AC_CONFIG_FILES([Makefile]) - -AC_OUTPUT - diff --git a/lwes_wrap.c b/lwes_wrap.c index 80f4ec0..da18f58 100644 --- a/lwes_wrap.c +++ b/lwes_wrap.c @@ -2380,6 +2380,7 @@ static ZEND_RSRC_DTOR_FUNC(_wrap_destroy_p_int) { /* end wrapper section */ /* init section */ +#ifdef COMPILE_DL_LWES #ifdef __cplusplus extern "C" { #endif @@ -2388,6 +2389,8 @@ ZEND_GET_MODULE(lwes) } #endif +#endif + PHP_MSHUTDOWN_FUNCTION(lwes) { return SUCCESS; diff --git a/php_lwes.h b/php_lwes.h index 9dc12fb..29f37f1 100644 --- a/php_lwes.h +++ b/php_lwes.h @@ -27,6 +27,7 @@ +----------------------------------------------------------------------+ */ +#include "config.h" #ifndef PHP_LWES_H #define PHP_LWES_H -- 2.11.4.GIT