Index: nsf/build.sh ================================================================== --- nsf/build.sh +++ nsf/build.sh @@ -31,11 +31,12 @@ fi BUILDDIR="$(pwd)/build/nsf${NSFVERS}" OUTDIR="$(pwd)/out" INSTDIR="$(pwd)/inst" -export NSFVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR +PATCHDIR="$(pwd)/patches" +export NSFVERS SRC SRCURL BUILDDIR OUTDIR INSTDIR PATCHDIR # Set configure options for this sub-project LDFLAGS="${LDFLAGS} ${KC_NSF_LDFLAGS}" CFLAGS="${CFLAGS} ${KC_NSF_CFLAGS}" CPPFLAGS="${CPPFLAGS} ${KC_NSF_CPPFLAGS}" @@ -72,10 +73,19 @@ ## the GIT zip tarball does not preserve file permissions (configure) rm -rf configure autoconf || exit 1 fi + # Apply patches if needed + for patch in "${PATCHDIR}/all"/nsf-${NSFVERS}-*.diff "${PATCHDIR}/all"/nsf-all-*.diff "${PATCHDIR}/${NSFVERS}"/nsf-${NSFVERS}-*.diff; do + if [ ! -f "${patch}" ]; then + continue + fi + + echo "Applying: ${patch}" + ${PATCH:-patch} -p1 < "${patch}" + done # There's a STATIC=-1,0,1 # ... where -1 means no (i.e., shared), # ... 0 means try not to (try shared first, if that # doesn't work do static), ADDED nsf/patches/all/nsf-all-noextern-fix.diff Index: nsf/patches/all/nsf-all-noextern-fix.diff ================================================================== --- nsf/patches/all/nsf-all-noextern-fix.diff +++ nsf/patches/all/nsf-all-noextern-fix.diff @@ -0,0 +1,23 @@ +--- nsf2.3.0/generic/nsf.h.orig 2020-09-02 17:32:45.000000000 +0200 ++++ nsf2.3.0/generic/nsf.h 2020-09-02 17:34:08.000000000 +0200 +@@ -40,6 +40,20 @@ + + #include "tcl.h" + ++/* ++ * Make sure EXTERN isn't defined elsewhere. ++ */ ++ ++#ifdef EXTERN ++# undef EXTERN ++#endif /* EXTERN */ ++ ++#ifdef __cplusplus ++# define EXTERN extern "C" TCL_STORAGE_CLASS ++#else ++# define EXTERN extern TCL_STORAGE_CLASS ++#endif ++ + #undef TCL_STORAGE_CLASS + #ifdef BUILD_nsf + # define TCL_STORAGE_CLASS DLLEXPORT