From 21191c3eede6868a5cc5d7a8dd92ebf00890a1f6 Mon Sep 17 00:00:00 2001 From: pavet Date: Thu, 7 Oct 2004 10:16:40 +0000 Subject: passage v0.6 swig 1.3.x --- GNUmakefile.in | 66 ++++--- aclocal.m4 | 526 +++++++++++++++++++++++++++++++++++-------------------- configure | 133 ++++++++------ configure.in | 11 +- ivycpy.i | 42 ++++- ivycpy_namer.sed | 4 +- private.m4 | 2 + 7 files changed, 508 insertions(+), 276 deletions(-) diff --git a/GNUmakefile.in b/GNUmakefile.in index d2cd687..ff0c59e 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -11,7 +11,7 @@ VERSION := @VERSION@ STATIC_EXAMPLES := pyhello.py testtk.py EXAMPLES := $(addprefix docs/examples/, env.sh) -DOCS := $(addprefix docs/html/, index.html ivycpy_wrap.html) +DOCS := $(addprefix docs/html/, index.html) # ivycpy_wrap.html DEBIANSTUFF := debian/copyright DEFINES := @DEFINES@ @@ -52,6 +52,8 @@ INSTALL_PROGRAM := @INSTALL_PROGRAM@ INSTALL_SCRIPT := @INSTALL_SCRIPT@ INSTALL_DATA := @INSTALL_DATA@ +PYTHON_COMPILER := @PYTHON_COMPILER@ + UMASK ?= 022 INSTALL_DIR := $(SHELL) $(top_srcdir)/mkinstalldirs @@ -81,34 +83,48 @@ CFLAGS = @CFLAGS@ $(CC_OPTIONS) LDFLAGS = @LDFLAGS@ $(LD_OPTIONS) LDLIBS = $(LIBRARIES) @LIBS@ -default: ivycpy.so $(DOCS) $(EXAMPLES) $(DEBIANSTUFF) +default: _ivycpy.so ivycpy.pyc $(DOCS) $(EXAMPLES) $(DEBIANSTUFF) -ivycpy.so: ivycpy_wrap_neat.o @PYTHON_LIBDIR@/python@PYTHON_VERSION@/lib-dynload/_tkinter.so - $(LINK.o) $(CC_SHARED_OPTIONS) $^ -o $@ -livy $(LDLIBS) -lc +_ivycpy.so: ivycpy_wrap.o @PYTHON_LIBDIR@/python@PYTHON_VERSION@/lib-dynload/_tkinter.so + $(LINK.o) $(CC_SHARED_OPTIONS) $^ -o $@ -livy $(LDLIBS) -lc -ivycpy_wrap_neat.o: CFLAGS += $(CC_PIC_OPTIONS) -ivycpy_wrap_neat.o: ivycpy_wrap_neat.c +#ivycpy_wrap_neat.o: CFLAGS += $(CC_PIC_OPTIONS) +#ivycpy_wrap_neat.o: ivycpy_wrap_neat.c +# ivycpy_wrap_neat.c is not generated anymore ; # true or neat wrapper with proper name for function -ivycpy_wrap_neat.c: ivycpy_wrap.c - >$@ sed -f ivycpy_namer.sed $< +# ivycpy_wrap_neat.c: ivycpy_wrap.c +# >$@ sed -f ivycpy_namer.sed $< + +ivycpy_wrap.o: CFLAGS += $(CC_PIC_OPTIONS) +ivycpy_wrap.o: ivycpy_wrap.c # wrapper code generated by swig +# original .py is moved toward _swig.py ivycpy_wrap.c: ivycpy.i - $(SWIG) -python -dhtml $< + $(SWIG) -python $< # -dhtml + mv ivycpy.py ivycpy_swig.py + +# then _swig.py is patched to suited names in ivycpy.py + +ivycpy.py: ivycpy.i + >$@ sed -f ivycpy_namer.sed ivycpy_swig.py # testing include and defines ivycpy_test.e: ivycpy_test.c - >|$@ $(CC) -E $(CPPFLAGS) $< + >|$@ $(CC) -E $(CPPFLAGS) $< + +# regarder comment générer les fichiers bytecompilé +# avec definiton générique de PYTHON voir MV_PYTHON # documentation -docs/html/ivycpy_wrap.html: ivycpy_wrap.html - >|$@ sed -e "s/pyIvy/Ivy/g" $< +#docs/html/ivycpy_wrap.html: ivycpy_wrap.html +# >|$@ sed -e "s/pyIvy/Ivy/g" $< docs/html/index.html: docs/html/index_tpl.html - >|$@ sed -e "s/_VERSION_/$(VERSION)/g" $< + >|$@ sed -e "s/_VERSION_/$(VERSION)/g" $< VERSION: printf '# generated dynamically do not edit; change VERSION in configure.in instead\n' >|$@ @@ -116,14 +132,21 @@ VERSION: # misc docs/examples/env.sh: env_tpl.sh - >|$@ sed -e "s|_IVYCPYPATH_|$(pythondir)|g" $< + >|$@ sed -e "s|_IVYCPYPATH_|$(pythondir)|g" $< # debian debian/copyright: docs/copyright $(INSTALL_DATA) $< debian -install:: ivycpy.so +# building compiled version of Python modules +# this step builds also the examples scripts + +ivycpy.pyc: ivycpy.py + python $(PYTHON_COMPILER) -l . + python $(PYTHON_COMPILER) docs/examples + +install:: _ivycpy.so ivycpy.py ivycpy.pyc $(INSTALL_DIR) $(pythondir) $(INSTALL_DATA) $< $(pythondir) @@ -132,22 +155,25 @@ install:: $(DOCS) $(EXAMPLES) $(INSTALL_DIR) $(PKGDOCDIR) # cp -rp docs/* $(PKGDOCDIR) cd docs && \ - find . -type d ! \( -path '*CVS*' -o -path '.' \) -exec install -d $(PKGDOCDIR)/{} ";" && \ - find . -type f ! \( -path '*.cvsignore' -o -path '*CVS*' \) -exec cp -p {} $(PKGDOCDIR)/{} ";" + find . -type d ! \( -name 'CVS*' -o -name '.' \) -exec install -d $(PKGDOCDIR)/{} ";" && \ + find . -type f ! -name '.cvsignore' -exec cp -p {} $(PKGDOCDIR)/{} ";" .PHONY: default install VERSION clean: - $(RM) core a.out *.o - $(RM) ivycpy.so + $(RM) core a.out *.o + $(RM) _ivycpy.so ivycpy*.py + find . -name '*.pyc' -exec $(RM) {} ";" realclean: clean $(RM) ivycpy_wrap*.c - $(RM) $(EXAMPLES) + $(RM) $(EXAMPLES) $(DOCS) distclean: realclean $(RM) ivycpy_wrap*.* $(RM) GNUmakefile config.log config.status config.cache + $(RM) *.debhelper + $(RM) -r debian/tmp .PHONY: clean realclean distclean diff --git a/aclocal.m4 b/aclocal.m4 index 261d5a4..37f59ca 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1921,9 +1921,11 @@ fi PYTHON_INCLUDEDIR=$mv_tmp/include PYTHON_LIBDIR=$mv_tmp/lib +PYTHON_COMPILER=$PYTHON_LIBDIR/python$PYTHON_VERSION/compileall.py AC_SUBST(PYTHON_INCLUDEDIR) AC_SUBST(PYTHON_LIBDIR) +AC_SUBST(PYTHON_COMPILER) dnl # A FAIRE: dnl # S'assurer de bien utiliser cette version de la bibliotheque python! @@ -2262,6 +2264,7 @@ AC_DEFUN(SC_PATH_TKCONFIG, [ # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR +# TCL_INC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ @@ -2286,6 +2289,7 @@ AC_DEFUN(SC_LOAD_TCLCONFIG, [ AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) + AC_SUBST(TCL_INC_DIR) AC_SUBST(TCL_LIB_FILE) ]) @@ -2317,6 +2321,7 @@ AC_DEFUN(SC_LOAD_TKCONFIG, [ AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) + AC_SUBST(TK_LIB_DIR) AC_SUBST(TK_LIB_FILE) ]) @@ -2372,7 +2377,7 @@ AC_DEFUN(SC_ENABLE_GCC, [ AC_DEFUN(SC_ENABLE_SHARED, [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, - [ --disable-shared build and link without shared libraries [--disable-shared]], + [ --enable-shared build and link with shared libraries [--enable-shared]], [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then @@ -2411,6 +2416,7 @@ AC_DEFUN(SC_ENABLE_SHARED, [ # Defines the following vars: # TCL_THREADS # _REENTRANT +# _THREAD_SAFE # #------------------------------------------------------------------------ @@ -2424,20 +2430,42 @@ AC_DEFUN(SC_ENABLE_THREADS, [ TCL_THREADS=1 AC_DEFINE(TCL_THREADS) AC_DEFINE(_REENTRANT) - + AC_DEFINE(_THREAD_SAFE) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "no"; then + # Check a little harder for __pthread_mutex_init in the same + # library, as some systems hide it there until pthread.h is + # defined. We could alternatively do an AC_TRY_COMPILE with + # pthread.h, but that will work with libpthread really doesn't + # exist, like AIX 4.2. [Bug: 4359] + AC_CHECK_LIB(pthread,__pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + fi + if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else - TCL_THREADS=0 - AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...") + AC_CHECK_LIB(pthreads,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "yes"; then + # The space is needed + THREADS_LIBS=" -lpthreads" + else + AC_CHECK_LIB(c,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) + if test "$tcl_ok" = "no"; then + TCL_THREADS=0 + AC_MSG_WARN("Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...") + fi + fi fi + + # Does the pthread-implementation provide + # 'pthread_attr_setstacksize' ? + + AC_CHECK_FUNCS(pthread_attr_setstacksize) else TCL_THREADS=0 - AC_MSG_RESULT(no (default)) + AC_MSG_RESULT([no (default)]) fi - ]) #------------------------------------------------------------------------ @@ -2470,15 +2498,15 @@ AC_DEFUN(SC_ENABLE_THREADS, [ AC_DEFUN(SC_ENABLE_SYMBOLS, [ AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--enable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) + AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "yes"; then - CFLAGS_DEFAULT='${CFLAGS_DEBUG}' - LDFLAGS_DEFAULT='${LDFLAGS_DEBUG}' + CFLAGS_DEFAULT="${CFLAGS_DEBUG}" + LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" DBGX=g AC_MSG_RESULT([yes]) else - CFLAGS_DEFAULT='${CFLAGS_OPTIMIZE}' - LDFLAGS_DEFAULT='${LDFLAGS_OPTIMIZE}' + CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" + LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" DBGX="" AC_MSG_RESULT([no]) fi @@ -2567,19 +2595,32 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [ AC_DEFUN(SC_CONFIG_CFLAGS, [ - # Step 0: Enable 64 bit support? + # Step 0.a: Enable 64 bit support? - AC_MSG_CHECKING([if 64bit support is enabled]) - AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support],,enableval="no") + AC_MSG_CHECKING([if 64bit support is requested]) + AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)],,enableval="no") if test "$enableval" = "yes"; then - AC_MSG_RESULT(Will compile with 64bit support) do64bit=yes else do64bit=no fi AC_MSG_RESULT($do64bit) - + + # Step 0.b: Enable Solaris 64 bit VIS support? + + AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) + AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support],,enableval="no") + + if test "$enableval" = "yes"; then + # Force 64bit on with VIS + do64bit=yes + do64bitVIS=yes + else + do64bitVIS=no + fi + AC_MSG_RESULT($do64bitVIS) + # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. @@ -2606,6 +2647,15 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ fi fi + AC_MSG_CHECKING([if gcc is being used]) + if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + using_gcc="yes" + else + using_gcc="no" + fi + + AC_MSG_RESULT([$using_gcc ($CC)]) + # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. @@ -2622,43 +2672,103 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g - CFLAGS_OPTIMIZE=-O2 + CFLAGS_OPTIMIZE=-O + if test "$using_gcc" = "yes" ; then + CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int" + else + CFLAGS_WARNING="" + fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" STLIB_LD="ar cr" case $system in - AIX-4.[[2-9]]) + AIX-5.*) + if test "${TCL_THREADS}" = "1" -a "$using_gcc" = "no" ; then + # AIX requires the _r compiler when gcc isn't being used + if test "${CC}" != "cc_r" ; then + CC=${CC}_r + fi + AC_MSG_RESULT(Using $CC for compiling with threads) + fi + # AIX-5 uses ELF style dynamic libraries SHLIB_CFLAGS="" - SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + + # Note: need the LIBS below, otherwise Tk won't find Tcl's + # symbols when dynamically loaded into tclsh. + SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" - DL_LIBS="-ldl" + DL_OBJS="tclLoadDl.o" + # AIX-5 has dl* in libc.so + DL_LIBS="" LDFLAGS="" - LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' + if test "$using_gcc" = "yes" ; then + LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + + if test "$do64bit" = "yes" ; then + if test "$using_gcc" = "no" ; then + do64bit_ok=yes + EXTRA_CFLAGS="-q64" + LDFLAGS="-q64" + else + AC_MSG_WARN("64bit mode not supported with GCC on $system") + fi + fi ;; AIX-*) + if test "${TCL_THREADS}" = "1" -a "$using_gcc" = "no" ; then + # AIX requires the _r compiler when gcc isn't being used + if test "${CC}" != "cc_r" ; then + CC=${CC}_r + fi + AC_MSG_RESULT(Using $CC for compiling with threads) + fi SHLIB_CFLAGS="" SHLIB_LD="$fullSrcDir/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" - LIBOBJS="$LIBOBJS tclLoadAix.o" - DL_LIBS="-lld" + DL_OBJS="tclLoadDl.o" + DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' + + # AIX v<=4.1 has some different flags than 4.2+ + if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then + LIBOBJS="$LIBOBJS tclLoadAix.o" + DL_LIBS="-lld" + fi + + # On AIX <=v4 systems, libbsd.a has to be linked in to support + # non-blocking file IO. This library has to be linked in after + # the MATH_LIBS or it breaks the pow() function. The way to + # insure proper sequencing, is to add it to the tail of MATH_LIBS. + # This library also supplies gettimeofday. + # + # AIX does not have a timezone field in struct tm. When the AIX + # bsd library is used, the timezone global and the gettimeofday + # methods are to be avoided for timezone deduction instead, we + # deduce the timezone by comparing the localtime result on a + # known GMT value. + + AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) + if test $libbsd = yes; then + MATH_LIBS="$MATH_LIBS -lbsd" + AC_DEFINE(USE_DELTA_FOR_TZ) + fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2668,7 +2778,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-export-dynamic" LD_SEARCH_FLAGS="" @@ -2678,7 +2788,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2707,15 +2817,26 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' ;; - IRIX-5.*|IRIX-6.*|IRIX64-6.5*) + IRIX-5.*) + SHLIB_CFLAGS="" + SHLIB_LD="ld -shared -rdata_shared" + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + EXTRA_CFLAGS="" + LDFLAGS="" + ;; + IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' - if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + if test "$using_gcc" = "yes" ; then EXTRA_CFLAGS="-mabi=n32" LDFLAGS="-mabi=n32" else @@ -2736,7 +2857,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="ld -32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' @@ -2754,10 +2875,10 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ if test "$have_dl" = yes; then SHLIB_LD="${CC} -shared" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-rdynamic" - #LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS='' else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" @@ -2798,7 +2919,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2808,7 +2929,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="-Wl,-Bexport" LD_SEARCH_FLAGS="" @@ -2816,15 +2937,26 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ NetBSD-*|FreeBSD-[[1-2]].*|OpenBSD-*) # Not available on all versions: check for include file. AC_CHECK_HEADER(dlfcn.h, [ - SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld -Bshareable -x" + # NetBSD/SPARC needs -fPIC, -fpic will not do. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="${CC} -shared" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" - LD_SEARCH_FLAGS="" - SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.so.1.0' + LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + AC_MSG_CHECKING(for ELF) + AC_EGREP_CPP(yes, [ +#ifdef __ELF__ + yes +#endif + ], + AC_MSG_RESULT(yes) + SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.so', + AC_MSG_RESULT(no) + SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.so.1.0' + ) ], [ SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" @@ -2836,22 +2968,33 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' ]) + ;; + FreeBSD-*) + # FreeBSD 3.* and greater have ELF. + SHLIB_CFLAGS="-fPIC" + SHLIB_LD="ld -Bshareable -x" + SHLIB_LD_LIBS="" + SHLIB_SUFFIX=".so" + DL_OBJS="tclLoadDl.o" + DL_LIBS="" + LDFLAGS="-export-dynamic" + LD_SEARCH_FLAGS="" # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}\$\{DBGX\}.a' TCL_LIB_VERSIONS_OK=nodots ;; - FreeBSD-*) - # FreeBSD 3.* and greater have ELF. - SHLIB_CFLAGS="-fpic" - SHLIB_LD="ld -Bshareable -x" + Rhapsody-*|Darwin-*) + SHLIB_CFLAGS="-fno-common" + SHLIB_LD="cc -dynamiclib \${LDFLAGS} -compatibility_version ${TCL_MAJOR_VERSION} -current_version \${VERSION} -install_name \${LIB_RUNTIME_DIR}/\${TCL_LIB_FILE}" SHLIB_LD_LIBS="" - SHLIB_SUFFIX=".so" - DL_OBJS="" + SHLIB_SUFFIX=".dylib" + DL_OBJS="tclLoadDyld.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" + CFLAGS_OPTIMIZE="-O3" ;; NEXTSTEP-*) SHLIB_CFLAGS="" @@ -2881,11 +3024,11 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 - SHLIB_CFLAGS="-fpic" + SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -shared" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2896,10 +3039,25 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD='ld -shared -expect_unresolved "*"' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' + if test "$using_gcc" = "no" ; then + EXTRA_CFLAGS="-DHAVE_TZSET -std1" + fi + # see pthread_intro(3) for pthread support on osf1, k.furukawa + if test "${TCL_THREADS}" = "1" ; then + EXTRA_CFLAGS="${EXTRA_CFLAGS} -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" + if test "$using_gcc" = "no" ; then + EXTRA_CFLAGS="${EXTRA_CFLAGS} -pthread" + LDFLAGS="-pthread" + else + LIBS=`echo $LIBS | sed s/-lpthreads//` + LIBS="$LIBS -lpthread -lmach -lexc" + fi + fi + ;; RISCos-*) SHLIB_CFLAGS="-G 0" @@ -2912,16 +3070,21 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) - # Note, dlopen is available only on SCO 3.2.5 and greater. However, + # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. - SHLIB_CFLAGS="-Kpic -belf" + if test "$using_gcc" = "yes" ; then + SHLIB_CFLAGS="-fPIC -melf" + LDFLAGS="-melf -Wl,-Bexport" + else + SHLIB_CFLAGS="-Kpic -belf" + LDFLAGS="-belf -Wl,-Bexport" + fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="" - LDFLAGS="-belf -Wl,-Bexport" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) @@ -2929,7 +3092,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS="" @@ -2939,7 +3102,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' @@ -2962,7 +3125,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' @@ -2972,20 +3135,24 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD="/usr/ccs/bin/ld -G -z text" LDFLAGS="" - do64bit_ok=no if test "$do64bit" = "yes" ; then - arch=`isainfo` - if test "$arch" = "sparcv9 sparc" ; then - if test "$CC" != "gcc" -a `$CC -v 2>&1 | grep -c gcc` = "0" ; then - do64bit_ok=yes - EXTRA_CFLAGS="-xarch=v9" - LDFLAGS="-xarch=v9" - else - AC_MSG_WARN("64bit mode not supported using GCC on $system") + arch=`isainfo` + if test "$arch" = "sparcv9 sparc" ; then + if test "$using_gcc" = "no" ; then + do64bit_ok=yes + if test "$do64bitVIS" = "yes" ; then + EXTRA_CFLAGS="-xarch=v9a" + LDFLAGS="-xarch=v9a" + else + EXTRA_CFLAGS="-xarch=v9" + LDFLAGS="-xarch=v9" + fi + else + AC_MSG_WARN("64bit mode not supported with GCC on $system") + fi + else + AC_MSG_WARN("64bit mode only supported sparcv9 system") fi - else - AC_MSG_WARN("64bit mode only supported sparcv9 system") - fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's @@ -2993,9 +3160,9 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" - if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + if test "$using_gcc" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' @@ -3010,13 +3177,16 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ DL_LIBS="" LDFLAGS="-Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + if test "$using_gcc" = "no" ; then + EXTRA_CFLAGS="-DHAVE_TZSET -std1" + fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="cc -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" - DL_OBJS="" + DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. @@ -3036,7 +3206,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ esac if test "$do64bit" = "yes" -a "$do64bit_ok" = "no" ; then - AC_MSG_WARN("64bit support being disabled -- not supported on this platform") + AC_MSG_WARN("64bit support being disabled -- don\'t know magic for this platform") fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic @@ -3124,7 +3294,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ DL_OBJS="" fi - if test "x$SHLIB_LD" != "x" ; then + if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" @@ -3144,7 +3314,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then - if test "$CC" = "gcc" -o `$CC -v 2>&1 | grep -c gcc` != "0" ; then + if test "$using_gcc" = "yes" ; then case $system in AIX-*) ;; @@ -3154,8 +3324,12 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ ;; NetBSD-*|FreeBSD-*|OpenBSD-*) ;; + Rhapsody-*|Darwin-*) + ;; RISCos-*) ;; + SCO_SV-3.2*) + ;; ULTRIX-4.*) ;; *) @@ -3166,7 +3340,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ fi if test "$SHARED_LIB_SUFFIX" = "" ; then - SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}.1' + SHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${VERSION}\$\{DBGX\}.a' @@ -3175,6 +3349,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) + AC_SUBST(CFLAGS_WARNING) ]) #-------------------------------------------------------------------- @@ -3245,11 +3420,71 @@ main() } return 1; }], tk_ok=sgtty, tk_ok=none, tk_ok=none) + + if test $tk_ok = sgtty; then + AC_DEFINE(USE_SGTTY) + else + AC_TRY_RUN([ +#include +#include + +main() +{ + struct termios t; + if (tcgetattr(0, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + cfsetospeed(&t, 0); + t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; +}], tk_ok=termios, tk_ok=no, tk_ok=no) + + if test $tk_ok = termios; then + AC_DEFINE(USE_TERMIOS) + else + AC_TRY_RUN([ +#include +#include + +main() +{ + struct termio t; + if (ioctl(0, TCGETA, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; + return 0; + } + return 1; + }], tk_ok=termio, tk_ok=no, tk_ok=no) + + if test $tk_ok = termio; then + AC_DEFINE(USE_TERMIO) + else + AC_TRY_RUN([ +#include +#include + +main() +{ + struct sgttyb t; + if (ioctl(0, TIOCGETP, &t) == 0 + || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { + t.sg_ospeed = 0; + t.sg_flags |= ODDP | EVENP | RAW; + return 0; + } + return 1; +}], tk_ok=sgtty, tk_ok=none, tk_ok=none) + if test $tk_ok = sgtty; then AC_DEFINE(USE_SGTTY) fi fi fi + fi + fi + fi AC_MSG_RESULT($tk_ok) ]) @@ -3313,10 +3548,10 @@ closedir(d); fi AC_MSG_RESULT($tcl_ok) - AC_CHECK_HEADER(errno.h, , AC_DEFINE(NO_ERRNO_H)) - AC_CHECK_HEADER(float.h, , AC_DEFINE(NO_FLOAT_H)) - AC_CHECK_HEADER(values.h, , AC_DEFINE(NO_VALUES_H)) - AC_CHECK_HEADER(limits.h, , AC_DEFINE(NO_LIMITS_H)) + AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H)]) + AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H)]) + AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H)]) + AC_CHECK_HEADER(limits.h, , [AC_DEFINE(NO_LIMITS_H)]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) @@ -3335,8 +3570,8 @@ closedir(d); AC_DEFINE(NO_STRING_H) fi - AC_CHECK_HEADER(sys/wait.h, , AC_DEFINE(NO_SYS_WAIT_H)) - AC_CHECK_HEADER(dlfcn.h, , AC_DEFINE(NO_DLFCN_H)) + AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H)]) + AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H)]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). @@ -3498,68 +3733,6 @@ AC_DEFUN(SC_BLOCKING_STYLE, [ ]) #-------------------------------------------------------------------- -# SC_HAVE_VFORK -# -# Check to see whether the system provides a vfork kernel call. -# If not, then use fork instead. Also, check for a problem with -# vforks and signals that can cause core dumps if a vforked child -# resets a signal handler. If the problem exists, then use fork -# instead of vfork. -# -# Arguments: -# none -# -# Results: -# -# Defines some of the following vars: -# vfork (=fork) -# -#-------------------------------------------------------------------- - -AC_DEFUN(SC_HAVE_VFORK, [ - AC_TYPE_SIGNAL() - AC_CHECK_FUNC(vfork, tcl_ok=1, tcl_ok=0) - if test "$tcl_ok" = 1; then - AC_MSG_CHECKING([vfork/signal bug]); - AC_TRY_RUN([ -#include -#include -#include -int gotSignal = 0; -sigProc(sig) - int sig; -{ - gotSignal = 1; -} -main() -{ - int pid, sts; - (void) signal(SIGCHLD, sigProc); - pid = vfork(); - if (pid < 0) { - exit(1); - } else if (pid == 0) { - (void) signal(SIGCHLD, SIG_DFL); - _exit(0); - } else { - (void) wait(&sts); - } - exit((gotSignal) ? 0 : 1); -}], tcl_ok=1, tcl_ok=0, tcl_ok=0) - - if test "$tcl_ok" = 1; then - AC_MSG_RESULT(ok) - else - AC_MSG_RESULT([buggy, using fork instead]) - fi - fi - rm -f core - if test "$tcl_ok" = 0; then - AC_DEFINE(vfork, fork) - fi -]) - -#-------------------------------------------------------------------- # SC_TIME_HANLDER # # Checks how the system deals with time.h, what time structures @@ -3624,19 +3797,6 @@ AC_DEFUN(SC_TIME_HANDLER, [ AC_MSG_RESULT(no)) fi - # - # AIX does not have a timezone field in struct tm. When the AIX bsd - # library is used, the timezone global and the gettimeofday methods are - # to be avoided for timezone deduction instead, we deduce the timezone - # by comparing the localtime result on a known GMT value. - # - - if test "`uname -s`" = "AIX" ; then - AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes) - if test $libbsd = yes; then - AC_DEFINE(USE_DELTA_FOR_TZ) - fi - fi ]) #-------------------------------------------------------------------- @@ -3646,6 +3806,8 @@ AC_DEFUN(SC_TIME_HANDLER, [ # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. +# Also, on Compaq's Tru64 Unix 5.0, +# strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none @@ -3658,25 +3820,31 @@ AC_DEFUN(SC_TIME_HANDLER, [ #-------------------------------------------------------------------- AC_DEFUN(SC_BUGGY_STRTOD, [ - AC_CHECK_FUNC(strtod, tk_strtod=1, tk_strtod=0) - if test "$tk_strtod" = 1; then - AC_MSG_CHECKING([for Solaris 2.4 strtod bug]) + AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) + if test "$tcl_strtod" = 1; then + AC_MSG_CHECKING([for Solaris2.4/Tru64 strtod bugs]) AC_TRY_RUN([ extern double strtod(); int main() { - char *string = "NaN"; + char *string = "NaN", *spaceString = " "; char *term; - strtod(string, &term); + double value; + value = strtod(string, &term); if ((term != string) && (term[-1] == 0)) { exit(1); } + value = strtod(spaceString, &term); + if (term == (spaceString+1)) { + exit(1); + } exit(0); - }], tk_ok=1, tk_ok=0, tk_ok=0) - if test "$tk_ok" = 1; then + }], tcl_ok=1, tcl_ok=0, tcl_ok=0) + if test "$tcl_ok" = 1; then AC_MSG_RESULT(ok) else AC_MSG_RESULT(buggy) + LIBOBJS="$LIBOBJS fixstrtod.o" AC_DEFINE(strtod, fixstrtod) fi fi @@ -3721,29 +3889,12 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [ AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- - # On AIX systems, libbsd.a has to be linked in to support - # non-blocking file IO. This library has to be linked in after - # the MATH_LIBS or it breaks the pow() function. The way to - # insure proper sequencing, is to add it to the tail of MATH_LIBS. - # This library also supplies gettimeofday. - #-------------------------------------------------------------------- - - libbsd=no - if test "`uname -s`" = "AIX" ; then - AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes) - if test $libbsd = yes; then - MATH_LIBS="$MATH_LIBS -lbsd" - fi - fi - - - #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) - AC_CHECK_HEADER(net/errno.h, AC_DEFINE(HAVE_NET_ERRNO_H)) + AC_CHECK_HEADER(net/errno.h, [AC_DEFINE(HAVE_NET_ERRNO_H)]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. @@ -3766,15 +3917,16 @@ AC_DEFUN(SC_TCL_LINK_LIBS, [ tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then - AC_CHECK_LIB(socket, main, LIBS="$LIBS -lsocket", tcl_checkBoth=1) + AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, + LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi - AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, - [LIBS="$LIBS -lnsl"])) + AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, + [LIBS="$LIBS -lnsl"])]) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call SC_CONFIG_CFLAGS diff --git a/configure b/configure index 7823aef..0520827 100755 --- a/configure +++ b/configure @@ -548,7 +548,7 @@ else fi PACKAGE=ivycpy -VERSION=0.5 +VERSION=0.6 echo $ac_n "checking if «echo» can suppress trailing newline""... $ac_c" 1>&6 echo "configure:555: checking if «echo» can suppress trailing newline" >&5 @@ -1045,6 +1045,8 @@ fi PYTHON_INCLUDEDIR=$mv_tmp/include PYTHON_LIBDIR=$mv_tmp/lib +PYTHON_COMPILER=$PYTHON_LIBDIR/python$PYTHON_VERSION/compileall.py + @@ -1064,6 +1066,21 @@ pkgpythondir=\${pythondir}/$PACKAGE +if test ! -f "$PYTHON_COMPILER"; then +PYTHON_COMPILER="compileall.py" +fi +if test "$silent" != yes; then + mv_fd=1 +if test -n "$ESC" && test -t $mv_fd; then + mv_set_colors + mv_colors_on_fd_1=yes +else + mv_unset_colors + mv_colors_on_fd_1=no +fi + $ECHO "$CYAN"""PYTHON_COMPILER file is "$PYTHON_COMPILER ""${RESET}${FOREGROUND-$DEFAULT}${BACKGROUND-$BG_DEFAULT}" +fi + CPPFLAGS="$CPPFLAGS -I$PYTHON_INCLUDEDIR/python$PYTHON_VERSION" @@ -1084,7 +1101,7 @@ if test "${with_tcl+set}" = set; then fi echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:1088: checking for Tcl configuration" >&5 +echo "configure:1105: checking for Tcl configuration" >&5 if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1154,7 +1171,7 @@ fi echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6 -echo "configure:1158: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 +echo "configure:1175: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$ac_t""loading" 1>&6 @@ -1174,6 +1191,7 @@ echo "configure:1158: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 + if test "$silent" != yes; then @@ -1199,6 +1217,7 @@ INCLUDES=" $TCL_INCLUDES $INCLUDES" LIBRARIES=" $TCL_LIB_SPEC $LIBRARIES" + if test "$silent" != yes; then mv_fd=1 if test -n "$ESC" && test -t $mv_fd; then @@ -1217,7 +1236,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1221: checking for $ac_word" >&5 +echo "configure:1240: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_SWIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1312,7 +1331,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1316: checking for $ac_word" >&5 +echo "configure:1335: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1342,7 +1361,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1346: checking for $ac_word" >&5 +echo "configure:1365: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1393,7 +1412,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1397: checking for $ac_word" >&5 +echo "configure:1416: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1425,7 +1444,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1429: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1448: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1436,12 +1455,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1440 "configure" +#line 1459 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1467,12 +1486,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1471: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1490: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1476: checking whether we are using GNU C" >&5 +echo "configure:1495: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1481,7 +1500,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1485: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1500,7 +1519,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1504: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1523: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1535,7 +1554,7 @@ fi # Checks for libraries. # FIXME: Replace `main' with a function in `-lc': echo $ac_n "checking for main in -lc""... $ac_c" 1>&6 -echo "configure:1539: checking for main in -lc" >&5 +echo "configure:1558: checking for main in -lc" >&5 ac_lib_var=`echo c'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1543,14 +1562,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1580,7 +1599,7 @@ fi # Checks for header files. echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1584: checking how to run the C preprocessor" >&5 +echo "configure:1603: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1595,13 +1614,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1624: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1612,13 +1631,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1641: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1629,13 +1648,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1660,12 +1679,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1664: checking for ANSI C header files" >&5 +echo "configure:1683: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1673,7 +1692,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1677: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1690,7 +1709,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1708,7 +1727,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1729,7 +1748,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1740,7 +1759,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1763: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1767,17 +1786,17 @@ for ac_hdr in stdlib.h string.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1771: checking for $ac_hdr" >&5 +echo "configure:1790: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1800: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1806,12 +1825,12 @@ done # Checks for typedefs, structures, and compiler characteristics. echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1810: checking for working const" >&5 +echo "configure:1829: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1883,12 +1902,12 @@ fi # specific checks echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1887: checking return type of signal handlers" >&5 +echo "configure:1906: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1905,7 +1924,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1909: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1929,12 +1948,12 @@ EOF # AC_CHECK_FUNC(realloc,AC_MSG_RESULT(" present"),\ # AC_MSG_ERROR("unreachable")) echo $ac_n "checking for realloc""... $ac_c" 1>&6 -echo "configure:1933: checking for realloc" >&5 +echo "configure:1952: checking for realloc" >&5 if eval "test \"`echo '$''{'ac_cv_func_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_realloc=yes" else @@ -1999,17 +2018,17 @@ for ac_hdr in Python.h _tkinter.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2003: checking for $ac_hdr" >&5 +echo "configure:2022: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2013: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2032: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2042,17 +2061,17 @@ for ac_hdr in tcl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2046: checking for $ac_hdr" >&5 +echo "configure:2065: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2056: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2084,17 +2103,17 @@ for ac_hdr in ivy.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2088: checking for $ac_hdr" >&5 +echo "configure:2107: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2117: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2128,9 +2147,9 @@ done # #include <_tkinter.h> echo $ac_n "checking "suited patched Python version"""... $ac_c" 1>&6 -echo "configure:2132: checking "suited patched Python version"" >&5 +echo "configure:2151: checking "suited patched Python version"" >&5 cat > conftest.$ac_ext < #ifdef ENTER_PYTHON && LEAVE_PYTHON @@ -2155,9 +2174,9 @@ else fi echo $ac_n "checking "TCL_THREADS"""... $ac_c" 1>&6 -echo "configure:2159: checking "TCL_THREADS"" >&5 +echo "configure:2178: checking "TCL_THREADS"" >&5 cat > conftest.$ac_ext < $1 et $source -> $input %typemap(python,in) PyObject *PyFunc { - if (!PyCallable_Check($source)) { + if (!PyCallable_Check($input)) { PyErr_SetString(PyExc_TypeError, "Need a callable object!"); return NULL; } - $target = $source; -} + $1 = $input; +} %typemap(python,in) PyObject *PyFuncOnCx { - if (!PyCallable_Check($source)) { + if (!PyCallable_Check($input)) { PyErr_SetString(PyExc_TypeError, "Need a callable object!"); return NULL; } - $target = $source; -} + $1 = $input; +} %typemap(python,in) PyObject *PyFuncOnDie { - if (!PyCallable_Check($source)) { + if (!PyCallable_Check($input)) { PyErr_SetString(PyExc_TypeError, "Need a callable object!"); return NULL; } - $target = $source; + $1 = $input; } - // part 3 // on place ici les donnees, fonctions a wrapper diff --git a/ivycpy_namer.sed b/ivycpy_namer.sed index 859d11f..3cde8e7 100644 --- a/ivycpy_namer.sed +++ b/ivycpy_namer.sed @@ -1,3 +1,3 @@ -s/\"pyIvy/\"Ivy/g ; +s/^pyIvy/Ivy/g ; # s/MsgAsS\"/Msg\"/g; -s/ErrorAsS\"/Error\"/g; +#s/ErrorAsS\"/Error\"/g; diff --git a/private.m4 b/private.m4 index 733b865..d1218ce 100644 --- a/private.m4 +++ b/private.m4 @@ -47,9 +47,11 @@ fi PYTHON_INCLUDEDIR=$mv_tmp/include PYTHON_LIBDIR=$mv_tmp/lib +PYTHON_COMPILER=$PYTHON_LIBDIR/python$PYTHON_VERSION/compileall.py AC_SUBST(PYTHON_INCLUDEDIR) AC_SUBST(PYTHON_LIBDIR) +AC_SUBST(PYTHON_COMPILER) dnl # A FAIRE: dnl # S'assurer de bien utiliser cette version de la bibliotheque python! -- cgit v1.1