Check-in [2655d453ea]
Overview
Comment:Updated to use "fake-uname" when building Tcl if cross-compiling
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2655d453ea5b5913688b55a9e852a850c646a527
User & Date: rkeene on 2014-05-19 03:32:27
Other Links: manifest | tags
Context
2014-05-19
17:01
Updated to supply licensing information in build check-in: 4f493878e3 user: rkeene tags: trunk
03:32
Updated to use "fake-uname" when building Tcl if cross-compiling check-in: 2655d453ea user: rkeene tags: trunk
03:29
Removed extra whitespace check-in: 0d0e6831fe user: rkeene tags: trunk
Changes

Modified server/buildpkgs/build_all.sh from [4bef3a5bc6] to [c3ccff1f0c].

70
71
72
73
74
75
76










77
78
79
80
81
82
83
			echo '' > "${TCLPRIVATE}/win/tclWinReg.c"

			## Long-standing bug in Tcl
			echo '#undef strtod' > "${TCLPRIVATE}/compat/strtod.c.new"
			cat "${TCLPRIVATE}/compat/strtod.c" >> "${TCLPRIVATE}/compat/strtod.c.new"
			cat "${TCLPRIVATE}/compat/strtod.c.new" > "${TCLPRIVATE}/compat/strtod.c"
			rm -f "${TCLPRIVATE}/compat/strtod.c.new"











			tcl_platform_dir='unix win macosx'

			case "${CC}" in
				*mingw*)
					# If the compiler looks like Mingw, use Windows
					tcl_platform_dir='win'







>
>
>
>
>
>
>
>
>
>







70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
			echo '' > "${TCLPRIVATE}/win/tclWinReg.c"

			## Long-standing bug in Tcl
			echo '#undef strtod' > "${TCLPRIVATE}/compat/strtod.c.new"
			cat "${TCLPRIVATE}/compat/strtod.c" >> "${TCLPRIVATE}/compat/strtod.c.new"
			cat "${TCLPRIVATE}/compat/strtod.c.new" > "${TCLPRIVATE}/compat/strtod.c"
			rm -f "${TCLPRIVATE}/compat/strtod.c.new"

			## Update to call fake "uname" since Tcl insists on
			## using "uname" to determine HOST information
			case "${CC}" in
				*-*-*)
					sed 's|`uname |`'"${PROJROOTDIR}"'/fake-uname |g' "${TCLPRIVATE}/unix/configure" > "${TCLPRIVATE}/unix/configure.new"
					cat "${TCLPRIVATE}/unix/configure.new" > "${TCLPRIVATE}/unix/configure"
					rm -f "${TCLPRIVATE}/unix/configure.new"
					;;
			esac

			tcl_platform_dir='unix win macosx'

			case "${CC}" in
				*mingw*)
					# If the compiler looks like Mingw, use Windows
					tcl_platform_dir='win'

Added server/buildpkgs/fake-uname version [bed70cf53f].























































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
#! /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*)
		sysmachine="sun4u"
		;;
	x86_64-*)
		sysmachine="x86_64"
		;;
	i?86-*)
		sysmachine="i686"
		;;
	ia64-*)
		sysmachine="ia64"
		;;
	arm-*|armel-*|armeb-*)
		sysmachine="armv7l"
		;;
	mipsel-*|mipseb-*)
		sysmachine="mips"
		;;
	powerpc-*)
		sysmachine="ppc"
		;;
esac

for arg in $(echo "$@" | sed 's@.@ & @g'); do
	case "${arg}" in
		-)
			continue
			;;
		v)
			retval="${retval} unknown"
			;;
		r)
			retval="${retval} ${sysrelease}"
			;;
		s)
			retval="${retval} ${sysname}"
			;;
		m)
			retval="${retval} ${sysmachine}"
			;;
		p)
			# XXX
			retval="${retval} ${syscpu}"
			;;
		n)
			retval="${retval} $(hostname)"
			;;
		a)
			retval="${sysname} $(hostname) ${sysrelease} ${sysversion} ${sysmachine} ${syscpu}"
			;;
	esac
done

echo "${retval}" | sed 's@^  *@@;s@  *$@@'