[vlc-devel] commit: contrib: Allow multiple contribs install for multiple hosts. ( Pierre d'Herbemont )

git version control git at videolan.org
Fri Dec 18 02:24:12 CET 2009


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Fri Dec 18 02:13:23 2009 +0100| [43dc8a8d99b061bb1551c55289d1cd30ec6a6285] | committer: Pierre d'Herbemont 

contrib: Allow multiple contribs install for multiple hosts.

And make sure we really use the host to check what contrib to use in the configure.

You don't have to re-run bootstrap from contrib after make from contrib when building for x86_64-darwin.

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

 bootstrap                 |   16 ++++++++--------
 configure.ac              |   16 +++-------------
 extras/contrib/.gitignore |   13 ++-----------
 extras/contrib/Makefile   |   15 +++++++--------
 extras/contrib/bootstrap  |    4 +++-
 5 files changed, 23 insertions(+), 41 deletions(-)

diff --git a/bootstrap b/bootstrap
index c32c183..ac4934c 100755
--- a/bootstrap
+++ b/bootstrap
@@ -31,19 +31,19 @@ cd "$(dirname "$0")"
 ACLOCAL_ARGS="-I m4 ${ACLOCAL_ARGS}"
 
 # Check for contrib directory
-if test -d extras/contrib/bin; then
-  PATH="`pwd`/extras/contrib/bin:$PATH"
-  if test -d extras/contrib/share/aclocal; then
-    ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/share/aclocal"
+if test -d extras/contrib/build/bin; then
+  PATH="`pwd`/extras/contrib/build/bin:$PATH"
+  if test -d extras/contrib/build/share/aclocal; then
+    ACLOCAL_ARGS="${ACLOCAL_ARGS} -I extras/contrib/build/share/aclocal"
   fi
   if test ".`uname -s`" = ".Darwin"; then
-    LD_LIBRARY_PATH=./extras/contrib/lib:$LD_LIBRARY_PATH
-    DYLD_LIBRARY_PATH=./extras/contrib/lib:$DYLD_LIBRARY_PATH
+    LD_LIBRARY_PATH=./extras/contrib/build/lib:$LD_LIBRARY_PATH
+    DYLD_LIBRARY_PATH=./extras/contrib/build/lib:$DYLD_LIBRARY_PATH
     export LD_LIBRARY_PATH
     export DYLD_LIBRARY_PATH
   elif test ".`uname -s`" = ".BeOS"; then
-    LIBRARY_PATH=./extras/contrib/lib:$LIBRARY_PATH
-    BELIBRARIES=./extras/contrib/lib:$BELIBRARIES
+    LIBRARY_PATH=./extras/contrib/build/lib:$LIBRARY_PATH
+    BELIBRARIES=./extras/contrib/build/lib:$BELIBRARIES
     export LIBRARY_PATH
     export BELIBRARIES
   fi
diff --git a/configure.ac b/configure.ac
index 566a0e0..90f7572 100644
--- a/configure.ac
+++ b/configure.ac
@@ -125,19 +125,10 @@ AC_ARG_WITH(contrib,
       if test "`echo \"$topdir\" | cut -c 1`" != "/"; then
          topdir="`pwd`/$topdir"
       fi
-      CONTRIB_DIR=${topdir}/extras/contrib
+      CONTRIB_DIR=${topdir}/extras/contrib/hosts/${host}
     fi
     AC_MSG_CHECKING([for libs in ${CONTRIB_DIR}])
   AS_IF([test -d ${CONTRIB_DIR}/lib],[
-   AS_IF([test "`grep HOST ${CONTRIB_DIR}/config.mak 2>/dev/null|awk '{print $3}'`" != "`$CC -dumpmachine`"],[
-      if test "${with_contrib}" = "yes"; then
-        AC_MSG_RESULT([no])
-        AC_MSG_ERROR([ not using the libs in extras/contrib as it is not the same host])
-      else
-        AC_MSG_RESULT([no])
-        AC_MSG_WARN([ not using the libs in extras/contrib as it is not the same host])
-      fi
-     ],[
     AC_MSG_RESULT([yes])
     export PATH=${CONTRIB_DIR}/bin:$PATH
     CPPFLAGS="${CPPFLAGS} -I${CONTRIB_DIR}/include"
@@ -170,10 +161,9 @@ AC_ARG_WITH(contrib,
       export LIBRARY_PATH=${CONTRIB_DIR}/lib:$LIBRARY_PATH
       export BELIBRARIES=${CONTRIB_DIR}/lib:$BELIBRARIES
     fi
+    ],[
+       AC_MSG_RESULT([no])
     ])
-  ],[
-    AC_MSG_RESULT([no])
-  ])
 ])
 dnl
 dnl  Set default values
diff --git a/extras/contrib/.gitignore b/extras/contrib/.gitignore
index 072b2ce..89435ba 100644
--- a/extras/contrib/.gitignore
+++ b/extras/contrib/.gitignore
@@ -1,4 +1,6 @@
 # Ignore install path
+build
+hosts
 translations
 demos
 examples
@@ -6,17 +8,6 @@ mkspecs
 phrasebooks
 *.xml
 *.tar.bz2
-share
-bin
-lib
-include
-man
-sbin
-etc
-gecko-sdk
-doc
-info
-Sparkle
 *.bak
 toolchain.cmake
 # Ignore fetched contrib
diff --git a/extras/contrib/Makefile b/extras/contrib/Makefile
index 25f6838..243128e 100644
--- a/extras/contrib/Makefile
+++ b/extras/contrib/Makefile
@@ -58,16 +58,17 @@ using-bin: contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2
 		exit 1 ; \
 	fi
 	mkdir tmp
+	mkdir -p $(PREFIX)
 	(cd tmp && tar jxvf ../$<)
 	./change_prefix.sh tmp @@CONTRIB_PREFIX@@  $(PREFIX)
-	(cd tmp && find . -type d) | while read dir; do mkdir -p -- "$$dir"; done
-	(cd tmp && find . -not -type d) | while read i; do mv -f -- tmp/"$$i" "$$i"; done
+	(cd tmp && find . -type d) | while read dir; do mkdir -p -- "$(PREFIX)/$$dir"; done
+	(cd tmp && find . -not -type d) | while read i; do mv -f -- tmp/"$$i" "$(PREFIX)/$$i"; done
 	rm -rf tmp
     # libiconv.la is no longer present on Snow Leopard, so fix possible references to it, which would
     # result in linking issues
 ifdef HAVE_DARWIN_10
 	(cd $(PREFIX)/lib && sed -e 's%/usr/lib/libiconv.la%$(PREFIX)/lib/libiconv.la%g' -i.orig *.la && rm -f *.la.orig)
-	(cd $(PREFIX)/src && $(MAKE) .iconv)
+	(cd src && $(MAKE) .iconv)
 endif
 endif
 
@@ -91,9 +92,7 @@ package-macosx:
 		exit 1 ; \
 	fi
 	mkdir tmp
-	tar cf - bin sbin include lib share/aclocal* share/autoconf* \
-		share/automake* share/gettext* share/libtool* gecko-sdk Sparkle \
-		| (cd tmp; tar xf -)
+	(cd $(PREFIX); tar cf - *) | (cd tmp; tar xf -)
 	./change_prefix.sh tmp $(PREFIX) @@CONTRIB_PREFIX@@
 	(cd tmp; tar cf - .) | bzip2 -c > contrib-macosx.tar.bz2
 	rm -rf tmp
@@ -108,9 +107,9 @@ package-win%:
 		exit 1 ; \
 	fi
 	mkdir -p tmp/$(DISTDIR)
-	tar cf - --dereference bin sbin include lib share/aclocal*\
+	(cd $(PREFIX); tar cf - --dereference bin sbin include lib share/aclocal*\
 		share/autoconf* share/qt4* \
-		share/automake* share/gettext* gecko-sdk\
+		share/automake* share/gettext* gecko-sdk)\
 		| (cd tmp/$(DISTDIR); tar xpf -)
 #kludge for live.com
 	mkdir -p tmp/$(DISTDIR)/live.com
diff --git a/extras/contrib/bootstrap b/extras/contrib/bootstrap
index bb0337f..798daf5 100755
--- a/extras/contrib/bootstrap
+++ b/extras/contrib/bootstrap
@@ -290,7 +290,9 @@ cat src/Distributions/"${DISTRO}".mak >> distro.mak
 echo "BUILD = $BUILD" >> config.mak
 echo "HOST = $HOST" >> config.mak
 
-echo "PREFIX = `pwd`" >> config.mak
+echo "PREFIX = `pwd`/hosts/$HOST" >> config.mak
+
+ln -sfn hosts/$HOST build 
 
 echo "CC = ${CC}" >> config.mak
 echo "CXX = ${CXX}" >> config.mak




More information about the vlc-devel mailing list