make LIBSN optional
[mikachu/openbox.git] / configure.ac
1 AC_PREREQ([2.50])
2 AC_INIT([openbox], [2.90.0cvs], [http://bugzilla.icculus.org])
3 AM_INIT_AUTOMAKE
4 AC_CONFIG_SRCDIR([kernel/openbox.c])
5
6 AC_PREFIX_DEFAULT([/usr/local])
7 test "$prefix" = "NONE" && prefix=$ac_default_prefix
8
9 AC_PATH_PROG([SED], [sed])
10 test "$SED" || AC_MSG_ERROR([sed not found])
11
12 # Determine build target
13 OB_DEBUG
14 # Pick compiler specific/build target flags, and set $CVS
15 OB_COMPILER_FLAGS
16 AC_C_CONST
17 AC_C_INLINE
18
19 AC_PROG_MAKE_SET
20
21 if test "$CVS" = "yes"; then
22     AC_PATH_PROG([FLEX], [flex])
23     test "$FLEX" || AC_MSG_ERROR([flex not found])
24
25     AC_PATH_PROG([BISON], [bison])
26     test "BISON" || AC_MSG_ERROR([bison not found])
27 fi
28
29 AC_DISABLE_STATIC
30 AC_LIBTOOL_DLOPEN
31 AC_PROG_LIBTOOL
32 AC_SUBST(LIBTOOL_DEPS)
33 LIBTOOL="$LIBTOOL --silent"
34
35 AC_PROG_INSTALL
36
37 ALL_LINGUAS=""
38 AM_GNU_GETTEXT_VERSION(0.11.5)
39 AM_GNU_GETTEXT([external])
40
41 AC_CHECK_HEADERS(ctype.h fcntl.h locale.h signal.h string.h stdio.h stdlib.h)
42 AC_CHECK_HEADERS(unistd.h sys/stat.h sys/select.h sys/time.h sys/wait.h)
43 # AC_HEADER_TIME
44 # AC_TYPE_SIGNAL
45
46 PKG_CHECK_MODULES([GLIB], [glib-2.0])
47 AC_SUBST(GLIB_CFLAGS)
48 AC_SUBST(GLIB_LIBS)
49         
50 PKG_CHECK_MODULES([GMODULE], [gmodule-2.0])
51 AC_SUBST(GMODULE_CFLAGS)
52 AC_SUBST(GMODULE_LIBS)
53
54 PKG_CHECK_MODULES(XFT, [xft])
55 AC_SUBST(XFT_CFLAGS)
56 AC_SUBST(XFT_LIBS)
57
58 PKG_CHECK_MODULES(LIBSN, [libstartup-notification-1.0],
59   AC_DEFINE(USE_LIBSN)
60   AC_SUBST(LIBSN_CFLAGS)
61   AC_SUBST(LIBSN_LIBS)
62   ,
63 )
64
65 # Check for X11 extensions
66 X11_EXT_XKB
67 X11_EXT_XRANDR
68 X11_EXT_VIDMODE
69 X11_EXT_SHAPE
70 X11_EXT_XINERAMA
71
72 AC_CONFIG_FILES([Makefile
73                  po/Makefile.in
74                  themes/Makefile
75                  data/Makefile
76                  render/Makefile
77                  kernel/Makefile
78                  plugins/Makefile
79                  plugins/placement/Makefile
80                  plugins/mouse/Makefile
81                  plugins/keyboard/Makefile
82                  plugins/menu/Makefile])
83 AC_OUTPUT
84
85 AC_MSG_RESULT
86 if test "$DEBUG" = "yes"; then
87   AC_MSG_RESULT([Creating a DEBUG build.])
88 else
89   AC_MSG_RESULT([Creating a RELEASE build.])
90 fi
91 AC_MSG_RESULT
92 AC_MSG_RESULT([configure complete, now type \"make\"])