spelling
[monky] / configure.in
index f16af11..05d672a 100644 (file)
@@ -1,8 +1,9 @@
-AC_INIT([Conky],[1.3.3],[brenden1@users.sourceforge.net])
+AC_INIT([Conky],[1.4.0],[brenden1@users.sourceforge.net])
 
-AM_INIT_AUTOMAKE(conky, 1.3.3)
+AM_INIT_AUTOMAKE(conky, 1.4.0)
 AM_CONFIG_HEADER(src/config.h)
 AC_PROG_LIBTOOL
+PKG_PROG_PKG_CONFIG([0.17.2])
 
 
 AC_CONFIG_FILES(
@@ -47,9 +48,9 @@ dnl
 dnl XFT option
 dnl
 
-want_xft=no
+want_xft=yes
 AC_ARG_ENABLE(xft,
-[  --enable-xft            enable if you want to use Xft [default=no]],
+[  --enable-xft            enable if you want to use Xft [[default=yes]]],
   [want_xft="$enableval"])
 
 dnl
@@ -58,7 +59,7 @@ dnl
 
 dah=yes
 AC_ARG_ENABLE(own_window,
-[  --enable-own-window     enable if you want support for creating own window [default=yes]],
+[  --enable-own-window     enable if you want support for creating own window [[default=yes]]],
   [dah="$enableval"])
 
 if test $dah != "no"; then
@@ -69,9 +70,9 @@ dnl
 dnl PROC_UPTIME option
 dnl
 
-dah=no
+dah=yes
 AC_ARG_ENABLE(proc_uptime,
-[  --enable-proc-uptime    enable using /proc/uptime for uptime [default=no]],
+[  --enable-proc-uptime    enable using /proc/uptime for uptime [[default=yes]]],
   [dah="$enableval"])
 
 if test $dah = "yes"; then
@@ -79,12 +80,203 @@ if test $dah = "yes"; then
 fi
 
 dnl
+dnl XMMS (Version 1)
+dnl
+
+want_xmms=auto
+AC_ARG_ENABLE(xmms,
+   [  --enable-xmms           enable xmms (ver. 1) media player support [[default=auto]]],
+   [want_xmms="$enableval"])
+
+case x$want_xmms in
+    xauto)
+        want_xmms=yes
+        ## its ok to favor the glib 2.0 headers over 1.2 for our purposes ##
+        PKG_CHECK_MODULES([XMMS], [glib-2.0], [], [PKG_CHECK_MODULES([XMMS], [glib-1.2], [], [want_xmms=no])]) 
+
+        if test x$want_xmms = xyes; then
+            AC_CHECK_HEADERS([dlfcn.h], [], [want_xmms=no])
+            if test x$want_xmms = xyes; then
+                AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
+                                         [AC_CHECK_FUNCS(dlopen,[],
+                                                                [want_xmms=no])])
+                if test x$want_xmms = xyes; then
+                     CFLAGS="$CFLAGS $XMMS_CFLAGS"
+                    ### if we link to glib 1.2, that means 2.0 wasn't found ###
+                    ### if we link to glib 2.0, that's ok, we will load libglib-1.2.so.0 dynamically ###
+                     LIBS="$LIBS $XMMS_LIBS"
+                     AC_DEFINE(XMMS, 1, [Define for XMMS Ver. 1 support])
+                fi
+            fi
+        fi
+        ;;
+    xyes)
+        ## its ok to favor the glib 2.0 headers over 1.2 for our purposes ##
+       PKG_CHECK_MODULES([XMMS], [glib-2.0], [], [PKG_CHECK_MODULES([XMMS], [glib-1.2])])
+        CFLAGS="$CFLAGS $XMMS_CFLAGS"
+       ### if we link to glib 1.2, that means 2.0 wasn't found ###
+       ### if we link to glib 2.0, that's ok, we will load libglib-1.2.so.0 dynamically ###
+        LIBS="$LIBS $XMMS_LIBS"
+        AC_CHECK_HEADERS([dlfcn.h], [],
+             [AC_MSG_ERROR(["dlfcn.h not found: dynamic library loading not supported"])])
+        AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
+                                 [AC_CHECK_FUNCS(dlopen,[],
+                                                        [AC_MSG_ERROR([dlopen() not available])])])
+        AC_DEFINE(XMMS, 1, [Define for XMMS Ver. 1 support])
+        ;;
+    xno)
+        ;;
+    *)
+        echo "Error: invalid xmms parameter specified: $want_xmms"
+        exit -1
+        ;;
+esac
+AM_CONDITIONAL(BUILD_XMMS, test x$want_xmms = xyes)
+
+dnl
+dnl BMP (through 0.9.7.1)
+dnl
+
+want_bmp=auto
+AC_ARG_ENABLE(bmp,
+   [  --enable-bmp            enable beep media media player support [[default=auto]]],
+   [want_bmp="$enableval"])
+
+case x$want_bmp in
+    xauto)
+        want_bmp=yes
+        PKG_CHECK_MODULES([BMP], [glib-2.0], [], [want_bmp=no])
+        if test x$want_bmp = xyes; then
+            AC_CHECK_HEADERS([dlfcn.h], [], [want_bmp=no])
+            if test x$want_bmp = xyes; then
+                AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
+                                         [AC_CHECK_FUNCS(dlopen,[],
+                                                                [want_bmp=no])])
+                if test x$want_bmp = xyes; then
+                     CFLAGS="$CFLAGS $BMP_CFLAGS"
+                     LIBS="$LIBS $BMP_LIBS"
+                     AC_DEFINE(BMP, 1, [Define for Beep Media Player support])
+                fi
+            fi
+        fi
+        ;;
+    xyes)
+        PKG_CHECK_MODULES([BMP], [glib-2.0 >= 2.0])
+        CFLAGS="$CFLAGS $BMP_CFLAGS"
+        LIBS="$LIBS $BMP_LIBS"
+        AC_CHECK_HEADERS([dlfcn.h], [],
+             [AC_MSG_ERROR(["dlfcn.h not found: dynamic library loading not supported"])])
+        AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"],
+                                 [AC_CHECK_FUNCS(dlopen,[],
+                                                        [AC_MSG_ERROR([dlopen() not available])])])
+        AC_DEFINE(BMP, 1, [Define for Beep Media Player support])
+        ;;
+    xno)
+        ;;
+    *)
+        echo "Error: invalid bmp parameter specified: $want_bmp"
+        exit -1
+        ;;
+esac
+AM_CONDITIONAL(BUILD_BMP, test x$want_bmp = xyes)
+
+dnl
+dnl Audacious Media Player
+dnl
+
+want_audacious=auto
+AC_ARG_ENABLE(audacious,
+   [  --enable-audacious      enable audacious player support [[default=auto]]],
+   [want_audacious="$enableval"])
+
+case x$want_audacious in
+    xauto)
+        want_audacious=yes
+        PKG_CHECK_MODULES([AUDACIOUS], [glib-2.0], [], [want_audacious=no])  
+       if test x$want_audacious = xyes; then
+           AC_CHECK_HEADERS([dlfcn.h], [], [want_audacious=no])
+           if test x$want_audacious = xyes; then
+               AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"], 
+                                         [AC_CHECK_FUNCS(dlopen,[],
+                                                                [want_audacious=no])])
+               if test x$want_audacious = xyes; then
+                    CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
+                    LIBS="$LIBS $AUDACIOUS_LIBS"
+                    AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
+               fi
+           fi
+        fi
+        ;;
+    xyes)
+        PKG_CHECK_MODULES([AUDACIOUS], [glib-2.0])
+        CFLAGS="$CFLAGS $AUDACIOUS_CFLAGS"
+        LIBS="$LIBS $AUDACIOUS_LIBS"
+        AC_CHECK_HEADERS([dlfcn.h], [], 
+             [AC_MSG_ERROR(["dlfcn.h not found: dynamic library loading not supported"])])
+       AC_CHECK_LIB(dl, dlopen, [LIBS="$LIBS -ldl"], 
+                                 [AC_CHECK_FUNCS(dlopen,[], 
+                                                        [AC_MSG_ERROR([dlopen() not available])])])
+        AC_DEFINE(AUDACIOUS, 1, [Define for Audacious support])
+        ;;
+    xno)
+       ;;
+    *)
+        echo "Error: invalid audacious parameter specified: $want_audacious"
+        exit -1
+       ;;
+esac
+AM_CONDITIONAL(BUILD_AUDACIOUS, test x$want_audacious = xyes)
+
+dnl
+dnl InfoPipe (Version 1.3)
+dnl
+
+want_infopipe=yes
+AC_ARG_ENABLE(infopipe,
+   [  --enable-infopipe       enable xmms/bmp infopipe support [[default=yes]]],
+   [want_infopipe="$enableval"])
+
+case x$want_infopipe in
+    xyes)
+        AC_DEFINE(INFOPIPE, 1, [Define for InfoPipe support])
+        ;;
+    xno)
+        ;;
+    *)
+        echo "Error: invalid infopipe parameter specified: $want_infopipe"
+        exit -1
+        ;;
+esac
+AM_CONDITIONAL(BUILD_INFOPIPE, test x$want_infopipe = xyes)
+
+dnl
+dnl BMPx
+dnl
+
+want_bmpx=no
+AC_ARG_ENABLE(bmpx,
+             [  --enable-bmpx           enable if you want BMPx support [[default=no]]],
+             [want_bmpx="$enableval"])
+
+AM_CONDITIONAL(BUILD_BMPX, test x$want_bmpx = xyes)
+if test x$want_bmpx = xyes; then
+       PKG_CHECK_MODULES([DBUS], [dbus-1 >= 0.35 dbus-glib-1 >= 0.35])
+       CFLAGS="$CFLAGS $DBUS_CFLAGS"
+       LIBS="$LIBS $DBUS_LIBS"
+       AC_CHECK_HEADERS([bmpx/dbus.h], [], [BMPX_MISSING=yes])
+       if test "x$BMPX_MISSING" = xyes; then
+               AC_MSG_ERROR([bmpx doesn't seem to be installed, or the headers aren't available])
+       fi
+       AC_DEFINE(BMPX, 1, [Define if you want BMPx support])
+fi
+
+dnl
 dnl Seti@Home
 dnl
 
