Index: kitcreator ================================================================== --- kitcreator +++ kitcreator @@ -84,10 +84,23 @@ STATICMK4="0" export STATICMK4 fi fi fi + +# Find Windows resource-related files +if [ -f "kit.ico" ]; then + KITCREATOR_ICON="$(pwd)/kit.ico" +else + KITCREATOR_ICON="$(echo "$(pwd)/kitsh/buildsrc"/kitsh-*/kit.ico)" +fi +if [ -f "kit.rc" ]; then + KITCREATOR_RC="$(pwd)/kit.rc" +else + KITCREATOR_RC="$(echo "$(pwd)/kitsh/buildsrc"/kitsh-*/kit.rc)" +fi +export KITCREATOR_ICON KITCREATOR_RC failedpkgs="" buildfailed="0" for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} "${KITTARGET}"; do echo -n "Building ${pkg} ..." Index: kitsh/build.sh ================================================================== --- kitsh/build.sh +++ kitsh/build.sh @@ -41,26 +41,26 @@ if [ -z "${ZLIBDIR}" -o ! -f "${ZLIBDIR}/lib/libz.a" ]; then unset ZLIBDIR fi # Copy user specified kit.rc and kit.ico in to build directory, if found - if [ -f "${OTHERPKGSDIR}/kit.rc" ]; then - cp "${OTHERPKGSDIR}/kit.rc" "${BUILDDIR}" - fi - if [ -f "${OTHERPKGSDIR}/kit.ico" ]; then - cp "${OTHERPKGSDIR}/kit.ico" "${BUILDDIR}" - fi + cp "${KITCREATOR_ICON}" "${BUILDDIR}/kit.ico" + cp "${KITCREATOR_RC}" "${BUILDDIR}/kit.rc" # Include extra objects as required ## Initialize list of extra objects EXTRA_OBJS="" - ## Tk Resources (needed for Win32 support) + ## Tk Resources (needed for Win32 support) -- remove kit-found resources to prevent the symbols from being in conflict TKDIR="$(cd "${OTHERPKGSDIR}/tk/inst" && pwd)" TKRSRC="${TKDIR}/lib/tkbase.res.o" if [ -n "${TKDIR}" -a -f "${TKRSRC}" ]; then EXTRA_OBJS="${EXTRA_OBJS} ${TKRSRC}" + + echo ' *** Removing "kit.rc" since we have Tk with its own resource file' + + rm -f "${BUILDDIR}/kit.rc" fi ## Export to the environment, to be picked up by the "configure" script export EXTRA_OBJS Index: kitsh/buildsrc/kitsh-0.0/configure.ac ================================================================== --- kitsh/buildsrc/kitsh-0.0/configure.ac +++ kitsh/buildsrc/kitsh-0.0/configure.ac @@ -26,12 +26,15 @@ 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) if ! test "$RC" = "false"; then - EXTRA_OBJS="$EXTRA_OBJS kit.res.o" + if test -f kit.rc; then + EXTRA_OBJS="$EXTRA_OBJS kit.res.o" + fi fi dnl Check for Tcl features SAVE_LIBS="${LIBS}" LIBS="${ARCHS} ${LIBS}" Index: tk/build.sh ================================================================== --- tk/build.sh +++ tk/build.sh @@ -166,10 +166,16 @@ echo "Running: ${MAKE:-make} install" ${MAKE:-make} install || continue # Update to include resources, if found if [ "${dir}" = "win" ]; then + echo ' *** Importing user-specified icon' + cp "${KITCREATOR_ICON}" rc/tk.ico + + echo ' *** Importing user-specified resources' + cat "${KITCREATOR_RC}" | grep -v '^ *tclsh *ICON' >> "./rc/tk_base.rc" + echo ' *** Creating tkbase.res.o to support Windows build' echo "\"${RC:-windres}\" -o tkbase.res.o --define STATIC_BUILD --include \"./../generic\" --include \"${TCLCONFIGDIR}/../generic\" --include \"${TCLCONFIGDIR}\" --include \"./rc\" \"./rc/tk_base.rc\"" "${RC:-windres}" -o tkbase.res.o --define STATIC_BUILD --include "./../generic" --include "${TCLCONFIGDIR}/../generic" --include "${TCLCONFIGDIR}" --include "./rc" "./rc/tk_base.rc" if [ -f "tkbase.res.o" ]; then