Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -111,13 +111,13 @@ distclean: clean rm -rf autom4te.cache rm -f config.log config.status rm -f pkgIndex.tcl tcc4tcl.syms - rm -f Makefile + rm -f Makefile tcc/Makefile mrproper: distclean rm -rf tcc rm -f configure aclocal.m4 rm -f config.guess config.sub install-sh .PHONY: all install test clean distclean mrproper Index: build/pre.sh ================================================================== --- build/pre.sh +++ build/pre.sh @@ -42,10 +42,13 @@ ## Apply patches for patchfile in ../build/tcc-patches/${tcc_version}/*.diff; do ( cd * && patch --no-backup-if-mismatch -p1 ) < "${patchfile}" done + ## Rename "Makefile" to "Makefile.in" so configure processes it + ( cd * && mv Makefile Makefile.in ) || exit 1 + rm -rf ../tcc mkdir ../tcc || exit 1 mv */* ../tcc/ -) +) || exit 1 rm -rf __TMP__ ADDED build/tcc-patches/0.9.26/tcc-0.9.26-fixmakefile.diff Index: build/tcc-patches/0.9.26/tcc-0.9.26-fixmakefile.diff ================================================================== --- build/tcc-patches/0.9.26/tcc-0.9.26-fixmakefile.diff +++ build/tcc-patches/0.9.26/tcc-0.9.26-fixmakefile.diff @@ -0,0 +1,12 @@ +diff -uNr tcc-0.9.26.orig/Makefile tcc-0.9.26-fixmakefile/Makefile +--- tcc-0.9.26.orig/Makefile 2013-02-15 08:24:00.000000000 -0600 ++++ tcc-0.9.26-fixmakefile/Makefile 2016-12-08 23:20:32.856086001 -0600 +@@ -16,7 +16,7 @@ + ifeq (-$(GCC_MAJOR)-$(findstring $(GCC_MINOR),56789)-,-4--) + CFLAGS+=-D_FORTIFY_SOURCE=0 + else +-CFLAGS+=-Wno-unused-result ++CFLAGS+=@TCC_WNO_UNUSED_RESULT@ + endif + endif + endif Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -66,10 +66,29 @@ ]) if test "$no_dlopen" = '1'; then CPPFLAGS="${CPPFLAGS} -DCONFIG_TCC_STATIC_NODLOPEN=1" fi + +dnl Determine if the compiler supports -Wno-unused-result +AC_CACHE_CHECK([if compiler supports -Wno-unused-result], [tcc4tcl_cv_compiler_wno_unused_result], [ + SAVE_CFLAGS="${CFLAGS}" + CFLAGS="${SAVE_CFLAGS} -Wno-unused-result" + AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [ + tcc4tcl_cv_compiler_wno_unused_result='yes' + ], [ + tcc4tcl_cv_compiler_wno_unused_result='no' + ]) + CFLAGS="${SAVE_CFLAGS}" +]) + +if test "$tcc4tcl_cv_compiler_wno_unused_result" = 'yes'; then + TCC_WNO_UNUSED_RESULT='-Wno-unused-result' +else + TCC_WNO_UNUSED_RESULT='-Wno-unused-result' +fi +AC_SUBST(TCC_WNO_UNUSED_RESULT) dnl Determine HOST_PATH_SEPERATOR case $host_os in *mingw*) HOST_PATH_SEPARATOR=';' @@ -87,6 +106,6 @@ if test "${TCC4TCL_TARGET}" = "shared"; then DC_SETUP_STABLE_API([${srcdir}/tcc4tcl.vers], [tcc4tcl.syms]) fi dnl Produce output -AC_OUTPUT(Makefile pkgIndex.tcl tcc4tcl.syms) +AC_OUTPUT(Makefile pkgIndex.tcl tcc4tcl.syms tcc/Makefile)