Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added command line options for php-config stuff and other checks. rel…

…ease number for shared lib

git-svn-id: svn+ssh://tubbs/svnroot/projects/phpembed/trunk@57030 2c7ba8d8-a2f7-0310-a573-de162e16dcc7
  • Loading branch information...
commit 05a10f66a62ee0e1c58034ca5a3b79e20c4f7a8a 1 parent ee0276b
mvaradachari authored
Showing with 69 additions and 8 deletions.
  1. +53 −8 configure.ac
  2. +16 −0 src/Makefile.am
View
61 configure.ac
@@ -57,21 +57,65 @@ AC_FUNC_STAT
AC_FUNC_STRTOD
AC_CHECK_FUNCS([gethostname gettimeofday memset socket strchr strerror strstr strtoul strtoull])
-# Check for programs
-AC_CHECK_PROG([PHPCONFIG],[php-config],[yes],[],[],[reject])
+# Path to php-config program
+AC_ARG_WITH(php-config,
+ [ --with-php-config=PATH Path to php-config tool.],
+ [PHPCONFIG="$withval"],
+ [AC_PATH_PROGS(PHPCONFIG, php-config, , $PATH)]
+)
if test -z "${PHPCONFIG}"; then
- AC_ERROR([php-config not found.])
+ AC_MSG_ERROR([Program php-config not found. Required for further procecssing. Use --with-php-config=path to specify absolute path.])
fi
+# Verify if program exists
+#AC_PATH_PROGS(TESTPHPCONFIG, [${PHPCONFIG}], , ${PATH})
+#if test -z "${TESTPHPCONFIG}"; then
+# AC_MSG_ERROR([Cannot find program $PHPCONFIG. Check PATH variable or path entered.])
+#fi
+AC_SUBST(PHPCONFIG)
-PHPCONFIGINCLUDES=`php-config --includes`
-PHPCONFIGLDFLAGS=`php-config --ldflags`
-PHPCONFIGLIBS=`php-config --libs`
-
+# List of php-config include paths
+AC_ARG_WITH(php-includes,
+ [ --with-php-includes=PATHS php-config include locations.],
+ [PHPCONFIGINCLUDES="$withval"],
+ [PHPCONFIGINCLUDES=""]
+)
+if test -z "${PHPCONFIGINCLUDES}"; then
+ PHPCONFIGINCLUDES=`$PHPCONFIG --includes`
+fi
AC_SUBST(PHPCONFIGINCLUDES)
+
+# checking some basic php-config headers
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS ${PHPCONFIGINCLUDES}"
+headerstocheck="php_config.h php_version.h zend.h zend_API.h php.h php_ini.h ext/standard/info.h"
+for file in ${headerstocheck}
+do
+ AC_PREPROC_IFELSE([$file], [AC_MSG_RESULT([${file} - ok])], AC_MSG_ERROR([Cannot find $file.]))
+done
+CPPFLAGS=$save_CPPFLAGS
+
+# List of php-config ldflags
+AC_ARG_WITH(php-ldflags,
+ [ --with-php-ldflags=LDFLAGS php-config ldflags list.],
+ [PHPCONFIGLDFLAGS="$withval"],
+ [PHPCONFIGLDFLAGS=""]
+)
+if test -z "${PHPCONFIGLDFLAGS}"; then
+ PHPCONFIGLDFLAGS=`$PHPCONFIG --ldflags`
+fi
AC_SUBST(PHPCONFIGLDFLAGS)
-AC_SUBST(PHPCONFIGLIBS)
+# List of php-config include paths
+AC_ARG_WITH(php-libs,
+ [ --with-php-libs=LIBS php-config lib locations.],
+ [PHPCONFIGLIBS="$withval"],
+ [PHPCONFIGLIBS=""]
+)
+if test -z "${PHPCONFIGLIBS}"; then
+ PHPCONFIGLIBS=`$PHPCONFIG --libs`
+fi
+AC_SUBST(PHPCONFIGLIBS)
AC_MSG_CHECKING(whether to use ccache)
AC_ARG_WITH(ccache,
@@ -189,6 +233,7 @@ AC_ARG_ENABLE(debug,
)
AC_MSG_RESULT($enable_debug)
+
# phpembed versioning
PHPEMBED_MAJOR_VERSION=`echo $VERSION | cut -f1 -d.`
PHPEMBED_MINOR_VERSION=`echo $VERSION | cut -f2 -d.`
View
16 src/Makefile.am
@@ -10,10 +10,26 @@ INCLUDES += -I/usr/local/php/include/php/main
INCLUDES += -I/usr/local/php/include/php/sapi/embed
# add includes to dist.
+# use noinst_LTLIBRARIES to prevent -rpath inclusion during linking.
libphpembed_includes = php_arr.h php_cxx.h php_stl.h php_tok_consts.h php_tok.h
lib_LTLIBRARIES = libphpembed.la
libphpembed_la_SOURCES = php_cxx.cpp php_arr.cpp php_stl.cpp php_tok.cpp $(libphpembed_includes)
+libphpembed_la_LDFLAGS = -release 4.0.0
# old style wihtout libtools
#lib_LIBRARIES = libphpembed.a
#libphpembed_a_SOURCES = php_cxx.cpp php_arr.cpp php_stl.cpp php_tok.cpp $(libphpembed_includes)
+
+# Information about libtool shared lib versioning scheme.
+# libtool library versions are described by three integers:
+# current - The most recent interface number that this library implements.
+# revision - The implementation number of the current interface.
+# age - In other words, the library implements all the interface numbers in the range from number current - age to current.
+
+# Versioning rules
+# 1. Start with version information of `0:1:0' for each libtool library.
+# 2. If the library source code has changed at all since the last update, then increment revision (`c:r:a' becomes `c:r+1:a').
+# 3. If any interfaces have been added, removed, or changed since the last update, increment current, and set revision to 0.
+# 4. If any interfaces have been added since the last public release, then increment age.
+# 5. If any interfaces have been removed since the last public release, then set age to 0.
+# Example: #libphpembed_la_LDFLAGS = -version-info 0:1:0
Please sign in to comment.
Something went wrong with that request. Please try again.