forked from pekwm/pekwm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.ac
294 lines (269 loc) · 8.12 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
m4_pattern_allow(AM_CONFIG_HEADERS)
dnl init autotools
AC_INIT(pekwm, DEV)
AC_CONFIG_SRCDIR(src/main.cc)
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS(config.h)
dnl Check for programs
AC_PROG_CXX
AC_PROG_INSTALL
AC_LANG_CPLUSPLUS
AC_CHECK_PROGS(regex_cmd, sed)
if test x$regex_cmd = "x"; then
AC_MSG_ERROR([Could not find sed. It is required to build the configuration files.])
fi
dnl add x11 to the env
AC_PATH_X
AC_PATH_XTRA
CXXFLAGS="$CXXFLAGS $X_CFLAGS"
LIBS="$LIBS $X_LIBS"
LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
dnl Check for libraries
AC_CHECK_LIB(X11, XOpenDisplay,
LIBS="$LIBS -lX11",
AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.])
)
dnl Check for XShape extension support and proper library files
enableval="yes"
AC_MSG_CHECKING([whether to build support for the XShape extension])
AC_ARG_ENABLE(shape,
AC_HELP_STRING([--enable-shape],
[enable support of the XShape extension [default=yes]]), ,
[shape_enable=yes])
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xext, XShapeCombineShape,
AC_MSG_CHECKING([for X11/extensions/shape.h])
AC_TRY_COMPILE(
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/extensions/shape.h>
, long foo = ShapeSet,
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SHAPE, [], [Define to 1 if you have an XShape capable server])
LIBS="$LIBS -lXext"
FEATURES="$FEATURES XShape",
AC_MSG_RESULT([no])))
else
AC_MSG_RESULT([no])
CONFIGOPTS="$CONFIGOPTS --disable-shape"
fi
dnl Check for Xinerama support
AC_MSG_CHECKING([whether to build support for the Xinerama extension])
AC_ARG_ENABLE(xinerama,
AC_HELP_STRING([--enable-xinerama],
[enable xinerama extension [default=no]]), ,
[enable_xinerama=no])
if test "x$enable_xinerama" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xinerama, XineramaQueryScreens,
AC_DEFINE(HAVE_XINERAMA, [], [Define to 1 if you want Xinerama support to be])
LIBS="$LIBS -lXinerama"
FEATURES="$FEATURES Xinerama")
else
AC_MSG_RESULT([no])
fi
dnl Check for XRANDR support
AC_MSG_CHECKING([wheter to build support for the XRANDR extension])
AC_ARG_ENABLE(xrandr,
AC_HELP_STRING([--enable-xrandr],
[enable support for the XRANDR extension [default=yes]]), ,
[enable_xrandr=yes])
if test "x$enable_xrandr" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xrandr, XRRQueryExtension,
AC_DEFINE(HAVE_XRANDR, [], [Define to 1 if you have an XRANDR capable server])
LIBS="$LIBS -lXrandr"
FEATURES="$FEATURES Xrandr")
else
AC_MSG_RESULT([no])
fi
dnl Check for Xft support
AC_MSG_CHECKING([whether to support Xft fonts])
AC_ARG_ENABLE(xft,
AC_HELP_STRING([--enable-xft],
[enable Xft font support [default=yes]]), ,
[enable_xft=yes])
if test "x$enable_xft" = "xyes"; then
AC_MSG_RESULT([yes])
AC_PATH_GENERIC(xft, 2.0.0,
[
AC_DEFINE(HAVE_XFT, [], [Define to 1 if you want Xft2 font support])
XFT_LIBS=`xft-config --libs`
XFT_CFLAGS=`xft-config --cflags`
LIBS="$LIBS $XFT_LIBS"
CXXFLAGS="$CXXFLAGS $XFT_CFLAGS"
FEATURES="$FEATURES Xft";
],
[
AC_MSG_WARN([Couldn't fint Xft.])
])
else
AC_MSG_RESULT([no])
fi
dnl Check for pcre support
AC_MSG_CHECKING([whether to use pcre for autoprops])
AC_ARG_ENABLE(pcre,
AC_HELP_STRING([--enable-pcre],
[enable pcre regex [default=no]]), ,
[enable_pcre=no])
if test "x$enable_pcre" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(pcre, pcre_compile,
AC_DEFINE(HAVE_PCRE, [], [Define to 1 if you want PCRE style regexps])
PCRE_LIBS=`pcre-config --libs-posix`
PCRE_CFLAGS=`pcre-config --cflags-posix`
LIBS="$LIBS $PCRE_LIBS"
CXXFLAGS="$CXXFLAGS $PCRE_CFLAGS"
FEATURES="$FEATURES pcre")
else
AC_MSG_RESULT([no])
fi
dnl Check for XPM support
AC_MSG_CHECKING([wheter to build support XPM images])
AC_ARG_ENABLE(image-xpm,
AC_HELP_STRING([--enable-image-xpm],
[enable support for XPM images [default=yes]]), ,
[enableval=yes])
if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(Xpm, XpmReadFileToPixmap,
AC_MSG_CHECKING([for X11/xpm.h])
AC_TRY_COMPILE(
#include <X11/xpm.h>
, int foo = XpmSuccess,
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_IMAGE_XPM, [], [Define to 1 if you libXpm])
LIBS="$LIBS -lXpm"
FEATURES="$FEATURES image-xpm",
AC_MSG_RESULT([no])))
else
AC_MSG_RESULT([no])
fi
dnl Check for JPEG support
AC_MSG_CHECKING([wheter to build support for JPEG images])
AC_ARG_ENABLE(image-jpeg,
AC_HELP_STRING([--enable-image-jpeg],
[enable support for JPEG images [default=yes]]), ,
[enableval=yes])
if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(jpeg, jpeg_read_header,
AC_MSG_CHECKING([for jpeglib.h])
AC_TRY_CPP([#include <jpeglib.h>],
jpeg_ok=yes,
jpeg_ok=no)
AC_MSG_RESULT($jpeg_ok)
if test "$jpeg_ok" = yes; then
AC_DEFINE(HAVE_IMAGE_JPEG, [], [Define to 1 if you have jpeg6b])
LIBS="$LIBS -ljpeg"
FEATURES="$FEATURES image-jpeg"
fi,
AC_MSG_RESULT([no]))
else
AC_MSG_RESULT([no])
fi
dnl Check for PNG support
AC_MSG_CHECKING([wheter to build support for PNG images])
AC_ARG_ENABLE(image-png,
AC_HELP_STRING([--enable-image-png],
[enable support for PNG images [default=yes]]), ,
[enableval=yes])
if test "x$enableval" = "xyes"; then
AC_MSG_RESULT([yes])
AC_CHECK_LIB(png, png_read_info,
AC_MSG_CHECKING([for png.h])
AC_TRY_CPP([#include <png.h>],
png_ok=yes,
png_ok=no)
AC_MSG_RESULT($png_ok)
if test "$png_ok" = yes; then
AC_DEFINE(HAVE_IMAGE_PNG, [], [Define to 1 if you have libpng])
LIBS="$LIBS -lpng"
FEATURES="$FEATURES image-png"
fi,
AC_MSG_RESULT([no]))
else
AC_MSG_RESULT([no])
fi
dnl Check for header files
AC_STDC_HEADERS
AC_CHECK_HEADERS([limits])
dnl Check for library functions
AC_CHECK_FUNC(setenv, [AC_DEFINE(HAVE_SETENV, [], [Define to 1 if you the setenv systam call])], )
dnl Check simple toggles ( no outer dependecies )
dnl Check whether to include debugging code
AC_MSG_CHECKING([whether to include verbose debugging code])
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug],
[include verbose debugging code [default=no]]), ,
[enable_debug=no])
if test "x$enable_debug" = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE(DEBUG, [], [Define to 1 to compile in debug information])
FEATURES="$FEATURES debug"
else
AC_MSG_RESULT([no])
fi
dnl Check wheter to use strict warnings
AC_MSG_CHECKING([whether to use strict compile-time warnings])
AC_ARG_ENABLE(pedantic,
AC_HELP_STRING([--enable-pedantic],
[turn on strict compile-time warnings [default=no]]), ,
[enable_pedantic=no])
if test "$enable_pedantic" = "yes"; then
AC_MSG_RESULT([yes])
if test "$CXX" = "g++"; then
CXXFLAGS="-Wall -Werror -pedantic $CXXFLAGS"
fi
FEATURES="$FEATURES pedantic"
else
AC_MSG_RESULT([no])
fi
dnl Check whether to use menus
AC_MSG_CHECKING([whether to include menu support])
AC_ARG_ENABLE(menus,
AC_HELP_STRING([--enable-menus],
[include menu support [default=yes]]), ,
[menus_enable=yes])
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE(MENUS, [], [Define to 1 to compile in menu support])
FEATURES="$FEATURES menus"
else
AC_MSG_RESULT([no])
fi
dnl Check whether to include harbour
AC_MSG_CHECKING([whether to include harbour])
AC_ARG_ENABLE(harbour,
AC_HELP_STRING([--enable-harbour],
[include harbour [default=yes]]), ,
[harbour_enable=yes])
if test x$enableval = "xyes"; then
AC_MSG_RESULT([yes])
AC_DEFINE(HARBOUR, [], [Define to 1 to compile in support for dockapps])
FEATURES="$FEATURES harbour"
else
AC_MSG_RESULT([no])
fi
dnl define build info
EVO=`date`
AC_DEFINE_UNQUOTED(FEATURES, "$FEATURES", [Build info, do not touch])
AC_DEFINE_UNQUOTED(EXTRA_VERSION_INFO, " Built on $EVO", [Build info, do not touch])
dnl create the makefiles
AC_OUTPUT(Makefile
src/Makefile
data/Makefile
data/themes/Makefile
data/themes/default/Makefile
data/scripts/Makefile
doc/Makefile)
dnl print results
AC_MSG_RESULT([*])
AC_MSG_RESULT([* $PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([*])
AC_MSG_RESULT([* PREFIX: $prefix])
AC_MSG_RESULT([* FEATURES: $FEATURES])
AC_MSG_RESULT([* CXXFLAGS: $CXXFLAGS])
AC_MSG_RESULT([* LIBS: $LIBS])
AC_MSG_RESULT([*])