Skip to content

Instantly share code, notes, and snippets.

@jrabbit
Created August 3, 2010 23:20
Show Gist options
  • Save jrabbit/507352 to your computer and use it in GitHub Desktop.
Save jrabbit/507352 to your computer and use it in GitHub Desktop.
Quick and dirty script to set SDL env for Alien::SDL
#!/usr/bin/env python
from subprocess import *
import os
sdlconf = Popen(['sdl-config', '--prefix'], stdout=PIPE).communicate()[0]
pkgconf = Popen(['pkg-config','sdl', '--libs'], stdout=PIPE).communicate()[0]
if sdlconf:
prefix = sdlconf
elif pkgconf:
prefix = pkgconf.split()[0].split('/')[1] #/sw or /opt
SDL_INC = "%s/include" % prefix
SDL_LIB = "%s/lib" % prefix
os.system("export SDL_INC=%s") % SDL_INC
os.system("export SDL_LIB=%s") % SDL_LIB
#lipo -info /sw/lib/libSDL.dylib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment