ADDED tcc/patches/all/tcltcc-0.4-fixstaticwin32.diff Index: tcc/patches/all/tcltcc-0.4-fixstaticwin32.diff ================================================================== --- /dev/null +++ tcc/patches/all/tcltcc-0.4-fixstaticwin32.diff @@ -0,0 +1,12 @@ +diff -uNr tcltcc-0.4.orig/generic/win32/tccpe.c tcltcc-0.4-1fixstaticwin32/generic/win32/tccpe.c +--- tcltcc-0.4.orig/generic/win32/tccpe.c 2007-11-07 10:04:32.000000000 -0600 ++++ tcltcc-0.4-1fixstaticwin32/generic/win32/tccpe.c 2014-04-28 15:19:49.340645002 -0500 +@@ -397,7 +397,7 @@ + return sym_index; + } + +-#ifdef WIN32 ++#if defined(WIN32) && !defined(CONFIG_TCC_STATIC) + ST void **pe_imp; + ST int nb_pe_imp; + Index: tcc/patchscripts/tcltcc-0.4-addtclfuncs.sh ================================================================== --- tcc/patchscripts/tcltcc-0.4-addtclfuncs.sh +++ tcc/patchscripts/tcltcc-0.4-addtclfuncs.sh @@ -1,18 +1,13 @@ #! /bin/bash + +set -x function find_syms() { - if [ -z "${NM}" ]; then - if echo "${CC}" | sed 's@ .*$@@' | grep '[-]' >/dev/null; then - NM="$(echo "${CC}" | sed 's@ .*$@@;s@\(.*\)-[^-]*$@\1-nm@')" - else - NM='nm' - fi - fi - - # "${NM}" "${LIBTCL}" | sed 's@:.*$@@' | sed 's@.* @@' | grep '^Tcl_' | sort -u | while read -r sym; do - ${CC:-gcc} ${CPPFLAGS} -E include/tcl.h | grep '^ *extern.*Tcl_'| sed 's@^ *extern *@@;s@(.*@@;s@.* *\** *@@' | sort -u | grep '^Tcl_' | grep -v ';$' | while read -r sym; do + set -x + + ${CC:-gcc} ${CPPFLAGS} -E include/tcl.h | grep '^ *extern.*Tcl_'| sed 's@^ *extern *@@;s@([^(]*$@@;s@.* *\** *@@' | sort -u | grep '^Tcl_' | grep -v ';$' | while read -r sym; do echo " TCCSYM($sym)" done } add="$(find_syms)"