public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-fix-root
@ 2009-03-16  5:53 Ned Ludd (solar)
  0 siblings, 0 replies; 6+ messages in thread
From: Ned Ludd (solar) @ 2009-03-16  5:53 UTC (permalink / raw
  To: gentoo-commits

solar       09/03/16 05:53:18

  Modified:             cross-fix-root
  Log:
  be sure to update pc_files in ${ROOT}/usr/share/pkgconfig/ also

Revision  Changes    Path
1.3                  crossdev-wrappers/cross-fix-root

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?r1=1.2&r2=1.3

Index: cross-fix-root
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- cross-fix-root	26 Feb 2009 23:37:46 -0000	1.2
+++ cross-fix-root	16 Mar 2009 05:53:18 -0000	1.3
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Copyright 2008-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v 1.2 2009/02/26 23:37:46 solar Exp $
+# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v 1.3 2009/03/16 05:53:18 solar Exp $
 
 # - solar
 
@@ -31,11 +31,11 @@
 
 fix_pc_files() {
 	count=0
-	for PC in $CROSS_ROOT/usr/lib/pkgconfig/*.pc; do
-		[ -e $PC ] || continue
-		sed -i -e "s/^prefix\\=\\/usr$/prefix\=$(re_safe "$CROSS_ROOT")\\/usr/" $PC
+	for PC in "${CROSS_ROOT}"/usr/lib/pkgconfig/*.pc "${CROSS_ROOT}"/usr/share/pkgconfig/*.pc; do
+		[ -e "${PC}" ] || continue
+		sed -i -e "s/^prefix\\=\\/usr$/prefix\=$(re_safe "${CROSS_ROOT}")\\/usr/" "${PC}"
 		count=$(($count+1))
-		[[ $? != 0 ]] && printf "Fixing $PC for $CROSS_ROOT FAILED sucka\n"
+		[[ $? != 0 ]] && printf "Fixing ${PC} for ${CROSS_ROOT} FAILED sucka\n"
 	done
 	return $count
 }
@@ -45,4 +45,4 @@
 fix_pc_files ${CROSS_ROOT}
 pc_count=$?
 :
-( . /etc/init.d/functions.sh; einfo "Scanned/Fixed $pc_count "'*'".pc and $la_count "'*'".la files" )
+( . /etc/init.d/functions.sh; einfo "Scanned/Fixed ${pc_count} "'*'".pc and ${la_count} "'*'".la files" )






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-fix-root
@ 2009-11-23  3:29 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2009-11-23  3:29 UTC (permalink / raw
  To: gentoo-commits

vapier      09/11/23 03:29:47

  Modified:             cross-fix-root
  Log:
  cross-fix-root: import these changes from git:
  
  cross-fix-root: rewrite with stuff from uClinux-dist
  Rewrite the script to fix more things and be safer in general.
  
  cross-fix-root: exit 0 when lib dir does not exist
  If the lib dir does not exist yet, exit with 0 rather than 1.  This way we
  do not abort early when doing bootstrapping and the lib dir does not yet
  exist.
  
  cross-fix-root: fix *-config symlinks
  Make sure we install with the full ${prefix}${config} name rather than an
  incorrect ${prefix}.
  
  cross-fix-root: let people specify paths via cmdline

Revision  Changes    Path
1.4                  crossdev-wrappers/cross-fix-root

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?r1=1.3&r2=1.4

Index: cross-fix-root
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- cross-fix-root	16 Mar 2009 05:53:18 -0000	1.3
+++ cross-fix-root	23 Nov 2009 03:29:47 -0000	1.4
@@ -1,48 +1,68 @@
-#!/bin/bash
+#!/bin/sh
 # Copyright 2008-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v 1.3 2009/03/16 05:53:18 solar Exp $
+# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v 1.4 2009/11/23 03:29:47 vapier Exp $
 
-# - solar
+#
+# fix library perms, mung paths in pkg-config files, libtool linker scripts,
+# and random -config scripts to point to our build directory, and cross-compile
+# symlinks for the -config scripts as autotool packages will search for
+# prefixed -config scripts when cross-compiling.  note: the ugly ln/mv is to
+# work around a possible race condition if multiple make jobs are generating
+# the same symlink at the same time.  a `mv` is "atomic" (it uses rename())
+# while a `ln` is actually unlink();symlink();.
+#
+
+LIBDIR="usr/lib"
+SYSROOT=${SYSROOT:-${ROOT:-${STAGEDIR}}}
+CROSS_BINDIR=""
+if [ -n "${ROOTDIR}" ] ; then
+	# uClinux-dist mojo
+	CROSS_BINDIR="${ROOTDIR}/tools"
+fi
+CROSS_PREFIX=${CROSS_COMPILE}
+if [ -n "$3" ] ; then
+	SYSROOT="$1"
+	CROSS_BINDIR="$2"
+	CROSS_PREFIX="$3"
+elif [ -n "$1" ] ; then
+	if [ -e "/usr/$1" ] ; then
+		SYSROOT="/usr/$1"
+		CROSS_BINDIR="/usr/bin"
+		CROSS_PREFIX="$1-"
+	else
+		exit 1
+	fi
+fi
+
+cd "${SYSROOT}" || exit 0
+
+if [ -d "${LIBDIR}" ] ; then
+	find "./${LIBDIR}/" -name 'lib*.so*' -print0 | xargs -0 -r chmod 755
+	find "./${LIBDIR}/" -name 'lib*.la' -o -name 'lib*.a' -print0 | xargs -0 -r chmod 644
+	find "./${LIBDIR}/" -name 'lib*.la' -print0 | xargs -0 -r \
+		sed -i \
+			-e "/^libdir=/s:=.*:='${SYSROOT}/usr/lib':" \
+			-e "/^dependency_libs=/s: /usr/lib/: ${SYSROOT}/usr/lib/:g"
+fi
+
+if [ -d "${LIBDIR}/pkgconfig" ] ; then
+	find "./${LIBDIR}/pkgconfig/" ./usr/share/pkgconfig/ -name '*.pc' -print0 | xargs -0 -r \
+		sed -i "/^prefix=/s:=.*:='${SYSROOT}/usr':"
+fi
+
+if [ -d usr/bin ] ; then
+	find ./usr/bin/ -name '*-config' -print0 | xargs -0 -r \
+		sed -i "/^prefix=/s:=.*:='${SYSROOT}/usr':"
+
+	if [ -n "${CROSS_BINDIR}" ] && [ -d "${CROSS_BINDIR}" ] && [ -n "${CROSS_PREFIX}" ] ; then
+		cd usr/bin || exit 1
+		for config in *-config ; do
+			ln -s "${SYSROOT}/usr/bin/${config}" "${CROSS_BINDIR}/${CROSS_PREFIX}${config}.$$"
+			mv "${CROSS_BINDIR}/${CROSS_PREFIX}${config}.$$" "${CROSS_BINDIR}/${CROSS_PREFIX}${config}"
+		done
+		cd ../..
+	fi
+fi
 
-CROSS_ROOT=""
-[[ $1 != "" ]] && [ -e /usr/$1 ] && CROSS_ROOT="/usr/$1"
-[[ -e ${CROSS_ROOT} ]] || exit 0
-
-function strip_path() {
-        echo $1 | grep -Eo "[^\/]+$"
-}
-
-function re_safe() {
-        echo $1 | gawk '{ gsub("/","\\/"); print }'
-}
-
-fix_la_files() {
-	count=0
-	for LA in $(find $CROSS_ROOT/usr/lib/ -iname *.la); do
-		[ -e $LA ] || continue
-		count=$(($count+1))
-		sed  -i -e "s;libdir='/usr/lib';libdir='$CROSS_ROOT/usr/lib';" \
-			-e s@" /usr/lib"@" ${CROSS_ROOT}/usr/lib"@g $LA
-		[[ $? != 0 ]] && printf "FAIL $LA or $CROSS_ROOT FAILED sucka\n"
-	done
-	return $count
-}
-
-fix_pc_files() {
-	count=0
-	for PC in "${CROSS_ROOT}"/usr/lib/pkgconfig/*.pc "${CROSS_ROOT}"/usr/share/pkgconfig/*.pc; do
-		[ -e "${PC}" ] || continue
-		sed -i -e "s/^prefix\\=\\/usr$/prefix\=$(re_safe "${CROSS_ROOT}")\\/usr/" "${PC}"
-		count=$(($count+1))
-		[[ $? != 0 ]] && printf "Fixing ${PC} for ${CROSS_ROOT} FAILED sucka\n"
-	done
-	return $count
-}
-
-fix_la_files ${CROSS_ROOT}
-la_count=$?
-fix_pc_files ${CROSS_ROOT}
-pc_count=$?
-:
-( . /etc/init.d/functions.sh; einfo "Scanned/Fixed ${pc_count} "'*'".pc and ${la_count} "'*'".la files" )
+exit 0






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-fix-root
@ 2009-11-24 22:02 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2009-11-24 22:02 UTC (permalink / raw
  To: gentoo-commits

vapier      09/11/24 22:02:28

  Modified:             cross-fix-root
  Log:
  cross-fix-root: handle packages that set exec_prefix directly to /usr

Revision  Changes    Path
1.5                  crossdev-wrappers/cross-fix-root

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?r1=1.4&r2=1.5

Index: cross-fix-root
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- cross-fix-root	23 Nov 2009 03:29:47 -0000	1.4
+++ cross-fix-root	24 Nov 2009 22:02:28 -0000	1.5
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Copyright 2008-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v 1.4 2009/11/23 03:29:47 vapier Exp $
+# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v 1.5 2009/11/24 22:02:28 vapier Exp $
 
 #
 # fix library perms, mung paths in pkg-config files, libtool linker scripts,
@@ -48,7 +48,7 @@
 
 if [ -d "${LIBDIR}/pkgconfig" ] ; then
 	find "./${LIBDIR}/pkgconfig/" ./usr/share/pkgconfig/ -name '*.pc' -print0 | xargs -0 -r \
-		sed -i "/^prefix=/s:=.*:='${SYSROOT}/usr':"
+		sed -i -r -e "/^(exec_)?prefix=/s:=/usr\$:='${SYSROOT}/usr':"
 fi
 
 if [ -d usr/bin ] ; then






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-fix-root
@ 2009-12-09 23:42 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2009-12-09 23:42 UTC (permalink / raw
  To: gentoo-commits

vapier      09/12/09 23:42:58

  Modified:             cross-fix-root
  Log:
  cross-fix-root: fix up .pc search & fix

Revision  Changes    Path
1.6                  crossdev-wrappers/cross-fix-root

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.6&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.6&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?r1=1.5&r2=1.6

Index: cross-fix-root
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- cross-fix-root	24 Nov 2009 22:02:28 -0000	1.5
+++ cross-fix-root	9 Dec 2009 23:42:58 -0000	1.6
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Copyright 2008-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v 1.5 2009/11/24 22:02:28 vapier Exp $
+# $Header: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v 1.6 2009/12/09 23:42:58 vapier Exp $
 
 #
 # fix library perms, mung paths in pkg-config files, libtool linker scripts,
@@ -46,8 +46,12 @@
 			-e "/^dependency_libs=/s: /usr/lib/: ${SYSROOT}/usr/lib/:g"
 fi
 
-if [ -d "${LIBDIR}/pkgconfig" ] ; then
-	find "./${LIBDIR}/pkgconfig/" ./usr/share/pkgconfig/ -name '*.pc' -print0 | xargs -0 -r \
+set --
+for d in "./${LIBDIR}/pkgconfig/" ./usr/share/pkgconfig/ ; do
+	[[ -d $d ]] && set -- "$@" "${d}"
+done
+if [ $# -gt 0 ] ; then
+	find "$@" -name '*.pc' -print0 | xargs -0 -r \
 		sed -i -r -e "/^(exec_)?prefix=/s:=/usr\$:='${SYSROOT}/usr':"
 fi
 






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-fix-root
@ 2009-12-30  4:57 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2009-12-30  4:57 UTC (permalink / raw
  To: gentoo-commits

vapier      09/12/30 04:57:24

  Modified:             cross-fix-root
  Log:
  cross-fix-root: fix test bashism

Revision  Changes    Path
1.8                  crossdev-wrappers/cross-fix-root

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.8&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.8&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?r1=1.7&r2=1.8

Index: cross-fix-root
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cross-fix-root	10 Dec 2009 00:35:44 -0000	1.7
+++ cross-fix-root	30 Dec 2009 04:57:24 -0000	1.8
@@ -47,7 +47,7 @@
 
 set --
 for d in "./${LIBDIR}/pkgconfig/" ./usr/share/pkgconfig/ ; do
-	[[ -d $d ]] && set -- "$@" "${d}"
+	[ -d "$d" ] && set -- "$@" "${d}"
 done
 if [ $# -gt 0 ] ; then
 	find "$@" -name '*.pc' -print0 | xargs -0 -r \






^ permalink raw reply	[flat|nested] 6+ messages in thread

* [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-fix-root
@ 2010-01-08  7:10 Mike Frysinger (vapier)
  0 siblings, 0 replies; 6+ messages in thread
From: Mike Frysinger (vapier) @ 2010-01-08  7:10 UTC (permalink / raw
  To: gentoo-commits

vapier      10/01/08 07:10:34

  Modified:             cross-fix-root
  Log:
  cross-fix-root: add some usage text

Revision  Changes    Path
1.9                  crossdev-wrappers/cross-fix-root

file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.9&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?rev=1.9&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/crossdev-wrappers/cross-fix-root?r1=1.8&r2=1.9

Index: cross-fix-root
===================================================================
RCS file: /var/cvsroot/gentoo-projects/crossdev-wrappers/cross-fix-root,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cross-fix-root	30 Dec 2009 04:57:24 -0000	1.8
+++ cross-fix-root	8 Jan 2010 07:10:34 -0000	1.9
@@ -1,16 +1,25 @@
 #!/bin/sh
-# Copyright 2008-2009 Gentoo Foundation
+# Copyright 2008-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
-#
-# fix library perms, mung paths in pkg-config files, libtool linker scripts,
-# and random -config scripts to point to our build directory, and cross-compile
-# symlinks for the -config scripts as autotool packages will search for
-# prefixed -config scripts when cross-compiling.  note: the ugly ln/mv is to
-# work around a possible race condition if multiple make jobs are generating
-# the same symlink at the same time.  a `mv` is "atomic" (it uses rename())
-# while a `ln` is actually unlink();symlink();.
-#
+usage() {
+	cat <<-EOF
+	Usage: cross-fix-root <sysroot> <cross-bindir> <cross-prefix>
+	       cross-fix-root <cross-prefix>
+	       cross-fix-root # takes settings from env
+
+	Environment variables:
+	  CROSS_COMPILE=<cross-prefix>
+	  (SYSROOT|ROOT|STAGEDIR)=<sysroot>
+
+	Description:
+	  Fix library perms and mung paths in libtool linker scripts & random -config
+	  scripts to point to our SYSROOT directory.  Add symlinks for the -config
+	  with cross-compiler prefixes as autotool packages will search for them first
+	  when cross-compiling.
+	EOF
+	exit 1
+}
 
 LIBDIR="usr/lib"
 SYSROOT=${SYSROOT:-${ROOT:-${STAGEDIR}}}
@@ -20,19 +29,24 @@
 	CROSS_BINDIR="${ROOTDIR}/tools"
 fi
 CROSS_PREFIX=${CROSS_COMPILE}
-if [ -n "$3" ] ; then
-	SYSROOT="$1"
-	CROSS_BINDIR="$2"
-	CROSS_PREFIX="$3"
-elif [ -n "$1" ] ; then
-	if [ -e "/usr/$1" ] ; then
-		SYSROOT="/usr/$1"
-		CROSS_BINDIR="/usr/bin"
-		CROSS_PREFIX="$1-"
-	else
-		exit 1
-	fi
-fi
+case $# in
+	3)
+		SYSROOT="$1"
+		CROSS_BINDIR="$2"
+		CROSS_PREFIX="$3"
+		;;
+	1)
+		if [ -e "/usr/${1:-..........}" ] ; then
+			SYSROOT="/usr/$1"
+			CROSS_BINDIR="/usr/bin"
+			CROSS_PREFIX="$1-"
+		else
+			usage
+		fi
+		;;
+	0) [ -z "${SYSROOT}" ] && usage ;;
+	*) usage ;;
+esac
 
 cd "${SYSROOT}" || exit 0
 
@@ -61,6 +75,10 @@
 	if [ -n "${CROSS_BINDIR}" ] && [ -d "${CROSS_BINDIR}" ] && [ -n "${CROSS_PREFIX}" ] ; then
 		cd usr/bin || exit 1
 		for config in *-config ; do
+			# work around a possible race condition if multiple make jobs
+			# are generating the same symlink at the same time.  a `mv`
+			# is "atomic" (it uses rename())  while a `ln` is actually
+			# unlink() followed by a symlink().
 			ln -s "${SYSROOT}/usr/bin/${config}" "${CROSS_BINDIR}/${CROSS_PREFIX}${config}.$$"
 			mv "${CROSS_BINDIR}/${CROSS_PREFIX}${config}.$$" "${CROSS_BINDIR}/${CROSS_PREFIX}${config}"
 		done






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-01-08  7:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-08  7:10 [gentoo-commits] gentoo-projects commit in crossdev-wrappers: cross-fix-root Mike Frysinger (vapier)
  -- strict thread matches above, loose matches on Subject: below --
2009-12-30  4:57 Mike Frysinger (vapier)
2009-12-09 23:42 Mike Frysinger (vapier)
2009-11-24 22:02 Mike Frysinger (vapier)
2009-11-23  3:29 Mike Frysinger (vapier)
2009-03-16  5:53 Ned Ludd (solar)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox