Check-in [365a853bd5]
Overview
Comment:Fixed issues causing static KitDLL from not getting built
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | feature-kitdll-static
Files: files | file ages | folders
SHA1: 365a853bd5251aa1593502ca36260eb47fff2db9
User & Date: rkeene on 2016-02-24 20:23:40
Other Links: branch diff | manifest | tags
Context
2016-02-24
20:26
Created a mechanism for specifying which KitDLL to build check-in: eb5004bca0 user: rkeene tags: feature-kitdll-static
20:23
Fixed issues causing static KitDLL from not getting built check-in: 365a853bd5 user: rkeene tags: feature-kitdll-static
20:10
Merged duplicate branches check-in: 5ed2993b61 user: rkeene tags: feature-kitdll-static
Changes

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

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
	-mv libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@.safe; \
		$(CC) $(CPPFLAGS) $(CFLAGS) -o libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) @WHOLEARCHIVE@ $(ARCHS) @NOWHOLEARCHIVE@ $(LIBS) || \
			mv libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@.safe libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
	-rm -f libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@.safe

## Static archive build
libtclkit@KITDLL_LIB_VERSION@.a: $(OBJS) $(EXTRA_KIT_DEPS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS)
        rm -f libtclkit@KITDLL_LIB_VERSION@.a.new
        rm -rf __TMP__
        mkdir __TMP__
        for arch in $(ARCHS); do ( cd __TMP__ && ar x ../$${arch} ); done
        $(OBJCOPY) --redefine-sym Tcl_Init=Tcl_InitReal __TMP__/tclInterp.o
        $(AR) cr libtclkit@KITDLL_LIB_VERSION@.a.new $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) __TMP__/*.o
        rm -rf __TMP__
        $(RANLIB) libtclkit@KITDLL_LIB_VERSION@.a.new
        mv libtclkit@KITDLL_LIB_VERSION@.a.new libtclkit@KITDLL_LIB_VERSION@.a

# Test driver
tclsh.o: tclsh.c
tclsh: tclsh.o $(EXTRA_OBJS) libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
	$(CC) $(CPPFLAGS) $(CFLAGS) -o tclsh tclsh.o $(EXTRA_OBJS) -L. -ltclkit@KITDLL_LIB_VERSION@ $(LDRUNPATH)

wish.o: wish.c
wish: wish.o $(EXTRA_OBJS) libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
	$(CC) $(CPPFLAGS) $(CFLAGS) $(WISH_CFLAGS) -o wish wish.o $(EXTRA_OBJS) -L. -ltclkit@KITDLL_LIB_VERSION@ $(LDRUNPATH)

.PHONY: kitdll kitdll-static







|
|
|
|
|
|
|
|
|



|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
	-mv libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@.safe; \
		$(CC) $(CPPFLAGS) $(CFLAGS) -o libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@ $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) @WHOLEARCHIVE@ $(ARCHS) @NOWHOLEARCHIVE@ $(LIBS) || \
			mv libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@.safe libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
	-rm -f libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@.safe

## Static archive build
libtclkit@KITDLL_LIB_VERSION@.a: $(OBJS) $(EXTRA_KIT_DEPS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS)
	rm -f libtclkit@KITDLL_LIB_VERSION@.a.new
	rm -rf __TMP__
	mkdir __TMP__
	for arch in $(ARCHS); do ( cd __TMP__ && ar x ../$${arch} ); done
	$(OBJCOPY) --redefine-sym Tcl_Init=Tcl_InitReal __TMP__/tclInterp.o
	$(AR) cr libtclkit@KITDLL_LIB_VERSION@.a.new $(OBJS) $(EXTRA_OBJS) $(EXTRA_VFS_OBJS) __TMP__/*.o
	rm -rf __TMP__
	$(RANLIB) libtclkit@KITDLL_LIB_VERSION@.a.new
	mv libtclkit@KITDLL_LIB_VERSION@.a.new libtclkit@KITDLL_LIB_VERSION@.a

# Test driver
tclsh.o: tclsh.c
tclsh: tclsh.o $(EXTRA_OBJS) @TARGET@
	$(CC) $(CPPFLAGS) $(CFLAGS) -o tclsh tclsh.o $(EXTRA_OBJS) -L. -ltclkit@KITDLL_LIB_VERSION@ $(LDRUNPATH)

wish.o: wish.c
wish: wish.o $(EXTRA_OBJS) libtclkit@KITDLL_LIB_VERSION@.@SHOBJEXT@
	$(CC) $(CPPFLAGS) $(CFLAGS) $(WISH_CFLAGS) -o wish wish.o $(EXTRA_OBJS) -L. -ltclkit@KITDLL_LIB_VERSION@ $(LDRUNPATH)

.PHONY: kitdll kitdll-static

Modified kitsh/buildsrc/kitsh-0.0/configure.ac from [dc51bae560] to [77fa1a4052].

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

41
42
43

44
45

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60



61
62
63
64
65
66
67
68
69
AC_ARG_ENABLE(kitdll, AC_HELP_STRING([--enable-kitdll], [Enable building KitDLL instead of Tclkit (default: no)]), [
	AS_CASE([$enableval],
		[yes|kitdll], [
			TARGET="kitdll"
		],
		static, [
			TARGET="kitdll-static"
		]
		no, [
			true
		], [
			AC_MSG_RESULT([unknown])

			AC_MSG_ERROR([Invalid option: $enableval])
		]
	)
])
AC_MSG_RESULT([$TARGET])
AC_SUBST(TARGET)

dnl Find the appropriate libraries to link to
AC_SEARCH_LIBS(acos, m,, [ AC_MSG_WARN([Couldn't find acos (normally in libm)!]) ])
AC_SEARCH_LIBS(dlsym, dl,, [ AC_MSG_WARN([Couldn't find dlsym (normally in libdl)!]) ])

AS_IF([test "$TARGET" = "tclkit"], [
	dnl We have Tclkit


	dnl Specify local Appinit function
	AC_DEFINE(TK_LOCAL_APPINIT, [TclKit_AppInit], [Tclkit appinit function])

], [
	dnl We have KitDLL


	dnl Determine system information
	DC_CHK_OS_INFO

	dnl Determine how to create a shared object
	DC_GET_SHOBJFLAGS

	dnl Determine if we have "objcopy" available to weaken non-Tcl/Tk symbols
	AC_CHECK_TOOL(OBJCOPY, objcopy, [:])

	dnl Define KitDLL usage
	AC_DEFINE([TCLKIT_DLL], [1], [Define if you are using a KitDLL rather than a Tclkit])

	dnl Define a static KitDLL
	AS_IF([test "$TARGET" = "kitdll-static"], [



		AC_DEFINE([TCLKIT_DLL_STATIC], [1], [Define if you are building a static KitDLL])
		SHOBJE
	])
])

dnl Figure out how to statically link to libgcc, if needed
DC_STATIC_LIBGCC

dnl Set linker rpath for tclsh/wish







|


















>



>


>















>
>
>

<







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67

68
69
70
71
72
73
74
AC_ARG_ENABLE(kitdll, AC_HELP_STRING([--enable-kitdll], [Enable building KitDLL instead of Tclkit (default: no)]), [
	AS_CASE([$enableval],
		[yes|kitdll], [
			TARGET="kitdll"
		],
		static, [
			TARGET="kitdll-static"
		],
		no, [
			true
		], [
			AC_MSG_RESULT([unknown])

			AC_MSG_ERROR([Invalid option: $enableval])
		]
	)
])
AC_MSG_RESULT([$TARGET])
AC_SUBST(TARGET)

dnl Find the appropriate libraries to link to
AC_SEARCH_LIBS(acos, m,, [ AC_MSG_WARN([Couldn't find acos (normally in libm)!]) ])
AC_SEARCH_LIBS(dlsym, dl,, [ AC_MSG_WARN([Couldn't find dlsym (normally in libdl)!]) ])

AS_IF([test "$TARGET" = "tclkit"], [
	dnl We have Tclkit
	TARGET_BASE='tclkit'

	dnl Specify local Appinit function
	AC_DEFINE(TK_LOCAL_APPINIT, [TclKit_AppInit], [Tclkit appinit function])

], [
	dnl We have KitDLL
	TARGET_BASE='kitdll'

	dnl Determine system information
	DC_CHK_OS_INFO

	dnl Determine how to create a shared object
	DC_GET_SHOBJFLAGS

	dnl Determine if we have "objcopy" available to weaken non-Tcl/Tk symbols
	AC_CHECK_TOOL(OBJCOPY, objcopy, [:])

	dnl Define KitDLL usage
	AC_DEFINE([TCLKIT_DLL], [1], [Define if you are using a KitDLL rather than a Tclkit])

	dnl Define a static KitDLL
	AS_IF([test "$TARGET" = "kitdll-static"], [
		AC_CHECK_TOOL(RANLIB, [ranlib], [:])
		AC_CHECK_TOOL(AR, [ar], [false MISSING AR])

		AC_DEFINE([TCLKIT_DLL_STATIC], [1], [Define if you are building a static KitDLL])

	])
])

dnl Figure out how to statically link to libgcc, if needed
DC_STATIC_LIBGCC

dnl Set linker rpath for tclsh/wish
207
208
209
210
211
212
213
214
215
216
217
)

AC_SUBST(EXTRA_KIT_DEPS)
AC_SUBST(LDFLAGS_ADD)

dnl Put correct Makefile template in place
rm -f Makefile.in
cp Makefile.${TARGET}.in Makefile.in

dnl Produce output
AC_OUTPUT(Makefile Makefile.common)







|



212
213
214
215
216
217
218
219
220
221
222
)

AC_SUBST(EXTRA_KIT_DEPS)
AC_SUBST(LDFLAGS_ADD)

dnl Put correct Makefile template in place
rm -f Makefile.in
cp Makefile.${TARGET_BASE}.in Makefile.in

dnl Produce output
AC_OUTPUT(Makefile Makefile.common)