-want_seti=no
+want_seti=yes
 AC_ARG_ENABLE(seti,
-[  --enable-seti           enable if you want SETI at Home stats [default=no]],
+[  --enable-seti           enable if you want SETI at Home stats [[default=yes]]],
   [want_seti="$enableval"])
 
 AM_CONDITIONAL(BUILD_SETI, test x$want_seti = xyes)
@@ -96,9 +288,9 @@ dnl
 dnl MPD
 dnl
 
-want_mpd=no
+want_mpd=yes
 AC_ARG_ENABLE(mpd,
-[  --enable-mpd            enable if you want MPD support [default=no]],
+[  --enable-mpd            enable if you want MPD support [[default=yes]]],
   [want_mpd="$enableval"])
 
 AM_CONDITIONAL(BUILD_MPD, test x$want_mpd = xyes)
@@ -107,34 +299,26 @@ if test x$want_mpd = xyes; then
 fi
 
 dnl
-dnl Cairo
+dnl PORT_MONITORS
 dnl
 
-want_cairo=no
-AC_ARG_ENABLE(cairo,
-[  --enable-cairo          enable if you want Cairo support [default=no]],
-  [want_cairo="$enableval"])
-
-AM_CONDITIONAL(BUILD_CAIRO, test x$want_cairo = xyes)
-
+want_portmon=yes
+AC_ARG_ENABLE(portmon,
+[  --enable-portmon        enable if you want tcp (ip4) port monitoring [[default=yes]]],
+  [want_portmon="$enableval"])
 
