Check-in [d8aa72a9f7]
Overview
Comment:Added support for packages linking to the native system
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | packages
Files: files | file ages | folders
SHA1: d8aa72a9f74cbe3d05dfeb85ce3cb9c946a7ce13
User & Date: rkeene on 2015-03-20 15:19:04
Other Links: branch diff | manifest | tags
Context
2018-11-16
21:38
Upgraded to latest Tcl check-in: 3f2cfe4d81 user: rkeene tags: packages
2015-03-20
15:19
Added support for packages linking to the native system check-in: d8aa72a9f7 user: rkeene tags: packages
15:18
Added Fossil package check-in: 346731593e user: rkeene tags: packages
Changes

Modified build from [3e68dc7fb5] to [28a52cfdd8].

116
117
118
119
120
121
122




123
124
125
126
127
128
129
			*:*)
				pkgchanges=($(echo "${pkg}" | cut -f 2 -d ':'))
				pkg="$(echo "${pkg}" | cut -f 1 -d ':')"
				;;
		esac

		case "${pkg}" in




			*/*@*)
				pkgdomain="$(echo "${pkg}" | cut -f 2 -d '@')"
				pkgversion="$(echo "${pkg}" | cut -f 2 -d '/' | cut -f 1 -d '@')"
				pkg="$(echo "${pkg}" | cut -f 1 -d '/')"
				;;
			*/*)
				pkgversion="$(echo "${pkg}" | cut -f 2 -d '/')"







>
>
>
>







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
			*:*)
				pkgchanges=($(echo "${pkg}" | cut -f 2 -d ':'))
				pkg="$(echo "${pkg}" | cut -f 1 -d ':')"
				;;
		esac

		case "${pkg}" in
			@*)
				# Fake package
				continue
				;;
			*/*@*)
				pkgdomain="$(echo "${pkg}" | cut -f 2 -d '@')"
				pkgversion="$(echo "${pkg}" | cut -f 2 -d '/' | cut -f 1 -d '@')"
				pkg="$(echo "${pkg}" | cut -f 1 -d '/')"
				;;
			*/*)
				pkgversion="$(echo "${pkg}" | cut -f 2 -d '/')"
221
222
223
224
225
226
227

228
229
230
231
232
233
234
235
236
237
238
239
240










241
242
243
244
245
246
247
248




249
250
251
252
253
254
255
	:
}

function configure_gcc() {
	local glibcdir linuxheadersdir
	local dynlinker
	local gcc_default_headers


	glibcdir="/opt/appfs/core.appfs.rkeene.org/glibc/platform/latest"
	glibcdir="$(readlink -f "${glibcdir}")"

	linuxheadersdir="/opt/appfs/core.appfs.rkeene.org/linux-headers/platform/latest"
	linuxheadersdir="$(readlink -f "${linuxheadersdir}")"

	dynlinker="$(ls "${glibcdir}"/lib/ld-linux*.so.* | tail -n 1)"

	if [ ! -f "${dynlinker}" ]; then
		die 'glibc directory is not available (appfs running/working?)'
	fi











	gcc_default_headers="$(echo '' | ${CPP:-cpp} -v 2>&1 | sed '/^End of search list/,$ d;0,/search starts here:$/ d' | grep '/gcc/' | sed 's@^ *@-isystem @' | tr $'\n' ' ')"

	CC="${CC:-gcc} -nostdinc ${gcc_default_headers} -isystem ${glibcdir}/include"
	CXX="${CXX:-g++} -nostdinc ${gcc_default_headers} -isystem ${glibcdir}/include"

	if ! echo " ${require[*]} " | grep ' linux-headers[/@: ]' >/dev/null; then
		CC="${CC} -isystem ${linuxheadersdir}/include"
		CXX="${CXX} -isystem ${linuxheadersdir}/include"




	fi

	BUILD_CC="${CC}"
	HOST_CC="${CC}"

	LDFLAGS="${LDFLAGS} -L${glibcdir}/lib -Wl,-rpath,${glibcdir}/lib -Wl,--dynamic-linker,${dynlinker}"
	if [ -z "${appfs_build_no_default_symver}" ]; then







>













>
>
>
>
>
>
>
>
>
>
|

|
|

|
|
|
>
>
>
>







225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
	:
}

