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
..
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
...
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
|
AC_MSG_RESULT([$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 Figure out how to statically link to libgcc, if needed
DC_STATIC_LIBGCC
dnl Specify local Appinit function
AC_DEFINE(DTK_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 KitDLL always uses C-VFS
AC_DEFINE([KIT_STORAGE_CVFS], [1], [Define if you are going to use C-VFS for kit storage])
dnl Define KitDLL usage
AC_DEFINE([TCLKIT_DLL], [1], [Define if you are using a KitDLL rather than a Tclkit])
])
dnl Find the appropriate Tcl headers and libraries
DC_DO_TCL
dnl Find archives we need to link to
DC_FIND_TCLKIT_LIBS
dnl Find extra objects we need to link as a part of "kit"
AC_SUBST(EXTRA_OBJS)
dnl Check for Windows Resource Compiler
AC_CHECK_TOOL([RC], [windres], [false])
dnl If we found the resource compiler, add "kit.res.o" to our list of objects to build
dnl (as long as the source for such an object exists)
AS_IF([test "$RC" != "false"], [
................................................................................
AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib], [directory containing zlib]), [
CPPFLAGS="${CPPFLAGS} -I${with_zlib}/include -I${with_zlib}"
CFLAGS="${CFLAGS} -I${with_zlib}/include -I${with_zlib}"
LDFLAGS="${LDFLAGS} -L${with_zlib}/lib -L${with_zlib}"
])
dnl Only needed for Tclkit
AS_IF([test "$TARGET" = "tclkit"], [
DC_DO_STATIC_LINK_LIB(zlib, -lz,, [
DC_DO_STATIC_LINK_LIB(zlib, -lzlib,, [
AC_SEARCH_LIBS(inflate, z zlib,, [
AC_MSG_WARN([Couldn't find inflate (normally in zlib)!])
])
])
])
])
dnl Determine which storage mechanism to use
AC_MSG_CHECKING([which Tclkit Storage mechanism to use])
................................................................................
AC_DEFINE([KIT_STORAGE_CVFS], [1], [Define if you are going to use C-VFS for kit storage])
dnl Define that C-VFS should be make [load]-able
AC_DEFINE([KITDLL_MAKE_LOADABLE], [1], [Specify that the C-VFS should be able to be loaded])
dnl Add appropriate dependencies
EXTRA_KIT_DEPS="vfs_kitdll.tcl.h"
]
)
AC_SUBST(EXTRA_KIT_DEPS)
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)
|
>
>
|
|
>
>
>
>
<
|
|
|
|
<
>
|
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
75
76
77
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
...
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
AC_MSG_RESULT([$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 Figure out how to statically link to libgcc, if needed
DC_STATIC_LIBGCC
dnl Specify local Appinit function
AC_DEFINE(DTK_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 Set linker rpath for tclsh/wish
DC_SETLDRUNPATH([.])
dnl Find the appropriate Tcl headers and libraries
DC_DO_TCL
dnl Find archives we need to link to
DC_FIND_TCLKIT_LIBS
dnl Find extra objects we need to link as a part of "kit"
AC_SUBST(EXTRA_OBJS)
AC_SUBST(EXTRA_VFS_OBJS)
dnl Check for Windows Resource Compiler
AC_CHECK_TOOL([RC], [windres], [false])
dnl If we found the resource compiler, add "kit.res.o" to our list of objects to build
dnl (as long as the source for such an object exists)
AS_IF([test "$RC" != "false"], [
................................................................................
AC_ARG_WITH(zlib, AC_HELP_STRING([--with-zlib], [directory containing zlib]), [
CPPFLAGS="${CPPFLAGS} -I${with_zlib}/include -I${with_zlib}"
CFLAGS="${CFLAGS} -I${with_zlib}/include -I${with_zlib}"
LDFLAGS="${LDFLAGS} -L${with_zlib}/lib -L${with_zlib}"
])
dnl Only needed for Tclkit
DC_DO_STATIC_LINK_LIB(zlib, -lz,, [
DC_DO_STATIC_LINK_LIB(zlib, -lzlib,, [
AC_SEARCH_LIBS(inflate, z zlib,, [
AC_MSG_WARN([Couldn't find inflate (normally in zlib)!])
])
])
])
dnl Determine which storage mechanism to use
AC_MSG_CHECKING([which Tclkit Storage mechanism to use])
................................................................................
AC_DEFINE([KIT_STORAGE_CVFS], [1], [Define if you are going to use C-VFS for kit storage])
dnl Define that C-VFS should be make [load]-able
AC_DEFINE([KITDLL_MAKE_LOADABLE], [1], [Specify that the C-VFS should be able to be loaded])
dnl Add appropriate dependencies
EXTRA_KIT_DEPS="vfs_kitdll.tcl.h"
EXTRA_VFS_OBJS="${EXTRA_VFS_OBJS} vfs_kitdll_data_tcl.o"
]
)
AC_SUBST(EXTRA_KIT_DEPS)
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)
|