SCons recipe: pass -D_X11 if X server headers are found.

This commit is contained in:
Sergey Popov 2008-06-05 20:41:16 +00:00
parent 8e02b1db11
commit 12376d9f61
2 changed files with 9 additions and 6 deletions

View file

@ -170,10 +170,10 @@ if env["prereqs"]:
conf.CheckSDL("SDL_image", require_version = '1.2.0') and \
conf.CheckOgg() or Warning("Client prerequisites are not met. wesnoth, wesnoth_editor, cutter and exploder cannot be built.")
if env["PLATFORM"] == "win32":
have_X = True
else:
have_X = conf.CheckLib('X11') or Warning("wesnoth_editor cannot be built.")
have_X = False
if env["PLATFORM"] != "win32":
have_X = conf.CheckLib('X11')
if env['fribidi']:
env['fribidi'] = conf.CheckLibWithHeader('fribidi', 'fribidi/fribidi.h', 'C', 'fribidi_utf8_to_unicode(NULL,0,NULL);') or Warning("Can't find libfribidi, disabling freebidi support.")
@ -246,6 +246,9 @@ if env['python']:
if env['sendfile']:
env.Append(CPPDEFINES = "USE_SENDFILE")
if have_X:
env.Append(CPPDEFINES = "_X11")
if sys.platform != "win32":
if env['prefsdir']:
env.Append(CPPDEFINES = "PREFERENCES_DIR='\"%s\"'" % env['prefsdir'] )
@ -291,7 +294,7 @@ try:
except:
env["svnrev"] = ""
Export(Split("env have_client_prereqs have_X have_server_prereqs"))
Export(Split("env have_client_prereqs have_server_prereqs"))
SConscript(dirs = Split("po doc packaging/windows"))
binaries = Split("wesnoth wesnoth_editor wesnothd cutter exploder campaignd test")

View file

@ -218,7 +218,7 @@ wesnoth_editor_sources = Split("""
editor/editor_undo.cpp
animated_editor.cpp
""")
if have_client_prereqs and have_X:
if have_client_prereqs:
wesnoth_editor = env.Program("wesnoth_editor", wesnoth_editor_sources + [libwesnoth_core, libwesnoth_sdl, libwesnoth] + wesnoth_editor_res)
else:
wesnoth_editor = None