[vlc-devel] commit: contrib: Add using-bin target. (Pierre d'Herbemont )

git version control git at videolan.org
Mon Sep 22 16:32:07 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Mon Sep 22 15:35:26 2008 +0200| [009a133764d70b861e8ef6dca63a88365a80fc54] | committer: Pierre d'Herbemont 

contrib: Add using-bin target.

'make using-bin' will download the contrib binary and install them.

I am considering switching default make target to make using-bin, instead of the current using-src, because it's way faster, it's safer, and only experienced dev will use make using-src I guess.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=009a133764d70b861e8ef6dca63a88365a80fc54
---

 extras/contrib/Makefile         |   23 ++++++++++++++++++++---
 extras/contrib/bootstrap        |    9 +++++++++
 extras/contrib/change_prefix.sh |   24 ++++++++++++++----------
 3 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/extras/contrib/Makefile b/extras/contrib/Makefile
index 1c62f5b..4d7a2bc 100644
--- a/extras/contrib/Makefile
+++ b/extras/contrib/Makefile
@@ -30,8 +30,24 @@ BUILDDIRS = bin doc etc include info lib man sbin share vlc-lib tmp gecko-sdk
 all:
 	$(MAKE) -C src
 
-contrib-macosx.tar.bz2:
-	$(WGET) $(CONTRIB_URL)
+ifdef HAVE_DARWIN_OS
+
+CONTRIBREV=20080922
+contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
+	$(WGET) ftp://ftp.videolan.org/pub/videolan/testing/contrib/contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
+
+using-bin: contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
+	@if test -d tmp; then \
+		echo "Move away ./tmp, it's in the way" ; \
+		exit 1 ; \
+	fi
+	mkdir tmp
+	(cd tmp && tar jxvf ../contrib-macosx.tar.bz2)
+	./change_prefix.sh tmp @@CONTRIB_PREFIX@@  $(PREFIX)
+	for dir in `(cd tmp && find . -type d)`; do mkdir -p -- $$dir; done
+	for i in `(cd tmp && find . -not -type d)`; do mv -f tmp/$$i $$i; done
+	rm -rf tmp
+endif
 
 clean-src:
 	rm -rf $(BUILDDIRS)
@@ -45,6 +61,8 @@ clean:
 	$(MAKE) clean-src
 	rm -rf config.mak distro.mak
 
+bin: using-bin
+
 package-macosx:
 	@if test -d tmp; then \
 		echo "Move away ./tmp, it's in the way" ; \
@@ -55,7 +73,6 @@ package-macosx:
 		share/automake* share/gettext* \
 		| (cd tmp; tar xf -)
 	./change_prefix.sh tmp $(PREFIX) @@CONTRIB_PREFIX@@
-	(cd tmp; tar cf - .) | bzip2 -c > contrib-macosx.tar.bz2
 	rm -rf tmp
 
 DISTDIR = usr/win32
diff --git a/extras/contrib/bootstrap b/extras/contrib/bootstrap
index 1fbc2b0..913add9 100755
--- a/extras/contrib/bootstrap
+++ b/extras/contrib/bootstrap
@@ -70,6 +70,15 @@ if test "$HOST" != "$BUILD"; then
     STRIP="${HOST}-strip"
 fi
 
+case $HOST in
+    *powerpc*|*ppc*)
+         echo "ARCH=ppc" >> config.mak
+     ;;
+    *86*)
+          echo "ARCH=i386" >> config.mak
+     ;;
+esac
+
 # Check the HAVE_{OS}
 case $HOST in
     *darwin*)
diff --git a/extras/contrib/change_prefix.sh b/extras/contrib/change_prefix.sh
index 9a30789..c819709 100755
--- a/extras/contrib/change_prefix.sh
+++ b/extras/contrib/change_prefix.sh
@@ -45,20 +45,24 @@ fi
 cd $top_dir
 pwd
 files=`find . -type f`
-for file in $files; do
-  if test ".`file $file | grep Mach-O`" != "." ; then
+for file in $files; do 
+ if test ".`file $file | grep Mach-O`" != "." ; then
+    echo "Changing prefixes of '$file'"
     libs=`otool -L $file 2>/dev/null | grep $prefix | cut -d\  -f 1`
-    echo $libs
+    WD=`pwd`
+    first=y
     for i in "" $libs; do
-    echo $i
-      if ! test -z $i; then
-        install_name_tool -change $i \
-                          `echo $i | sed -e "s,$prefix,$new_prefix,"` \
-                          $file
+     if ! test -z $i; then
+         if test $first = y; then
+            install_name_tool -id `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
+            first=n
+        else
+            install_name_tool -change $i `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
+         fi
       fi
     done
   elif test ".`file $file | grep \"text\|shell\"`" != "." ; then
-
+   echo "Fixing up shell/text file "$file""
     sed -e "s,$prefix,$new_prefix,g" < $file > $file.tmp
     mv -f $file.tmp $file
   fi
@@ -68,7 +72,7 @@ cd $new_prefix2/lib/
 pwd
 files=` ls -1 *.la`
 for file in $files; do
-   echo $file
+   echo "Fixing up .la $file"
    sed -e "s,$prefix,$new_prefix,g" < $file > $file.tmp
    mv -f $file.tmp $file
 done




More information about the vlc-devel mailing list