EDIT: Question for someone who is more knowledgeable about the wiki: What page should I add the steps for compiling Sphere on Linux? I was looking at the Getting Started, Linux section, but I seem to recall the old wiki having instructions for compiling in the past.
ls /usr/lib | grep -i libsdl
nm -D /usr/lib/[what the above command produced] | grep SDL_NumJoysticks
00032900 T SDL_NumJoysticks
Import('base_env COMPILER')env = base_env.Clone()COMPILER.SetupSDL(env)#this is what we want.env.SharedLibrary('unix', Split(""" unix_audio.cpp unix_filesystem.cpp unix_input.cpp unix_network.cpp unix_screenshot.cpp unix_system.cpp unix_sphere_config.cpp unix_time.cpp unix_video.cpp unix_main.cpp """))#this keeps the build working, but the engine executable will be non-functional.env.Library('unix', Split(""" unix_audio.cpp unix_filesystem.cpp unix_input.cpp unix_network.cpp unix_screenshot.cpp unix_system.cpp unix_sphere_config.cpp unix_time.cpp unix_video.cpp unix_main.cpp """))
Then, run `ldd libunix.so` in the same directory.
scons: Reading SConscript files ...os.name: posixUsing compiler: linuxFound sdl-config: /usr/bin/sdl-configUsing subsystem: unixFound sdl-config: /usr/bin/sdl-configFound wx-config: /usr/bin/wx-configFound sdl-config: /usr/bin/sdl-configFound sdl-config: /usr/bin/sdl-configscons: done reading SConscript files.scons: Building targets ...g++ -o source/engine/engine source/engine/SpritesetServer.o source/engine/benchmark.o source/engine/engine.o source/engine/log.o source/engine/map_engine.o source/engine/render.o source/engine/rendersort.o source/engine/parameters.o source/engine/script.o source/engine/sfont.o source/engine/sfxr.o source/engine/simage.o source/engine/smap.o source/engine/sphere.o source/engine/ssfxr.o source/engine/sspriteset.o source/engine/swindowstyle.o source/engine/PlayerConfig.o -Lsource/common -Lsource/particle_engine -L/usr/lib/i386-linux-gnu -Lsource/engine/unix -lcommon -laudiere -lcorona -lmng -ljpeg -lz -lparticle_engine -lSDL -lunix -ldl -ljsg++ -o source/video_unix/sdl32/libsdl32.so -shared source/video_unix/sdl32/sdl32.os source/video_unix/sdl32/configfile.os source/video_unix/sdl32/defaultfile.os source/video_unix/sdl32/defaultfilesystem.os -lzg++ -o source/util/spktest/spktest source/util/spktest/spktest.o -Lsource/common -lz -lcommon -lcoronaInstall file: "source/util/tst2rts/tst2rts" as "build/linux/util/tst2rts"g++ -o source/util/vmap2rmp/vmap2rmp source/util/vmap2rmp/vmap2rmp.o -Lsource/common -lz -lcommon -lcoronaInstall file: "source/util/vsp2rts/vsp2rts" as "build/linux/util/vsp2rts"Install file: "source/video_unix/sdl32/libsdl32.so" as "build/linux/system/video/sdl32.so"source/common/libcommon.a(PackageFile.o): In function `CPackageFile::Close()':PackageFile.cpp:(.text+0x38): undefined reference to `inflateEnd'source/common/libcommon.a(PackageFile.o): In function `CPackageFile::Read(void*, int)':PackageFile.cpp:(.text+0x165): undefined reference to `inflate'source/common/libcommon.a(PackageFile.o): In function `CPackageFile::Seek(int)':PackageFile.cpp:(.text+0x395): undefined reference to `inflateEnd'PackageFile.cpp:(.text+0x3d8): undefined reference to `inflateInit_'source/common/libcommon.a(PackageFile.o): In function `CPackageFile::CPackageFile(_IO_FILE*, int, int, int)':PackageFile.cpp:(.text+0x517): undefined reference to `inflateInit_'collect2: error: ld returned 1 exit statusscons: *** [source/util/spktest/spktest] Error 1scons: building terminated because of errors.
# common optionsbase_env.Append(CXXFLAGS = ['-DUNIX'])#newbase_env.Prepend(LINKFLAGS ' -lz ')base_env.Append(LINKFLAGS ' -lz ')
scons: Reading SConscript files ... File "/home/vincent/src/sphere/sphere/SConstruct", line 134 base_env.Prepend(LINKFLAGS ' -lz ') ^SyntaxError: invalid syntax
base_env.Prepend(LINKFLAGS = ' -lz ')base_env.Append(LINKFLAGS = ' -lz ')
scons: Reading SConscript files ...os.name: posixUsing compiler: linuxFound sdl-config: /usr/bin/sdl-configUsing subsystem: unixFound sdl-config: /usr/bin/sdl-configFound wx-config: /usr/bin/wx-configFound sdl-config: /usr/bin/sdl-configFound sdl-config: /usr/bin/sdl-configscons: done reading SConscript files.scons: Building targets ...g++ -o source/util/spktest/spktest -lz -lz source/util/spktest/spktest.o -Lsource/common -lz -lcommon -lcoronasource/common/libcommon.a(PackageFile.o): In function `CPackageFile::Close()':PackageFile.cpp:(.text+0x38): undefined reference to `inflateEnd'source/common/libcommon.a(PackageFile.o): In function `CPackageFile::Read(void*, int)':PackageFile.cpp:(.text+0x165): undefined reference to `inflate'source/common/libcommon.a(PackageFile.o): In function `CPackageFile::Seek(int)':PackageFile.cpp:(.text+0x395): undefined reference to `inflateEnd'PackageFile.cpp:(.text+0x3d8): undefined reference to `inflateInit_'source/common/libcommon.a(PackageFile.o): In function `CPackageFile::CPackageFile(_IO_FILE*, int, int, int)':PackageFile.cpp:(.text+0x517): undefined reference to `inflateInit_'collect2: error: ld returned 1 exit statusscons: *** [source/util/spktest/spktest] Error 1scons: building terminated because of errors.