Skip to content

Instantly share code, notes, and snippets.

@armadsen
Created February 15, 2013 19:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save armadsen/4962956 to your computer and use it in GitHub Desktop.
Save armadsen/4962956 to your computer and use it in GitHub Desktop.
Quickly thrown together script to build libFLAC as a 64/32-bit universal binary on Mac OS X 10.8.
#!/usr/bin/env bash
# Put this script in the libFLAC source directory, and make sure it's executable (chmod +x BuildLibFlac.sh), then run it (./BuildLibFLAC.sh)
# Note that this was written to be used on 10.8 with Xcode 4.6 and FLAC 1.2.1. It may/will need to be changed for future versions of the OS, tools, and/or FLAC
env CFLAGS="-arch x86_64" CPPFLAGS="-arch x86_64" LDFLAGS="-arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.5" ./configure --disable-asm-optimizations --enable-static --disable-shared --disable-ogg
make clean; make
cp src/libFLAC/.libs/libFLAC.a ./libFLAC64.a
make clean;
env CFLAGS="-arch i386" CPPFLAGS="-arch i386" LDFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -mmacosx-version-min=10.5" ./configure --disable-asm-optimizations --enable-static --disable-shared --disable-ogg
make clean; make
mv src/libFLAC/.libs/libFLAC.a ./libFLAC32.a
lipo libFLAC32.a libFLAC64.a -create -output libFLAC.a
mv libFLAC.a src/libFLAC/.libs/libFLAC.a
rm libFLAC32.a libFLAC64.a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment