Update of /cvsroot/hugin/hugin/mac/Notes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28571 Added Files: libtiff.sh SetEnv-universal.txt libpng.sh enblend.sh pano12.sh wxconfig.sh clens.sh libjpeg.sh SetEnv-ppc.txt Log Message: mac: various compilation changes --- NEW FILE: wxconfig.sh --- # ------------------ # libwx # ------------------ # prepare # export REPOSITORYDIR="" \ # ARCHS="ppc i386" \ # ppcMACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # ppcONLYARG="-mcpu=G3 -mtune=G4" \ # i386ONLYARG="-mfpmath=sse -msse2 -mtune=pentium-m -ftree-vectorize" \ # ppc64ONLYARG="-mcpu=G5 -mtune=G5 -ftree-vectorize" \ # OTHERARGs=""; # init let NUMARCH="0" for i in $ARCHS do NUMARCH=$(($NUMARCH + 1)) done mkdir -p "$REPOSITORYDIR/bin"; mkdir -p "$REPOSITORYDIR/lib"; mkdir -p "$REPOSITORYDIR/include"; # compile for ARCH in $ARCHS do mkdir -p "$REPOSITORYDIR/arch/$ARCH/bin"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/lib"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/include"; ARCHARGs="" MACSDKDIR="" if [ $ARCH = "i386" -o $ARCH = "i686" ] then TARGET="i386-apple-darwin8" MACSDKDIR=$i386MACSDKDIR ARCHARGs="$i386ONLYARG" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then TARGET="powerpc-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppcONLYARG" elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ] then TARGET="powerpc64-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppc64ONLYARG" fi env CFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O2 -dead_strip" \ CXXFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O2 -dead_strip" \ CPPFLAGS="-I$REPOSITORYDIR/include" \ LDFLAGS="-L$REPOSITORYDIR/lib -dead_strip -prebind" \ NEXT_ROOT="$MACSDKDIR" \ ../configure --prefix="$REPOSITORYDIR" --disable-dependency-tracking \ --host="$TARGET" --exec-prefix=$REPOSITORYDIR/arch/$ARCH \ --disable-debug --disable-shared --enable-monolithic --enable-unicode --with-opengl; make clean; make install; done # merge libwx for libname in lib/libwx_macu-2.6 lib/libwx_macu_gl-2.6 lib/libwxexpat-2.6 lib/libwxregexu-2.6 do LIPOARGs="" for ARCH in $ARCHS do if [ $ARCH = "i386" -o $ARCH = "i686" ] then liba="$libname-i386-apple-darwin8.a" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then liba="$libname.a" fi if [ $NUMARCH -eq 1 ] then mv "$REPOSITORYDIR/arch/$ARCH/$liba" "$REPOSITORYDIR/$libname.a"; ranlib "$REPOSITORYDIR/$libname.a"; continue fi LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$liba" done if [ $NUMARCH -gt 1 ] then lipo $LIPOARGs -create -output "$REPOSITORYDIR/$libname.a"; ranlib "$REPOSITORYDIR/$libname.a"; fi done # merge setup.h for confname in "wx/setup.h" do wxmacconf="lib/wx/include/mac-unicode-release-static-2.6/$confname" echo "" > "$REPOSITORYDIR/$wxmacconf"; if [ $NUMARCH -eq 1 ] then ARCH=$ARCHS if [ $ARCH = "i386" -o $ARCH = "i686" ] then conf_h="lib/wx/include/i386-apple-darwin8-mac-unicode-release-static-2.6/$confname" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then conf_h="$wxmacconf" fi mkdir -p `dirname $REPOSITORYDIR/$wxmacconf`; mv "$REPOSITORYDIR/arch/$ARCH/$conf_h" "$REPOSITORYDIR/$wxmacconf"; continue fi for ARCH in $ARCHS do if [ $ARCH = "i386" -o $ARCH = "i686" ] then conf_h="lib/wx/include/i386-apple-darwin8-mac-unicode-release-static-2.6/$confname" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then conf_h="$wxmacconf" fi mkdir -p `dirname $REPOSITORYDIR/$wxmacconf`; if [ $ARCH = "i386" -o $ARCH = "i686" ] then echo "#if defined(__i386__)" >> "$REPOSITORYDIR/$wxmacconf"; echo "" >> "$REPOSITORYDIR/$wxmacconf"; cat "$REPOSITORYDIR/arch/$ARCH/$conf_h" >> "$REPOSITORYDIR/$wxmacconf"; echo "" >> "$REPOSITORYDIR/$wxmacconf"; echo "#endif" >> "$REPOSITORYDIR/$wxmacconf"; elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then echo "#if defined(__ppc__) || defined(__ppc64__)" >> "$REPOSITORYDIR/$wxmacconf"; echo "" >> "$REPOSITORYDIR/$wxmacconf"; cat "$REPOSITORYDIR/arch/$ARCH/$conf_h" >> "$REPOSITORYDIR/$wxmacconf"; echo "" >> "$REPOSITORYDIR/$wxmacconf"; echo "#endif" >> "$REPOSITORYDIR/$wxmacconf"; fi done done --- NEW FILE: libpng.sh --- # ------------------ # libpng # ------------------ # prepare # export REPOSITORYDIR="" \ # ARCHS="ppc i386" \ # ppcMACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # ppcONLYARG="-mcpu=G3 -mtune=G4" \ # i386ONLYARG="-mfpmath=sse -msse2 -mtune=pentium-m -ftree-vectorize" \ # ppc64ONLYARG="-mcpu=G5 -mtune=G5 -ftree-vectorize" \ # OTHERARGs=""; # init let NUMARCH="0" for i in $ARCHS do NUMARCH=$(($NUMARCH + 1)) done mkdir -p "$REPOSITORYDIR/bin"; mkdir -p "$REPOSITORYDIR/lib"; mkdir -p "$REPOSITORYDIR/include"; # compile for ARCH in $ARCHS do mkdir -p "$REPOSITORYDIR/arch/$ARCH/bin"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/lib"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/include"; ARCHARGs="" MACSDKDIR="" if [ $ARCH = "i386" -o $ARCH = "i686" ] then TARGET="i386-apple-darwin8" MACSDKDIR=$i386MACSDKDIR ARCHARGs="$i386ONLYARG" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then TARGET="powerpc-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppcONLYARG" elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ] then TARGET="powerpc64-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppc64ONLYARG" fi make clean; make install-static \ prefix="$REPOSITORYDIR" \ ZLIBLIB="$MACSDKDIR/usr/lib" \ ZLIBINC="$MACSDKDIR/usr/include" \ CFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O3 -funroll-loops -dead_strip" \ LDFLAGS="-L$REPOSITORYDIR/lib -L. -L$ZLIBLIB -lpng12 -lz" \ NEXT_ROOT="$MACSDKDIR" \ LIBPATH="$REPOSITORYDIR/arch/$ARCH/lib" \ BINPATH="$REPOSITORYDIR/arch/$ARCH/bin"; done # merge libpng for liba in lib/libpng12.a do if [ $NUMARCH -eq 1 ] then mv "$REPOSITORYDIR/arch/$ARCHS/$liba" "$REPOSITORYDIR/$liba"; ranlib "$REPOSITORYDIR/$liba"; continue fi LIPOARGs="" for ARCH in $ARCHS do LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$liba" done lipo $LIPOARGs -create -output "$REPOSITORYDIR/$liba"; ranlib "$REPOSITORYDIR/$liba"; done cd $REPOSITORYDIR/lib; ln -s libpng12.a libpng.a; --- NEW FILE: libjpeg.sh --- # ------------------ # libjpeg # ------------------ # prepare # export REPOSITORYDIR="" \ # ARCHS="ppc i386" \ # ppcMACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # ppcONLYARG="-mcpu=G3 -mtune=G4" \ # i386ONLYARG="-mfpmath=sse -msse2 -mtune=pentium-m -ftree-vectorize" \ # ppc64ONLYARG="-mcpu=G5 -mtune=G5 -ftree-vectorize" \ # OTHERARGs=""; # init let NUMARCH="0" for i in $ARCHS do NUMARCH=$(($NUMARCH + 1)) done mkdir -p "$REPOSITORYDIR/bin"; mkdir -p "$REPOSITORYDIR/lib"; mkdir -p "$REPOSITORYDIR/include"; # compile for ARCH in $ARCHS do mkdir -p "$REPOSITORYDIR/arch/$ARCH/bin"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/lib"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/include"; ARCHARGs="" MACSDKDIR="" if [ $ARCH = "i386" -o $ARCH = "i686" ] then TARGET="i386-apple-darwin8" MACSDKDIR=$i386MACSDKDIR ARCHARGs="$i386ONLYARG" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then TARGET="powerpc-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppcONLYARG" elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ] then TARGET="powerpc64-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppc64ONLYARG" fi env CFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O3 -funroll-loops -dead_strip" \ CXXFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O3 -funroll-loops -dead_strip" \ CPPFLAGS="-I$REPOSITORYDIR/include" \ LDFLAGS="-L$REPOSITORYDIR/lib -dead_strip -prebind" \ NEXT_ROOT="$MACSDKDIR" \ ./configure --prefix="$REPOSITORYDIR" --disable-dependency-tracking \ --host="$TARGET" --exec-prefix=$REPOSITORYDIR/arch/$ARCH \ --enable-static --disable-shared; make clean; make install-lib; done # merge libjpeg for liba in lib/libjpeg.a do if [ $NUMARCH -eq 1 ] then mv "$REPOSITORYDIR/arch/$ARCHS/$liba" "$REPOSITORYDIR/$liba"; ranlib "$REPOSITORYDIR/$liba"; continue fi LIPOARGs="" for ARCH in $ARCHS do LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$liba" done lipo $LIPOARGs -create -output "$REPOSITORYDIR/$liba"; ranlib "$REPOSITORYDIR/$liba"; done --- NEW FILE: SetEnv-ppc.txt --- # PPC: export \ REPOSITORYDIR="/Users/myname/dev/hugin/ExternalPrograms/Repository-ppc" \ ARCHS="ppc" \ ppcMACSDKDIR="/Developer/SDKs/MacOSX10.3.9.sdk" \ i386MACSDKDIR="" \ ppcONLYARG="-mcpu=G3 -mtune=G3" \ i386ONLYARG="" \ ppc64ONLYARG="" \ OTHERARGs=""; --- NEW FILE: clens.sh --- # ------------------ # enblend # ------------------ # prepare # export REPOSITORYDIR="" \ # ARCHS="ppc i386" \ # ppcMACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # ppcONLYARG="-mcpu=G3 -mtune=G4" \ # i386ONLYARG="-mfpmath=sse -msse2 -mtune=pentium-m -ftree-vectorize" \ # ppc64ONLYARG="-mcpu=G5 -mtune=G5 -ftree-vectorize" \ # OTHERARGs=""; # init let NUMARCH="0" for i in $ARCHS do NUMARCH=$(($NUMARCH + 1)) done mkdir -p "$REPOSITORYDIR/bin"; mkdir -p "$REPOSITORYDIR/lib"; mkdir -p "$REPOSITORYDIR/include"; # compile for ARCH in $ARCHS do mkdir -p "$REPOSITORYDIR/arch/$ARCH/bin"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/lib"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/include"; ARCHARGs="" MACSDKDIR="" if [ $ARCH = "i386" -o $ARCH = "i686" ] then TARGET="i386-apple-darwin8" MACSDKDIR=$i386MACSDKDIR ARCHARGs="$i386ONLYARG" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then TARGET="powerpc-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppcONLYARG" elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ] then TARGET="powerpc64-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppc64ONLYARG" fi env CFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O2 -dead_strip" \ CXXFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O2 -dead_strip" \ CPPFLAGS="-I$REPOSITORYDIR/include" \ LDFLAGS="-L$REPOSITORYDIR/lib -dead_strip -prebind" \ NEXT_ROOT="$MACSDKDIR" \ ./configure --prefix="$REPOSITORYDIR" --disable-dependency-tracking \ --host="$TARGET" --exec-prefix=$REPOSITORYDIR/arch/$ARCH \ ; make clean; make install \ prefix="$REPOSITORYDIR" \ ZLIBLIB="$MACSDKDIR/usr/lib" \ ZLIBINC="$MACSDKDIR/usr/include" \ CFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O3 -funroll-loops -dead_strip" \ LDFLAGS="-L$REPOSITORYDIR/lib -L. -L$ZLIBLIB -lpng12 -lz" \ NEXT_ROOT="$MACSDKDIR" \ LIBPATH="$REPOSITORYDIR/arch/$ARCH/lib" \ BINPATH="$REPOSITORYDIR/arch/$ARCH/bin"; done # merge execs for program in bin/clens do if [ $NUMARCH -eq 1 ] then mv "$REPOSITORYDIR/arch/$ARCHS/$program" "$REPOSITORYDIR/$program"; strip "$REPOSITORYDIR/$program"; continue fi LIPOARGs="" for ARCH in $ARCHS do LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$program" done lipo $LIPOARGs -create -output "$REPOSITORYDIR/$program"; strip "$REPOSITORYDIR/$program"; done --- NEW FILE: pano12.sh --- # ------------------ # pano12 # ------------------ # prepare # export REPOSITORYDIR="" \ # ARCHS="ppc i386" \ # ppcMACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # ppcONLYARG="-mcpu=G3 -mtune=G4" \ # i386ONLYARG="-mfpmath=sse -msse2 -mtune=pentium-m -ftree-vectorize" \ # ppc64ONLYARG="-mcpu=G5 -mtune=G5 -ftree-vectorize" \ # OTHERARGs=""; # init let NUMARCH="0" for i in $ARCHS do NUMARCH=$(($NUMARCH + 1)) done mkdir -p "$REPOSITORYDIR/bin"; mkdir -p "$REPOSITORYDIR/lib"; mkdir -p "$REPOSITORYDIR/include"; # compile for ARCH in $ARCHS do mkdir -p "$REPOSITORYDIR/arch/$ARCH/bin"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/lib"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/include"; ARCHARGs="" MACSDKDIR="" if [ $ARCH = "i386" -o $ARCH = "i686" ] then TARGET="i386-apple-darwin8" MACSDKDIR=$i386MACSDKDIR ARCHARGs="$i386ONLYARG" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then TARGET="powerpc-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppcONLYARG" elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ] then TARGET="powerpc64-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppc64ONLYARG" fi env CFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O3 -funroll-loops -gfull -dead_strip" \ CXXFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O3 -funroll-loops -gfull -dead_strip" \ CPPFLAGS="-I$REPOSITORYDIR/include" \ LDFLAGS="-L$REPOSITORYDIR/lib -dead_strip -prebind" \ NEXT_ROOT="$MACSDKDIR" \ ./configure --prefix="$REPOSITORYDIR" --disable-dependency-tracking \ --host="$TARGET" --exec-prefix=$REPOSITORYDIR/arch/$ARCH \ --with-java=$MACSDKDIR/System/Library/Frameworks/JavaVM.framework/Versions/Current \ --with-zlib=$MACSDKDIR/usr \ --with-png=$REPOSITORYDIR \ --with-jpeg=$REPOSITORYDIR \ --with-tiff=$REPOSITORYDIR \ --disable-shared; make clean; make install; done # merge libpano12 for liba in lib/libpano12.a do if [ $NUMARCH -eq 1 ] then mv "$REPOSITORYDIR/arch/$ARCHS/$liba" "$REPOSITORYDIR/$liba"; ranlib "$REPOSITORYDIR/$liba"; continue fi LIPOARGs="" for ARCH in $ARCHS do LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$liba" done lipo $LIPOARGs -create -output "$REPOSITORYDIR/$liba"; ranlib "$REPOSITORYDIR/$liba"; done # merge execs for program in bin/PTOptimizer bin/panoinfo do LIPOARGs="" if [ $NUMARCH -eq 1 ] then mv "$REPOSITORYDIR/arch/$ARCHS/$program" "$REPOSITORYDIR/$program"; continue fi for ARCH in $ARCHS do LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$program" done lipo $LIPOARGs -create -output "$REPOSITORYDIR/$program"; done --- NEW FILE: enblend.sh --- # ------------------ # enblend # ------------------ # prepare # export REPOSITORYDIR="" \ # ARCHS="ppc i386" \ # ppcMACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # ppcONLYARG="-mcpu=G3 -mtune=G4" \ # i386ONLYARG="-mfpmath=sse -msse2 -mtune=pentium-m -ftree-vectorize" \ # ppc64ONLYARG="-mcpu=G5 -mtune=G5 -ftree-vectorize" \ # OTHERARGs=""; # init let NUMARCH="0" for i in $ARCHS do NUMARCH=$(($NUMARCH + 1)) done mkdir -p "$REPOSITORYDIR/bin"; mkdir -p "$REPOSITORYDIR/lib"; mkdir -p "$REPOSITORYDIR/include"; # compile for ARCH in $ARCHS do mkdir -p "$REPOSITORYDIR/arch/$ARCH/bin"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/lib"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/include"; ARCHARGs="" MACSDKDIR="" if [ $ARCH = "i386" -o $ARCH = "i686" ] then TARGET="i386-apple-darwin8" MACSDKDIR=$i386MACSDKDIR ARCHARGs="$i386ONLYARG" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then TARGET="powerpc-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppcONLYARG" elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ] then TARGET="powerpc64-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppc64ONLYARG" fi env CFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O2 -dead_strip" \ CXXFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O2 -dead_strip" \ CPPFLAGS="-I$REPOSITORYDIR/include" \ LDFLAGS="-L$REPOSITORYDIR/lib -dead_strip -prebind" \ LIBS="-lz -ljpeg" \ NEXT_ROOT="$MACSDKDIR" \ ./configure --prefix="$REPOSITORYDIR" --disable-dependency-tracking \ --host="$TARGET" --exec-prefix=$REPOSITORYDIR/arch/$ARCH \ ; make clean; make install; done # merge execs for program in bin/enblend do if [ $NUMARCH -eq 1 ] then mv "$REPOSITORYDIR/arch/$ARCHS/$program" "$REPOSITORYDIR/$program"; strip "$REPOSITORYDIR/$program"; continue fi LIPOARGs="" for ARCH in $ARCHS do LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$program" done lipo $LIPOARGs -create -output "$REPOSITORYDIR/$program"; strip "$REPOSITORYDIR/$program"; done --- NEW FILE: SetEnv-universal.txt --- # Universal: export \ REPOSITORYDIR="/Users/myname/dev/hugin/ExternalPrograms/Repository-universal" \ ARCHS="ppc i386" \ ppcMACSDKDIR="/Developer/SDKs/MacOSX10.3.9.sdk" \ i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ ppcONLYARG="-mcpu=G3 -mtune=G4" \ i386ONLYARG="-mfpmath=sse -msse2 -mtune=pentium-m -ftree-vectorize" \ ppc64ONLYARG="" \ OTHERARGs=""; --- NEW FILE: libtiff.sh --- # ------------------ # libtiff # ------------------ # prepare # export REPOSITORYDIR="" \ # ARCHS="ppc i386" \ # ppcMACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # i386MACSDKDIR="/Developer/SDKs/MacOSX10.4u.sdk" \ # ppcONLYARG="-mcpu=G3 -mtune=G4" \ # i386ONLYARG="-mfpmath=sse -msse2 -mtune=pentium-m -ftree-vectorize" \ # ppc64ONLYARG="-mcpu=G5 -mtune=G5 -ftree-vectorize" \ # OTHERARGs=""; # init let NUMARCH="0" for i in $ARCHS do NUMARCH=$(($NUMARCH + 1)) done mkdir -p "$REPOSITORYDIR/bin"; mkdir -p "$REPOSITORYDIR/lib"; mkdir -p "$REPOSITORYDIR/include"; # compile for ARCH in $ARCHS do mkdir -p "$REPOSITORYDIR/arch/$ARCH/bin"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/lib"; mkdir -p "$REPOSITORYDIR/arch/$ARCH/include"; ARCHARGs="" MACSDKDIR="" if [ $ARCH = "i386" -o $ARCH = "i686" ] then TARGET="i386-apple-darwin8" MACSDKDIR=$i386MACSDKDIR ARCHARGs="$i386ONLYARG" elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then TARGET="powerpc-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppcONLYARG" elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ] then TARGET="powerpc64-apple-darwin8" MACSDKDIR=$ppcMACSDKDIR ARCHARGs="$ppc64ONLYARG" fi env CFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O3 -funroll-loops -dead_strip" \ CXXFLAGS="-isysroot $MACSDKDIR -arch $ARCH $ARCHARGs $OTHERARGs -O3 -funroll-loops -dead_strip" \ CPPFLAGS="-I$REPOSITORYDIR/include" \ LDFLAGS="-L$REPOSITORYDIR/lib -dead_strip -prebind" \ NEXT_ROOT="$MACSDKDIR" \ ./configure --prefix="$REPOSITORYDIR" --disable-dependency-tracking \ --host="$TARGET" --exec-prefix=$REPOSITORYDIR/arch/$ARCH \ --disable-shared --with-apple-opengl-framework; make clean; cd ./port; make; cd ../libtiff; make install; cd ../; rm $REPOSITORYDIR/include/tiffconf.h; cp "./libtiff/tiffconf.h" "$REPOSITORYDIR/arch/$ARCH/include/tiffconf.h"; done # merge libtiff for liba in lib/libtiff.a lib/libtiffxx.a do if [ $NUMARCH -eq 1 ] then mv "$REPOSITORYDIR/arch/$ARCHS/$liba" "$REPOSITORYDIR/$liba"; ranlib "$REPOSITORYDIR/$liba"; continue fi LIPOARGs="" for ARCH in $ARCHS do LIPOARGs="$LIPOARGs $REPOSITORYDIR/arch/$ARCH/$liba" done lipo $LIPOARGs -create -output "$REPOSITORYDIR/$liba"; ranlib "$REPOSITORYDIR/$liba"; done # merge config.h for conf_h in include/tiffconf.h do echo "" > "$REPOSITORYDIR/$conf_h"; if [ $NUMARCH -eq 1 ] then mv $REPOSITORYDIR/arch/$ARCHS/$conf_h $REPOSITORYDIR/$conf_h; continue; fi for ARCH in $ARCHS do if [ $ARCH = "i386" -o $ARCH = "i686" ] then echo "#if defined(__i386__)" >> "$REPOSITORYDIR/$conf_h"; echo "" >> "$REPOSITORYDIR/$conf_h"; cat "$REPOSITORYDIR/arch/$ARCH/$conf_h" >> "$REPOSITORYDIR/$conf_h"; echo "" >> "$REPOSITORYDIR/$conf_h"; echo "#endif" >> "$REPOSITORYDIR/$conf_h"; elif [ $ARCH = "ppc" -o $ARCH = "ppc750" -o $ARCH = "ppc7400" ] then echo "#if defined(__ppc__)" >> "$REPOSITORYDIR/$conf_h"; echo "" >> "$REPOSITORYDIR/$conf_h"; cat "$REPOSITORYDIR/arch/$ARCH/$conf_h" >> "$REPOSITORYDIR/$conf_h"; echo "" >> "$REPOSITORYDIR/$conf_h"; echo "#endif" >> "$REPOSITORYDIR/$conf_h"; elif [ $ARCH = "ppc64" -o $ARCH = "ppc970" ] then echo "#if defined(__ppc64__)" >> "$REPOSITORYDIR/$conf_h"; echo "" >> "$REPOSITORYDIR/$conf_h"; cat "$REPOSITORYDIR/arch/$ARCH/$conf_h" >> "$REPOSITORYDIR/$conf_h"; echo "" >> "$REPOSITORYDIR/$conf_h"; echo "#endif" >> "$REPOSITORYDIR/$conf_h"; fi done done |