Check-in [44e46cf739]
Overview
Comment:Added start of KitDLL static building
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | feature-kitdll-static
Files: files | file ages | folders
SHA1:44e46cf7398396ce42d812c7d3a1a0246581dc31
User & Date: rkeene on 2016-02-24 20:08:09
Other Links: manifest | tags
Context
2016-02-24
20:10
Merged duplicate branches check-in: 5ed2993b61 user: rkeene tags: feature-kitdll-static
20:08
Added start of KitDLL static building check-in: 44e46cf739 user: rkeene tags: feature-kitdll-static
20:00
Added Tcl 8.5.19 to the web interface check-in: f71b69d91f user: rkeene tags: trunk
Changes

Modified kitsh/build.sh from [fe33f09af3] to [e30417e077].

   111    111   	fi
   112    112   
   113    113   	# Cleanup
   114    114   	rm -f kit kit.exe tclsh tclsh.exe
   115    115   
   116    116   	# Determine if target is KitDLL or KitSH
   117    117   	if [ "${KITTARGET}" = "kitdll" ]; then
   118         -		CONFIGUREEXTRA="${CONFIGUREEXTRA} --enable-kitdll"
          118  +		CONFIGUREEXTRA="${CONFIGUREEXTRA} --enable-kitdll=static"
   119    119   	fi
   120    120   
   121    121   	# Compile Kit
   122    122   	if [ -z "${ZLIBDIR}" ]; then
   123    123   		echo "Running: ./configure --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
   124    124   
   125    125   		./configure --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}
................................................................................
   164    164   	if [ "${KITTARGET}" = "kitdll" ]; then
   165    165   		## Find the library created
   166    166   		for chkkittarget in libtclkit*.*; do
   167    167   			if [ ! -f "${chkkittarget}" ]; then
   168    168   				continue
   169    169   			fi
   170    170   
   171         -			if echo "${chkkittarget}" | egrep '\.(lib|def|a)$'; then
          171  +			if echo "${chkkittarget}" | egrep '\..*\.(lib|def|a)$'; then
   172    172   				continue
   173    173   			fi
   174    174   
   175    175   			KITTARGET_NAME="./${chkkittarget}"
   176    176   
   177    177   			break
   178    178   		done

Modified kitsh/buildsrc/kitsh-0.0/Makefile.common.in from [93d968f811] to [bfce9994ae].

    12     12   EXTRA_OBJS = @EXTRA_OBJS@
    13     13   LDRUNPATH = @LDRUNPATH@
    14     14   EXTRA_KIT_DEPS = @EXTRA_KIT_DEPS@
    15     15   EXTRA_VFS_OBJS = @EXTRA_VFS_OBJS@
    16     16   TCLSH_NATIVE = tclsh
    17     17   LDFLAGS_ADD = @LDFLAGS_ADD@
    18     18   DIR2C_FLAGS = @DIR2C_FLAGS@
           19  +AR = @AR@
           20  +RANLIB = @RANLIB@
    19     21   
    20     22   # Build targets
    21     23   ## VFS Build
    22     24   cvfs_data_tcl.o: cvfs_data_tcl.c
    23     25   cvfs_data_tcl.c: dir2c.tcl starpack.vfs cvfs_data.c
    24     26   	"$(TCLSH_NATIVE)" dir2c.tcl tcl starpack.vfs $(DIR2C_FLAGS) > cvfs_data_tcl.c
    25     27   
................................................................................
    41     43   
    42     44   ### Windows resources
    43     45   kit.res.o: kit.rc tclkit.ico
    44     46   	$(RC) -o kit.res.o $(CPPFLAGS) kit.rc
    45     47   
    46     48   # Cleanup routines
    47     49   clean:
           50  +	rm -rf __TMP__
    48     51   	rm -f kit kit.res.o
    49     52   	rm -f libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
    50     53   	rm -f $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS)
    51     54   	rm -f cvfs_data_tcl.c cvfs_data_tcl.o
    52     55   	rm -f cvfs.tcl.h
    53     56   	rm -f tclsh.o tclsh tclsh.exe
    54     57   	rm -f wish.o wish wish.exe

