* added files g-wrap/.arch-ids/g-wrap-compatibility.c.id g-wrap/.arch-ids/g-wrap-runtime.c.id g-wrap/.arch-ids/g-wrap-runtime.h.id g-wrap/g-wrap-compatibility.c g-wrap/g-wrap-runtime.c g-wrap/g-wrap-runtime.h {arch}/g-wrap/g-wrap--rotty/g-wrap--rotty--0.1/address@hidden/patch-log/patch-4 * modified files --- orig/ChangeLog +++ mod/ChangeLog @@ -1,3 +1,24 @@ +2003-11-11 Andreas Rottmann + + * bin/g-wrap-config.in (c-link-args): s/gwrap-wct/gwrap-runtime/ + and don't link against libgwrap-glib. + + * configure.in: Add check for libffi. + + * g-wrap/g-wrap-wct.c (gwp_runtime_get_version_info): Moved to + g-wrap-runtime.c and renamed to gw_runtime_get_version_info. + + * configure.in, g-wrap/Makefile.am: libgwrap-wct is now + libgwrap-runtime. + + * g-wrap/g-wrap-runtime.h, g-wrap/g-wrap-runtime.c: New files, + accomodating a bunch of runtime functions. + + * g-wrap/g-wrap-compatibility.h (SCM_VERSION_17X): New macro. + * g-wrap/g-wrap-compatibility.h, g-wrap/g-wrap-compatibility.c + (scm_malloc, scm_free): New compat functions. + * g-wrap/g-wrap-compatibility.c: New file. + 2003-11-09 Andreas Rottmann * Makefile.am (guilemoduledir): Revert to configure-time setting. --- orig/bin/g-wrap-config.in +++ mod/bin/g-wrap-config.in @@ -45,7 +45,7 @@ (pr "--guile-module-directory - Location of guile module dir"))) (define (c-link-args language static?) - (let* ((lib-list '(("guile" "gwrap-wct" "gwrap-glib") + (let* ((lib-list '(("guile" "gwrap-runtime") ("rscheme" "gwraprs"))) (libs (assoc language lib-list))) --- orig/configure.in +++ mod/configure.in @@ -84,6 +84,16 @@ +############################################################################ +### Check for libffi +AC_CHECK_LIB(ffi, ffi_prep_cif, true, + AC_MSG_ERROR([libffi is needed by g-wrap])) +AC_CHECK_HEADER(ffi.h, true, AC_MSG_ERROR([libffi is needed by g-wrap])) +LIBFFI_CFLAGS="" +LIBFFI_LIBS="-lffi" +AC_SUBST(LIBFFI_CFLAGS) +AC_SUBST(LIBFFI_LIBS) + ########################################################################### ### Check for and set up glib @@ -179,24 +189,24 @@ AC_SUBST(GW_GUILE_GTK_LIBFLAGS) fi -GW_WCT_INTERFACE_MAJOR_VER=1 -GW_WCT_INTERFACE_REVISION=0 -GW_WCT_INTERFACE_AGE=0 - -AC_SUBST(GW_WCT_INTERFACE_MAJOR_VER) -AC_SUBST(GW_WCT_INTERFACE_REVISION) -AC_SUBST(GW_WCT_INTERFACE_AGE) - -AC_DEFINE_UNQUOTED(GW_WCT_INTERFACE_MAJOR_VER, - ${GW_WCT_INTERFACE_MAJOR_VER}, - [The major interface number for libgwp-runtime-guile.]) - -AC_DEFINE_UNQUOTED(GW_WCT_INTERFACE_REVISION, - ${GW_WCT_INTERFACE_REVISION}, - [The revision number for libgwp-runtime-guile.]) +GW_RUNTIME_INTERFACE_MAJOR_VER=0 +GW_RUNTIME_INTERFACE_REVISION=0 +GW_RUNTIME_INTERFACE_AGE=0 + +AC_SUBST(GW_RUNTIME_INTERFACE_MAJOR_VER) +AC_SUBST(GW_RUNTIME_INTERFACE_REVISION) +AC_SUBST(GW_RUNTIME_INTERFACE_AGE) + +AC_DEFINE_UNQUOTED(GW_RUNTIME_INTERFACE_MAJOR_VER, + ${GW_RUNTIME_INTERFACE_MAJOR_VER}, + [The major interface number for libgwrap-runtime.]) + +AC_DEFINE_UNQUOTED(GW_RUNTIME_INTERFACE_REVISION, + ${GW_RUNTIME_INTERFACE_REVISION}, + [The revision number for libgwrap-runtime.]) -AC_DEFINE_UNQUOTED(GW_WCT_INTERFACE_AGE, - ${GW_WCT_INTERFACE_AGE}, +AC_DEFINE_UNQUOTED(GW_RUNTIME_INTERFACE_AGE, + ${GW_RUNTIME_INTERFACE_AGE}, [Number of previous interfaces supported by the current libgwp-runtime-guile API.]) AC_OUTPUT([Makefile --- orig/g-wrap/Makefile.am +++ mod/g-wrap/Makefile.am @@ -1,5 +1,5 @@ address@hidden@/g-wrap +gwrapmoduledir = @GUILEMODDIR@/g-wrap gwrapincludedir = $(includedir)/g-wrap CLEANFILES = @@ -47,8 +47,8 @@ EXTRA_DIST += ${GW_GLIB_EXTRAS} ${GW_GUILE_GTK_EXTRAS} lib_LTLIBRARIES = \ + libgwrap-runtime.la \ libgw-standard.la \ - libgwrap-wct.la \ libgw-wct.la \ ${GW_GLIB_LIB_ADD} \ ${GW_GUILE_GTK_LIB_ADD} @@ -61,20 +61,20 @@ GUILE_FLAGS = -################## libgwrap-wct section +################## libgwrap-runtime section -GW_LIBWCT_VINFO = \ - ${GW_WCT_INTERFACE_MAJOR_VER}:${GW_WCT_INTERFACE_REVISION}:${GW_WCT_INTERFACE_AGE} -gwrapinclude_HEADERS += g-wrap-wct.h -libgwrap_wct_la_SOURCES = g-wrap-wct.c -libgwrap_wct_la_LDFLAGS = -rpath @libdir@ -version-info ${GW_LIBWCT_VINFO} -libgwrap_wct_la_LIBADD = @GUILE_LIBS@ +GW_RUNTIME_VINFO = \ + ${GW_RUNTIME_INTERFACE_MAJOR_VER}:${GW_RUNTIME_INTERFACE_REVISION}:${GW_RUNTIME_INTERFACE_AGE} +gwrapinclude_HEADERS += g-wrap-runtime.h g-wrap-wct.h +libgwrap_runtime_la_SOURCES = g-wrap-runtime.c g-wrap-wct.c +libgwrap_runtime_la_LDFLAGS = -rpath @libdir@ -version-info ${GW_RUNTIME_VINFO} +libgwrap_runtime_la_LIBADD = @GUILE_LIBS@ $(LIBFFI_LIBS) ################## (g-wrap gw-wct) section nodist_libgw_wct_la_SOURCES = gw-wct.c libgw_wct_la_LDFLAGS = -rpath @libdir@ -module -export-dynamic @GUILE_LIBS@ -libgw_wct_la_LIBADD = libgwrap-wct.la +libgw_wct_la_LIBADD = libgwrap-runtime.la gw-wct.scm gw-wct.c gw-wct.h gw-wct.html: gw-wct-spec.scm guile $(GUILE_FLAGS) -c \ @@ -100,15 +100,12 @@ nodist_libgw_standard_la_SOURCES = gw-standard.c libgw_standard_la_LDFLAGS = -rpath @libdir@ -module -export-dynamic @GUILE_LIBS@ -libgw_standard_la_LIBADD = +libgw_standard_la_LIBADD = libgwrap-runtime.la LIBGW_STANDARD_GWGEN = $(addprefix gw-standard, .h .c .scm .html) ${LIBGW_STANDARD_GWGEN}: gw-standard-spec.scm - guile -c \ - ${SETGWPPATH}"(debug-enable 'backtrace) \ - (debug-enable 'debug) \ - (read-enable 'positions) \ - (use-modules (g-wrap)) \ + guile $(GUILE_FLAGS) -c \ + ${SETGWPPATH}"(use-modules (g-wrap)) \ (use-modules (g-wrap gw-standard-spec)) \ (gw:generate-wrapset \"gw-standard\")" --- orig/g-wrap/g-wrap-compatibility.h +++ mod/g-wrap/g-wrap-compatibility.h @@ -35,6 +35,20 @@ #define SCM_MAKE_CHAR(x) SCM_MAKICHR(x) #endif +/* Define this macro if Guile 1.7.x or better is in use. */ +#if defined (SCM_MINOR_VERSION) && (SCM_MINOR_VERSION >= 7) && \ + defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION >= 1) +#define SCM_VERSION_17X 1 +#endif + +/* Support for coding against Guile 1.7 */ +#ifndef SCM_VERSION_17X + +void * scm_malloc(size_t size); +void * scm_realloc(void *mem, size_t size); + +#endif + #ifdef __cplusplus } #endif --- orig/g-wrap/g-wrap-wct.c +++ mod/g-wrap/g-wrap-wct.c @@ -53,13 +53,6 @@ #endif void -gwp_runtime_get_version_info(int *major, int *revision, int *age) { - *major = GW_WCT_INTERFACE_MAJOR_VER; - *revision = GW_WCT_INTERFACE_REVISION; - *age = GW_WCT_INTERFACE_AGE; -} - -void gw_puts(const char* str, SCM port) { #if HAVE_SCM_PUTS /* (char *) fixes problem with guile 1.3.4 prototype. */