Skip to content
This repository
Browse code

Fixes for Xcode 4.3+

  • Loading branch information...
commit 8bbf735287d7376800ce8253c90ac2e337baccb6 1 parent f911e7c
Patrick Atoon authored
157  contrib/build-pms-binaries.sh
@@ -2,8 +2,8 @@
2 2
 #
3 3
 # build-pms-osx.sh
4 4
 #
5  
-# Version: 2.1.1
6  
-# Last updated: 2012-04-09
  5
+# Version: 2.1.2
  6
+# Last updated: 2012-04-18
7 7
 # Authors: Patrick Atoon, Happy-Neko
8 8
 #
9 9
 #
@@ -160,7 +160,8 @@ check_binary() {
160 160
 It seems you are missing Xcode from Apple ("ant"), which is required to run this script.
161 161
 
162 162
 Please go to http://developer.apple.com/technologies/xcode.html, create a free
163  
-Apple developer account and download Xcode and install it.
  163
+Apple developer account and download Xcode and install it. After installation,
  164
+install the "Command Line Tools" under "Preferences... > Downloads > Components".
164 165
 
165 166
 EOM
166 167
             else
@@ -174,13 +175,76 @@ EOM
174 175
             fi
175 176
             exit;;
176 177
         
177  
-        gcc|g++|make|autoconf|automake)
  178
+        gcc|g++|make|patch)
178 179
             if is_osx; then
179 180
                 cat >&2 << EOM
180 181
 It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script.
181 182
 
182 183
 Please go to http://developer.apple.com/technologies/xcode.html, create a free
183  
-Apple developer account and download Xcode and install it.
  184
+Apple developer account and download Xcode and install it. After installation,
  185
+install the "Command Line Tools" under "Preferences... > Downloads > Components".
  186
+
  187
+EOM
  188
+            else
  189
+                cat >&2 << EOM
  190
+It seems you are missing gcc/g++ or make.
  191
+You can install them with following command on Debian based systems (Debian, Ubuntu, etc):
  192
+
  193
+    sudo apt-get install build-essential
  194
+
  195
+EOM
  196
+            fi
  197
+            exit;;
  198
+
  199
+        autoconf|autoreconf)
  200
+            if is_osx; then
  201
+                cat >&2 << EOM
  202
+It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script.
  203
+
  204
+Please go to http://developer.apple.com/technologies/xcode.html, create a free
  205
+Apple developer account and download Xcode and install it. After installation,
  206
+install the "Command Line Tools" under "Preferences... > Downloads > Components".
  207
+
  208
+Note: The Command Line Tools for Xcode 4.3 are missing essential build tools.
  209
+You can download and install $BINARY with the following commands:
  210
+
  211
+    curl -O http://mirrors.kernel.org/gnu/autoconf/autoconf-2.68.tar.gz
  212
+    tar xzvf autoconf-2.68.tar.gz 
  213
+    cd autoconf-2.68
  214
+    ./configure --prefix=/usr/local
  215
+    make
  216
+    sudo make install
  217
+
  218
+EOM
  219
+            else
  220
+                cat >&2 << EOM
  221
+It seems you are missing autoconf.
  222
+You can install it with following command on Debian based systems (Debian, Ubuntu, etc):
  223
+
  224
+    sudo apt-get install autoconf
  225
+
  226
+EOM
  227
+            fi
  228
+            exit;;
  229
+
  230
+        automake)
  231
+            if is_osx; then
  232
+                cat >&2 << EOM
  233
+It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script.
  234
+
  235
+Please go to http://developer.apple.com/technologies/xcode.html, create a free
  236
+Apple developer account and download Xcode and install it. After installation,
  237
+install the "Command Line Tools" under "Preferences... > Downloads > Components".
  238
+
  239
+Note: The Command Line Tools for Xcode 4.3 are missing essential build tools.
  240
+You can download and install $BINARY with the following commands:
  241
