Localisation support
[sbrightapplet] / configure.ac
index 8d203fc..82ba680 100644 (file)
@@ -1,21 +1,46 @@
-AC_PREREQ[(2.58)]
-AC_INIT([simple-brightness-applet], [1.1])
+AC_INIT(m4_esyscmd([dpkg-parsechangelog | grep ^Source:.* | cut -d ' ' -f 2 | tr -d '\n']), m4_esyscmd([dpkg-parsechangelog | grep ^Version:.* | cut -d ' ' -f 2 | tr -d '\n']), m4_esyscmd([dpkg-parsechangelog | grep ^Maintainer:.* | awk '{print $2 " "$3}' | tr -d '\n']))
 AC_CONFIG_SRCDIR([src/simple-brightness-applet.c])
-AM_INIT_AUTOMAKE
-AC_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE([foreign dist-tarZ])
+AC_CONFIG_HEADERS([config.h])
+
+AM_MAINTAINER_MODE
 
 AC_PROG_CC
+AM_PROG_CC_C_O
+AC_HEADER_STDC
+AM_PATH_GLIB_2_0([2.16.0])
+AM_PATH_GTK_2_0([2.14.7])
 AC_PROG_INSTALL
+AC_DISABLE_STATIC
 AM_PROG_LIBTOOL
+AC_PREFIX_DEFAULT(/usr)
+
+# AC_PREFIX_DEFAULT does not get expanded until too late so we need to do this to use prefix in this script --conny 
+if test "x$prefix" = "xNONE" ; then
+       prefix='/usr'
+fi
 
 PKG_CHECK_MODULES(BRIGHTNESS, hildon-1 libhildondesktop-1 gtk+-2.0 glib-2.0 gobject-2.0 gconf-2.0 libosso)
 AC_SUBST(BRIGHTNESS_CFLAGS)
 AC_SUBST(BRIGHTNESS_LIBS)
 
+PKG_CHECK_MODULES([OSSOSETTINGS], [osso-af-settings])
+
 HILDON_HOME_DESKTOP_DIR=`pkg-config libhildondesktop-1 --variable=hildonstatusmenudesktopentrydir`
 AC_SUBST(HILDON_HOME_DESKTOP_DIR)
 
 HILDON_DESKTOP_LIB_DIR=`pkg-config libhildondesktop-1 --variable=hildondesktoplibdir`
 AC_SUBST(HILDON_DESKTOP_LIB_DIR) 
 
-AC_OUTPUT([Makefile src/Makefile data/Makefile])
+LOCALEDIR=`$PKG_CONFIG osso-af-settings --variable=localedir`
+AC_SUBST([LOCALEDIR])
+AC_DEFINE_UNQUOTED([LOCALEDIR], ["$LOCALEDIR"], [LOCALEDIR])
+
+AH_TEMPLATE([GETTEXT_PACKAGE], [NAME])
+GETTEXT_PACKAGE=m4_esyscmd([dpkg-parsechangelog | sed -n 's/Source: //p' | tr -d '\n'])
+AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext package])
+AC_SUBST([GETTEXT_PACKAGE])
+AC_PROG_INTLTOOL([0.40.0],[no-xml])
+AM_GLIB_GNU_GETTEXT
+
+AC_OUTPUT([Makefile po/Makefile.in src/Makefile data/Makefile])