Check-in [d8aa72a9f7]
Overview
SHA1:d8aa72a9f74cbe3d05dfeb85ce3cb9c946a7ce13
Date: 2015-03-20 15:19:04
User: rkeene
Comment:Added support for packages linking to the native system
Timelines: family | ancestors | packages
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2015-03-20
15:19
[d8aa72a9f7] Leaf: Added support for packages linking to the native system (user: rkeene, tags: packages)
15:18
[346731593e] Added Fossil package (user: rkeene, tags: packages)
Changes

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

   116    116   			*:*)
   117    117   				pkgchanges=($(echo "${pkg}" | cut -f 2 -d ':'))
   118    118   				pkg="$(echo "${pkg}" | cut -f 1 -d ':')"
   119    119   				;;
   120    120   		esac
   121    121   
   122    122   		case "${pkg}" in
          123  +			@*)
          124  +				# Fake package
          125  +				continue
          126  +				;;
   123    127   			*/*@*)
   124    128   				pkgdomain="$(echo "${pkg}" | cut -f 2 -d '@')"
   125    129   				pkgversion="$(echo "${pkg}" | cut -f 2 -d '/' | cut -f 1 -d '@')"
   126    130   				pkg="$(echo "${pkg}" | cut -f 1 -d '/')"
   127    131   				;;
   128    132   			*/*)
   129    133   				pkgversion="$(echo "${pkg}" | cut -f 2 -d '/')"
................................................................................
   221    225   	:
   222    226   }
   223    227   
   224    228   function configure_gcc() {
   225    229   	local glibcdir linuxheadersdir
   226    230   	local dynlinker
   227    231   	local gcc_default_headers
          232  +	local pkg use_native_platform
   228    233   
   229    234   	glibcdir="/opt/appfs/core.appfs.rkeene.org/glibc/platform/latest"
   230    235   	glibcdir="$(readlink -f "${glibcdir}")"
   231    236   
   232    237   	linuxheadersdir="/opt/appfs/core.appfs.rkeene.org/linux-headers/platform/latest"
   233    238   	linuxheadersdir="$(readlink -f "${linuxheadersdir}")"
   234    239   
   235    240   	dynlinker="$(ls "${glibcdir}"/lib/ld-linux*.so.* | tail -n 1)"
   236    241   
   237    242   	if [ ! -f "${dynlinker}" ]; then
   238    243   		die 'glibc directory is not available (appfs running/working?)'
   239    244   	fi
   240    245   
   241         -	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' ' ')"
          246  +	use_native_platform='0'
          247  +	for pkg in "${require[@]}"; do
          248  +		case "${pkg}" in
          249  +			@native-os)
          250  +				use_native_platform='1'
          251  +				;;
          252  +		esac
          253  +	done
   242    254   
   243         -	CC="${CC:-gcc} -nostdinc ${gcc_default_headers} -isystem ${glibcdir}/include"
   244         -	CXX="${CXX:-g++} -nostdinc ${gcc_default_headers} -isystem ${glibcdir}/include"
          255  +	if [ "${use_native_platform}" = '0' ]; then
          256  +		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' ' ')"
   245    257   
   246         -	if ! echo " ${require[*]} " | grep ' linux-headers[/@: ]' >/dev/null; then
   247         -		CC="${CC} -isystem ${linuxheadersdir}/include"
   248         -		CXX="${CXX} -isystem ${linuxheadersdir}/include"
          258  +		CC="${CC:-gcc} -nostdinc ${gcc_default_headers} -isystem ${glibcdir}/include"
          259  +		CXX="${CXX:-g++} -nostdinc ${gcc_default_headers} -isystem ${glibcdir}/include"
          260  +
          261  +		if ! echo " ${require[*]} " | grep ' linux-headers[/@: ]' >/dev/null; then
          262  +			CC="${CC} -isystem ${linuxheadersdir}/include"
          263  +			CXX="${CXX} -isystem ${linuxheadersdir}/include"
          264  +		fi
          265  +	else
          266  +		CC="${CC:-gcc} -isystem ${glibcdir}/include"
          267  +		CXX="${CXX:-g++} -isystem ${glibcdir}/include"
   249    268   	fi
   250    269   
   251    270   	BUILD_CC="${CC}"
   252    271   	HOST_CC="${CC}"
   253    272   
   254    273   	LDFLAGS="${LDFLAGS} -L${glibcdir}/lib -Wl,-rpath,${glibcdir}/lib -Wl,--dynamic-linker,${dynlinker}"
   255    274   	if [ -z "${appfs_build_no_default_symver}" ]; then
................................................................................
   342    361   	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)"
   343    362   fi
   344    363   
   345    364   . "${pkgfile}"
   346    365   
   347    366   archivedir="$(pwd)/ARCHIVE"
   348    367   workdir="workdir-$$${RANDOM}${RANDOM}${RANDOM}"
   349         -pkgarchive="${archivedir}/${pkg}-${version}"
          368  +pkgarchive="${archivedir}/${pkg}-${version}.archive"
   350    369   mkdir "${archivedir}" >/dev/null 2>/dev/null
   351    370   mkdir "${workdir}" || exit 1
   352    371   cd "${workdir}" || exit 1
   353    372   workdir="$(pwd)"
   354    373   
   355    374   # Download
   356    375   download