Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -1,21 +1,24 @@ CC = @CC@ +AR = @AR@ CFLAGS = @CFLAGS@ @SHOBJFLAGS@ CPPFLAGS = @CPPFLAGS@ -I@srcdir@ @DEFS@ LDFLAGS = @LDFLAGS@ @SHOBJLDFLAGS@ LIBS = @LIBS@ INSTALL = @INSTALL@ PACKAGE_VERSION = @PACKAGE_VERSION@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ PACKAGE_INSTALL_DIR = $(TCL_PACKAGE_PATH)/tcltls$(PACKAGE_VERSION) -all: tcltls.@SHOBJEXT@ +all: @EXTENSION_TARGET@ tcltls.@SHOBJEXT@: tls.o tlsBIO.o tlsIO.o tlsX509.o $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o tcltls.@SHOBJEXT@ tls.o tlsBIO.o tlsIO.o tlsX509.o $(LIBS) -install: tcltls.@SHOBJEXT@ pkgIndex.tcl +tcltls.a: tls.o tlsBIO.o tlsIO.o tlsX509.o + $(AR) rcu tcltls.a.new tls.o tlsBIO.o tlsIO.o tlsX509.o + mv tcltls.a.new tcltls.a tls.o: @srcdir@/tls.c @srcdir@/tlsInt.h @srcdir@/tclOpts.h @srcdir@/tls.tcl.h tlsBIO.o: @srcdir@/tlsBIO.c @srcdir@/tlsInt.h tlsIO.o: @srcdir@/tlsIO.c @srcdir@/tlsInt.h tlsX509.o: @srcdir@/tlsX509.c @srcdir@/tlsInt.h @@ -25,13 +28,16 @@ mv '@srcdir@/tls.tcl.h.new' '@srcdir@/tls.tcl.h' %.o: @srcdir@/%.c $(CC) $(CPPFLAGS) $(CFLAGS) -o "$@" -c "$<" +install: @EXTENSION_TARGET@ pkgIndex.tcl + clean: rm -f tls.o tlsBIO.o tlsIO.o tlsX509.o rm -f tcltls.@SHOBJEXT@ + rm -f tcltls.a.new tcltls.a distclean: clean rm -f config.log config.status rm -f Makefile pkgIndex.tcl Index: configure.in ================================================================== --- configure.in +++ configure.in @@ -8,16 +8,25 @@ AC_GNU_SOURCE dnl Determine system information DC_CHK_OS_INFO -dnl Determine how to make shared objects -DC_GET_SHOBJFLAGS - dnl Look for appropriate headers AC_CHECK_HEADERS(unistd.h stdlib.h string.h strings.h) dnl Perform Tcl Extension required stuff TCLEXT_INIT + +if test "$TCLEXT_BUILD" != 'static'; then + dnl Determine how to make shared objects + DC_GET_SHOBJFLAGS + + EXTENSION_TARGET="tcltls.${SHOBJEXT}" +else + AC_CHECK_TOOL([AR], [ar], [false]) + AC_CHECK_TOOL([RANLIB], [ranlib], [:]) + EXTENSION_TARGET="tcltls.a" +fi +AC_SUBST(EXTENSION_TARGET) dnl Produce output AC_OUTPUT(Makefile pkgIndex.tcl)