*** empty log message ***
[m17n/m17n-im-config.git] / configure.ac
index 31b46fe..605c00f 100644 (file)
@@ -1,6 +1,6 @@
 dnl configure.ac -- autoconf script for the m17n-im-config package.
 
-dnl Copyright (C) 2007, 2008
+dnl Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
 dnl   National Institute of Advanced Industrial Science and Technology (AIST)
 dnl   Registration Number H15PRO112
 
@@ -24,7 +24,7 @@ dnl Boston, MA 02110-1301, USA.
 
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT(m17n-im-config, 0.9.1, 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)
 
@@ -36,6 +36,7 @@ AC_SUBST(GETTEXTDIR)
 
 dnl Checks for programs for compiling.
 AC_PROG_CC
+AC_PROG_CXX
 AM_PROG_LIBTOOL
 
 dnl Checks for standard header files.
@@ -50,11 +51,36 @@ AC_SUBST(M17NLIB_LDFLAGS)
 dnl Check for Gtk+ library.
 PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= 2.4.0])
 
+EXTRA_BUILD=
+
 AC_ARG_ENABLE(program,
              AC_HELP_STRING([--enable-program],
-                            [enable a standalone program m17n-im-config (default is YES)]))
+                            [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
@@ -62,6 +88,11 @@ AC_CONFIG_FILES([Makefile po/Makefile.in po/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: ""