Index: .fossil-settings/crnl-glob ================================================================== --- .fossil-settings/crnl-glob +++ .fossil-settings/crnl-glob @@ -1,1 +1,2 @@ tcc/patches/all/tcltcc-0.4-fixloading.diff +tcc/patches/all/tcltcc-0.4-setincpath.diff Index: tcc/build.sh ================================================================== --- tcc/build.sh +++ tcc/build.sh @@ -137,12 +137,39 @@ mkdir -p "${pkgDir}" cp tcc.tcl "${pkgDir}" cp pkgIndex.tcl "${pkgDir}" + # Install headers needed for compilation + incDir="${pkgDir}/include" + mkdir "${incDir}" + + touch include/windows.h + cp -r include/* "${incDir}" + cp -r ../../../{tcl,tk}/inst/include/* "${incDir}" + + find "${incDir}" -name '*.a' | xargs rm -f + + # Install libraries + libDir="${pkgDir}/lib" + mkdir "${libDir}" + + ( + cd c || exit 1 + rm -f *.a *.o + for file in *.c; do + ofile="$(echo "${file}" | sed 's@\.c$@.o@')" + "${CC:-gcc}" -I../include -I../../../../{tcl,tk}/inst/include/ -I../../../../tcl/build/tcl${TCLVERS}/generic/ -I../../../../tcl/build/tcl${TCLVERS}/unix/ -DUSE_TCL_STUBS=1 -c "${file}" -o "${ofile}" + done + "${AR:-ar}" cu ../lib/libtcc1.a *.o + "${RANLIB:-ranlib}" ../lib/libtcc1.a + ) + cp lib/libtcc1.a "${libDir}" + + # Create VFS-insert cp -r "${INSTDIR}/lib" "${OUTDIR}" || exit 1 - find "${OUTDIR}" -name '*.a' -type f | xargs -n 1 rm -f -- + find "${OUTDIR}" -name '*.a' -type f | grep -v '/lib/libtcc1\.a$' | xargs rm -f exit 0 ) || exit 1 exit 0 ADDED tcc/patches/all/tcltcc-0.4-setincpath.diff Index: tcc/patches/all/tcltcc-0.4-setincpath.diff ================================================================== --- /dev/null +++ tcc/patches/all/tcltcc-0.4-setincpath.diff @@ -0,0 +1,21 @@ +Common subdirectories: tcltcc-0.4.orig/c and tcltcc-0.4/c +Common subdirectories: tcltcc-0.4.orig/demo and tcltcc-0.4/demo +Common subdirectories: tcltcc-0.4.orig/examples and tcltcc-0.4/examples +Common subdirectories: tcltcc-0.4.orig/generic and tcltcc-0.4/generic +Common subdirectories: tcltcc-0.4.orig/include and tcltcc-0.4/include +Common subdirectories: tcltcc-0.4.orig/install and tcltcc-0.4/install +Common subdirectories: tcltcc-0.4.orig/lib and tcltcc-0.4/lib +diff -u tcltcc-0.4.orig/tcc.tcl tcltcc-0.4/tcc.tcl +--- tcltcc-0.4.orig/tcc.tcl 2014-04-26 23:57:35.522645002 -0500 ++++ tcltcc-0.4/tcc.tcl 2014-04-27 00:01:35.492645002 -0500 +@@ -101,6 +101,7 @@ + set tcc(cc) tcc1 + tcc $tcc::dir $tcc(cc) + $tcc(cc) add_library tcl8.5 ++ $tcc(cc) add_include_path [file join $::tcc::dir include] + } + Log code:$code + $tcc(cc) compile $code +Common subdirectories: tcltcc-0.4.orig/tclconfig and tcltcc-0.4/tclconfig +Common subdirectories: tcltcc-0.4.orig/tests and tcltcc-0.4/tests +Common subdirectories: tcltcc-0.4.orig/tools and tcltcc-0.4/tools