1 AC_INIT([wmpower],[0.4.3],[michele.noberasco@tiscali.it])
3 AC_CONFIG_SRCDIR(src/wmpower.c)
4 AM_INIT_AUTOMAKE([1.7 check-news dist-bzip2])
11 # Set my own flags for gcc
12 if test "$MY_CFLAGS" = ""; then
13 if test "x$GCC" = "xyes"; then
15 MY_CFLAGS="-Os -fomit-frame-pointer -pipe -W -Wall"
16 GCC_TEST_MESSAGE="Checking for gcc version"
17 AC_MSG_CHECKING([$GCC_TEST_MESSAGE])
18 GCCVERSION="`$CC -dumpversion`"
19 AC_MSG_RESULT([$GCCVERSION])
20 if test "`$CC -dumpversion | grep 3.`" != ""; then
21 #Good! let see if we can see the system arch
22 PROCESSOR=`cat /proc/cpuinfo`
23 #Is our CPU a Celeron?
24 if test "`echo $PROCESSOR | grep \"Celeron\"`" != ""; then
25 CPUFLAGS="-march=pentium2"
27 if test "`echo $PROCESSOR | grep \"Celeron (Coppermine)\"`" != ""; then
28 CPUFLAGS="-march=pentium3"
30 #Is our CPU a Pentium?
31 if test "`echo $PROCESSOR | grep \"Pentium\"`" != ""; then
32 CPUFLAGS="-march=pentium"
34 #Is our CPU a Pentium II?
35 if test "`echo $PROCESSOR | grep \"Pentium II\"`" != ""; then
36 CPUFLAGS="-march=pentium2"
38 #Is our CPU a Pentium III?
39 if test "`echo $PROCESSOR | grep \"Pentium III\"`" != ""; then
40 CPUFLAGS="-march=pentium3"
42 #Is our CPU a Pentium 4?
43 if test "`echo $PROCESSOR | grep \"Intel(R) Pentium(R) 4\"`" != ""; then
44 CPUFLAGS="-march=pentium4"
47 if test "`echo $PROCESSOR | grep \"AMD-K6(tm)\"`" != ""; then
51 if test "`echo $PROCESSOR | grep \"AMD Athlon(tm)\"`" != ""; then
52 CPUFLAGS="-march=athlon"
54 if test "`echo $PROCESSOR | grep \"AMD Athlon(tm) MP\"`" != ""; then
55 CPUFLAGS="-march=athlon-mp"
57 if test "`echo $PROCESSOR | grep \"AMD Athlon(tm) XP\"`" != ""; then
58 CPUFLAGS="-march=athlon-xp"
60 if test "`echo $PROCESSOR | grep \"AMD Athlon(tm) 64\"`" != ""; then
61 CPUFLAGS="-march=athlon64"
63 #Is our CPU an Ultra Sparc?
64 if test "`echo $PROCESSOR | grep \"UltraSparc\"`" != ""; then
65 CPUFLAGS="-mcpu=ultrasparc"
68 #Alas, we can set only generic arch optimizations
69 PROCESSOR=`uname -m | grep 86`
70 if test "$PROCESSOR" != ""; then
71 CPUFLAGS="-march=$PROCESSOR"
74 if test "$CPUFLAGS" != ""; then
75 echo "Applying architecture optimizations: "$CPUFLAGS
77 CFLAGS="$CPUFLAGS $MY_CFLAGS"
82 # End of setting suctom flags for gcc
84 # Check wether we are x86 or not
85 AC_MSG_CHECKING([for machine class])
88 if test "`echo $HW | grep \"86\"`" != ""; then
93 # End check for x86 hardware
96 HEADERS="stdio.h stdlib.h stdarg.h string.h syslog.h time.h unistd.h ctype.h pwd.h sys/types.h \
97 fcntl.h sys/stat.h sys/ioctl.h envz.h X11/X.h X11/Xlib.h X11/xpm.h X11/extensions/shape.h"
98 HEADERS_ERROR_MESSAGE="One or more system headers that are necessary to compile this program are missing on this system. Cannot continue."
99 AC_CHECK_HEADERS([$HEADERS],,[AC_MSG_ERROR([$HEADERS_ERROR_MESSAGE])],)
101 # End check for C headers
103 # Check wether we can spawn new threads
104 AC_CHECK_HEADERS([pthread.h],,[AC_MSG_ERROR([$HEADERS_ERROR_MESSAGE])],)
105 AC_CHECK_LIB(pthread, pthread_create, , , )
108 AC_CONFIG_FILES([Makefile
111 src/power_management/Makefile