[phc-internals] [phc commit] r1792 - in trunk: . src/lib
codesite-noreply at google.com
codesite-noreply at google.com
Thu Oct 16 18:32:05 IST 2008
Author: paul.biggar
Date: Thu Oct 16 10:30:58 2008
New Revision: 1792
Modified:
trunk/Makefile.am
trunk/Makefile.in
trunk/config.h.in
trunk/configure
trunk/configure.ac
trunk/src/lib/Object.h
Log:
Enable GC by default, change --enable-gc to --disable-gc. This simplifies
the checks, since we dont need to check whether we should enable, then if
the libraries are available. Instead, it should fail if the libraries arent
available.
Tested with all permutations of (--enable-gc,--disable-gc,no flag),
(libgc-dev installed, libgc-dev uninstalled).
Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am (original)
+++ trunk/Makefile.am Thu Oct 16 10:30:58 2008
@@ -35,8 +35,6 @@
# -export-dynammic: Special libtool flag for later plugin loading
src_phc_LDFLAGS = -export-dynamic
-# We leave out -dlopen" self "-dlopen" since its built-in to later
automakes,
-# and we dont want this feature anyway
src_phc_LDADD = @gc_lib@ $(LIBLTDL) libphc.la
bin_SCRIPTS = src/phc_compile_plugin
Modified: trunk/Makefile.in
==============================================================================
--- trunk/Makefile.in (original)
+++ trunk/Makefile.in Thu Oct 16 10:30:58 2008
@@ -570,9 +570,6 @@
# -export-dynammic: Special libtool flag for later plugin loading
src_phc_LDFLAGS = -export-dynamic
-
-# We leave out -dlopen" self "-dlopen" since its built-in to later
automakes,
-# and we dont want this feature anyway
src_phc_LDADD = @gc_lib@ $(LIBLTDL) libphc.la
bin_SCRIPTS = src/phc_compile_plugin
libexec_SCRIPTS = libtool
Modified: trunk/config.h.in
==============================================================================
--- trunk/config.h.in (original)
+++ trunk/config.h.in Thu Oct 16 10:30:58 2008
@@ -16,14 +16,8 @@
* Garbage collector
*/
-// "libgc" available?
-#undef HAVE_GC_LIB
-
-// "gc/gc_cpp.h" available?
-#undef HAVE_GC_INC
-
// --enable-gc specified?
-#undef ENABLE_GC
+#undef DISABLE_GC
/*
* Xerces-C++
Modified: trunk/configure
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Thu Oct 16 10:30:58 2008
@@ -805,7 +805,6 @@
build_alias
host_alias
target_alias
-gc_lib
INSTALL_PROGRAM
INSTALL_SCRIPT
INSTALL_DATA
@@ -895,6 +894,7 @@
php_install_path
libphp_headers
use_libXerces
+gc_lib
LIBOBJS
LTLIBOBJS'
ac_subst_files=''
@@ -1492,8 +1492,6 @@
Optional Features:
--disable-FEATURE do not include FEATURE (same as
--enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-gc Link to the Boehm garbage collector
(EXPERIMENTAL;
- seems to lead to segfaults in some cases
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
--disable-dependency-tracking speeds up one-time build
@@ -1503,6 +1501,8 @@
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-gc Link to the Boehm garbage collector
+ [default=enabled]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1997,18 +1997,6 @@
-# Check whether --enable-gc was given.
-if test "${enable_gc+set}" = set; then
- enableval=$enable_gc; cat >>confdefs.h <<\_ACEOF
-#define ENABLE_GC 1
-_ACEOF
-
- gc_lib=-lgc
-
-
-fi
-
-
am__api_version='1.10'
# Find a good install program. We prefer a C program (faster),
@@ -4867,7 +4855,7 @@
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4870 "configure"' > conftest.$ac_ext
+ echo '#line 4858 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7452,11 +7440,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7455: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7443: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7459: \$? = $ac_status" >&5
+ echo "$as_me:7447: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7742,11 +7730,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7745: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7733: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7749: \$? = $ac_status" >&5
+ echo "$as_me:7737: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7846,11 +7834,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7849: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7837: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7853: \$? = $ac_status" >&5
+ echo "$as_me:7841: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -10223,7 +10211,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10226 "configure"
+#line 10214 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10323,7 +10311,7 @@
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10326 "configure"
+#line 10314 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12724,11 +12712,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12727: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12715: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12731: \$? = $ac_status" >&5
+ echo "$as_me:12719: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -12828,11 +12816,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12831: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12819: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12835: \$? = $ac_status" >&5
+ echo "$as_me:12823: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14426,11 +14414,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14429: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14417: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14433: \$? = $ac_status" >&5
+ echo "$as_me:14421: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14530,11 +14518,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14533: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14521: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14537: \$? = $ac_status" >&5
+ echo "$as_me:14525: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16750,11 +16738,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16753: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16741: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16757: \$? = $ac_status" >&5
+ echo "$as_me:16745: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17040,11 +17028,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17043: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17031: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17047: \$? = $ac_status" >&5
+ echo "$as_me:17035: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17144,11 +17132,11 @@
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17147: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17135: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17151: \$? = $ac_status" >&5
+ echo "$as_me:17139: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -20971,6 +20959,13 @@
+# Check whether --enable-gc was given.
+if test "${enable_gc+set}" = set; then
+ enableval=$enable_gc;
+fi
+
+
+
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -21101,67 +21096,6 @@
fi
-{ echo "$as_me:$LINENO: checking for main in -lgc" >&5
-echo $ECHO_N "checking for main in -lgc... $ECHO_C" >&6; }
-if test "${ac_cv_lib_gc_main+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgc $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-
-int
-main ()
-{
-return main ();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_lib_gc_main=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_lib_gc_main=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_lib_gc_main" >&5
-echo "${ECHO_T}$ac_cv_lib_gc_main" >&6; }
-if test $ac_cv_lib_gc_main = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_GC_LIB 1
-_ACEOF
-
-fi
if test "x$with_xerces" != xno; then
@@ -21235,8 +21169,11 @@
fi
+# USE GC unless disabled
-if test "${ac_cv_header_gc_gc_cpp_h+set}" = set; then
+if test "x$enable_gc" != xno; then
+
+ if test "${ac_cv_header_gc_gc_cpp_h+set}" = set; then
{ echo "$as_me:$LINENO: checking for gc/gc_cpp.h" >&5
echo $ECHO_N "checking for gc/gc_cpp.h... $ECHO_C" >&6; }
if test "${ac_cv_header_gc_gc_cpp_h+set}" = set; then
@@ -21367,12 +21304,96 @@
fi
if test $ac_cv_header_gc_gc_cpp_h = yes; then
- cat >>confdefs.h <<\_ACEOF
-#define HAVE_GC_INC 1
+ :
+else
+ { { echo "$as_me:$LINENO: error: libgc required
+See \`config.log' for more details." >&5
+echo "$as_me: error: libgc required
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+{ echo "$as_me:$LINENO: checking for main in -lgc" >&5
+echo $ECHO_N "checking for main in -lgc... $ECHO_C" >&6; }
+if test "${ac_cv_lib_gc_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgc $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ ac_cv_lib_gc_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_lib_gc_main=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_lib_gc_main" >&5
+echo "${ECHO_T}$ac_cv_lib_gc_main" >&6; }
+if test $ac_cv_lib_gc_main = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBGC 1
+_ACEOF
+
+ LIBS="-lgc $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: libgc required
+See \`config.log' for more details." >&5
+echo "$as_me: error: libgc required
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
+ gc_lib=-lgc
+
+
+else
+ cat >>confdefs.h <<\_ACEOF
+#define DISABLE_GC 1
+_ACEOF
+
+fi
@@ -22076,7 +22097,6 @@
build_alias!$build_alias$ac_delim
host_alias!$host_alias$ac_delim
target_alias!$target_alias$ac_delim
-gc_lib!$gc_lib$ac_delim
INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
INSTALL_DATA!$INSTALL_DATA$ac_delim
@@ -22136,6 +22156,7 @@
GREP!$GREP$ac_delim
EGREP!$EGREP$ac_delim
LN_S!$LN_S$ac_delim
+ECHO!$ECHO$ac_delim
_ACEOF
if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97;
then
@@ -22177,7 +22198,6 @@
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
cat >conf$$subs.sed <<_ACEOF
-ECHO!$ECHO$ac_delim
AR!$AR$ac_delim
RANLIB!$RANLIB$ac_delim
DSYMUTIL!$DSYMUTIL$ac_delim
@@ -22207,6 +22227,7 @@
php_install_path!$php_install_path$ac_delim
libphp_headers!$libphp_headers$ac_delim
use_libXerces!$use_libXerces$ac_delim
+gc_lib!$gc_lib$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Thu Oct 16 10:30:58 2008
@@ -8,14 +8,6 @@
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([config])
-dnl Package information
-AC_ARG_ENABLE(
- [gc],
- [AS_HELP_STRING([--enable-gc], [Link to the Boehm garbage collector
(EXPERIMENTAL; seems to lead to segfaults in some cases])],
- [AC_DEFINE([ENABLE_GC], [1])
- AC_SUBST([gc_lib], [-lgc])
- ])
-
dnl configure automake
AM_INIT_AUTOMAKE([foreign -Wall -Werror 1.9])
AM_MAINTAINER_MODE
@@ -71,22 +63,28 @@
])
+dnl Package information
+AC_ARG_ENABLE([gc],
+ [AS_HELP_STRING([--disable-gc], [Link to the Boehm garbage collector
@<:@default=enabled@:>@])])
+
+
dnl checks for libraries
AC_LANG([C++])
AC_CHECK_COVARIANCE
AC_CHECK_LIB_CRUN
-AC_CHECK_LIB([gc], [main], [AC_DEFINE([HAVE_GC_LIB], [1])])
+
dnl check xerces unless disabled
AS_IF([test "x$with_xerces" != xno], [AC_CHECK_LIB_XERCES], [])
-dnl checks for header files
-AC_CHECK_HEADER([gc/gc_cpp.h], [AC_DEFINE([HAVE_GC_INC], [1])])
+# USE GC unless disabled
+AS_IF([test "x$enable_gc" != xno],
+ [
+ AC_CHECK_HEADER([gc/gc_cpp.h], [], [AC_MSG_FAILURE(libgc required)])
+ AC_CHECK_LIB([gc], [main], [], [AC_MSG_FAILURE(libgc required)])
+ AC_SUBST([gc_lib], [-lgc])
+ ],
+ [AC_DEFINE(DISABLE_GC, 1)])
-dnl checks for types
-dnl checks for structures
-dnl checks for compiler characteristics
-dnl checks for library functions
-dnl checks for system services
# Finishing
# phc_compile_plugin and test/scripts/lib/autovars.php are created using
their
Modified: trunk/src/lib/Object.h
==============================================================================
--- trunk/src/lib/Object.h (original)
+++ trunk/src/lib/Object.h Thu Oct 16 10:30:58 2008
@@ -16,15 +16,6 @@
#define NULL 0L
#endif
-#ifdef ENABLE_GC
-#ifdef HAVE_GC_LIB
-#ifdef HAVE_GC_INC
-// Logical AND for the preceding three
-#define USE_GC
-#endif
-#endif
-#endif
-
/*
* Garbage collection:
*
@@ -62,7 +53,7 @@
*/
// Avoid proliferation of USE_GC by defining the allocator here.
-#ifdef USE_GC
+#ifndef DISABLE_GC
#include "gc/gc_cpp.h"
#include "gc/gc_allocator.h"
#define phc_allocator gc_allocator
@@ -71,7 +62,7 @@
#endif
-#ifdef USE_GC
+#ifndef DISABLE_GC
class GC_obj : public gc
#else
class GC_obj
More information about the phc-internals
mailing list