Mac build script: add clean contrib option
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 14 Jul 2016 13:36:20 +0000 (15:36 +0200)
committerFelix Paul Kühne <fkuehne@videolan.org>
Sat, 1 Jul 2017 08:54:03 +0000 (10:54 +0200)
extras/package/macosx/build.sh

index 57d1408..f8cdfc7 100755 (executable)
@@ -25,6 +25,7 @@ OPTIONS:
    -h            Show some help
    -q            Be quiet
    -r            Rebuild everything (tools, contribs, vlc)
+   -c            Recompile contribs from sources
    -k <sdk>      Use the specified sdk (default: $SDKROOT)
    -a <arch>     Use the specified arch (default: $ARCH)
 EOF
@@ -41,7 +42,7 @@ spopd()
     popd > /dev/null
 }
 
-while getopts "hvrk:a:" OPTION
+while getopts "hvrck:a:" OPTION
 do
      case $OPTION in
          h)
@@ -55,6 +56,9 @@ do
          r)
              REBUILD="yes"
          ;;
+         c)
+             CONTRIBFROMSOURCE="yes"
+         ;;
          a)
              ARCH=$OPTARG
          ;;
@@ -123,9 +127,14 @@ mkdir -p contrib-$TRIPLET && cd contrib-$TRIPLET
 if [ "$REBUILD" = "yes" ]; then
     make clean
 fi
+if [ "$CONTRIBFROMSOURCE" = "yes" ]; then
+    make fetch
+    make
+else
 if [ ! -e "../$TRIPLET" ]; then
     make prebuilt > $out
 fi
+fi
 spopd