+
  242
+    curl -O http://mirrors.kernel.org/gnu/automake/automake-1.11.tar.gz
  243
+    tar xzvf automake-1.11.tar.gz 
  244
+    cd automake-1.11
  245
+    ./configure --prefix=/usr/local
  246
+    make
  247
+    sudo make install
184 248
 
185 249
 EOM
186 250
             else
@@ -200,7 +264,19 @@ EOM
200 264
 It seems you are missing Xcode from Apple ("$BINARY"), which is required to run this script.
201 265
 
202 266
 Please go to http://developer.apple.com/technologies/xcode.html, create a free
203  
-Apple developer account and download Xcode and install it.
  267
+Apple developer account and download Xcode and install it. After installation,
  268
+install the "Command Line Tools" under "Preferences... > Downloads > Components".
  269
+
  270
+Note: The Command Line Tools for Xcode 4.3 are missing essential build tools.
  271
+You can download and install $BINARY with the following commands:
  272
+
  273
+    curl -O http://mirrors.kernel.org/gnu/libtool/libtool-2.4.tar.gz
  274
+    tar xzvf libtool-2.4.tar.gz
  275
+    cd libtool-2.4
  276
+    ./configure --prefix=/usr/local
  277
+    make
  278
+    sudo make install
  279
+    sudo ln -s /usr/local/bin/libtoolize /usr/local/bin/glibtoolize
204 280
 
205 281
 EOM
206 282
             else
@@ -220,7 +296,8 @@ EOM
220 296
 It seems you are missing Xcode from Apple ("mvn"), which is required to run this script.
221 297
 
222 298
 Please go to http://developer.apple.com/technologies/xcode.html, create a free
223  
-Apple developer account and download Xcode and install it.
  299
+Apple developer account and download Xcode and install it. After installation,
  300
+install the "Command Line Tools" under "Preferences... > Downloads > Components".
224 301
 
225 302
 EOM
226 303
             else
@@ -240,7 +317,8 @@ EOM
240 317
 It seems you are missing Xcode from Apple ("javac"), which is required to run this script.
241 318
 
242 319
 Please go to http://developer.apple.com/technologies/xcode.html, create a free
243  
-Apple developer account and download Xcode and install it.
  320
+Apple developer account and download Xcode and install it. After installation,
  321
+install the "Command Line Tools" under "Preferences... > Downloads > Components".
244 322
 
245 323
 EOM
246 324
             else
@@ -320,22 +398,23 @@ ANT=`check_binary ant`
320 398
 GCC=`check_binary gcc`
321 399
 GPP=`check_binary g++`
322 400
 JAVAC=`check_binary javac`
  401
+AUTOMAKE=`check_binary automake`
  402
+AUTOCONF=`check_binary autoconf`
323 403
 LIBTOOL=`check_binary libtool`
324 404
 MAKE=`check_binary make`
325 405
 MVN=`check_binary mvn`
  406
+PATCH=`check_binary patch`
326 407
 SED=`check_binary sed`
327 408
 TAR=`check_binary tar`
328 409
 YASM=`check_binary yasm`
329 410
 UNZIP=`check_binary unzip`
330 411
 
331 412
 if is_osx; then
332  
-    GCC2=`check_binary gcc-4.2`
  413
+    GCC2=$GCC
333 414
     HDID=`check_binary hdid`
334 415
     HDIUTIL=`check_binary hdiutil`
335 416
 else
336 417
     GCC2=$GCC
337  
-    AUTOMAKE=`check_binary automake`
338  
-    AUTOCONF=`check_binary autoconf`
339 418
     STRIP=`check_binary strip`
340 419
     PKG_CONFIG=`check_binary pkg-config`
341 420
 fi
