Removed dead code, eliminated empty cycles, reduced doubleclick timeout from 1.5sec...
[dockapps.git] / wmcpuload / configure.ac
blob9a7cac3c0cee54f366343c40fcd02a8813cb9daf
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.0.0, ssato@sh.rim.or.jp)
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"])
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 ignore_proc=no
94 case ${target_os} in
95 linux*)
96   OS=linux
97   ignore_nice=yes
98   ignore_proc=yes
99   AC_CHECK_HEADER(linux/threads.h, [AC_DEFINE(USE_SMP, 1, [use SMP support])],
100     [echo "linux/threads.h header file was not found, but is necessary to support mulit processors"])
101   ;;
102 freebsd*)
103   OS=freebsd
104   ignore_nice=yes
105   LIBS="$LIBS -lkvm"
106   SETGID_FLAGS="-g kmem -m 2755 -o  root"
107   ;;
108 openbsd*)
109   OS=openbsd
110   ignore_nice=yes
111   ;;
112 netbsd*)
113   OS=netbsd
114   ignore_nice=yes
115   ;;
116 bsdi*)
117   OS=bsdi
118   ignore_nice=yes
119   ;;
120 solaris*)
121   OS=solaris
122   LIBS="$LIBS -lkstat"
123   ;;
124 cygwin*)
125   OS=cygwin
126   ;;
128   echo ""
129   echo "Sorry, ${target_os} is not supported yet"
130   echo ""
131   exit 1
132   ;;
133 esac
135 AC_SUBST(OS)
136 AC_SUBST(SETGID_FLAGS)
137 AC_SUBST(LIBS)
139 if test "$ignore_nice" = yes; then
140   AC_DEFINE(IGNORE_NICE, 1, [use '--ignore-nice' option])
142 if test "$ignore_proc" = yes; then
143   AC_DEFINE(IGNORE_PROC, 1, [use '--ignore-process' option])
147 dnl =============================
148 dnl Checks for library functions.
149 dnl =============================
151 LIBRARY_SEARCH_PATH="$lib_search_path"
152 HEADER_SEARCH_PATH="$inc_search_path"
154 AC_SUBST(LIBRARY_SEARCH_PATH)
155 AC_SUBST(HEADER_SEARCH_PATH)
157 dnl Checks for header files.
158 AC_HEADER_STDC
159 AC_HEADER_SYS_WAIT
160 AC_HEADER_TIME
161 AC_CHECK_HEADERS(fcntl.h memory.h stddef.h stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h)
163 dnl Checks for library functions.
164 AC_FUNC_MALLOC
165 AC_CHECK_FUNCS(select)
167 AC_CONFIG_FILES([Makefile
168                  src/Makefile
169                  libdockapp/Makefile
170                  doc/Makefile
171                  icons/Makefile
172                  contrib/Makefile
173                  contrib/wmcpuload.spec])
174 AC_OUTPUT