Fixed Container.Background support. We can have that support or not.
[idesk.git] / configure.in
blob7eac592aa9393a703e65a7d2dcc3feeffc76a2a2
1 dnl Initialize autoconf and automake
2 AC_INIT(src/Main.cpp)
3 VERSION=0.7.5
4 PACKAGE=idesk
5 dnl Output files
6 AM_CONFIG_HEADER(config.h)
8 AM_INIT_AUTOMAKE($PACKAGE,"$VERSION")
10 dnl Determine default prefix
11 if test "x$prefix" = "xNONE"; then
12   prefix="/usr/local"
14 if test "x$exec_prefix" = "xNONE"; then
15  exec_prefix=$prefix
18 dnl Check for various flavors of UNIX(r)
19 dnl AC_AIX
20 AC_ISC_POSIX
21 AC_LANG_CPLUSPLUS
23 dnl Locate required external software
24 AC_PROG_CC
25 AC_PROG_CXX
26 AC_PROG_INSTALL
27 AM_PROG_CC_STDC
28 AC_PROG_MAKE_SET
30 dnl Check for system header files
31 AC_HEADER_STDC
32 AC_CHECK_HEADERS(string.h unistd.h dirent.h stdlib.h sys/time.h time.h sys/wait.h) 
34 AC_CHECK_HEADERS(sstream, ,
35         [ AC_CHECK_HEADERS(strstream,,
36             [AC_MSG_ERROR([Your libstdc++ doesn't have the sstream, fstream or strstream classes])]
37         )]
41 AC_CHECK_HEADERS(cassert cctype cerrno cmath cstdarg cstdio cstdlib cstring ctime)
43 AC_HEADER_TIME
45 dnl Check for X headers and libraries
46 AC_PATH_X([X11], [X11/Xlib.h], [XOpenDisplay(NULL)])
47 AC_PATH_XTRA
49 test x$no_x = "xyes" && AC_MSG_ERROR([Idesk requires the X Window System libraries and headers.])
51 test x$x_includes = "x" && x_includes="/usr/include"
52 test x$x_libraries = "x" && x_libraries="/usr/lib"
54 CFLAGS="$CFLAGS $X_CFLAGS"
55 CXXFLAGS="$CXXFLAGS $X_CFLAGS"
56 LIBS="$LIBS $X_LIBS"
57 LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS"
59 dnl Check for required functions in -lX11
60 AC_CHECK_LIB(X11, XOpenDisplay, LIBS="$LIBS -lX11",[
61   echo "ERROR:  You need libX11 to build Idesk.  Verify that you have libX11.a or";
62   echo "        libX11.so installed and that it is located in the X libraries";
63   AC_MSG_ERROR([Fatal:  libX11 not found.])])
65 LIBS="$LIBS $X_EXTRA_LIBS"
67 dnl Check for XShape extension support and proper library files.
68 SHAPE=""
69 AC_MSG_CHECKING([whether to build support for the XShape extension])
70 AC_ARG_ENABLE(
71   shape, [  --enable-shape          enable support of the XShape extension [default=yes]])
73 : ${enableval="yes"}
74 if test x$enableval = "xyes"; then
75   AC_MSG_RESULT([yes])
76   AC_CHECK_LIB(Xext, XShapeCombineShape,
77     AC_MSG_CHECKING([for X11/extensions/shape.h])
78     AC_TRY_LINK(
79 #include <X11/Xlib.h>
80 #include <X11/Xutil.h>
81 #include <X11/extensions/shape.h>
82 , long foo = ShapeSet,
83       AC_MSG_RESULT([yes])
84       SHAPE="-DSHAPE"; Xext_lib="-lXext",
85       AC_MSG_RESULT([no])
86     )
87   )
88 else
89   AC_MSG_RESULT([no])
91 AC_SUBST(SHAPE)
92 CXXFLAGS="$CXXFLAGS $SHAPE"
93 LIBS="$LIBS $Xext_lib"
95 dnl Imlib2 detection
97 AC_PATH_GENERIC(imlib2, , [
98     AC_SUBST(IMLIB_LIBS)
99    AC_SUBST(IMLIB_CXXFLAGS) ],
100   AC_MSG_ERROR(Cannot find imlib2: Is imlib2-config in the path?
101                You need Imlib2 to build Idesk.  Verify that you have Imlib2-dev))
103 dnl the above doesn't work for some reason :/
104 IMLIB_LIBS=`imlib2-config --libs`
105 IMLIB_CFLAGS=`imlib2-config --cflags`
106 AC_SUBST(IMLIB_LIBS)
107 AC_SUBST(IMLIB_CXXFLAGS)
109 CXXFLAGS="$CXXFLAGS $IMLIB_CXXFLAGS"
110 LIBS="$LIBS $IMLIB_LIBS"
113 dnl Check for libsn Startup Notificacion options
114 STARTUP=""
115 AC_MSG_CHECKING([whether to include Startup Notification ])
116 AC_ARG_ENABLE(
117   libsn, [  --enable-libsn        include code for LIBSN [default=no]])
119 if test -n "$enable_libsn"; then
120                     PKG_CHECK_MODULES(LIBSN, libstartup-notification-1.0 >= 0.5)
121                     AC_MSG_RESULT([yes])
122                     STARTUP="-DHAVE_STARTUP_NOTIFICATION -DSN_API_NOT_YET_FROZEN=1",
123 else
124   AC_MSG_RESULT([no])
127 AM_CONDITIONAL(HAVE_STARTUP_NOTIFICATION, test x$LIBSN = xtrue)
128 AC_SUBST(STARTUP)
129 AC_SUBST(LIBSN_CFLAGS)
130 AC_SUBST(LIBSN_LIBS)
131 CXXFLAGS="$CXXFLAGS $LIBSN_CFLAGS $STARTUP"
132 LIBS="$LIBS $LIBSN_LIBS"
135 AC_MSG_CHECKING([whether to have Xft support])
136 AM_PATH_XFT(yes,
137         XFT=true,
138         XFT=false
141 if test "x$XFT" = "xtrue" ; then
142         AC_TRY_LINK([
143                         #include <X11/Xft/Xft.h>
144                 ], [ XftFontClose(0, 0); return 1; ], 
145         [
146                 
147                 AC_DEFINE(USE_XFT, 1, "antialias support")
148             AC_MSG_CHECKING([Xft UTF-8 support])
149              AC_TRY_LINK([
150                         #include <X11/Xft/Xft.h>
151                 ], [ XftDrawStringUtf8(0, 0, 0, 0, 0, 0, 0); return 0; ],
152                 AC_DEFINE(HAVE_XFT_UTF8_STRING, 1, "Xft UTF8 support")
153                 AC_MSG_RESULT(yes),
154                 AC_MSG_RESULT(no)
155                 )
156         ],
157         [       AC_MSG_RESULT([Could not link with Xft. Install Xft if you want support for it.])
158                 XFT=false
159         ])
162 AM_CONDITIONAL(XFT, test x$XFT = xtrue)
164 dnl Determine the return type of signal handlers
165 AC_TYPE_SIGNAL
167 dnl Determine if maintainer portions of the Makefiles should be included.
168 dnl AM_MAINTAINER_MODE
170 dnl default prefix
171 DEFAULT_PREFIX="$prefix"
172 AC_SUBST(DEFAULT_PREFIX)
174 dnl Print results
175 AC_MSG_RESULT([])
176 AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
177 AC_MSG_RESULT([])
178 AC_MSG_RESULT([Using '$prefix' for installation.])
179 AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
180 AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.])
181 AC_MSG_RESULT([Building with '$LIBS' for linker flags.])
182 AC_MSG_RESULT([])
185 AC_OUTPUT(Makefile
186 src/Makefile