initial import
[patches.git] / fillets-ng-check-for-X.patch
1 --- configure.in
2 +++ configure.in
3 @@ -89,21 +91,31 @@ AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont],
4
5 ###################################################
6 # Test X11
7 -OLD_CPPFLAGS="$CPPFLAGS"
8 -CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
9 -AC_TRY_COMPILE([
10 - #include "SDL.h"
11 - #include "SDL_syswm.h"
12 - #include <X11/Xutil.h>
13 - ], [
14 - SDL_SysWMinfo info;
15 - info.subsystem = SDL_SYSWM_X11;
16 - ], [have_x11="yes"], [have_x11="no"])
17 -CPPFLAGS="$OLD_CPPFLAGS"
18 -if test "x$have_x11" = xyes; then
19 - AC_DEFINE(HAVE_X11)
20 +X_LIBS=""
21 +AC_ARG_WITH(X,
22 + [AC_HELP_STRING([--with-x],[enable X window manager support [default=detect]])],
23 + [with_x11=$withval],[with_x11="maybe"])
24 +if test "x$with_x11" != "xno" ; then
25 + AC_CHECK_LIB([X11], [Xutf8TextListToTextProperty], [with_x11="yes"], [with_x11="no"])
26 + if test "x$with_x11" != "xno" ; then
27 + OLD_CPPFLAGS="$CPPFLAGS"
28 + CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
29 + AC_TRY_COMPILE([
30 + #include "SDL.h"
31 + #include "SDL_syswm.h"
32 + #include <X11/Xutil.h>
33 + ], [
34 + SDL_SysWMinfo info;
35 + info.subsystem = SDL_SYSWM_X11;
36 + ], [have_x11="yes"], [have_x11="no"])
37 + CPPFLAGS="$OLD_CPPFLAGS"
38 + if test "x$have_x11" = xyes; then
39 + AC_DEFINE(HAVE_X11)
40 + X_LIBS="-lX11"
41 + fi
42 + fi
43 fi
44 -
45 +AC_SUBST(X_LIBS)
46
47 ###################################################
48 # Test FriBidi
49 --- src/game/Makefile.am
50 +++ src/game/Makefile.am
51 @@ -18,4 +18,4 @@ ICON_LIBS =
52 endif
53
54
55 -fillets_LDADD = $(ICON_LIBS) ../menu/libmenu.a ../level/liblevel.a ../state/libstate.a ../option/liboption.a ../plan/libplan.a ../widget/libwidget.a ../effect/libeffect.a ../gengine/libgengine.a $(SDL_GFX_LIBS) $(SDL_LIBS) $(LUA_LIBS) $(BOOST_LIBS) $(FRIBIDI_LIBS)
56 +fillets_LDADD = $(ICON_LIBS) ../menu/libmenu.a ../level/liblevel.a ../state/libstate.a ../option/liboption.a ../plan/libplan.a ../widget/libwidget.a ../effect/libeffect.a ../gengine/libgengine.a $(SDL_GFX_LIBS) $(SDL_LIBS) $(LUA_LIBS) $(BOOST_LIBS) $(FRIBIDI_LIBS) $(X_LIBS)