autogen.sh: change to use autoreconf et al
[lxde/lxpanel.git] / configure.ac
index 2a87762..bd3a990 100644 (file)
@@ -1,7 +1,8 @@
 AC_PREREQ(2.53)
-AC_INIT(lxpanel, 0.5.8, http://lxde.org/)
-AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign])
+AC_INIT(lxpanel, 0.5.12, http://lxde.org/)
+AM_INIT_AUTOMAKE([-Wall foreign])
 AC_CONFIG_HEADER([config.h])
+AC_CONFIG_MACRO_DIR([m4])
 
 # Support silent build rules. Disable by either passing --disable-silent-rules
 # to configure or passing V=1 to make
@@ -16,6 +17,7 @@ AC_PROG_INSTALL
 AC_PROG_LN_S
 AC_PROG_INTLTOOL(, [no-xml])
 AM_PROG_CC_C_O
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 
 #Initialize libtool
 LT_PREREQ([2.2])
@@ -34,12 +36,13 @@ if test "x$enable_gtk3" = "xyes" ; then
   CFLAGS="$CFLAGS -DENABLE_GTK3"
   pkg_modules="$pkg_modules gtk+-3.0"
 else
-  pkg_modules="$pkg_modules gtk+-2.0 >= 2.12.0"
+  pkg_modules="$pkg_modules gtk+-2.0 >= 2.16.0"
 fi
 
 pkg_modules="$pkg_modules \
              gio-unix-2.0 \
              gthread-2.0 \
+             gmodule-2.0 \
              libmenu-cache"
 #             libstartup-notification-1.0"
 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
@@ -218,6 +221,7 @@ fi
 
 dnl Here are plugin listing.
 plugin_netstatus=
+plugin_netstat=
 plugin_volume=
 plugin_volumealsa=
 plugin_cpu=
@@ -236,8 +240,11 @@ AC_ARG_WITH(plugins,
 [  --with-plugins=<list>  compile dynamic plugins in <list> ]
 [                         plugins may be comma separated ]
 [                         'all' builds all plugins (default), 'none' builds none ]
+[                         plugins prefixed with '-' are not built]
 [                         Possible plugins are: ]
-[                         netstatus, volume, volumealsa, cpu, deskno, batt, kbled, xkb, thermal, cpufreq, monitors, wnckpager], plugins="$withval",[plugins="all"])
+[                         netstatus, netstat, volume, volumealsa, cpu, deskno, batt,]
+[                         kbled, xkb, thermal, cpufreq, monitors, wnckpager]
+, plugins="$withval",[plugins="all"])
 
 if test x"$plugins" != xall -a x"$plugins" != xnone; then
     if test x"$plugins_loading" = xno; then
@@ -246,83 +253,44 @@ if test x"$plugins" != xall -a x"$plugins" != xnone; then
     fi
 fi
 
-ALL_PLUGINS_LIST="netstatus volume volumealsa cpu deskno batt kbled xkb thermal cpufreq monitors wnckpager"
+ALL_PLUGINS_LIST="netstatus netstat volume volumealsa cpu deskno batt kbled xkb thermal cpufreq monitors wnckpager indicator"
 AC_SUBST(ALL_PLUGINS_LIST)
 
-if test x"$plugins" = xall; then
-dnl    for name in $ALL_PLUGINS
-dnl    do
-dnl        export plugin_$name="$name"
-dnl    done
-
-    plugin_netstatus=netstatus
-    plugin_volume=volume
-    plugin_volumealsa=volumealsa
-    plugin_cpu=cpu
-    plugin_deskno=deskno
-    plugin_batt=batt
-    plugin_kbled=kbled
-    plugin_xkb=xkb
-    plugin_thermal=thermal
-    plugin_cpufreq=cpufreq
-    plugin_monitors=monitors
-    plugin_wnckpager=wnckpager
-    plugin_indicator=indicator
-
-    AC_MSG_RESULT(all)
-else
-    if test "$plugins" != "none"; then
-        plugins=`echo $plugins | sed 's/,/ /g'`
-        for plugin in $plugins
-        do
+AC_DEFUN([check_plugin_name],[
+    plugin_found=false
+    for name in $ALL_PLUGINS_LIST; do
+        if test x[$1] = x[$name]; then
+            plugin_found=true
+        fi
+    done
+    if test x[$plugin_found] = false; then
+        echo [Unknown plugin $1.]
+        exit 1
+    fi
+])
+
+if test "$plugins" != "none"; then
+    plugins=`echo $plugins | sed 's/,/ /g'`
+    for plugin in $plugins
+    do
         case "$plugin" in
