]> icculus.org git repositories - dana/openbox.git/blob - configure.ac
add some text files..
[dana/openbox.git] / configure.ac
1 AC_INIT
2 AC_CONFIG_SRCDIR([src/main.cc])
3 AM_INIT_AUTOMAKE([openbox], [2.90.0])
4
5 dnl Determine default prefix
6 test "$prefix" = "NONE" && prefix="$ac_default_prefix"
7
8 dnl We're in the C++ world
9 AC_LANG(C++)
10
11 AC_PROG_CC
12 AC_PROG_CXX
13 AC_PROG_INSTALL
14 AC_PROG_LIBTOOL
15
16 AC_CHECK_PROGS([regex_cmd], [sed])
17 if test x$regex_cmd = "x"; then
18   AC_MSG_ERROR([error. sed is required to build the default menu file.])
19 fi
20
21 dnl Check what compiler we are using
22 AC_MSG_CHECKING([for GCC])
23 if test "$GCC" = "yes"; then
24   AC_MSG_RESULT([yes])
25   CPPFLAGS="$CPPFLAGS -Wall -W -pedantic"
26 else
27   AC_MSG_RESULT([no, trying other compilers])
28   AC_MSG_CHECKING(for MIPSpro)
29   mips_pro_ver=`$CXX -version 2>&1 | grep -i mipspro | cut -f4 -d ' '`
30   if test -z "$mips_pro_ver"; then
31     AC_MSG_RESULT([no])
32   else
33     AC_MSG_RESULT([yes, version $mips_pro_ver.])
34     AC_MSG_CHECKING(for -LANG:std in CPPFLAGS)
35     lang_std_not_set=`echo $CPPFLAGS | grep "\-LANG:std"`
36     if test "x$lang_std_not_set" = "x"; then
37       AC_MSG_RESULT([not set, setting.])
38       CPPFLAGS="${CPPFLAGS} -LANG:std"
39     else
40       AC_MSG_RESULT([already set.])
41     fi
42   fi
43 fi
44
45 dnl Determine if maintainer portions of the Makefiles should be included.
46 AM_MAINTAINER_MODE
47
48 dnl Check for system header files
49 AC_CHECK_HEADERS(ctype.h dirent.h fcntl.h libgen.h locale.h nl_types.h process.h signal.h stdarg.h stdio.h stdlib.h string.h time.h unistd.h sys/param.h sys/select.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/wait.h)
50 AC_HEADER_TIME
51
52 dnl Determine the return type of signal handlers
53 AC_TYPE_SIGNAL
54
55 dnl Look for gettext, using external libintl
56 AM_GNU_GETTEXT([external])
57
58 dnl Check whether to include debugging code
59 DEBUG=""
60 AC_MSG_CHECKING([whether to include verbose debugging code])
61 AC_ARG_ENABLE([debug],
62   [  --enable-debug          include verbose debugging code @<:@default=no@:>@],
63   if test "$enableval" = "yes"; then
64     AC_MSG_RESULT([yes])
65     if test "$GCC" = "yes"; then
66        DEBUG="-DDEBUG -fno-inline -g"
67     else
68        DEBUG="-DDEBUG"
69     fi
70   else
71     AC_MSG_RESULT([no])
72     DEBUG="-DNDEBUG"
73   fi,
74   AC_MSG_RESULT([no])
75   DEBUG="-DNDEBUG"
76 )
77 CPPFLAGS="$CPPFLAGS $DEBUG"
78
79 dnl Check for X headers and libraries
80 AC_PATH_X
81 AC_PATH_XTRA
82 test "$no_x" = "yes" && AC_MSG_ERROR([No Xlibs found.])
83 test -z "$x_includes" && x_includes="/usr/include"
84 test -z "$x_libraries" && x_libraries="/usr/lib"
85      
86 CPPFLAGS="$CPPFLAGS $X_CPPFLAGS"
87 LIBS="$LIBS $X_LIBS $X_EXTRA_LIBS"
88 LDFLAGS="$LDFLAGS $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
89
90 dnl Check for required functions in -lX11
91 AC_CHECK_LIB([X11], [XOpenDisplay],
92   ,
93   AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
94 )
95
96 dnl Check for XShape extension support
97 AC_CHECK_LIB([Xext], [XShapeCombineShape],
98   AC_MSG_CHECKING([for X11/extensions/shape.h])
99   AC_TRY_LINK(
100     [
101       #include <X11/Xlib.h>
102       #include <X11/Xutil.h>
103       #include <X11/extensions/shape.h>
104     ],
105     [
106       long foo = ShapeSet
107     ],
108     [
109       AC_MSG_RESULT([yes])
110       SHAPE="yes"
111       AC_DEFINE([HAVE_SHAPE], [1], [Found the XShape extension])
112       LIBS="$LIBS -lXext"
113     ],
114     [ 
115       AC_MSG_RESULT([no])
116       SHAPE="no"
117     ]
118   )
119 )
120 AC_MSG_CHECKING([for the XShape extension])
121 if test "$SHAPE" = "yes"; then
122   AC_MSG_RESULT([yes])
123 else
124   AC_MSG_RESULT([no])
125 fi
126
127 dnl Check for Xinerama extension support
128 AC_MSG_CHECKING([whether to build support for the Xinerama extension])
129 XINERAMA="no"
130 AC_ARG_ENABLE([xinerama],
131 [  --enable-xinerama       enable support of the Xinerama extension @<:@default=no@:>@],
132   if test "$enableval" = "yes"; then
133         AC_MSG_RESULT([yes])
134
135         AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
136           [
137             AC_MSG_CHECKING([for X11/extensions/Xinerama.h])
138             AC_TRY_LINK(
139               [
140                 #include <X11/Xlib.h>
141                 #include <X11/extensions/Xinerama.h>
142               ],
143               [
144                 XineramaScreenInfo foo
145               ],
146               [
147                 AC_MSG_RESULT([yes])
148                 XINERAMA="yes"
149                 AC_DEFINE([XINERAMA], [1],
150                           [Enable support of the Xinerama extension])
151                 LIBS="$LIBS -lXinerama"
152               ],
153               [
154                 AC_MSG_RESULT([no])
155               ]
156             )
157           ]
158         )
159
160     AC_MSG_CHECKING([for the Xinerama extension])
161     if test "$XINRERAMA" = "yes"; then
162       AC_MSG_RESULT([yes])
163     else
164       AC_MSG_RESULT([no])
165     fi
166   else
167         AC_MSG_RESULT([no])
168   fi,
169   AC_MSG_RESULT([no])
170 )
171
172 dnl Output files
173 AM_CONFIG_HEADER(config.h)
174 AC_CONFIG_FILES([
175   Makefile
176   m4/Makefile 
177   po/Makefile.in
178   otk/Makefile
179   src/Makefile
180   util/Makefile
181   util/epist/Makefile
182   doc/Makefile
183   data/Makefile
184   data/styles/Makefile
185   version.h
186 ])
187 AC_OUTPUT
188
189 dnl Print results
190 AC_MSG_RESULT([])
191 AC_MSG_RESULT([ $PACKAGE_NAME version $PACKAGE_VERSION configured successfully.])
192 AC_MSG_RESULT([])
193 AC_MSG_RESULT([Using '$prefix' for installation.])
194 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
195 AC_MSG_RESULT([Building with '$CPPFLAGS' for C++ compiler flags.])
196 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
197 AC_MSG_RESULT([])