Diff

Differences From Artifact [3e68dc7fb5]:

To Artifact [28a52cfdd8]:


116
117
118
119
120
121
122




123
124
125
126
127
128
129
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
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' ' ')"
		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"
		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"
		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
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}"
pkgarchive="${archivedir}/${pkg}-${version}.archive"
mkdir "${archivedir}" >/dev/null 2>/dev/null
mkdir "${workdir}" || exit 1
cd "${workdir}" || exit 1
workdir="$(pwd)"

# Download
download