--- irrlamb/SConstruct 2007-07-09 13:04:26.000000000 +0200 +++ irrlamb/SConstruct 2007-07-09 16:11:39.000000000 +0200 @@ -8,6 +8,10 @@ # Create the environment env = Environment() +opts = Options() +opts.Add(BoolOption('USE_INTERNAL_LIBS', 'Use precompiled libs shipped with our tarball (only x86)', "yes")) +opts.Update(env) + # Get the source files SOURCES = glob.glob("src/*.cpp") + glob.glob("src/tinyxml/*.cpp") + glob.glob("src/objects/*.cpp") + glob.glob("src/engine/*.cpp") @@ -18,6 +22,10 @@ else: env.Append(CCFLAGS=Split(" -O3 -DNDEBUG")) +# Linker flags +if os.environ.has_key("LDFLAGS"): + env.Append(LINKFLAGS=os.environ["LDFLAGS"]) + # Detect lua-5.1 name lua_name = "lua" lua_cpppath = "/usr/include" @@ -28,12 +36,17 @@ break # Paths -env.Append(CPPPATH=Split("./libraries/include ./libraries/include/bullet " + lua_cpppath )) -env.Append(LIBPATH="./libraries/lib") +env.Append(CPPPATH=lua_cpppath) +if env["USE_INTERNAL_LIBS"]: + env.Append(CPPPATH=Split("./libraries/include ./libraries/include/bullet " )) + env.Append(LIBPATH="./libraries/lib") +else: + env.Append(CPPPATH=Split("/usr/include/irrlicht /usr/include/bullet /usr/local/include/irrlicht /usr/local/include/bullet " )) # Libraries env.Append(LIBS=Split("GL GLU Irrlicht Xxf86vm Xext X11 bulletdynamics bulletcollision bulletmath audiere libboost_filesystem " + lua_name)) +if not env["USE_INTERNAL_LIBS"]: + env.Append(LIBS=Split("jpeg png")) # Build the program irrlamb = env.Program("irrlamb", SOURCES) -