Make AddMouseRegion's index unsigned
[dockapps.git] / wmcpuload / configure.ac
blob21d79801bec9ab5caa045a6f4d65fd66a36e732a
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(wmcpuload, 0.9.0)
6 AC_INIT(wmcpuload, 1.1.1, wmaker-dev@googlegroups.com)
7 AC_CANONICAL_HOST
8 AC_CANONICAL_TARGET
9 AM_INIT_AUTOMAKE
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"])
32 dnl ===========================================
33 dnl             Stuff that uses X
34 dnl ===========================================
36 AC_PATH_XTRA
38 X_LIBRARY_PATH=$x_libraries
40 XCFLAGS="$X_CFLAGS"
42 XLFLAGS="$X_LIBS"
44 XLIBS="-lX11 $X_EXTRA_LIBS"
46 lib_search_path="$lib_search_path $XLFLAGS"
47 inc_search_path="$inc_search_path $XCFLAGS"
49 AC_SUBST(X_LIBRARY_PATH)
51 dnl Shape extension
52 dnl ===============
53 AC_CHECK_LIB(Xext, XShapeCombineMask, [XLIBS="$XLIBS -lXext"],
54     [echo "The shape extension stuff could not be found in the X client libraries"
55      exit 1],
56     $X_LIBS $X_EXTRA_LIBS -lX11)
58 dnl XPM library
59 dnl ===========
60 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [XLIBS="$XLIBS -lXpm"],
61     [echo "The libXpm library was not found, but is necessary to build this library"
62      exit 1],
63     $X_LIBS $X_EXTRA_LIBS -lX11)
65 AC_SUBST(XCFLAGS)
66 AC_SUBST(XLFLAGS)
67 AC_SUBST(XLIBS)
69 AC_SUBST(X_EXTRA_LIBS)
71 dnl ===============================================
72 dnl             End of stuff that uses X
73 dnl ===============================================
76 dnl =========
77 dnl Debugging
78 dnl =========
79 AC_ARG_ENABLE(debug,
80              [  --enable-debug          turn on debugging [default=no]],, enable_debug=no)
81 if test "$enable_debug" = yes; then
82   DFLAGS="-Wall -g -ansi -pedantic"
84 AC_SUBST(DFLAGS)
87 dnl ============
88 dnl Determine OS
89 dnl ============
91 ignore_nice=no
92 use_smp=no
94 case ${target_os} in
95 linux*)
96   OS=linux
97   ignore_nice=yes
98   use_smp=yes
99   ;;
100 freebsd*)
101   OS=freebsd
102   ignore_nice=yes
103   LIBS="$LIBS -lkvm"
104   SETGID_FLAGS="-g kmem -m 2755 -o  root"
105   ;;
106 openbsd*)
107   OS=openbsd
108   ignore_nice=yes
109   ;;
110 netbsd*)
111   OS=netbsd
112   ignore_nice=yes
113   ;;
114 bsdi*)
115   OS=bsdi
116   ignore_nice=yes
117   ;;
118 solaris*)
119   OS=solaris
120   LIBS="$LIBS -lkstat"
121   ;;
122 cygwin*)
123   OS=cygwin
124   ;;
125 irix*)
126   OS=irix
127   use_smp=yes
128   ;;
129 darwin*)
130   OS=darwin
131   ;;
133   echo ""
134   echo "Sorry, ${target_os} is not supported yet"
135   echo ""
136   exit 1
137   ;;
138 esac
140 AC_SUBST(OS)
141 AC_SUBST(SETGID_FLAGS)
142 AC_SUBST(LIBS)
144 if test "$ignore_nice" = yes; then
145   AC_DEFINE(IGNORE_NICE, 1, [use '--ignore-nice' option])
147 if test "$use_smp" = yes; then
148   AC_DEFINE(USE_SMP, 1, [use SMP support])
152 dnl =============================
153 dnl Checks for library functions.
154 dnl =============================
156 LIBRARY_SEARCH_PATH="$lib_search_path"
157 HEADER_SEARCH_PATH="$inc_search_path"
159 AC_SUBST(LIBRARY_SEARCH_PATH)
160 AC_SUBST(HEADER_SEARCH_PATH)
162 dnl Checks for header files.
163 AC_HEADER_STDC
164 AC_HEADER_SYS_WAIT
165 AC_HEADER_TIME
166 AC_CHECK_HEADERS(fcntl.h memory.h stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h)
168 dnl Checks for library functions.
169 AC_FUNC_MALLOC
170 AC_CHECK_FUNCS(select)
172 AC_CONFIG_FILES([Makefile
173                  src/Makefile
174                  libdockapp/Makefile
175                  doc/Makefile
176                  icons/Makefile
177                  contrib/Makefile
178                  contrib/wmcpuload.spec])
179 AC_OUTPUT