wmail: updated contact details in README.
[dockapps.git] / wmhdplop / configure.ac
blob03314d0ab39b74bea089e1568a7a49215bfed4c1
1 AC_INIT(wmhdplop, 0.9.11)
2 AC_CONFIG_SRCDIR(wmhdplop.c)
3 AM_INIT_AUTOMAKE
4 AM_CONFIG_HEADER(config.h)
6 AC_SUBST(VERSION)
8 ISODATE=`date +%Y-%m-%d`
9 AC_SUBST(ISODATE)
11 AC_CANONICAL_HOST
13 AC_PROG_INSTALL
14 AC_PROG_CC
15 AC_HEADER_STDC
18 AC_DEFINE(ENABLE_HDDTEMP_QUERY,[],[enable queries to hddtemp])
19 AC_DEFINE(_GNU_SOURCE,[],[uses GNU extensions])
22 if test x$GCC = xyes; then
23   CFLAGS="-O3 -fomit-frame-pointer -ffast-math -Wall -W";
26 dnl check for X
27 AC_PATH_X
28 AC_PATH_XTRA
29 if test x$no_x = xyes; then
30   echo "You need to supply the path to the X headers and libraries with --x-includes=dir and --x-libraries=dir";
31   exit 1;
32 fi;
34 LIBS="${X_PRE_LIBS} ${X_LIBS} -lX11 -lXext ${LIBS} ${X_EXTRA_LIBS}"
35 CFLAGS="$CFLAGS $X_CFLAGS"
37 dnl Checks for library functions.
38 AC_CHECK_HEADERS(linux/hdreg.h)
40 AC_CHECK_PROG([IMLIB2_CONFIG_IN_PATH],[imlib2-config],[yes],[no])
41 if test "x$IMLIB2_CONFIG_IN_PATH" = "xno"; then
42   AC_ERROR([imlib2-config not found in PATH.. You need to install Imlib2 (and its developpement package)])
44 IMLIB2_CFLAGS=$(imlib2-config --cflags)
45 IMLIB2_LIBS=$(imlib2-config --libs)
46 AC_SUBST(IMLIB2_CFLAGS)
47 AC_SUBST(IMLIB2_LIBS)
49 YELLOW="\\033\\1331;33m"
50 RESET="\\033\\1330m"
52 dnl Checks for the gkrellm plugin
53 build_gkhdplop="yes"
54 AC_ARG_ENABLE(gkrellm,
55  [  --enable-gkrellm        build the gkrellm plugin (requires gtk2 and gkrellm developpement files) (Default is yes)
56   --disable-gkrellm       do not build the gkrellm plugin],
57  [ if   test "x$enableval" = "xno" ; then
58         build_gkhdplop="no"
59         echo you disabled the gkhdplop gkrellm plugin
60    fi
61  ], [build_gkhdplop="yes"])
63 GKHDPLOP=""
64 if test "x$build_gkhdplop" = "xno"; then
65   echo gkhdplop disabled...
66 else
67   echo building with GKHDPLOP, checking for gtk2..
68   pkg_modules="gtk+-2.0 >= 2.0.0"
69   PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
70   GTK2_CFLAGS=$PACKAGE_CFLAGS;
71   GTK2_LIBS=$PACKAGE_LIBS;
72   AC_SUBST(GTK2_CFLAGS)
73   AC_SUBST(GTK2_LIBS)
74   SAVECPPFLAGS="$CPPFLAGS"
75   CPPFLAGS="$CFLAGS $GTK2_CFLAGS"
76   AC_CHECK_HEADERS([gkrellm2/gkrellm.h], [ok=1], [ok=0])
77   if test "x$ok" = "x0"; then
78      echo -e "${YELLOW}gkrellm2/gkrellm.h header not found or unusable${RESET}... cannot build gkhdplop.so"
79      build_gkhdplop="no"
80   else
81     GKHDPLOP="gkhdplop.so"
82   fi
83   CPPFLAGS="$SAVECPPFLAGS"
85 AC_SUBST(GKHDPLOP)
88 AC_OUTPUT(Makefile)
90 echo "- - - - - - - - - - - - - - - -"
91 echo -e "${YELLOW}wmhdplop    will be built${RESET}"
92 if test "x$build_gkhdplop" = "xno"; then
93   echo -e "${YELLOW}gkhdplop.so will NOT be built${RESET}"
94 else
95   echo -e "${YELLOW}gkhdplop.so will be built${RESET}"
96   echo "Check that the plugin is working properly before installing it with:"
97   echo "   gkrellm -p ./gkhdplop.so"
98   echo "and then install the gkrellm plugin with:"
99   echo "     mv ./gkhdplop.so ~/.gkrellm2/plugins"