Skip to content
Snippets Groups Projects
build-cmd.sh 2.36 KiB
Newer Older
# turn on verbose debugging output for parabuild logs.
set -x
# make errors fatal
set -e

ZLIB_VERSION="1.2.5"
if [ "$OSTYPE" = "cygwin" ] ; then
    export AUTOBUILD="$(cygpath -u $AUTOBUILD)"
fi

# load autbuild provided shell functions and variables
set +x
eval "$("$AUTOBUILD" source_environment)"
stage="$(pwd)/stage"
pushd "$ZLIB_SOURCE_DIR"
            load_vsvars
            
            pushd contrib/masmx86
                ./bld_ml32.bat
            popd
            
            build_sln "contrib/vstudio/vc10/zlibvc.sln" "Debug|Win32" "zlibstat"
            build_sln "contrib/vstudio/vc10/zlibvc.sln" "Release|Win32" "zlibstat"
            mkdir -p "$stage/lib/debug"
            mkdir -p "$stage/lib/release"
            cp "contrib/vstudio/vc10/x86/ZlibStatDebug/zlibstat.lib" \
                "$stage/lib/debug/zlibd.lib"
            cp "contrib/vstudio/vc10/x86/ZlibStatRelease/zlibstat.lib" \
                "$stage/lib/release/zlib.lib"
Alain Linden's avatar
Alain Linden committed
            mkdir -p "$stage/include/zlib"
            cp {zlib.h,zconf.h} "$stage/include/zlib"
            opts='-arch i386 -iwithsysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5'
            export CFLAGS="$opts"
            export CXXFLAGS="$opts"
            export LDFLAGS="$opts"
            ./configure --prefix="$stage"
            mkdir -p "$stage/include/zlib"
            mv "$stage/include/"*.h "$stage/include/zlib/"
Dave Huseby's avatar
Dave Huseby committed
			# do release build
            CFLAGS="-m32 -O2" CXXFLAGS="-m32 -O2" ./configure --prefix="$stage" --includedir="$stage/include/zlib" --libdir="$stage/lib/release"
            make
            make install

			# clean the build artifacts
			make distclean

			# do debug build
            CFLAGS="-m32 -O0 -gstabs+" CXXFLAGS="-m32 -O0 -gstabs+" ./configure --prefix="$stage" --includedir="$stage/include/zlib" --libdir="$stage/lib/debug"
Andrew de Laix's avatar
Andrew de Laix committed

Dave Huseby's avatar
Dave Huseby committed
			# fix the names of the debug library files
			for f in `ls $stage/lib/debug/libz*`
			do
				mv ${f} ${f/libz/libz_debug}
			done
    mkdir -p "$stage/LICENSES"
    tail -n 31 README > "$stage/LICENSES/zlib.txt"
popd