Modified kitsh/buildsrc/kitsh-0.0/Makefile.kitdll.in from [05829b4d07] to [36bd975f50].

     1      1   OBJS = kitInit.o rechan.o pwb.o zlib.o
     2      2   
     3      3   # Default target
     4         -all: libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
            4  +all: @TARGET@
     5      5   
     6      6   -include Makefile.common
            7  +
            8  +kitdll: libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
            9  +kitdll-static: libtclkit@KITDLL_LIB_VERSION@.a
     7     10   
     8     11   ## DLL Build
     9     12   libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@: $(OBJS) $(EXTRA_KIT_DEPS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS)
    10     13   	$(CC) $(CPPFLAGS) $(CFLAGS) -o libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) @WHOLEARCHIVE@ $(ARCHS) @NOWHOLEARCHIVE@ $(LIBS) $(LDFLAGS_ADD)
    11     14   	-for striplib in $(STRIPLIBS); do $(OBJCOPY) --weaken "$${striplib}"; done
    12     15   	-mv libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@.safe; \
    13     16   		$(CC) $(CPPFLAGS) $(CFLAGS) -o libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) @WHOLEARCHIVE@ $(ARCHS) @NOWHOLEARCHIVE@ $(LIBS) || \
    14     17   			mv libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@.safe libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
    15     18   	-rm -f libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@.safe
    16     19   
           20  +## Static archive build
           21  +libtclkit@KITDLL_LIB_VERSION@.a: $(OBJS) $(EXTRA_KIT_DEPS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS)
           22  +        rm -f libtclkit@KITDLL_LIB_VERSION@.a.new
           23  +        rm -rf __TMP__
           24  +        mkdir __TMP__
           25  +        for arch in $(ARCHS); do ( cd __TMP__ && ar x ../$${arch} ); done
           26  +        $(OBJCOPY) --redefine-sym Tcl_Init=Tcl_InitReal __TMP__/tclInterp.o
           27  +        $(AR) cr libtclkit@KITDLL_LIB_VERSION@.a.new $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) __TMP__/*.o
           28  +        rm -rf __TMP__
           29  +        $(RANLIB) libtclkit@KITDLL_LIB_VERSION@.a.new
           30  +        mv libtclkit@KITDLL_LIB_VERSION@.a.new libtclkit@KITDLL_LIB_VERSION@.a
           31  +
    17     32   # Test driver
    18     33   tclsh.o: tclsh.c
    19     34   tclsh: tclsh.o $(EXTRA_OBJS) libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
    20     35   	$(CC) $(CPPFLAGS) $(CFLAGS) -o tclsh tclsh.o $(EXTRA_OBJS) -L. -ltclkit@KITDLL_LIB_VERSION@ $(LDRUNPATH)
    21     36   
    22     37   wish.o: wish.c
    23     38   wish: wish.o $(EXTRA_OBJS) libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
    24     39   	$(CC) $(CPPFLAGS) $(CFLAGS) $(WISH_CFLAGS) -o wish wish.o $(EXTRA_OBJS) -L. -ltclkit@KITDLL_LIB_VERSION@ $(LDRUNPATH)
           40  +
           41  +.PHONY: kitdll kitdll-static

Modified kitsh/buildsrc/kitsh-0.0/configure.ac from [42d57f3f66] to [dc51bae560].

    13     13   EXTRA_KIT_DEPS=""
    14     14   AC_MSG_CHECKING([what target to build])
    15     15   AC_ARG_ENABLE(kitdll, AC_HELP_STRING([--enable-kitdll], [Enable building KitDLL instead of Tclkit (default: no)]), [
    16     16   	AS_CASE([$enableval],
    17     17   		[yes|kitdll], [
    18     18   			TARGET="kitdll"
    19     19   		],
           20  +		static, [
           21  +			TARGET="kitdll-static"
           22  +		]
    20     23   		no, [
    21     24   			true
    22     25   		], [
    23     26   			AC_MSG_RESULT([unknown])
    24     27   
    25     28   			AC_MSG_ERROR([Invalid option: $enableval])
    26     29   		]
    27     30   	)
    28     31   ])
    29     32   AC_MSG_RESULT([$TARGET])
           33  +AC_SUBST(TARGET)
    30     34   
    31     35   dnl Find the appropriate libraries to link to
    32     36   AC_SEARCH_LIBS(acos, m,, [ AC_MSG_WARN([Couldn't find acos (normally in libm)!]) ])
    33     37   AC_SEARCH_LIBS(dlsym, dl,, [ AC_MSG_WARN([Couldn't find dlsym (normally in libdl)!]) ])
    34     38   
    35     39   AS_IF([test "$TARGET" = "tclkit"], [
    36     40   	dnl We have Tclkit
................................................................................
    47     51   	DC_GET_SHOBJFLAGS
    48     52   
    49     53   	dnl Determine if we have "objcopy" available to weaken non-Tcl/Tk symbols
    50     54   	AC_CHECK_TOOL(OBJCOPY, objcopy, [:])
    51     55   
    52     56   	dnl Define KitDLL usage
    53     57   	AC_DEFINE([TCLKIT_DLL], [1], [Define if you are using a KitDLL rather than a Tclkit])
           58  +
           59  +	dnl Define a static KitDLL
           60  +	AS_IF([test "$TARGET" = "kitdll-static"], [
           61  +		AC_DEFINE([TCLKIT_DLL_STATIC], [1], [Define if you are building a static KitDLL])
           62  +		SHOBJE
           63  +	])
    54     64   ])
    55     65   
    56     66   dnl Figure out how to statically link to libgcc, if needed
    57     67   DC_STATIC_LIBGCC
    58     68   
    59     69   dnl Set linker rpath for tclsh/wish
    60     70   DC_SETLDRUNPATH([.])