Check-in [6b648f7f4d]
Overview
Comment:Unified cross-compiling detection and configuration
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6b648f7f4d2de932b320f799d0f2ed2505a020c6
User & Date: rkeene on 2014-05-29 05:19:41
Other Links: manifest | tags
Context
2014-05-29
05:27
Added more Mac OS X support to cross-compile fakeouts check-in: fe5d208867 user: rkeene tags: trunk
05:19
Unified cross-compiling detection and configuration check-in: 6b648f7f4d user: rkeene tags: trunk
05:15
Added script to remove "fixstrtod" in Tk check-in: abc83d3b1d user: rkeene tags: trunk
Changes

Modified kitcreator from [0ebdeb3250] to [d9c2335c1d].

60
61
62
63
64
65
66



















67
68
69
70
71
72
73
CONFIGUREEXTRA="$@"
export CONFIGUREEXTRA

if echo " ${CONFIGUREEXTRA} " | grep ' --enable-threads' >/dev/null 2>/dev/null; then
	KITCREATOR_PKGS="${KITCREATOR_PKGS} thread"
fi




















# Set default target
KITTARGET="kitsh"
export KITTARGET

# Fix up package list
## If building KitDLL, define it as our target
if echo " ${KITCREATOR_PKGS} " | grep ' kitdll ' >/dev/null 2>/dev/null; then







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
CONFIGUREEXTRA="$@"
export CONFIGUREEXTRA

if echo " ${CONFIGUREEXTRA} " | grep ' --enable-threads' >/dev/null 2>/dev/null; then
	KITCREATOR_PKGS="${KITCREATOR_PKGS} thread"
fi

# Determine cross-compile status
host_os="$(echo " ${CONFIGUREEXTRA} " sed 's@^.* --host=\([^ ]*\) .*$@\1@
t x
d
:x')"
build_os="$(echo " ${CONFIGUREEXTRA} " sed 's@^.* --build=\([^ ]*\) .*$@\1@
t x
d
:x')"

if [ "${host_os}" != "${build_os}" -a -n "${host_os}" ]; then
	KC_CROSSCOMPILE='1'
	KC_CROSSCOMPILE_HOST_OS="${host_os}"
else
	KC_CROSSCOMPILE='0'
	KC_CROSSCOMPILE_HOST_OS=''
fi
export KC_CROSSCOMPILE KC_CROSSCOMPILE_HOST_OS

# Set default target
KITTARGET="kitsh"
export KITTARGET

# Fix up package list
## If building KitDLL, define it as our target
if echo " ${KITCREATOR_PKGS} " | grep ' kitdll ' >/dev/null 2>/dev/null; then

Modified tcl/build.sh from [99f31c134b] to [a0fc7f495f].

197
198
199
200
201
202
203










204

205
206


207
208
209
210
211
212
213
214
...
215
216
217
218
219
220
221

222
223
224
225
226
227
228
			(
				. "${patchscript}"
			)
		fi
	done

	tryfirstdir=''










	if [ "$(uname -s)" = "Darwin" ]; then

		tryfirstdir='macosx'
	fi



	for dir in "${tryfirstdir}" unix win macosx __fail__; do
		if [ -z "${dir}" ]; then
			continue
		fi

		if [ "${dir}" = "__fail__" ]; then
			# If we haven't figured out how to build it, reject.
................................................................................

			exit 1
		fi

		# Remove previous directory's "tclConfig.sh" if found
		rm -f 'tclConfig.sh'


		cd "${BUILDDIR}/${dir}" || exit 1

		# Remove broken pre-generated Makfiles
		rm -f GNUmakefile Makefile makefile

		echo "Running: ./configure --disable-shared --with-encoding=utf-8 --prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" ${CONFIGUREEXTRA}"
		./configure --disable-shared --with-encoding=utf-8 --prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" ${CONFIGUREEXTRA}







>
>
>
>
>
>
>
>
>
>
|
>
|
|
>
>
|







 







>







197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
...
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
			(
				. "${patchscript}"
			)
		fi
	done

	tryfirstdir=''
	case "${KC_CROSSCOMPILE_HOST_OS}" in
		*-*-darwin*)
			# Cross-compiling for Mac OS X -- try to build macosx directory first
			tryfirstdir='macosx'
			;;
		*-*-*)
			# Cross-compiling, do not assume based on build platform
			;;
		'')
			# Not cross-compiling, assume based on build platform
			if [ "$(uname -s)" = "Darwin" ]; then
				# Compiling for Mac OS X, build in that directory first
				tryfirstdir='macosx'
			fi
			;;
	esac
		
	for dir in "${tryfirstdir}" unix win macosx __fail__; do
		if [ -z "${dir}" ]; then
			continue
		fi

		if [ "${dir}" = "__fail__" ]; then
			# If we haven't figured out how to build it, reject.
................................................................................

			exit 1
		fi

		# Remove previous directory's "tclConfig.sh" if found
		rm -f 'tclConfig.sh'

		echo "Working in: $dir"
		cd "${BUILDDIR}/${dir}" || exit 1

		# Remove broken pre-generated Makfiles
		rm -f GNUmakefile Makefile makefile

		echo "Running: ./configure --disable-shared --with-encoding=utf-8 --prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" ${CONFIGUREEXTRA}"
		./configure --disable-shared --with-encoding=utf-8 --prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" ${CONFIGUREEXTRA}

