From 6f3dea45cee94f12ffa0b2acbbdb3eedbc01807b Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 18 Dec 2008 15:24:46 +0000 Subject: Autoconf wizardry! --- ChangeLog | 1 + unix/Makefile.in | 11 +++++++++-- unix/configure.in | 33 ++++++++++++++++++++------------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index c3cc743..548bec0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-12-18 Donal K. Fellows + * unix/configure.in, unix/Makefile.in: Autoconf wizardry. * compat/zlib/*: Import of zlib 1.2.3. The license is directly compatible with Tcl's. This import omits the obsolete and contributed parts (i.e. selected directories) and the supplied diff --git a/unix/Makefile.in b/unix/Makefile.in index 83b5008..5d4adc2 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -4,7 +4,7 @@ # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.251 2008/12/17 17:23:10 dgp Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.252 2008/12/18 15:24:46 dkf Exp $ VERSION = @TCL_VERSION@ MAJOR_VERSION = @TCL_MAJOR_VERSION@ @@ -232,6 +232,10 @@ DLTEST_DIR = @TCL_SRC_DIR@/unix/dltest # Must be absolute to so the corresponding tcltest's tcl_library is absolute. TCL_BUILDTIME_LIBRARY = @TCL_SRC_DIR@/library +ZLIB_DIR = @ZLIB_DIR@ +ZLIB_LIBRARY = @ZLIB_DIR@@ZLIB_LIB@ +ZLIB_LIB = @ZLIB_LIB@ + CC = @CC@ #CC = purify -best-effort @CC@ -DPURIFY @@ -566,7 +570,7 @@ doc: # The following target is configured by autoconf to generate either a shared # library or non-shared library for Tcl. -${LIB_FILE}: ${OBJS} ${STUB_LIB_FILE} +${LIB_FILE}: ${OBJS} ${STUB_LIB_FILE} ${ZLIB_DIR}${ZLIB_LIB} rm -f $@ @MAKE_LIB@ @@ -574,6 +578,9 @@ ${STUB_LIB_FILE}: ${STUB_LIB_OBJS} rm -f $@ @MAKE_STUB_LIB@ +${ZLIB_DIR}${ZLIB_LIB}: + cd ${ZLIB_DIR}; ${MAKE} ${ZLIB_LIB} + # Make target which outputs the list of the .o contained in the Tcl lib useful # to build a single big shared library containing Tcl and other extensions. # Used for the Tcl Plugin. -- dl diff --git a/unix/configure.in b/unix/configure.in index 7f66b61..af7a456 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.196 2008/12/17 15:36:58 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.197 2008/12/18 15:24:46 dkf Exp $ AC_INIT([tcl],[8.6]) AC_PREREQ(2.59) @@ -119,22 +119,21 @@ SC_ENABLE_SHARED # Add stuff for zlib #------------------------------------------------------------------------ -tcl_ok=yes +zlib_ok=yes AC_CHECK_HEADER([zlib.h],[ - AC_CHECK_TYPE([gz_header],[],[ - tcl_ok=no - AC_MSG_WARN([todo: Add -Icompat/zlib/include to compile lines]) - ],[#include ])],[ - tcl_ok=no - AC_MSG_WARN([todo: Add -Icompat/zlib/include to compile lines]) - ]) -AS_IF([test $tcl_ok = yes], [ + AC_CHECK_TYPE([gz_header],[],[zlib_ok=no],[#include ])],[ + zlib_ok=no]) +AS_IF([test $zlib_ok = yes], [ AC_SEARCH_LIBS([deflateSetHeader],[z],[],[ - tcl_ok=no + zlib_ok=no AC_MSG_WARN([todo: Add compat/zlib to list of things to build]) ])]) -AS_IF([test $tcl_ok = yes], [ - AC_DEFINE(HAVE_ZLIB, 1, [Is there an installed zlib?])]) +AS_IF([test $zlib_ok = no], [ + AC_SUBST(ZLIB_DIR,[${TOP_DIR}/compat/zlib/]) + AC_SUBST(ZLIB_LIB,[libz.a]) + CFLAGS="$CFLAGS -I\${ZLIB_DIR}" +]) +AC_DEFINE(HAVE_ZLIB, 1, [Is there an installed zlib?]) #-------------------------------------------------------------------- # The statements below define a collection of compile flags. This @@ -845,6 +844,10 @@ TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}" # Install time header dir can be set via --includedir eval "TCL_INCLUDE_SPEC=\"-I${includedir}\"" +AS_IF([test $zlib_ok = no], [ + LD_SEARCH_FLAGS="\${ZLIB_LIBRARY} ${LD_SEARCH_FLAGS}" +]) + #------------------------------------------------------------------------ # tclConfig.sh refers to this by a different name #------------------------------------------------------------------------ @@ -922,3 +925,7 @@ AC_CONFIG_FILES([ tclConfig.sh:../unix/tclConfig.sh.in ]) AC_OUTPUT + +dnl Local Variables: +dnl mode: autoconf +dnl End: -- cgit v0.12