@@ -387,14 +466,18 @@ exit_on_error() {
387 466
 initialize() {
388 467
     WORKDIR=`pwd`
389 468
 
  469
+    # Avoid having ".." in the path reference to avoid problems with symlinks
  470
+    cd ..
  471
+    PARENTDIR=`pwd`
  472
+
390 473
     # Directories for statically compiled libraries
391  
-    BUILD="$WORKDIR/../target/bin-tools/build"
392  
-    SRC="$WORKDIR/../target/bin-tools/src"
393  
-    TARGET="$WORKDIR/../target/bin-tools/target"
  474
+    BUILD="$PARENTDIR/target/bin-tools/build"
  475
+    SRC="$PARENTDIR/target/bin-tools/src"
  476
+    TARGET="$PARENTDIR/target/bin-tools/target"
394 477
     createdir "$BUILD"
395 478
     createdir "$SRC"
396 479
     createdir "$TARGET"
397  
-    
  480
+
398 481
     if is_linux; then    
399 482
       THREADS=$(cat /proc/cpuinfo | grep processor | wc -l)
400 483
     fi
@@ -445,13 +528,34 @@ set_flags() {
445 528
     if is_osx; then
446 529
         # Minimum OSX version as target
447 530
         OSX_VERSION=10.6
  531
+
  532
+        if [ -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs ]; then
  533
+            # Xcode 4.3+
  534
+            SDK_PATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs"
  535
+        else
  536
+            # Xcode < 4.2
  537
+            if [ -d /Developer/SDKs ]; then
  538
+                SDK_PATH="/Developer/SDKs"
  539
+            else
  540
+                cat << EOM
  541
+It seems you are missing Xcode.
  542
+
  543
+Please go to http://developer.apple.com/technologies/xcode.html, create a free
  544
+Apple developer account and download Xcode and install it. After installation,
  545
+install the "Command Line Tools" under "Preferences... > Downloads > Components".
  546
+
  547
+EOM
  548
+                exit;
  549
+            fi
  550
+	fi
  551
+
448 552
         CFLAGS="$CFLAGS -mmacosx-version-min=${OSX_VERSION}"
449  
-        CFLAGS="$CFLAGS -isystem /Developer/SDKs/MacOSX${OSX_VERSION}.sdk"
  553
+        CFLAGS="$CFLAGS -isystem ${SDK_PATH}/MacOSX${OSX_VERSION}.sdk"
450 554
         CXXFLAGS="$CXXFLAGS -mmacosx-version-min=${OSX_VERSION}"
451  
-        CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX${OSX_VERSION}.sdk"
  555
+        CXXFLAGS="$CXXFLAGS -isysroot ${SDK_PATH}/MacOSX${OSX_VERSION}.sdk"
452 556
         LDFLAGS="$LDFLAGS -mmacosx-version-min=${OSX_VERSION}"
453  
-        LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX${OSX_VERSION}.sdk"
454  
-        LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX${OSX_VERSION}.sdk"
  557
+        LDFLAGS="$LDFLAGS -isysroot ${SDK_PATH}/MacOSX${OSX_VERSION}.sdk"
  558
+        LDFLAGS="$LDFLAGS -Wl,-syslibroot,${SDK_PATH}/MacOSX${OSX_VERSION}.sdk"
455 559
     fi
456 560
 
457 561
     if [ "$1" != "" ]; then
@@ -671,7 +775,7 @@ build_ffmpeg() {
671 775
     fi
672 776
 
673 777
     # Apply SB patch that was used for the Windows version
674  
-    patch -p1 < ./../../../../contrib/mplayer-r34866-SB31-ffmpeg-58c25724.patch
  778
+    $PATCH -p1 < $WORKDIR/mplayer-r34866-SB31-ffmpeg-58c25724.patch
675 779
     exit_on_error
676 780
 
677 781
     $MAKE -j$THREADS
@@ -1229,7 +1333,7 @@ build_mplayer() {
1229 1333
         # See https://svn.macports.org/ticket/30279
1230 1334
 
1231 1335
         # Apply SB patch that was used for the Windows version
1232  
-        patch -p0 < ./../../../../contrib/mplayer-r34866-SB31.patch
  1336
+        $PATCH -p0 < $WORKDIR/mplayer-r34866-SB31.patch
1233 1337
         exit_on_error
1234 1338
 
1235 1339
         # Theora and vorbis support seems broken in this revision, disable it for now
@@ -1248,11 +1352,11 @@ build_mplayer() {
1248 1352
         export LDFLAGS="$LDFLAGS -O4 -fomit-frame-pointer -pipe"
1249 1353
 
1250 1354
         # Apply SB patch that was used for the Windows version
1251  
-        patch -p0 < ./../../../../contrib/mplayer-r34866-SB31.patch
  1355
+        $PATCH -p0 < $WORKDIR/mplayer-r34866-SB31.patch
1252 1356
         exit_on_error
1253 1357
 
1254 1358
         # mplayer configure patch for r34587-SB22
1255  
-        patch -p0 < ./../../../../contrib/mplayer-r34587-configure.patch
  1359
+        $PATCH -p0 < $WORKDIR/mplayer-r34587-configure.patch
1256 1360
         exit_on_error
1257 1361
 
1258 1362
         # libvorbis support seems broken in this revision, disable it for now
@@ -1379,9 +1483,11 @@ build_tsmuxer() {
1379 1483
         if [ ! -d tsMuxeR_${VERSION_TSMUXER} ]; then
1380 1484
             createdir tsMuxeR_${VERSION_TSMUXER}
1381 1485
             # Nothing to build. Just open the disk image, copy the binary and detach the disk image
1382  
-            $HDID $SRC/tsMuxeR__${VERSION_TSMUXER}.dmg
  1486
+            $HDID $SRC/tsMuxeR_${VERSION_TSMUXER}.dmg
1383 1487
             exit_on_error
  1488
+
1384 1489
             cp -f /Volumes/tsMuxeR/tsMuxerGUI.app/Contents/MacOS/tsMuxeR tsMuxeR_${VERSION_TSMUXER}/tsMuxeR
  1490
+            exit_on_error
1385 1491
             $HDIUTIL detach /Volumes/tsMuxeR
1386 1492
         fi
1387 1493
     else
@@ -1546,7 +1652,7 @@ fi
1546 1652
 initialize
1547 1653
 
1548 1654
 # Build static libraries to link against
1549  
-# build_yasm # for systems where YASM version is below 1.0.0
  1655
+#build_yasm # for systems where YASM version is below 1.0.0
1550 1656
 build_zlib
1551 1657
 build_bzip2
1552 1658
 build_expat
@@ -1566,6 +1672,7 @@ build_libdv
1566 1672
 build_libmad
1567 1673
 build_libzen
1568 1674
 # Note: libmediainfo requires libzen to build
  1675
+# FIXME: problem building
1569 1676
 build_libmediainfo
1570 1677
 build_libpng
1571 1678
 build_libogg
2  contrib/download-pms-binaries-source.sh
@@ -711,7 +711,7 @@ download_tsmuxer() {
711 711
 
712 712
     if is_osx; then
713 713
         if [ ! -f tsMuxeR-${VERSION_TSMUXER}.dmg ]; then
714  
-            $CURL --referer "http://www.videohelp.com/tools/tsMuxeR" -L http://www.videohelp.com/download/tsMuxeR__${VERSION_TSMUXER}.dmg > tsMuxeR__${VERSION_TSMUXER}.dmg
  714
+            $CURL --referer "http://www.videohelp.com/tools/tsMuxeR" -L http://www.videohelp.com/download/tsMuxeR_${VERSION_TSMUXER}.dmg > tsMuxeR_${VERSION_TSMUXER}.dmg
715 715
             exit_on_error
716 716
         fi
717 717
     else

0 notes on commit 8bbf735

Please sign in to comment.
Something went wrong with that request. Please try again.