-if test "$want_cairo" = "yes"; then
-  AC_CHECK_HEADERS([cairo.h cairo-xlib.h], [], [CAIRO_MISSING=yes])
-    if test "x$CAIRO_MISSING" = xyes; then
-      AC_MSG_ERROR([something went wrong when checking for cairo, you're probably missing headers or it's not installed])
-  fi
-  AC_PATH_PROG(CAIROCONFIG, pkg-config)
-  if test x$CAIROCONFIG != x; then
-    dnl TODO: needs more checks
-
-    AC_DEFINE(CAIRO, 1, [Define if you are using Cairo])
-    CFLAGS="$CFLAGS `$CAIROCONFIG --cflags cairo` `$CAIROCONFIG --libs cairo` "
-    CAIRO_LIBS="`$CAIROCONFIG --libs cairo` `$CAIROCONFIG --cflags cairo`"
-  else
-    want_cairo=no
+AM_CONDITIONAL(BUILD_PORT_MONITORS, test x$want_portmon = xyes)
+if test x$want_portmon = xyes; then
+  AC_CHECK_HEADERS([netdb.h netinet/in.h netinet/tcp.h sys/socket.h arpa/inet.h], [], [PORT_MONITORS_MISSING=yes])
+  if test "x$PORT_MONITORS_MISSING" = xyes; then
+         AC_MSG_ERROR([missing a needed network header for port monitoring])
   fi
+  AC_DEFINE(TCP_PORT_MONITOR, 1, [Define if you want tcp port monitoring support])
 fi
 
+dnl
+dnl Cairo
+dnl
 
 dnl
 dnl MLDonkey
@@ -142,7 +326,7 @@ dnl
 
 want_mldonkey=no
 AC_ARG_ENABLE(mldonkey,
-[  --enable-mldonkey       enable if you want MLDonkey support [default=no]],
+[  --enable-mldonkey       enable if you want MLDonkey support [[default=no]]],
   [want_mldonkey="$enableval"])
 
 AM_CONDITIONAL(BUILD_MLDONKEY, test x$want_mldonkey = xyes)
@@ -162,12 +346,12 @@ dnl
 
 dah=yes
 AC_ARG_ENABLE(double_buffer,
-[  --enable-double-buffer  enable if you want to support flicker-free operation [default=yes]],
+[  --enable-double-buffer  enable if you want to support flicker-free operation [[default=yes]]],
   [dah="$enableval"])
 
 want_x11=yes
 AC_ARG_ENABLE(x11,
-[  --enable-x11            enable if you want X11 support [default=yes]],
+[  --enable-x11            enable if you want X11 support [[default=yes]]],
  [want_x11="$enableval"])
 
 
@@ -260,7 +444,6 @@ AC_CHECK_HEADERS([sys/mount.h], [], [],
                  #include <sys/param.h>
                  #endif
 ])
-dnl For cairo
 
 dnl
 dnl Check doc stuff