autogen.sh: change to use autoreconf et al
[lxde/lxpanel.git] / configure.ac
index 2213bd2..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])
@@ -237,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, netstat, 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
@@ -250,84 +256,41 @@ fi
 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_netstat=netstat
-    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
-                ;;
-            netstat)
-                plugin_netstat=netstat
-                ;;
-            volume)
-                plugin_volume=volume
-                ;;
-            volumealsa)
-                plugin_volumealsa=volumealsa
-                ;;
-            cpu)
-                plugin_cpu=cpu
-                ;;
-            deskno)
-                plugin_deskno=deskno
+            all)
+                for name in $ALL_PLUGINS_LIST
+                do
+                    export plugin_$name="$name"
+                done
                 ;;
-            batt)
-                plugin_batt=batt
-                ;;
-            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
@@ -402,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.])