diff --git a/magic/Makefile b/magic/Makefile index 62a5815b..b818ec58 100644 --- a/magic/Makefile +++ b/magic/Makefile @@ -34,7 +34,7 @@ DEST_XBM = $(BITMAPS:%=$(DESTDIR)${INSTALL_TCLDIR}/bitmaps/%) DFLAGS += -DMAGIC_DATE="\"`date`\"" -DCAD_DIR="${LIBDIR}" LIBS += ${GR_LIBS} ${READLINE_LIBS} -lm ${LD_EXTRA_LIBS} \ - ${OA_LIBS} ${TOP_EXTRA_LIBS} + ${OA_LIBS} ${ZLIB_FLAG} ${TOP_EXTRA_LIBS} CLEANS += tclmagic${SHDLIB_EXT} libtclmagic${SHDLIB_EXT}.a proto.magicrc main: magic proto.magicrc diff --git a/scripts/configure b/scripts/configure index fed71267..9b341cb4 100755 --- a/scripts/configure +++ b/scripts/configure @@ -660,6 +660,7 @@ LIB_SPECS_GRNULL LIB_SPECS_NOSTUB LIB_SPECS INC_SPECS +ZLIB_FLAG EXTRA_LIB_SPECS SHLIB_LIB_SPECS LDDL_FLAGS @@ -5043,6 +5044,7 @@ else fi +ZLIB_FLAG="" if test "x$enable_compression" = "xyes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 $as_echo_n "checking for gzopen in -lz... " >&6; } @@ -5082,8 +5084,11 @@ fi $as_echo "$ac_cv_lib_z_gzopen" >&6; } if test "x$ac_cv_lib_z_gzopen" = xyes; then : + $as_echo "#define HAVE_ZLIB 1" >>confdefs.h + ZLIB_FLAG=" -lz" + fi fi @@ -8246,6 +8251,7 @@ fi + fi if test "$GCC" = "yes" ; then diff --git a/scripts/configure.in b/scripts/configure.in index 97dbb01d..cac7b9fd 100644 --- a/scripts/configure.in +++ b/scripts/configure.in @@ -185,8 +185,12 @@ AC_ARG_ENABLE(compression, [enable_compression=yes]) dnl Check for zlib +ZLIB_FLAG="" if test "x$enable_compression" = "xyes" ; then - AC_CHECK_LIB([z],[gzopen],[AC_DEFINE([HAVE_ZLIB],[1],["zlib compression"])]) + AC_CHECK_LIB([z],[gzopen],[ + AC_DEFINE([HAVE_ZLIB],[1],["zlib compression"]) + ZLIB_FLAG=" -lz" + ]) fi dnl Check for some C99 functions @@ -1759,6 +1763,7 @@ if test $usingTcl ; then AC_SUBST(EXTRA_LIB_SPECS) AC_SUBST(LDFLAGS) + AC_SUBST(ZLIB_FLAG) AC_SUBST(INC_SPECS) AC_SUBST(LIB_SPECS) AC_SUBST(LIB_SPECS_NOSTUB) diff --git a/scripts/defs.mak.in b/scripts/defs.mak.in index 3b155a0a..7aa921fc 100755 --- a/scripts/defs.mak.in +++ b/scripts/defs.mak.in @@ -62,7 +62,7 @@ MCPP = @MCPP@ MSED = @MSED@ RANLIB = @RANLIB@ SHDLIB_EXT = @SHDLIB_EXT@ -LDDL_FLAGS = ${LDFLAGS} @LDDL_FLAGS@ +ZLIB_FLAG = @ZLIB_FLAG@ LD_RUN_PATH = @LD_RUN_PATH@ LIB_SPECS = @LIB_SPECS@ LIB_SPECS_NOSTUB = @LIB_SPECS_NOSTUB@ diff --git a/tcltk/Makefile b/tcltk/Makefile index 0248bb70..10dd8087 100644 --- a/tcltk/Makefile +++ b/tcltk/Makefile @@ -51,12 +51,13 @@ install-tcl: magicexec magicdnull ${BIN_FILES} ${TCL_FILES} magicexec: magicexec.c ${MAGICDIR}/defs.mak ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} ${LDFLAGS} magicexec.c \ - -o magicexec ${LD_RUN_PATH} ${LIB_SPECS_NOSTUB} ${LIBS} \ - ${GR_LIBS} + -o magicexec ${LD_RUN_PATH} ${LIB_SPECS_NOSTUB} ${ZLIB_FLAG} \ + ${LIBS} ${GR_LIBS} magicdnull: magicdnull.c ${MAGICDIR}/defs.mak ${CC} ${CFLAGS} ${CPPFLAGS} ${DFLAGS_NOSTUB} ${LDFLAGS} magicdnull.c \ - -o magicdnull ${LD_RUN_PATH} ${LIB_SPECS_GRNULL} ${LIBS} + -o magicdnull ${LD_RUN_PATH} ${LIB_SPECS_GRNULL} ${ZLIB_FLAG} \ + ${LIBS} magic.tcl: magic.tcl.in ${MAGICDIR}/defs.mak ${MAGICDIR}/VERSION sed -e /MAGIC_VERSION/s%MAGIC_VERSION%${MAGIC_VERSION}%g \