Index: tcl/build.sh ================================================================== --- tcl/build.sh +++ tcl/build.sh @@ -69,10 +69,11 @@ tar -cf - "tcl${TCLVERS}" | gzip -c > "../${SRC}" fi rm -f "tmp-tcl.zip" "tmp-itcl.zip" "tmp-thread.zip" "tmp-tclconfig.zip" rm -rf "tcl-${CVSTAG}" "itcl-${CVSTAG}" "thread-${CVSTAG}" "tclconfig-${CVSTAG}" + rm -rf "tcl${TCLVERS}" ) else rm -f "${SRC}.tmp" wget -O "${SRC}.tmp" "${SRCURL}" || exit 1 mv "${SRC}.tmp" "${SRC}" @@ -110,21 +111,10 @@ . "${patchscript}" ) fi done - # Patch Win32 builds to always provide DllMain if we are building KitDLL - if [ "${KITTARGET}" = "kitdll" ]; then - ## DllMain is needed when building KitDLL - for filetopatch in win/tclWin32Dll.c win/tclWinInit.c; do - echo "Undefining STATIC_BUILD in \"${filetopatch}\"" - - sed 's@STATIC_BUILD@NEVER_STATIC_BUILD@g' "${filetopatch}" > "${filetopatch}.new" && cat "${filetopatch}.new" > "${filetopatch}" - rm -f "${filetopatch}.new" - done - fi - for dir in unix win macosx __fail__; do if [ "${dir}" = "__fail__" ]; then # If we haven't figured out how to build it, reject. exit 1 ADDED tcl/patchscripts/visibility-unhidden.sh Index: tcl/patchscripts/visibility-unhidden.sh ================================================================== --- /dev/null +++ tcl/patchscripts/visibility-unhidden.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +if [ "${KITTARGET}" != "kitdll" ]; then + exit 0 +fi + +for file in unix/configure; do + sed 's@-fvisibility@-__disabled__fvisibility@' "${file}" > "${file}.new" + cat "${file}.new" > "${file}" + rm -f "${file}.new" +done ADDED tcl/patchscripts/win32-dllmain.sh Index: tcl/patchscripts/win32-dllmain.sh ================================================================== --- /dev/null +++ tcl/patchscripts/win32-dllmain.sh @@ -0,0 +1,13 @@ +#! /bin/bash + +if [ "${KITTARGET}" != "kitdll" ]; then + exit 0 +fi + +## DllMain is needed when building KitDLL +for filetopatch in win/tclWin32Dll.c win/tclWinInit.c; do + echo "Undefining STATIC_BUILD in \"${filetopatch}\"" + + sed 's@STATIC_BUILD@NEVER_STATIC_BUILD@g' "${filetopatch}" > "${filetopatch}.new" && cat "${filetopatch}.new" > "${filetopatch}" + rm -f "${filetopatch}.new" +done Index: tk/build.sh ================================================================== --- tk/build.sh +++ tk/build.sh @@ -15,11 +15,12 @@ SRCURL="http://prdownloads.sourceforge.net/tcl/tk${TCLVERS}-src.tar.gz" BUILDDIR="$(pwd)/build/tk${TCLVERS}" PATCHDIR="$(pwd)/patches" OUTDIR="$(pwd)/out" INSTDIR="$(pwd)/inst" -export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR +PATCHSCRIPTDIR="$(pwd)/patchscripts" +export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR PATCHSCRIPTDIR rm -rf 'build' 'out' 'inst' mkdir 'build' 'out' 'inst' || exit 1 # Determine Tcl version @@ -56,10 +57,11 @@ tar -cf - "tk${TCLVERS}" | gzip -c > "../${SRC}" fi rm -f "tmp-tk.zip" + rm -rf "tk-${CVSTAG}" rm -rf "tk${TCLVERS}" ) else rm -f "${SRC}.tmp" wget -O "${SRC}.tmp" "${SRCURL}" || exit 1 @@ -98,10 +100,21 @@ echo "Applying: ${patch}" ${PATCH:-patch} -p1 < "${patch}" done ) + + # Apply patch scripts if needed + for patchscript in "${PATCHSCRIPTDIR}"/*.sh; do + if [ -f "${patchscript}" ]; then + echo "Running patch script: ${patchscript}" + + ( + . "${patchscript}" + ) + fi + done for dir in unix win macosx win64 __fail__; do if [ "${dir}" = "__fail__" ]; then exit 1 fi ADDED tk/patchscripts/visibility-unhidden.sh Index: tk/patchscripts/visibility-unhidden.sh ================================================================== --- /dev/null +++ tk/patchscripts/visibility-unhidden.sh @@ -0,0 +1,11 @@ +#! /bin/bash + +if [ "${KITTARGET}" != "kitdll" ]; then + exit 0 +fi + +for file in unix/configure; do + sed 's@-fvisibility@-__disabled__fvisibility@' "${file}" > "${file}.new" + cat "${file}.new" > "${file}" + rm -f "${file}.new" +done