ADDED build/tcc-patches/0.9.26/tcc-0.9.26-crosscompilefixes.diff Index: build/tcc-patches/0.9.26/tcc-0.9.26-crosscompilefixes.diff ================================================================== --- build/tcc-patches/0.9.26/tcc-0.9.26-crosscompilefixes.diff +++ build/tcc-patches/0.9.26/tcc-0.9.26-crosscompilefixes.diff @@ -0,0 +1,143 @@ +diff -uNr tcc-0.9.26.orig/configure tcc-0.9.26-1crosscompilefixes/configure +--- tcc-0.9.26.orig/configure 2013-02-15 08:24:00.000000000 -0600 ++++ tcc-0.9.26-1crosscompilefixes/configure 2014-05-02 01:27:11.267140003 -0500 +@@ -46,16 +46,8 @@ + tcc_lddir= + confvars= + +-cpu=`uname -m` +- +-# OS specific + targetos=`uname -s` +-case $targetos in +- MINGW32*) mingw32=yes;; +- DragonFly) noldl=yes;; +- OpenBSD) noldl=yes;; +- *) ;; +-esac ++cpu=`uname -m` + + # find source path + # XXX: we assume an absolute path is given when launching configure, +@@ -68,47 +60,6 @@ + source_path_used="no" + fi + +-case "$cpu" in +- i386|i486|i586|i686|i86pc|BePC|i686-AT386) +- cpu="x86" +- ;; +- x86_64) +- cpu="x86-64" +- ;; +- arm*) +- case "$cpu" in +- arm|armv4l) +- cpuver=4 +- ;; +- armv5tel|armv5tejl) +- cpuver=5 +- ;; +- armv6j|armv6l) +- cpuver=6 +- ;; +- armv7a|armv7l) +- cpuver=7 +- ;; +- esac +- cpu="armv4l" +- ;; +- alpha) +- cpu="alpha" +- ;; +- "Power Macintosh"|ppc|ppc64) +- cpu="powerpc" +- ;; +- mips) +- cpu="mips" +- ;; +- s390) +- cpu="s390" +- ;; +- *) +- cpu="unknown" +- ;; +-esac +- + for opt do + eval opt=\"$opt\" + case "$opt" in +@@ -156,6 +107,8 @@ + ;; + --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` + ;; ++ --os=*) targetos=`echo $opt | cut -d '=' -f 2-` ++ ;; + --enable-gprof) gprof="yes" + ;; + --enable-mingw32) mingw32="yes" ; cross_prefix="i686-pc-mingw32-" ; cpu=x86 +@@ -181,6 +134,55 @@ + esac + done + ++# OS specific ++case $targetos in ++ MINGW32*|mingw32*) mingw32=yes;; ++ DragonFly) noldl=yes;; ++ OpenBSD) noldl=yes;; ++ *) ;; ++esac ++ ++case "$cpu" in ++ i386|i486|i586|i686|i86pc|BePC|i686-AT386) ++ cpu="x86" ++ ;; ++ x86_64) ++ cpu="x86-64" ++ ;; ++ arm*) ++ case "$cpu" in ++ arm|armv4l) ++ cpuver=4 ++ ;; ++ armv5tel|armv5tejl) ++ cpuver=5 ++ ;; ++ armv6j|armv6l) ++ cpuver=6 ++ ;; ++ armv7a|armv7l) ++ cpuver=7 ++ ;; ++ esac ++ cpu="armv4l" ++ ;; ++ alpha) ++ cpu="alpha" ++ ;; ++ "Power Macintosh"|ppc|ppc64) ++ cpu="powerpc" ++ ;; ++ mips) ++ cpu="mips" ++ ;; ++ s390) ++ cpu="s390" ++ ;; ++ *) ++ cpu="unknown" ++ ;; ++esac ++ + # Checking for CFLAGS + if test -z "$CFLAGS"; then + CFLAGS="-Wall -g -O2" +@@ -270,6 +272,8 @@ + --disable-static make libtcc.so instead of libtcc.a + --disable-rpath disable use of -rpath with the above + --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a ++ --cpu=... Specify CPU ++ --os=... Specify OS + --enable-mingw32 build windows version on linux with mingw32 + --enable-cygwin build windows version on windows with cygwin + --enable-cross build cross compilers Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -19,11 +19,19 @@ fi ], [ TCC4TCL_TARGET=shared ]) +dnl Configure TCC build options +AC_SUBST(TCC_CONFIGURE_OPTS) TCC_CONFIGURE_OPTS="" + +dnl -- If cross-compiling, specify a "--cross-prefix" and define the CPU +if test "${host}" != "${build}"; then + TCC_CONFIGURE_OPTS="${TCC_CONFIGURE_OPTS} --cross-prefix=${host_alias}- --cpu=${host_cpu} --os=${host_os}" +fi + if test "${TCC4TCL_TARGET}" = "shared"; then dnl Determine how to make shared objects DC_GET_SHOBJFLAGS dnl Only export symbols we wish to expose @@ -34,11 +42,10 @@ else TARGET="tcltcc-static.a" fi AC_SUBST(TARGET) AC_SUBST(TCC4TCL_TARGET) -AC_SUBST(TCC_CONFIGURE_OPTS) dnl Find out if we have the functions needed to open shared objects AC_SEARCH_LIBS(dlopen, dl,, [ AC_SEARCH_LIBS(shl_load, dld dl) ])