-            netstatus)
-                plugin_netstatus=netstatus
-                ;;
-            volume)
-                plugin_volume=volume
-                ;;
-            volumealsa)
-                plugin_volumealsa=volumealsa
-                ;;
-            cpu)
-                plugin_cpu=cpu
-                ;;
-            deskno)
-                plugin_deskno=deskno
-                ;;
-            batt)
-                plugin_batt=batt
+            all)
+                for name in $ALL_PLUGINS_LIST
+                do
+                    export plugin_$name="$name"
+                done
                 ;;
-            kbled)
-                plugin_kbled=kbled
-                ;;
-            xkb)
-                plugin_xkb=xkb
-                ;;
-            thermal)
-                plugin_thermal=thermal
-                ;;
-            cpufreq)
-                plugin_cpufreq=cpufreq
-                ;;
-            monitors)
-                plugin_monitors=monitors
-                ;;
-            wnckpager)
-                plugin_wnckpager=wnckpager
-                ;;
-            indicator)
-                plugin_indicator=indicator
+            -*)
+                check_plugin_name([${plugin#-}])
+                export plugin_${plugin#-}=
                 ;;
             *)
-                echo "Unknown plugin $plugin."
-                exit 1
+                check_plugin_name([$plugin])
+                export plugin_$plugin=$plugin
                 ;;
         esac
-        done
-        AC_MSG_RESULT($plugins)
-    fi
+    done
+    AC_MSG_RESULT($plugins)
 fi
 
 dnl FIXME: OSS/ALSA checking
@@ -343,6 +311,7 @@ fi
 
 PLUGINS_LIST="\
     $plugin_netstatus \
+    $plugin_netstat \
     $plugin_volume \
     $plugin_volumealsa \
     $plugin_cpu \
@@ -358,6 +327,12 @@ PLUGINS_LIST="\
 
 AC_SUBST(PLUGINS_LIST)
 
+# Plugin-specific dependencies
+# nestat
+if test x"$plugin_netstat" != "x";then
+AC_CHECK_HEADER([iwlib.h],,
+ AC_MSG_ERROR([netstat plugin requires wireless-tools-devel]))
+fi
 
 # Checks for header files.
 AC_PATH_X
@@ -390,7 +365,7 @@ do
 done
 
 GETTEXT_PACKAGE=lxpanel
-#AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT_VERSION(0.14.1)
 AC_SUBST(GETTEXT_PACKAGE)
 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
@@ -418,6 +393,7 @@ AC_CONFIG_FILES([
     src/Makefile
     src/plugins/Makefile
     src/plugins/netstatus/Makefile
+    src/plugins/netstat/Makefile
     src/plugins/volume/Makefile
     src/plugins/volumealsa/Makefile
     src/plugins/cpu/Makefile
@@ -433,6 +409,8 @@ AC_CONFIG_FILES([
     po/Makefile.in
     data/Makefile
     data/default/panels/panel
+    data/two_panels/panels/top
+    data/two_panels/panels/bottom
     man/Makefile
 ])
 AC_OUTPUT
@@ -446,6 +424,9 @@ echo Building dynamic plugins:
     if test x"$plugin_netstatus" != x; then
         AC_MSG_RESULT([    netstatus - Monitor networking status])
     fi
+    if test x"$plugin_netstat" != x; then
+        AC_MSG_RESULT([    netstat - Monitor networking status])
+    fi
     if test x"$plugin_volume" != x; then
         AC_MSG_RESULT([    volume - Display and adjust volume of sound card for OSS])
     fi