Skip to content
Browse files

updating include paths etc

git-svn-id: svn+ssh://tubbs/svnroot/projects/phpembed/trunk@60854 2c7ba8d8-a2f7-0310-a573-de162e16dcc7
  • Loading branch information...
1 parent 9adb932 commit 1c83703b71a0093f0ada14d998abaeed291b7c77 mvaradachari committed
Showing with 111 additions and 81 deletions.
  1. +25 −0 COPYING
  2. +1 −17 Makefile.am
  3. 0 NEWS
  4. +55 −0 README
  5. +18 −11 configure.ac
  6. +1 −8 examples/Makefile.am
  7. +0 −21 setup
  8. +10 −14 setup.sh
  9. +1 −10 src/Makefile.am
View
25 COPYING
@@ -0,0 +1,25 @@
+Phpembd Software License
+Copyright (c) 2007- Facebook, Inc.
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
View
18 Makefile.am
@@ -3,21 +3,5 @@
SUBDIRS = src examples
-EXTRA_DIST = phpembedVersion.h setup
+EXTRA_DIST = phpembedVersion.h setup.sh docs
-# Update config if configure.ac or aclocal.m4 changes
-#$(srcdir)/configure: configure.ac aclocal.m4
-# (cd $(srcdir);autoconf)
-#Makefile: Makefile.in config.status
-# ./config.status
-#config.status: configure
-# ./config.status --recheck
-
-#This macro sets the shell variable LIBTOOL_DEPS, that can be used to automatically update libtool.
-#script if it becomes out-of-date.
-# To add to configure.ac
-#AC_SUBST(LIBTOOL_DEPS)
-
-#LIBTOOL_DEPS = @LIBTOOL_DEPS@
-#libtool: $(LIBTOOL_DEPS)
-# $(SHELL) ./config.status --recheck
View
0 NEWS
No changes.
View
55 README
@@ -0,0 +1,55 @@
+PHPEMBED (Simplified API built on top of PHP SAPI)
+
+Andrew Bosworth (boz@facebook.com)
+Brian Shire (shire@facebook.com)
+
+Last Modified: 2007-Sep-23
+
+Phpembed is distributed under the Phpembed open source software license.
+Please see the included LICENSE file.
+
+For more information on phpmbed usage see documentation in ./docs
+
+Installing phpembed
+==============================
+
+Pre-Requisites:
+================================
+
+php 5.x must be installed with --enable-embed option turned on.
+[ To enable building of embedded SAPI library ]
+
+
+Building phpembed library:
+=======================================
+ NOTE: The phpembed library is just a more accessible and simplified library built on top of
+ of the PHP SAPI.
+
+If you are building from the first time out of the source repository, you will
+need to generate the configure scripts. From the top directory, do:
+
+ ./bootstrap.sh
+
+Once the configure scripts are generated, phpembed can be configured.
+From the top directory, do:
+
+ ./configure [ default shared mode]
+
+Run ./configure --help to see other configuration options
+
+Make phpembed:
+
+ make
+
+Install phpembed as superuser:
+
+ make install
+
+Note: To run bootstrap you may need the following:
+
+ automake / aclocal -- 1.9.5
+ autoconf -- 2.59
+ autoheader -- 2.59
+ libtool -- 1.5.16
+
+
View
29 configure.ac
@@ -2,11 +2,11 @@
# $Id$
AC_PREREQ(2.52)
-AC_INIT(phpembed, 1.0.0, boz@facebook.com)
+AC_INIT(phpembed, 4.0.0, boz@facebook.com)
AC_CANONICAL_SYSTEM
AC_CONFIG_SRCDIR(phpembedVersion.h.in)
-AM_INIT_AUTOMAKE(phpembed, 1.0.0)
+AM_INIT_AUTOMAKE(phpembed, 1.9.5)
AM_CONFIG_HEADER(config.h)
AC_PREFIX_DEFAULT(`pwd`/install)
@@ -59,19 +59,14 @@ AC_CHECK_FUNCS([gethostname gettimeofday memset socket strchr strerror strstr st
# Path to php-config program
AC_ARG_WITH(php-config,
- [ --with-php-config=PATH Path to php-config tool.],
+ [ --with-php-config=PATH Path to php-config tool. EX: /<localpath>/php-config],
[PHPCONFIG="$withval"],
[AC_PATH_PROGS(PHPCONFIG, php-config, , $PATH)]
)
if test -z "${PHPCONFIG}"; then
- AC_MSG_ERROR([Program php-config not found. Required for further procecssing. Use --with-php-config=path to specify absolute path.])
+ AC_MSG_ERROR([Program php-config not found. Required for further procecssing. Use --with-php-config=path to specify absolute path to the php-config tool.])
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)
# List of php-config include paths
@@ -82,6 +77,7 @@ AC_ARG_WITH(php-includes,
)
if test -z "${PHPCONFIGINCLUDES}"; then
PHPCONFIGINCLUDES=`$PHPCONFIG --includes`
+ PHPCONFIGINCLUDES="${PHPCONFIGINCLUDES} -I`$PHPCONFIG --prefix`/include/php/sapi/embed"
fi
AC_SUBST(PHPCONFIGINCLUDES)
@@ -93,6 +89,12 @@ for file in ${headerstocheck}
do
AC_PREPROC_IFELSE([$file], [AC_MSG_RESULT([${file} - ok])], AC_MSG_ERROR([Cannot find $file.]))
done
+
+# Special check for php_embed.h
+embedheader="php_embed.hh"
+AC_PREPROC_IFELSE([$embedheader], [AC_MSG_RESULT([${embedheader} - ok])], AC_MSG_ERROR([Cannot find ${embedheader}. Check if php was compiled with the --enable-embed option.]))
+
+NEWCPPFLAGS="$CPPFLAGS"
CPPFLAGS=$save_CPPFLAGS
# List of php-config ldflags
@@ -103,6 +105,7 @@ AC_ARG_WITH(php-ldflags,
)
if test -z "${PHPCONFIGLDFLAGS}"; then
PHPCONFIGLDFLAGS=`$PHPCONFIG --ldflags`
+ PHPCONFIGLDFLAGS="${PHPCONFIGLDFLAGS} -L`$PHPCONFIG --prefix`/lib"
fi
AC_SUBST(PHPCONFIGLDFLAGS)
@@ -114,6 +117,7 @@ AC_ARG_WITH(php-libs,
)
if test -z "${PHPCONFIGLIBS}"; then
PHPCONFIGLIBS=`$PHPCONFIG --libs`
+ PHPCONFIGLIBS="${PHPCONFIGLIBS} -L`$PHPCONFIG --prefix`/lib"
fi
AC_SUBST(PHPCONFIGLIBS)
@@ -254,10 +258,13 @@ CXXFLAGS="$CXXFLAGS -Wall"
AC_CONFIG_FILES(Makefile phpembedVersion.h src/Makefile examples/Makefile)
AC_OUTPUT
-echo " PHPCONFIG -- $PHPCONFIGLD"
+echo "PHPCONFIG -- $PHPCONFIG"
+echo "PHPCONFIGINCLUDES -- $PHPCONFIGINCLUDES"
+echo "PHPCONFIGLDFLAGS -- $PHPCONFIGLDFLAGS"
+echo "PHPCONFIGLIBS -- $PHPCONFIGLIBS"
echo "CFLAGS = $CFLAGS"
echo "CXXFLAGS = $CXXFLAGS"
-echo "CPPFLAGS = $CPPFLAGS"
+echo "CPPFLAGS = $NEWCPPFLAGS"
echo "DEFS = $DEFS"
echo "CC = $CC"
echo "CXX = $CXX"
View
9 examples/Makefile.am
@@ -5,14 +5,9 @@
INCLUDES = -I.
INCLUDES += @PHPCONFIGINCLUDES@
INCLUDES += -I$(top_srcdir)/src
-INCLUDES += -I/usr/local/php/include/php
-INCLUDES += -I/usr/local/php/include/php/Zend
-INCLUDES += -I/usr/local/php/include/php/TSRM
-INCLUDES += -I/usr/local/php/include/php/main
-INCLUDES += -I/usr/local/php/include/php/sapi/embed
# Paths to installed libraries
-AM_LDFLAGS = @PHPCONFIGLDFLAGS@ -L/usr/local/php/lib
+AM_LDFLAGS = @PHPCONFIGLDFLAGS@
# List of libraries to link with.
LDADD = @PHPCONFIGLIBS@ $(top_builddir)/src/libphpembed.la -lphp5
@@ -21,5 +16,3 @@ bin_PROGRAMS = test usage
test_SOURCES = test.cpp
usage_SOURCES = usage.cpp
-# old style without libtools
-#LDADD = @PHPCONFIGLIBS@ $(top_builddir)/src/libphpembed.a -lphp5
View
21 setup
@@ -1,21 +0,0 @@
-#!/bin/sh
-# $Id$
-
-# Script to set up environment.
-
-echo "aclocal..."
-ACLOCAL=`which aclocal-1.9 || which aclocal19 || which aclocal-1.7 || which aclocal17 || which aclocal-1.5 || which aclocal15 || which aclocal || exit 1`
-$ACLOCAL || exit 1
-
-echo "autoheader..."
-AUTOHEADER=${AUTOHEADER:-autoheader}
-$AUTOHEADER || exit 1
-
-echo "automake..."
-AUTOMAKE=`which automake-1.9 || which automake-1.7 || which automake`
-#$AUTOMAKE --foreign --add-missing || $AUTOMAKE --gnu --add-missing || exit 1
-$AUTOMAKE -a
-
-echo "autoconf..."
-AUTOCONF=${AUTOCONF:-autoconf}
-$AUTOCONF || exit 1
View
24 setup.sh
@@ -1,21 +1,18 @@
#!/bin/sh
# $Id$
-# Script to set up environment.
+# Script to set up compilation environment.
-rm -rf NEWS README AUTHORS ChangeLog
-rm -rf ltmain.sh configure depcomp config.guess config.sub config.h.in autom4te.cache INSTALL COPYING missing install-sh aclocal.m4
-rm -rf mkinstalldirs phpembedVersion.h config.log config.status stamp-h1 config.h libtool
-
-
-touch NEWS README AUTHORS ChangeLog
-
-echo "libtoolize..."
-LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
-$LIBTOOLIZE --automake
+LIBTOOLIZE=${LIBTOOLIZE:-`which libtoolize`}
+if test -f "${LIBTOOLIZE}"; then
+ echo "libtoolize..."
+ $LIBTOOLIZE --automake
+else
+ echo " skipping libtoolize"
+fi
echo "aclocal..."
-ACLOCAL=`which aclocal-1.9 || which aclocal19 || which aclocal-1.7 || which aclocal17 || which aclocal-1.5 || which aclocal15 || which aclocal || exit 1`
+ACLOCAL=${ACLOCAL:-aclocal}
$ACLOCAL || exit 1
echo "autoheader..."
@@ -23,8 +20,7 @@ AUTOHEADER=${AUTOHEADER:-autoheader}
$AUTOHEADER || exit 1
echo "automake..."
-AUTOMAKE=`which automake-1.9 || which automake-1.7 || which automake`
-#$AUTOMAKE --foreign --add-missing || $AUTOMAKE --gnu --add-missing || exit 1
+AUTOMAKE=${AUTOMAKE:-automake}
$AUTOMAKE -a
echo "autoconf..."
View
11 src/Makefile.am
@@ -2,12 +2,7 @@
# $Id$
INCLUDES = -I.
-#INCLUDES += @PHPCONFIGINCLUDES@
-INCLUDES += -I/usr/local/php/include/php
-INCLUDES += -I/usr/local/php/include/php/Zend
-INCLUDES += -I/usr/local/php/include/php/TSRM
-INCLUDES += -I/usr/local/php/include/php/main
-INCLUDES += -I/usr/local/php/include/php/sapi/embed
+INCLUDES += @PHPCONFIGINCLUDES@
# add includes to dist.
# use noinst_LTLIBRARIES to prevent -rpath inclusion during linking.
@@ -16,10 +11,6 @@ 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.

0 comments on commit 1c83703

Please sign in to comment.
Something went wrong with that request. Please try again.