[vlc-devel] commit: macosx/framework: Support building multiple vlc tree for multiple archs. (Pierre d' Herbemont )

git version control git at videolan.org
Tue Feb 16 01:52:09 CET 2010


vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Mon Feb 15 23:19:41 2010 +0100| [1eff27e08aa7c8c271d5fbed7ba6b7c9e60375b7] | committer: Pierre d'Herbemont 

macosx/framework: Support building multiple vlc tree for multiple archs.

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

 projects/macosx/framework/Configure.sh             |   30 ++++++++---
 projects/macosx/framework/Pre-Compile.sh           |   23 +++++---
 .../framework/VLCKit.xcodeproj/project.pbxproj     |   53 +++-----------------
 3 files changed, 43 insertions(+), 63 deletions(-)

diff --git a/projects/macosx/framework/Configure.sh b/projects/macosx/framework/Configure.sh
index 433b9ae..5e56092 100644
--- a/projects/macosx/framework/Configure.sh
+++ b/projects/macosx/framework/Configure.sh
@@ -35,7 +35,6 @@ args="--enable-faad $args"
 args="--enable-flac $args"
 args="--enable-theora $args"
 args="--enable-shout $args"
-args="--enable-cddax $args"
 args="--enable-caca $args"
 args="--enable-vcdx $args"
 args="--enable-twolame $args"
@@ -48,7 +47,6 @@ args="--disable-ncurses $args"
 args="--disable-httpd $args"
 args="--disable-vlm $args"
 args="--disable-skins2 $args"
-args="--disable-x11 $args"
 args="--disable-glx $args"
 args="--disable-xvideo $args"
 args="--disable-xcb $args"
@@ -71,12 +69,26 @@ else
 	args="--enable-release $args"
 fi
 
+top_srcdir="$SRCROOT/../../.."
+
 # 64 bits switches
-if test $ARCHS = "x86_64"
-then
-	args="--build=x86_64-apple-darwin10 $args"
-fi
+for arch in $ARCHS; do
 
-echo "Running configure $args"
-top_srcdir="$SRCROOT/../../.."
-CFLAGS="-arch $ARCHS" CXXFLAGS="-arch $ARCHS" CPPFLAGS="-arch $ARCHS" OBJCFLAGS="-arch $ARCHS" exec $top_srcdir/configure $args
+    input="$top_srcdir/configure"
+    output="$arch/Makefile"
+    if test -e ${output} && test ${output} -nt ${input}; then
+        continue;
+    fi
+
+    # Contruct the vlc_build_dir/$arch
+    mkdir -p $arch
+    cd $arch
+
+    if test $arch = "x86_64"; then
+        args="--build=x86_64-apple-darwin10 $args"
+    fi
+
+    echo "Running[$arch] configure $args"
+    CFLAGS="-arch $arch" CXXFLAGS="-arch $arch" CPPFLAGS="-arch $arch" OBJCFLAGS="-arch $arch" exec $top_srcdir/configure $args
+    cd ..
+done
diff --git a/projects/macosx/framework/Pre-Compile.sh b/projects/macosx/framework/Pre-Compile.sh
index ab2d96c..04121a9 100644
--- a/projects/macosx/framework/Pre-Compile.sh
+++ b/projects/macosx/framework/Pre-Compile.sh
@@ -25,6 +25,11 @@ if test "${ACTION}" = "release-makefile"; then
     VLC_SRC_DIR="${src_dir}"
     ACTION="build"
     RELEASE_MAKEFILE="yes"
+    use_archs="no"
+    main_build_dir="${VLC_BUILD_DIR}"
+else
+    use_archs="yes"
+    main_build_dir="${VLC_BUILD_DIR}/x86_64"
 fi
 
 if test "${ACTION}" != "build"; then
@@ -118,23 +123,23 @@ vlc_install() {
 ##########################
 # Hack for VLC-release.app
 if [ "$FULL_PRODUCT_NAME" = "VLC-release.app" ] ; then
-    vlc_install "${VLC_BUILD_DIR}/bin/${prefix}vlc" "${target}" "bin" "@loader_path/lib"
+    vlc_install "${main_build_dir}/bin/${prefix}vlc" "${target}" "bin" "@loader_path/lib"
     mv ${target}/vlc ${target}/VLC
     chmod +x ${target}/VLC
 elif [ "$FULL_PRODUCT_NAME" = "VLC-Plugin.plugin" ] ; then
     # install Safari webplugin
-    vlc_install "${VLC_BUILD_DIR}/projects/mozilla/${prefix}npvlc.${suffix}" "${target}" "library" "@loader_path/lib"
+    vlc_install "${main_build_dir}/projects/mozilla/${prefix}npvlc.${suffix}" "${target}" "library" "@loader_path/lib"
     mv ${target}/npvlc.${suffix} "${target}/VLC Plugin"
     chmod +x "${target}/VLC Plugin"
 else
-    vlc_install "${VLC_BUILD_DIR}/bin/${prefix}vlc" "${target}/bin" "bin" "@loader_path/../lib"
+    vlc_install "${main_build_dir}/bin/${prefix}vlc" "${target}/bin" "bin" "@loader_path/../lib"
 fi
 
 ##########################
 # Build the modules folder (Same as VLCKit.framework/modules in Makefile)
 echo "Building modules folder..."
 # Figure out what modules are available to install
-for module in `find ${VLC_BUILD_DIR}/modules -name *.${suffix}` ; do
+for module in `find ${main_build_dir}/modules -name *.${suffix}` ; do
     # Check to see that the reported module actually exists
     if test -n ${module}; then
         vlc_install ${module} ${target_modules} "module"
@@ -142,7 +147,7 @@ for module in `find ${VLC_BUILD_DIR}/modules -name *.${suffix}` ; do
 done
 
 # Install the module cache
-vlc_install `ls ${VLC_BUILD_DIR}/modules/plugins-*.dat` ${target_modules} "data"
+vlc_install `ls ${main_build_dir}/modules/plugins-*.dat` ${target_modules} "data"
 
 # Build the modules folder
 ##########################
@@ -180,8 +185,8 @@ for linked_lib in ${linked_libs} ; do
     esac
 done
 
-vlc_install "${VLC_BUILD_DIR}/src/${prefix}libvlc.5.dylib" "${target_lib}" "library"
-vlc_install "${VLC_BUILD_DIR}/src/${prefix}libvlccore.4.dylib" "${target_lib}" "library"
+vlc_install "${main_build_dir}/src/${prefix}libvlc.5.dylib" "${target_lib}" "library"
+vlc_install "${main_build_dir}/src/${prefix}libvlccore.4.dylib" "${target_lib}" "library"
 pushd `pwd` > /dev/null
 cd ${TARGET_BUILD_DIR}/${FULL_PRODUCT_NAME}/lib
 ln -sf libvlc.5.dylib libvlc.dylib
@@ -193,7 +198,7 @@ popd > /dev/null
 echo "Building share folder..."
 pbxcp="/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -resolve-src-symlinks"
 mkdir -p ${target_share}
-$pbxcp ${VLC_SRC_DIR}/share/lua ${target_share}
+$pbxcp ${main_build_dir}/share/lua ${target_share}
 
 
 ##########################
@@ -201,7 +206,7 @@ $pbxcp ${VLC_SRC_DIR}/share/lua ${target_share}
 if [ "$FULL_PRODUCT_NAME" = "VLC-release.app" ] ; then
     echo "Exporting headers..."
     mkdir -p ${target_include}/vlc
-    $pbxcp ${VLC_SRC_DIR}/include/vlc/*.h ${target_include}/vlc
+    $pbxcp ${main_build_dir}/include/vlc/*.h ${target_include}/vlc
 else
     echo "Headers not needed for this product"
 fi
diff --git a/projects/macosx/framework/VLCKit.xcodeproj/project.pbxproj b/projects/macosx/framework/VLCKit.xcodeproj/project.pbxproj
index 2ef6ad3..7b0f270 100644
--- a/projects/macosx/framework/VLCKit.xcodeproj/project.pbxproj
+++ b/projects/macosx/framework/VLCKit.xcodeproj/project.pbxproj
@@ -37,8 +37,7 @@
 			isa = PBXAggregateTarget;
 			buildConfigurationList = 633BD6EC0D2ADF460012A314 /* Build configuration list for PBXAggregateTarget "Setup VLC contribs" */;
 			buildPhases = (
-				633BD6E30D2ADF030012A314 /* bootstrap */,
-				633BD6EB0D2ADF280012A314 /* make bin */,
+				633BD6E30D2ADF030012A314 /* make */,
 			);
 			dependencies = (
 			);
@@ -442,12 +441,9 @@
 			files = (
 			);
 			inputPaths = (
-				"$(SRCROOT)/../../../configure.ac",
-				"$(SRCROOT)/../../../bootstrap",
 			);
 			name = bootstrap;
 			outputPaths = (
-				"$(SRCROOT)/../../../configure",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
@@ -466,7 +462,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "cd  $SYMROOT/vlc_build_dir\nmake";
+			shellScript = "for arch in $ARCHS; do\n\techo \"Make [$arch]\"\n\tcd  $SYMROOT/vlc_build_dir/$arch\n\tmake\ndone";
 		};
 		633754D310ED0D330072A0D9 /* install */ = {
 			isa = PBXShellScriptBuildPhase;
@@ -486,9 +482,9 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "cd  $SYMROOT/vlc_build_dir\ncd src\necho \"Installing libvlc, libvlccore, vlc\"\nmake install --quiet > /dev/null";
+			shellScript = "for arch in $ARCHS; do\n\tcd  $SYMROOT/vlc_build_dir/$arch\n\tcd src\n\techo \"Installing  [$arch] libvlc, libvlccore, vlc\"\n\tmake install --quiet > /dev/null\ndone";
 		};
-		633BD6E30D2ADF030012A314 /* bootstrap */ = {
+		633BD6E30D2ADF030012A314 /* make */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
@@ -496,28 +492,13 @@
 			inputPaths = (
 				$SRCROOT/../../../extras/contrib/bootstrap,
 			);
-			name = bootstrap;
+			name = make;
 			outputPaths = (
 				$SRCROOT/../../../extras/contrib/config.mak,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "if test $ACTION = \"clean\"\nthen\n    cd ../../../extras/contrib && make clean\n    exit 0\nfi\nif test $ARCHS = \"x86_64\"\nthen\n    cd ../../../extras/contrib && ./bootstrap x86_64-apple-darwin10\nelse\n    cd ../../../extras/contrib && ./bootstrap\nfi";
-			showEnvVarsInLog = 0;
-		};
-		633BD6EB0D2ADF280012A314 /* make bin */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			name = "make bin";
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "if test \"$ACTION\" = \"clean\"; then\n    exit 0\nfi\ncd ../../../extras/contrib && make\n";
+			shellScript = "cd ../../../extras/contrib\n\nif test $ACTION = \"clean\"\nthen\n    make clean\n    exit 0\nfi\n\necho \"Building a set of contribs for $ARCHS...\"\necho \"\"\n\nfor arch in $ARCHS; do\n\techo \"Making contribs for $arch\"\n\tif test \"$arch\" = \"x86_64\"; then\n          ./bootstrap x86_64-apple-darwin10\n\telse\n          ./bootstrap\n\tfi\n\tmake\ndone\n";
 			showEnvVarsInLog = 0;
 		};
 		63FFDBCD0D2AE2AE0092FC96 /* configure */ = {
@@ -722,32 +703,14 @@
 		6337547C10ED090B0072A0D9 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
-				CC = "/Developer/usr/bin/llvm-gcc-4.2";
-				COPY_PHASE_STRIP = NO;
-				CXX = "/Developer/usr/bin/llvm-g++-4.2";
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_ENABLE_OBJC_GC = supported;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				GCC_VERSION = 4.2;
-				GCC_WARN_ABOUT_RETURN_TYPE = YES;
-				GCC_WARN_UNUSED_VARIABLE = YES;
-				OBJC = "/Developer/usr/bin/llvm-gcc-4.2";
-				ONLY_ACTIVE_ARCH = YES;
-				PREBINDING = NO;
-				PRODUCT_NAME = "vlc-make";
-				SDKROOT = macosx10.5;
+				PRODUCT_NAME = VLC;
 			};
 			name = Debug;
 		};
 		6337547D10ED090B0072A0D9 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				COPY_PHASE_STRIP = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				GCC_ENABLE_FIX_AND_CONTINUE = NO;
-				PRODUCT_NAME = "Make VLC 2";
-				ZERO_LINK = NO;
+				PRODUCT_NAME = VLC;
 			};
 			name = Release;
 		};




More information about the vlc-devel mailing list