dnl configure.ac -- autoconf script for the m17n-im-config package.
-dnl Copyright (C) 2007
+dnl Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
dnl National Institute of Advanced Industrial Science and Technology (AIST)
dnl Registration Number H15PRO112
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(m17n-im-config, 0.9.0, m17n-lib-bug@m17n.org)
+AC_INIT(m17n-im-config, 0.9.2, m17n-lib-bug@m17n.org)
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(src/config.h)
AC_GNU_SOURCE
-AM_GNU_GETTEXT
+AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION(0.14.4)
GETTEXTDIR="$datadir/locale"
AC_SUBST(GETTEXTDIR)
dnl Checks for programs for compiling.
AC_PROG_CC
+AC_PROG_CXX
AM_PROG_LIBTOOL
dnl Checks for standard header files.
dnl Check for Gtk+ library.
PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0])
-AC_CONFIG_FILES([Makefile intl/Makefile po/Makefile.in po/Makefile
+EXTRA_BUILD=
+
+AC_ARG_ENABLE(program,
+ AC_HELP_STRING([--enable-program],
+ [build a standalone program m17n-im-config (default is YES)]))
+AM_CONDITIONAL(ENABLE_PROG, test x$enable_program != xno)
+
+if test "x$enable_program" != "xno"; then
+ EXTRA_BUILD="$EXTRA_BUILD m17n-im-config(standalone program)"
+fi
+
+AC_ARG_ENABLE(SCIM_SETUP,
+ AC_HELP_STRING([--enable-scim-setup],
+ [build a module for scim-setup (default is YES)]))
+if test "x$SCIM_SETUP" != "xno" ; then
+ PKG_CHECK_MODULES(SCIM,[scim >= 1.4.0],
+ [SCIM_SETUP=yes], [SCIM_SETUP=no])
+ if test "x$SCIM_SETUP" = "xyes"; then
+ PKG_CHECK_MODULES(SCIM_GTKUTILS,[scim-gtkutils >= 1.4.0],
+ [SCIM_SETUP=yes], [SCIM_SETUP=no])
+ if test "x$SCIM_SETUP" = "xyes"; then
+ SCIM_MODULEDIR=`$PKG_CONFIG --variable=moduledir scim`
+ EXTRA_BUILD="$EXTRA_BUILD scim-m17n-setup(scim-setup module)"
+ fi
+ fi
+fi
+
+AM_CONDITIONAL(ENABLE_SCIM_SETUP, test "x$SCIM_SETUP" = "xyes")
+AC_SUBST(SCIM_MODULEDIR)
+
+AC_CONFIG_FILES([Makefile po/Makefile.in po/Makefile
+ m17n-im-config.pc
src/Makefile
])
AC_OUTPUT
+if test -n "$EXTRA_BUILD"; then
+ echo "Configured to build these extra programs/modules:"
+ echo " $EXTRA_BUILD"
+fi
+
dnl Local Variables:
dnl comment-start: "dnl "
dnl comment-end: ""