function configure_gcc() {
	local glibcdir linuxheadersdir
	local dynlinker
	local gcc_default_headers
	local pkg use_native_platform

	glibcdir="/opt/appfs/core.appfs.rkeene.org/glibc/platform/latest"
	glibcdir="$(readlink -f "${glibcdir}")"

	linuxheadersdir="/opt/appfs/core.appfs.rkeene.org/linux-headers/platform/latest"
	linuxheadersdir="$(readlink -f "${linuxheadersdir}")"

	dynlinker="$(ls "${glibcdir}"/lib/ld-linux*.so.* | tail -n 1)"

	if [ ! -f "${dynlinker}" ]; then
		die 'glibc directory is not available (appfs running/working?)'
	fi

	use_native_platform='0'
	for pkg in "${require[@]}"; do
		case "${pkg}" in
			@native-os)
				use_native_platform='1'
				;;
		esac
	done

	if [ "${use_native_platform}" = '0' ]; then
		gcc_default_headers="$(echo '' | ${CPP:-cpp} -v 2>&1 | sed '/^End of search list/,$ d;0,/search starts here:$/ d' | grep '/gcc/' | sed 's@^ *@-isystem @' | tr $'\n' ' ')"

		CC="${CC:-gcc} -nostdinc ${gcc_default_headers} -isystem ${glibcdir}/include"
		CXX="${CXX:-g++} -nostdinc ${gcc_default_headers} -isystem ${glibcdir}/include"

		if ! echo " ${require[*]} " | grep ' linux-headers[/@: ]' >/dev/null; then
			CC="${CC} -isystem ${linuxheadersdir}/include"
			CXX="${CXX} -isystem ${linuxheadersdir}/include"
		fi
	else
		CC="${CC:-gcc} -isystem ${glibcdir}/include"
		CXX="${CXX:-g++} -isystem ${glibcdir}/include"
	fi

	BUILD_CC="${CC}"
	HOST_CC="${CC}"

	LDFLAGS="${LDFLAGS} -L${glibcdir}/lib -Wl,-rpath,${glibcdir}/lib -Wl,--dynamic-linker,${dynlinker}"
	if [ -z "${appfs_build_no_default_symver}" ]; then
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
	pkgdate="$(find "${pkgdir}" -type f -printf '%TY%Tm%Td%TH%TM.%TS\n' 2>/dev/null | cut -f 1-2 -d '.' | sort -n | tail -n 1)"
fi

. "${pkgfile}"

archivedir="$(pwd)/ARCHIVE"
workdir="workdir-$$${RANDOM}${RANDOM}${RANDOM}"
pkgarchive="${archivedir}/${pkg}-${version}"
mkdir "${archivedir}" >/dev/null 2>/dev/null
mkdir "${workdir}" || exit 1
cd "${workdir}" || exit 1
workdir="$(pwd)"

# Download
download







|







361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
	pkgdate="$(find "${pkgdir}" -type f -printf '%TY%Tm%Td%TH%TM.%TS\n' 2>/dev/null | cut -f 1-2 -d '.' | sort -n | tail -n 1)"
fi

. "${pkgfile}"

archivedir="$(pwd)/ARCHIVE"
workdir="workdir-$$${RANDOM}${RANDOM}${RANDOM}"
pkgarchive="${archivedir}/${pkg}-${version}.archive"
mkdir "${archivedir}" >/dev/null 2>/dev/null
mkdir "${workdir}" || exit 1
cd "${workdir}" || exit 1
workdir="$(pwd)"

# Download
download