diff options
author | Steve Bennett <steveb@workware.net.au> | 2019-07-04 12:06:01 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2019-11-06 17:42:55 +1000 |
commit | dc4ba7770d580800634f90b67a24e077b4a26d98 (patch) | |
tree | 8cc4f220d7fb7cfd5dd1b78d2cd278e79fabdf12 /auto.def | |
parent | 0104b324bc89ab1dce883be1e3b5510296c695ea (diff) | |
download | jimtcl-dc4ba7770d580800634f90b67a24e077b4a26d98.zip jimtcl-dc4ba7770d580800634f90b67a24e077b4a26d98.tar.gz jimtcl-dc4ba7770d580800634f90b67a24e077b4a26d98.tar.bz2 |
build: improve build for shared objects
Rather than listing the build rules for each shared object
(loadable module) in the Makefile template, generate the build
rules in configure.
Also, if an extension is configured as a module, any automatic
dependencies required by the extension are configured as modules
by default.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'auto.def')
-rw-r--r-- | auto.def | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -495,6 +495,23 @@ define EXTRA_OBJS $extra_objs # Restore the user-specified LIBS define LIBS $LIBS +# Now generate the Makefile rules to build the external C shared objects +# It is easier to do this here rather than listing them out explicitly in Makefile.in +set lines {} +foreach mod $extinfo(module-c) { + set objs {} + set libs [get-define LDLIBS_$mod] + set src jim-$mod.c + lappend lines "$mod.so: $src" + set obj [file rootname $src].o + lappend lines "\t\$(ECHO)\t\"\tCC\t$obj\"" + lappend lines "\t\$(Q)\$(CC) \$(CFLAGS) \$(SHOBJ_CFLAGS) -c -o $obj $src" + lappend lines "\t\$(ECHO)\t\"\tLDSO\t\$@\"" + lappend lines "\t\$(Q)\$(CC) \$(CFLAGS) \$(LDFLAGS) \$(SHOBJ_LDFLAGS) -o \$@ $obj \$(SH_LIBJIM) $libs" + lappend lines "" +} +define BUILD_SHOBJS [join $lines \n] + make-config-header jim-config.h -auto {HAVE_LONG_LONG* JIM_UTF8} -bare JIM_VERSION -none * make-config-header jimautoconf.h -auto {jim_ext_* TCL_PLATFORM_* TCL_LIBRARY USE_* JIM_* _FILE_OFFSET*} -bare {S_I*} make-template Makefile.in |