wmclockmon: build against GTK+ 2.0.
[dockapps.git] / wmclockmon / configure.ac
blobe7de2d8c74f7ef979de12f55ae0c69bdb5c007c0
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.52)
4 dnl AC_INIT(src/main.c)
5 dnl AM_INIT_AUTOMAKE(wmclockmon, 0.8.1)
6 AC_INIT(wmclockmon, 0.8.1, tnemeth@free.fr)
7 AC_CANONICAL_HOST
8 AC_CANONICAL_TARGET
9 AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
11 AC_CONFIG_SRCDIR(src/main.c)
12 AM_CONFIG_HEADER(config.h)
14 dnl Checks for programs.
15 AC_PROG_AWK
16 AC_PROG_CC
17 AC_PROG_INSTALL
18 AC_PROG_LN_S
20 dnl
21 dnl Specify paths to look for libraries and headers
22 dnl ===============================================
23 AC_ARG_WITH(libs-from,
24        [  --with-libs-from        pass compiler flags to look for libraries],
25        [lib_search_path="$withval $lib_search_path"])
27 AC_ARG_WITH(incs-from,
28        [  --with-incs-from        pass compiler flags to look for header files],
29        [inc_search_path="$withval $inc_search_path"])
31 PKG_CHECK_MODULES([gtk], [gtk+-2.0])
33 dnl ===========================================
34 dnl             Stuff that uses X
35 dnl ===========================================
37 AC_PATH_XTRA
39 X_LIBRARY_PATH=$x_libraries
41 XCFLAGS="$X_CFLAGS"
43 XLFLAGS="$X_LIBS"
45 XLIBS="-lX11 $X_EXTRA_LIBS"
47 lib_search_path="$lib_search_path $XLFLAGS -L/usr/local/lib"
48 inc_search_path="$inc_search_path $XCFLAGS -I/usr/local/include"
50 AC_SUBST(X_LIBRARY_PATH)
52 dnl Shape extension
53 dnl ===============
54 AC_CHECK_LIB(Xext, XShapeCombineMask, [XLIBS="$XLIBS -lXext"],
55     [echo "The shape extension stuff could not be found in the X client libraries"
56      exit 1],
57     $X_LIBS $X_EXTRA_LIBS -lX11)
59 dnl XPM library
60 dnl ===========
61 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [XLIBS="$XLIBS -lXpm"],
62     [echo "The libXpm library was not found, but is necessary to build this library"
63      exit 1],
64     $X_LIBS $X_EXTRA_LIBS -lX11)
66 AC_SUBST(XCFLAGS)
67 AC_SUBST(XLFLAGS)
68 AC_SUBST(XLIBS)
70 AC_SUBST(X_EXTRA_LIBS)
72 dnl ===============================================
73 dnl             End of stuff that uses X
74 dnl ===============================================
76 dnl =========
77 dnl Debugging
78 dnl =========
79 AC_ARG_ENABLE(debug,
80              [  --enable-debug          turn on debugging [default=on]],,enable_debug=no)
81 if test "$enable_debug" = yes; then
82   DFLAGS="-Wall -g -ansi -pedantic"
83   AC_DEFINE(DEBUG, 1, [use debug code])
85 AC_SUBST(DFLAGS)
88 dnl ============
89 dnl Check for OS
90 dnl ============
92 ignore_buffers=no
93 ignore_cached=no
94 ignore_wired=no
96 case ${host_os} in
97 linux*)
98   OS=linux
99   ignore_buffers=yes
100   ignore_cached=yes
101   ;;
102 freebsd*)
103   OS=freebsd
104   ignore_wired=yes
105   ignore_cached=yes
106   LIBS="$LIBS -lkvm"
107   SETGID_FLAGS="-g kmem -m 2755 -o root"
108   ;;
109 openbsd*)
110   OS=openbsd
111   ;;
112 netbsd*)
113   OS=netbsd
114   ;;
115 solaris*)
116   OS=solaris
117   ;;
119   echo ""
120   echo "Sorry, ${host_os} is not supported yet"
121   echo ""
122   exit 1
123   ;;
124 esac
126 AC_SUBST(OS)
127 AC_SUBST(SETGID_FLAGS)
128 AC_SUBST(LIBS)
130 if test "$ignore_buffers" = yes; then
131   AC_DEFINE(IGNORE_BUFFERS, 1, [use '--ignore-buffers' option])
133 if test "$ignore_cached" = yes; then
134   AC_DEFINE(IGNORE_CACHED, 1, [use '--ignore-cached' option])
136 if test "$ignore_wired" = yes; then
137   AC_DEFINE(IGNORE_WIRED, 1, [use '--ignore-wired' option])
141 dnl =============================
142 dnl Checks for library functions.
143 dnl =============================
145 LIBRARY_SEARCH_PATH="$lib_search_path"
146 HEADER_SEARCH_PATH="$inc_search_path"
148 AC_SUBST(LIBRARY_SEARCH_PATH)
149 AC_SUBST(HEADER_SEARCH_PATH)
151 dnl Checks for header files.
152 AC_HEADER_STDC
153 AC_CHECK_HEADERS([fcntl.h memory.h stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h])
155 dnl Checks for typedefs, structures, and compiler characteristics.
156 AC_C_CONST
157 AC_TYPE_SIZE_T
158 AC_HEADER_TIME
160 dnl Checks for library functions.
161 AC_FUNC_MALLOC
162 AC_CHECK_FUNCS(select strtoul uname)
164 AC_CONFIG_FILES(Makefile \
165                 src/Makefile \
166                 doc/Makefile \
167                 wmclockmon-config/Makefile\
168                 wmclockmon-cal/Makefile\
169                 styles/Makefile)
170 AC_OUTPUT