Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

compatibility fixes concerning bigloo 3.0c and 3.1b. also allow for

system gc library, rather than bigloo bundled. addresses #3610, maybe others.
there are still known failures on 3.1b, however it now compiles.
thanks to igli for the original patch, which this is based on.
  • Loading branch information...
commit 5c962e0544432db41e4481a6d9262b0f4408e6e9 1 parent 66cecfe
@weyrick authored
View
18 Makefile.config.in
@@ -4,10 +4,16 @@ PCC_OS = @PCC_OS@
SOEXT = @SO_EXT@
BIGLOOVERSION = @BIGLOO_VERSION@
BIGLOO_LIB_PATH = @BIGLOO_LIB_PATH@
-STATIC_SUFFIX =
+BIGLOO_GC_LIB = @BIGLOO_GC_LIB@
+STATIC_SUFFIX =
BIGLOO_PIC = -copt -fPIC
C_PIC = -fPIC
+# GC_LIB can be gc or bigloogc
+ifeq ($(BIGLOO_GC_LIB),bigloogc)
+ BIGLOO_GC_LIB = bigloogc-$(BIGLOOVERSION)
+endif
+
# build .so libraries
# no difference between these commands in linux, only mingw
ifeq ($(PCC_OS),PCC_MACOSX)
@@ -106,11 +112,13 @@ GTK_LIBS = @GTK_LIBS@
#APR_LINK = $(shell $(APR) --link-ld)
#these are pretty bad
-#LINK_APACHE_MODULE = $(APXS) -I$(BGL_DEFAULT_LIB_DIR) -c mod_pcc.c $(MOD_OBJS) -o mod_pcc_s.so -I/usr/local/include/libxml2 -s -lcrypt -L../../libs -L. -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_$(SU) -lphp-runtime_$(SU) -lphpeval_$(SU) -lwebconnect_$(SU) -lbigloo_$(SU)-$(BIGLOO_VERSION) -lbigloogc-$(BIGLOO_VERSION) $(OS_LIBS) -lm
+#LINK_APACHE_MODULE = $(APXS) -I$(BGL_DEFAULT_LIB_DIR) -c mod_pcc.c $(MOD_OBJS) -o mod_pcc_s.so -I/usr/local/include/libxml2 -s -lcrypt -L../../libs -L. -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_$(SU) -lphp-runtime_$(SU) -lphpeval_$(SU) -lwebconnect_$(SU) -lbigloo_$(SU)-$(BIGLOO_VERSION) -l$(BIGLOO_GC_LIB) $(OS_LIBS) -lm -lc
+
+
+#LINK_APACHE_MODULE_UNSAFE = $(APXS) -I$(BGL_DEFAULT_LIB_DIR) -c mod_pcc.c -o mod_pcc_u.so $(MOD_OBJS) -I/usr/local/include/libxml2 -s -lcrypt -L../../libs -L. -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_u -lphp-runtime_u -lphpeval_u -lwebconnect_u -lbigloo_u-$(BIGLOO_VERSION) -l$(BIGLOO_GC_LIB) $(OS_LIBS) -lm -lc
-#LINK_APACHE_MODULE_UNSAFE = $(APXS) -I$(BGL_DEFAULT_LIB_DIR) -c mod_pcc.c -o mod_pcc_u.so $(MOD_OBJS) -I/usr/local/include/libxml2 -s -lcrypt -L../../libs -L. -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_u -lphp-runtime_u -lphpeval_u -lwebconnect_u -lbigloo_u-$(BIGLOO_VERSION) -lbigloogc-$(BIGLOO_VERSION) $(OS_LIBS) -lm
-#LINK_APACHE2_MODULE = $(APXS2) -I$(BGL_DEFAULT_LIB_DIR) -c mod_pcc2.c $(MOD2_OBJS) -export-dynamic -I/usr/local/include/libxml2 -s $(APR_LINK) -lcrypt -L../../libs -L. -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_$(SU) -lphp-runtime_$(SU) -lphpeval_$(SU) -lwebconnect_$(SU) -lbigloo_$(SU)-$(BIGLOO_VERSION) -lbigloogc-$(BIGLOO_VERSION) $(OS_LIBS) -lm
+#LINK_APACHE2_MODULE = $(APXS2) -I$(BGL_DEFAULT_LIB_DIR) -c mod_pcc2.c $(MOD2_OBJS) -export-dynamic -I/usr/local/include/libxml2 -s $(APR_LINK) -lcrypt -L../../libs -L. -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_$(SU) -lphp-runtime_$(SU) -lphpeval_$(SU) -lwebconnect_$(SU) -lbigloo_$(SU)-$(BIGLOO_VERSION) -l$(BIGLOO_GC_LIB) $(OS_LIBS) -lm -lc
-#LINK_APACHE2_MODULE_UNSAFE = $(APXS2) -I$(BGL_DEFAULT_LIB_DIR) -c mod_pcc2.c $(MOD2_OBJS) -I/usr/local/include/libxml2 -s $(APR_LINK) -lcrypt -L../../libs -L. -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_u -lphp-runtime_u -lphpeval_u -lwebconnect_u -lbigloo_u-$(BIGLOO_VERSION) -lbigloogc-$(BIGLOO_VERSION) $(OS_LIBS) -lm
+#LINK_APACHE2_MODULE_UNSAFE = $(APXS2) -I$(BGL_DEFAULT_LIB_DIR) -c mod_pcc2.c $(MOD2_OBJS) -I/usr/local/include/libxml2 -s $(APR_LINK) -lcrypt -L../../libs -L. -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_u -lphp-runtime_u -lphpeval_u -lwebconnect_u -lbigloo_u-$(BIGLOO_VERSION) -l$(BIGLOO_GC_LIB) $(OS_LIBS) -lm -lc
View
14 Makefile.mingw
@@ -17,13 +17,13 @@ dllcmd_i = gcc -shared -o $(1) -Wl,--enable-auto-import,--enable-auto-image-base
PCC_LINK_OPTIONS = -ldopt " -Wl,--enable-auto-import "
#on windows, the DLLs cannot have unresolved symbols
-RUNTIME_DLL_LIBS = -L$(BGL_DEFAULT_LIB_DIR) -lbigloo_$(SU)-$(BIGLOOVERSION) -lbigloogc-$(BIGLOOVERSION) -lws2_32 -liberty
-COMPILER_DLL_LIBS = -L../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -lprofiler_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lwebconnect_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -lbigloogc-$(BIGLOOVERSION) -lws2_32
-WEBCONNECT_DLL_LIBS = -L../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -lbigloogc-$(BIGLOOVERSION) -lws2_32
-FASTCGI_DLL_LIBS = -L../../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lwebconnect_$(SU)-$(BIGLOOVERSION) -lphpeval_$(SU)-$(BIGLOOVERSION) -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -lbigloogc-$(BIGLOOVERSION) -lws2_32 -L/usr/local/lib -lfcgi
-CGI_DLL_LIBS = -L../../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lwebconnect_$(SU)-$(BIGLOOVERSION) -lphpeval_$(SU)-$(BIGLOOVERSION) -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -lbigloogc-$(BIGLOOVERSION) -lws2_32
-MHTTPD_DLL_LIBS = -L../../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -L/usr/local/lib -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -lbigloogc-$(BIGLOOVERSION) -lwebconnect_$(SU)-$(BIGLOOVERSION) -lphpeval_$(SU)-$(BIGLOOVERSION) -lws2_32 -lwebserver -lws2_32
-EXTENSION_DLL_LIBS = -L$(LIB) -lphpeval_$(SU)-$(BIGLOOVERSION) -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -lbigloogc-$(BIGLOOVERSION) -lws2_32 -lm
+RUNTIME_DLL_LIBS = -L$(BGL_DEFAULT_LIB_DIR) -lbigloo_$(SU)-$(BIGLOOVERSION) -lws2_32 -liberty
+COMPILER_DLL_LIBS = -L../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -lprofiler_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lwebconnect_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -lws2_32
+WEBCONNECT_DLL_LIBS = -L../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -l$(BIGLOO_GC_LIB) -lws2_32
+FASTCGI_DLL_LIBS = -L../../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lwebconnect_$(SU)-$(BIGLOOVERSION) -lphpeval_$(SU)-$(BIGLOOVERSION) -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -l$(BIGLOO_GC_LIB) -lws2_32 -L/usr/local/lib -lfcgi
+CGI_DLL_LIBS = -L../../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lwebconnect_$(SU)-$(BIGLOOVERSION) -lphpeval_$(SU)-$(BIGLOOVERSION) -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -lws2_32
+MHTTPD_DLL_LIBS = -L../../libs/ -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -L/usr/local/lib -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -lwebconnect_$(SU)-$(BIGLOOVERSION) -lphpeval_$(SU)-$(BIGLOOVERSION) -l$(BIGLOO_GC_LIB) -lws2_32 -lwebserver -lws2_32
+EXTENSION_DLL_LIBS = -L$(LIB) -lphpeval_$(SU)-$(BIGLOOVERSION) -lphp-runtime_$(SU)-$(BIGLOOVERSION) -L$(BGL_DEFAULT_LIB_DIR) -lprofiler_$(SU)-$(BIGLOOVERSION) -lbigloo_$(SU)-$(BIGLOOVERSION) -l$(BIGLOO_GC_LIB) -lws2_32 -lm
PROFILER_DLL_LIBS = $(BIGLOO_LIBS) -L/usr/local/lib -lgw32c -lole32 -luuid
DOTEST_LIBS = -L /usr/local/lib -lgw32c -lws2_32
View
2  bigloo-rules.mk
@@ -40,7 +40,7 @@ CUNSAFEFLAGS = -D$(PCC_OS) -O4 $(CCOMMONFLAGS)
CPPSAFEFLAGS = $(CSAFEFLAGS)
CPPUNSAFEFLAGS = $(CUNSAFEFLAGS)
-BIGLOO_LIBS = -L$(BGL_DEFAULT_LIB_DIR) -lbigloo_$(SU)-$(BIGLOOVERSION) -lbigloogc-$(BIGLOOVERSION)
+BIGLOO_LIBS = -L$(BGL_DEFAULT_LIB_DIR) -lbigloo_$(SU)-$(BIGLOOVERSION) -l$(BIGLOO_GC_LIB)
# we could put non-pic code in the static libraries without too much
# trouble by adding the t to STATIC_SUFFIX in linux, and not building
View
8 compiler/target.scm
@@ -603,6 +603,9 @@
(define-macro (bigloo-version)
`',*bigloo-version*)
+(define-macro (bigloo-gc-lib)
+ `',*gc-lib*)
+
(define (res-out-file-name file)
(string-append (prefix file) "-res.o"))
@@ -790,7 +793,10 @@
(for-each (lambda (l) (pushf l libs)) ext-libs))))
(scheme-libraries-and-includes))
(pushf (string-append "-l" "bigloo" (safety-ext) "-" (bigloo-version)) libs)
- (pushf (string-append "-l" "bigloogc" "-" (bigloo-version)) libs)
+ (pushf (if (eqv? (bigloo-gc-lib) 'bigloogc)
+ (string-append "-lbigloogc-" (bigloo-version))
+ (string-append "-l" (symbol->string (bigloo-gc-lib)))
+ ) libs)
; verbose if we're really debugging
(when (> *debug-level* 4)
View
12 configure
@@ -725,6 +725,7 @@ FCGI_CFLAGS
PCC_EXT_LIST
PDO_DRIVER_LIST
PDO_DRIVER_ARRAY
+BIGLOO_GC_LIB
srcdir
LIBOBJS
LTLIBOBJS'
@@ -3121,7 +3122,7 @@ test -n "$target_alias" &&
# can't figure out how to get this into AC_CHECK_PROG_VER below?
# have to change it there too
-want_bigloo="3.0c, 3.0d, 3.1a, 3.1b"
+want_bigloo="3.0c, 3.1a, 3.1b"
want_curl=7.15.1
# defaults
@@ -3191,7 +3192,7 @@ echo $ECHO_N "checking version of $HAVE_BIGLOO... $ECHO_C" >&6; }
ac_prog_version=`$HAVE_BIGLOO -revision 2>&1 | sed -n 's/^.*\([2-9].[0-9][a-z]\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version_m="v. ?.??, bad"; ac_verc_fail=yes;;
- 3.0c | 3.0d | 3.1a | 3.1b)
+ 3.0c | 3.1a | 3.1b)
ac_prog_version_m="$ac_prog_version, ok"; ac_verc_fail=no;;
*) ac_prog_version_m="$ac_prog_version, bad"; ac_verc_fail=yes;;
@@ -3211,6 +3212,7 @@ fi
BIGLOO_VERSION=$ac_prog_version
BIGLOO_LIB_PATH=`bigloo -eval "(display *default-lib-dir*)(exit 0)"`
+BIGLOO_GC_LIB=`bigloo -eval "(display *gc-lib*)(exit 0)"`
# XXX for now we require PCC_HOME variable
#AC_MSG_CHECKING([for existence of PCC_HOME variable])
@@ -5576,6 +5578,8 @@ CONF_HOME=$CONF_HOME
PCC_LIBS=$PCC_LIBS
+BIGLOO_GC_LIB=$BIGLOO_GC_LIB
+
prefix=$prefix
@@ -6387,12 +6391,13 @@ FCGI_CFLAGS!$FCGI_CFLAGS$ac_delim
PCC_EXT_LIST!$PCC_EXT_LIST$ac_delim
PDO_DRIVER_LIST!$PDO_DRIVER_LIST$ac_delim
PDO_DRIVER_ARRAY!$PDO_DRIVER_ARRAY$ac_delim
+BIGLOO_GC_LIB!$BIGLOO_GC_LIB$ac_delim
srcdir!$srcdir$ac_delim
LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 17; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 18; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -6836,6 +6841,7 @@ echo "
bigloo version: ${BIGLOO_VERSION}
bigloo libs: ${BIGLOO_LIB_PATH}
+ bigloo gc: ${BIGLOO_GC_LIB}
readline: ${with_readline}
= Web Backends =
View
7 configure.in
@@ -26,7 +26,7 @@ AC_CANONICAL_SYSTEM
# can't figure out how to get this into AC_CHECK_PROG_VER below?
# have to change it there too
-want_bigloo="3.0c, 3.0d, 3.1a, 3.1b"
+want_bigloo="3.0c, 3.1a, 3.1b"
want_curl=7.15.1
# defaults
@@ -49,12 +49,13 @@ AC_CHECK_PROG_VER([HAVE_BIGLOO],
bigloo,
-revision,
[\([2-9].[0-9][a-z]\)],
- [3.0c | 3.0d | 3.1a | 3.1b],
+ [3.0c | 3.1a | 3.1b],
AC_MSG_FAILURE([Bigloo version $want_bigloo required in the system path]))
BIGLOO_VERSION=$ac_prog_version
BIGLOO_LIB_PATH=`bigloo -eval "(display *default-lib-dir*)(exit 0)"`
+BIGLOO_GC_LIB=`bigloo -eval "(display *gc-lib*)(exit 0)"`
# XXX for now we require PCC_HOME variable
#AC_MSG_CHECKING([for existence of PCC_HOME variable])
@@ -411,6 +412,7 @@ AC_SUBST(PDO_DRIVER_LIST, $PDO_DRIVER_LIST)
AC_SUBST(PDO_DRIVER_ARRAY, $PDO_DRIVER_ARRAY)
AC_SUBST(CONF_HOME, $CONF_HOME)
AC_SUBST(PCC_LIBS, $PCC_LIBS)
+AC_SUBST(BIGLOO_GC_LIB, $BIGLOO_GC_LIB)
AC_SUBST(prefix, $prefix)
AC_SUBST(exec_prefix, $exec_prefix)
@@ -450,6 +452,7 @@ echo "
bigloo version: ${BIGLOO_VERSION}
bigloo libs: ${BIGLOO_LIB_PATH}
+ bigloo gc: ${BIGLOO_GC_LIB}
readline: ${with_readline}
= Web Backends =
View
16 runtime/c-runtime.c
@@ -294,11 +294,16 @@ int re_strpos(obj_t haystack, obj_t needle, unsigned int offset, int cs) {
}
-/* this is a workaround for a bigloo problem. manuel has been notified, get
- rid of this when we require the next release with a fix (3.0d?) */
+
+/* this is a workaround for a bigloo problem in 3.0c */
+BGL_RUNTIME_DEF obj_t
+bgl_output_flush( obj_t port, char *str, size_t slen );
+
BGL_RUNTIME_DEF
obj_t
strport_bin_flush( obj_t port ) {
+
+#ifdef BGL_3_0c
obj_t res;
if( OUTPUT_STRING_PORT(port).buffer ) {
@@ -312,6 +317,13 @@ strport_bin_flush( obj_t port ) {
} else {
return string_to_bstring( "" );
}
+#else
+
+ // bigloo >3.0c
+ FLUSH_OUTPUT_PORT(port);
+
+#endif
+
}
View
12 runtime/ext/sockets/php-sockets.scm
@@ -173,9 +173,15 @@
(set! *last-socket-error* (&io-error-msg e))
#f)
(begin
- (php-socket-bsocket-set! sock (make-client-socket (mkstr address)
- (mkfixnum cport)
- :buffer #f))
+ (cond-expand
+ (bigloo3.0c
+ (php-socket-bsocket-set! sock (make-client-socket (mkstr address)
+ (mkfixnum cport)
+ :buffer #f)))
+ (else
+ (php-socket-bsocket-set! sock (make-client-socket (mkstr address)
+ (mkfixnum cport)
+ :inbuf #f :outbuf #f))))
(php-socket-connected?-set! sock #t)
#t)))
#f))
View
3  runtime/utils.scm
@@ -28,7 +28,7 @@
(opaque-math "opaque-math-binding.scm")
(php-types "php-types.scm"))
(extern
- ;; bigloo's flush-output-port is not binary safe on string ports,
+ ;; in 3.0c, bigloo's flush-output-port is not binary safe on string ports,
;; and in recent versions it no longer resets the position to 0
(flush-string-port/bin::bstring (::output-port) "strport_bin_flush")
(c-strpos::int (::bstring ::bstring ::int ::int) "re_strpos"))
@@ -76,6 +76,7 @@
(pcc-file-separator)
(force-trailing-/ p)))
+
; a version of php's str_replace
(define (string-subst::bstring text::bstring old::bstring new::bstring . rest)
(let ((new-len (string-length new))
Please sign in to comment.
Something went wrong with that request. Please try again.