Check-in [ea645d2a50]
Overview
Comment:Added more cross-compiling support
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ea645d2a5006cbfd78d5dec2bcf0115acffabbe4
User & Date: rkeene on 2014-05-02 06:29:30
Other Links: manifest | tags
Context
2014-05-02
06:41
Windows fixups check-in: b25d0baade user: rkeene tags: trunk
06:29
Added more cross-compiling support check-in: ea645d2a50 user: rkeene tags: trunk
05:39
Minor cleanup check-in: d2385ff774 user: rkeene tags: trunk
Changes

Added build/tcc-patches/0.9.26/tcc-0.9.26-crosscompilefixes.diff version [403c9c4668].































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
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

Modified configure.ac from [cc0f388ad8] to [8b39413dfe].

17
18
19
20
21
22
23


24






25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
	else
		TCC4TCL_TARGET=shared
	fi
], [
	TCC4TCL_TARGET=shared
])



TCC_CONFIGURE_OPTS=""






if test "${TCC4TCL_TARGET}" = "shared"; then
	dnl Determine how to make shared objects
	DC_GET_SHOBJFLAGS

	dnl Only export symbols we wish to expose
	DC_SETVERSIONSCRIPT([tcltcc.syms], [tcltcc.vers])
	DC_FIND_STRIP_AND_REMOVESYMS([tcltcc.syms])

	TARGET="tcltcc.${SHOBJEXT}"
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)
])
AC_CHECK_FUNCS(dlopen shl_load)








>
>

>
>
>
>
>
>














<







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

47
48
49
50
51
52
53
	else
		TCC4TCL_TARGET=shared
	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
	DC_SETVERSIONSCRIPT([tcltcc.syms], [tcltcc.vers])
	DC_FIND_STRIP_AND_REMOVESYMS([tcltcc.syms])

	TARGET="tcltcc.${SHOBJEXT}"
else
	TARGET="tcltcc-static.a"
fi
AC_SUBST(TARGET)
AC_SUBST(TCC4TCL_TARGET)


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)
])
AC_CHECK_FUNCS(dlopen shl_load)