Modified tcl/patchscripts/fix-crosscompile.sh from [d9ee5d652f] to [e079dfb078].

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
#! /bin/bash

case "${CC}" in
	*-*-*)
		;;
	*)
		exit 0
		;;
esac


mkdir fake-bin

cat << \_EOF_ > fake-bin/fake-uname
#! /bin/bash

if [ "$1" == "--fake" ]; then
	echo "true"

	exit 0
fi

case "${CC}" in
	*-*-*)
		;;
	*)
		CC=''
		;;
esac

if [ -z "${CC}" ]; then
	# If not cross compiling, revert to system uname
	while [ "$(uname --fake 2>/dev/null)" == "true" -a -n "${PATH}" ]; do
		PATH="$(echo "${PATH}" | sed 's@^[^:]*$@@;s@^[^:]*:@@')"

		export PATH
	done

................................................................................
	if [ -z "${PATH}" ]; then
		exit 1
	fi

	exec uname "$@"
fi

CROSS="$(echo "${CC}" | sed -r 's@-[^-]*($| .*$)@@')"

# Determine release information
case "${CROSS}" in

	*-hpux11*)
		sysname="HP-UX"
		sysrelease="$(echo "${CROSS}" | sed 's@^.*-hpux@@')"
		;;
	*-solaris2*)
		sysname="SunOS"
		sysrelease="$(echo "${CROSS}" | sed 's@^.*-solaris@@;s@^2@5@')"
		;;
	*-linux*)
		sysname="Linux"
		sysrelease="2.6.5"
		;;
	*-netbsd*)
		sysname="NetBSD"
		sysrelease="$(echo "${CROSS}" | sed 's@^.*-netbsd@@;s@$@.0@')"
		;;
	*-freebsd*)
		sysname="FreeBSD"
		sysrelease="$(echo "${CROSS}" | sed 's@^.*-freebsd@@;s@$@.0-RELEASE@')"
		;;
	*-aix[0-9].*)
		sysname="AIX"
		sysrelease="$(echo "${CROSS}" | sed 's@.*-aix\([0-9]\..*\)@\1@')"
		;;
esac

# Determine machine information
case "${CROSS}" in
	hppa64-*-hpux*)
		sysmachine="9000/859"
		;;
	i386-*-solaris*)
		sysmachine="i86pc"
		;;
	sparc-*-solaris*)


|
<
<
<
|
<
<
>












|
<
<
<
<
<
<
<
<







 







<
<

<
>


|



|







|



|



|




|







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
#! /bin/bash

if [ "${KC_CROSSCOMPILE}" != '1' ]; then



	exit 0


fi

mkdir fake-bin

cat << \_EOF_ > fake-bin/fake-uname
#! /bin/bash

if [ "$1" == "--fake" ]; then
	echo "true"

	exit 0
fi

if [ -z "${KC_CROSSCOMPILE_HOST_OS}" ]; then








	# If not cross compiling, revert to system uname
	while [ "$(uname --fake 2>/dev/null)" == "true" -a -n "${PATH}" ]; do
		PATH="$(echo "${PATH}" | sed 's@^[^:]*$@@;s@^[^:]*:@@')"

		export PATH
	done

................................................................................
	if [ -z "${PATH}" ]; then
		exit 1
	fi

	exec uname "$@"
fi



# Determine release information

case "${KC_CROSSCOMPILE_HOST_OS}" in
	*-hpux11*)
		sysname="HP-UX"
		sysrelease="$(echo "${KC_CROSSCOMPILE_HOST_OS}" | sed 's@^.*-hpux@@')"
		;;
	*-solaris2*)
		sysname="SunOS"
		sysrelease="$(echo "${KC_CROSSCOMPILE_HOST_OS}" | sed 's@^.*-solaris@@;s@^2@5@')"
		;;
	*-linux*)
		sysname="Linux"
		sysrelease="2.6.5"
		;;
	*-netbsd*)
		sysname="NetBSD"
		sysrelease="$(echo "${KC_CROSSCOMPILE_HOST_OS}" | sed 's@^.*-netbsd@@;s@$@.0@')"
		;;
	*-freebsd*)
		sysname="FreeBSD"
		sysrelease="$(echo "${KC_CROSSCOMPILE_HOST_OS}" | sed 's@^.*-freebsd@@;s@$@.0-RELEASE@')"
		;;
	*-aix[0-9].*)
		sysname="AIX"
		sysrelease="$(echo "${KC_CROSSCOMPILE_HOST_OS}" | sed 's@.*-aix\([0-9]\..*\)@\1@')"
		;;
esac

# Determine machine information
case "${KC_CROSSCOMPILE_HOST_OS}" in
	hppa64-*-hpux*)
		sysmachine="9000/859"
		;;
	i386-*-solaris*)
		sysmachine="i86pc"
		;;
	sparc-*-solaris*)