@@ -169,18 +169,23 @@ echo '/* Dynamically generated. */' > kitInit-libs.h libs_init_funcs="" for projdir in ../../../*/; do proj="`basename "${projdir}"`" + subprojs="$proj" if test "${proj}" = "build"; then continue fi if test "${proj}" = "kitsh"; then continue fi + + if test "${proj}" = "common"; then + continue + fi projlibdir="../../../${proj}/inst" if test -d "${projlibdir}"; then true @@ -188,13 +193,28 @@ continue fi AC_MSG_CHECKING([for libraries required for ${proj}]) - projlibfiles="`find "${projlibdir}" -name '*.a' 2>/dev/null | sort | tr "\n" ' '`" - projlibfilesnostub="`find "${projlibdir}" -name '*.a' 2>/dev/null | grep -v 'stub' | tr "\n" ' '`" + projlibfiles="`find "${projlibdir}" -name '*.a' 2>/dev/null | sort`" + projexcludefile="${projlibdir}/kitcreator-nolibs" + if test -e "${projexcludefile}"; then + projexclude="`cat "$projexcludefile"`" + projlibfiles="`echo "$projlibfiles" | egrep -v "$projexclude"`" + fi + + projlibfilesnostub="`echo "$projlibfiles" | grep -v 'stub' | tr "\n" ' '`" + projlibfiles="`echo "$projlibfiles" | tr "\n" ' '`" projlibextra="" + + if test "$projlibfilesnostub" = ' '; then + projlibfilesnostub='' + fi + + if test "$projlibfiles" = ' '; then + projlibfiles='' + fi for libfile in ${projlibfilesnostub}; do if test -f "${libfile}.linkadd"; then projlibextra="`cat "${libfile}.linkadd"`" fi @@ -201,11 +221,10 @@ done AC_MSG_RESULT([${projlibfilesnostub} ${projlibextra}]) hide_symbols="1" - initialize="1" if test "${proj}" = "tcl"; then DC_TEST_WHOLE_ARCHIVE_SHARED_LIB([$ARCHS $projlibfilesnostub], [ projlibfiles="${projlibfilesnostub}" ], [ @@ -213,11 +232,11 @@ projlibfiles="${projlibfiles}" ]) ]) hide_symbols="0" - initialize="0" + subprojs="`echo " $projlibfilesnostub " | sed 's@ [[^ ]]*/@ @g;s@ lib@ @g;s@[[0-9\.]]*\.a@ @g;s@ tdbc[[^ ]]*@ @g;s@ sqlite @ sqlite3 @;s@ tcldde[[0-9]][[0-9]]*s*g* @ @g;s@ tclreg[[0-9]][[0-9]]*s*g* @ @g;s@ tcl[[0-9]]*s*g* @ @g;s@^ *@@;s@ *[$]@@'`" fi if test "${proj}" = "mk4tcl"; then if test -n "${projlibfiles}"; then AC_DEFINE(KIT_INCLUDES_MK4TCL, [1], [Specify this if you link against mkt4tcl]) @@ -225,11 +244,11 @@ kc_cv_feature_kit_includes_mk4tcl='1' DC_DO_STATIC_LINK_LIBCXX fi - initialize="0" + subprojs="" fi if test "${proj}" = "tk"; then if test "${projlibfilesnostub}" != ""; then DC_DO_TK @@ -252,15 +271,15 @@ ]) hide_symbols="0" fi - initialize="0" + subprojs="" fi if test "${proj}" = "tclvfs"; then - initialize="0" + subprojs="" fi if test "${hide_symbols}" = "1"; then STRIPLIBS="${STRIPLIBS} ${projlibfiles}" fi @@ -268,20 +287,22 @@ dnl Do not explicitly link to Zlib, that will happen elsewhere if test "${proj}" = "zlib"; then continue fi - if test "${initialize}" = "1"; then + if test -n "${subprojs}"; then if test -n "${projlibfilesnostub}"; then - projucase="`echo ${proj} | dd conv=ucase 2>/dev/null`" - projtcase="`echo ${projucase} | cut -c 1``echo ${proj} | cut -c 2-`" - lib_init_func="${projtcase}_Init" - - echo "#define KIT_INCLUDES_${projucase}" >> kitInit-libs.h - echo "Tcl_AppInitProc ${lib_init_func};" >> kitInit-libs.h - - libs_init_funcs="${libs_init_funcs} ${lib_init_func}" + for subproj in $subprojs; do + subprojucase="`echo ${subproj} | dd conv=ucase 2>/dev/null`" + subprojtcase="`echo ${subprojucase} | cut -c 1``echo ${subproj} | cut -c 2-`" + lib_init_func="${subprojtcase}_Init" + + echo "#define KIT_INCLUDES_${subprojucase}" >> kitInit-libs.h + echo "Tcl_AppInitProc ${lib_init_func};" >> kitInit-libs.h + + libs_init_funcs="${libs_init_funcs} ${lib_init_func}" + done fi fi ARCHS="${ARCHS} ${projlibfiles}" LIBS="${LIBS} ${projlibextra}"