1 dnl Process this file with autoconf to produce a configure script.
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)
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.
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 ===========================================
34 dnl ===========================================
38 X_LIBRARY_PATH=$x_libraries
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)
53 AC_CHECK_LIB(Xext, XShapeCombineMask, [XLIBS="$XLIBS -lXext"],
54 [echo "The shape extension stuff could not be found in the X client libraries"
56 $X_LIBS $X_EXTRA_LIBS -lX11)
60 AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [XLIBS="$XLIBS -lXpm"],
61 [echo "The libXpm library was not found, but is necessary to build this library"
63 $X_LIBS $X_EXTRA_LIBS -lX11)
69 AC_SUBST(X_EXTRA_LIBS)
71 dnl ===============================================
72 dnl End of stuff that uses X
73 dnl ===============================================
80 [ --enable-debug turn on debugging [default=no]],, enable_debug=no)
81 if test "$enable_debug" = yes; then
82 DFLAGS="-Wall -g -ansi -pedantic"
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"])
106 SETGID_FLAGS="-g kmem -m 2755 -o root"
129 echo "Sorry, ${target_os} is not supported yet"
136 AC_SUBST(SETGID_FLAGS)
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.
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.
165 AC_CHECK_FUNCS(select)
167 AC_CONFIG_FILES([Makefile
173 contrib/wmcpuload.spec])