From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1FGN37-0003N8-9b for garchives@archives.gentoo.org; Mon, 06 Mar 2006 21:15:25 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id k26LDXMP001653; Mon, 6 Mar 2006 21:13:33 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id k26LDWMr025900 for ; Mon, 6 Mar 2006 21:13:32 GMT Received: from mail01.emarketsouth.com ([208.247.233.6]) by smtp.gentoo.org with smtp (Exim 4.54) id 1FGN1H-00010u-Rf for gentoo-embedded@lists.gentoo.org; Mon, 06 Mar 2006 21:13:31 +0000 Received: (qmail 2743 invoked by uid 399); 6 Mar 2006 21:14:56 -0000 Received: from unknown (HELO onyx) (64.192.54.4) by mail01.emarketsouth.com with SMTP; 6 Mar 2006 21:14:56 -0000 Subject: [gentoo-embedded] Multi target cross emerge wrapper From: solar To: gentoo-embedded@lists.gentoo.org Content-Type: multipart/mixed; boundary="=-fJqBfpNUAXej1NnwJ2Vu" Organization: Gentoo Linux Date: Mon, 06 Mar 2006 16:13:26 -0500 Message-Id: <1141679606.10616.166.camel@onyx> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-embedded@gentoo.org Reply-to: gentoo-embedded@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 X-Archives-Salt: ae6f9802-4aff-4d7a-ab96-c1fe04cc79f4 X-Archives-Hash: 60bdc345d3e82ed29fbed14d557a5555 --=-fJqBfpNUAXej1NnwJ2Vu Content-Type: text/plain Content-Transfer-Encoding: 7bit Hey I've been playing around with mega x-compiling all last week. I mass merged every cross compiler crossdev can build at this time. http://tinderbox.x86.dev.gentoo.org/cross-x86/ I've actually got a crontab setup that will auto merge new cross compilers as they become available. I've got a little script to also automate much of the process of figuring out what is the right x-compiler settings and what variables should be set. I'd appreciate it if a few of you could take it for a spin and give me feedback. It should auto detect if you have a crossdev x-compiler installed and use it. If you have more than 1 it would try to merge the package for each target compiler you have. In my case I wanted to install busybox/portage-utils/libc into every ~/ROOT-$CTARGET It has a few quarks with merging virtuals and so on but thats not easy to solve as long as portage itself depends on /etc/make.profile symlinks. -- solar Gentoo Linux --=-fJqBfpNUAXej1NnwJ2Vu Content-Disposition: inline; filename=cmerge Content-Type: application/x-shellscript; name=cmerge Content-Transfer-Encoding: 7bit #!/bin/sh # Copyright 2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # - March 2006 CFLAGS="-Os -pipe" CBUILD=$(portageq envvar CHOST) CXXFLAGS="${CFLAGS}" USE_SAVE="${USE}" if [ ! -x /usr/bin/qlist ]; then echo "please emerge portage-utils" exit 1 fi gcc_executables=$(qlist -oeCI gcc| sort -u | grep ^cross | sed s/cross-//g | tr / -) if [[ "$1" == "--libc" ]]; then shift DO_LIBC=1 do_libc=1 fi if [[ $1 == "--target" ]]; then shift ctarget_only=$1 shift fi function cross_env_update() { mkdir -p ${ROOT}/etc for lpath in /usr/local/lib /usr/${CTARGET}/lib /usr/lib/gcc/${CTARGET}/$(${CTARGET}-gcc -dumpversion) /usr/lib/libstdc++-v3/; do echo "${lpath}" >> ${ROOT}/etc/ld.so.conf done } function cmerge() { CHOST=${1} shift export CTARGET=${CHOST} ARCH=$(echo ${CTARGET} | cut -d '-' -f 1) CC=${CTARGET}-gcc CXX=${CTARGET}-g++ PKGDIR=${HOME}/packages/${CHOST} ROOT="${HOME}/ROOT-${CHOST}" LDFLAGS="-L${ROOT}/lib -L${ROOT}/usr/lib" do_libc=${DO_LIBC} unset ELIBC case ${CTARGET} in *-linux-gnu) ELIBC=glibc;; *-linux-uclibc) ELIBC=uclibc;; avr) ELIBC=avr-libc;; esac export ELIBC [[ $ELIBC == "" ]] && do_libc=0 USE="${ARCH} ${USE_SAVE}" case ${ARCH} in armeb) ARCH=arm;; s390x) ARCH=s390;; mips*) ARCH=mips;; powerpc64) ARCH=ppc64;; sparc*) ARCH=sparc;; powerpc) ARCH=ppc;; hppa*) ARCH=hppa;; sh4*|sheb) ARCH=sh;; x86_64) ARCH=amd64;; avr|ee|iop|cris) ARCH="x86";; i?86) ARCH=x86;; esac ACCEPT_KEYWORDS="${ARCH}" USE="-* ${ARCH} ${USE} elibc_${ELIBC} multicall make-symlinks" export ARCH ACCEPT_KEYWORDS CFLAGS CXXFLAGS LDFLAGS ROOT CBUILD CHOST CTARGET CC CXX PKGDIR USE mkdir -p ${ROOT}/etc if [[ $ELIBC != "" ]]; then if [ -e ${ROOT}/etc/ld.so.conf ]; then [ "$(md5sum ${ROOT}/etc/ld.so.conf|awk '{print $1}')" == "b18efa8c9f95b6aecc0974c0f54d8bb9" ] && cross_env_update else cross_env_update fi fi if [[ "$do_libc" == 1 ]]; then emerge -b cross-${CHOST}/${ELIBC} $* else emerge -b $* fi unset ARCH ACCEPT_KEYWORDS LDFLAGS ROOT CHOST CTARGET CC CXX PKGDIR USE ELIBC } for gnugcc in ${gcc_executables}; do [ -e /usr/bin/${gnugcc} ] || { echo bummer $gnugcc ; continue; } # include=$($gnugcc -print-file-name=) [[ $ctarget_only != "" ]] && [[ ${gnugcc/-gcc/} != $ctarget_only ]] && continue cmerge "${gnugcc/-gcc/}" "$*" done --=-fJqBfpNUAXej1NnwJ2Vu-- -- gentoo-embedded@gentoo.org mailing list