Add --disable-qt4-immodule to configure.
authorHuang Peng <shawn.p.huang@gmail.com>
Tue, 5 Aug 2008 12:44:13 +0000 (20:44 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Tue, 5 Aug 2008 12:44:13 +0000 (20:44 +0800)
configure.ac
gconf/ibus-gconf
gtk2/Makefile.am
qt4/Makefile.am

index 1ff2f9e3a5adf5d2262496d995b36425bbbf58f6..779b890d5723e32ae5ec560b78a4046fc8cd9fb3 100644 (file)
@@ -71,6 +71,13 @@ PKG_CHECK_MODULES(GTK2, [
        gtk+-2.0
 ])
 
+GTK_BINARY_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
+GTK_LIBDIR=`$PKG_CONFIG --variable=libdir gtk+-2.0`
+if test -z "$GTK_LIBDIR)"; then
+       GTK_LIBDIR="$libdir"
+fi
+GTK_IM_MODULEDIR=$GTK_LIBDIR/gtk-2.0/immodules
+
 PKG_CHECK_MODULES(GDK2, [
        gdk-2.0
 ])
@@ -86,16 +93,19 @@ PKG_CHECK_MODULES(DBUS, [
 
 
 # Check for Qt4
-PKG_CHECK_MODULES(QT, [
-       QtCore >= 4.3.5
-       QtDBus >= 4.3.5
-])
-
-QMAKE=`$PKG_CONFIG --variable=qmake Qt`
-if test x"$QMAKE" == x""; then
-       QMAKE=qmake-qt4
+PKG_CHECK_MODULES(QT,
+[QtCore >= 4.3.5 QtDBus >= 4.3.5],
+[IBUS_HAS_QT4=yes],
+[IBUS_HAS_QT4=no]
+)
+
+if test x"$HAS_QT4" == x"yes"; then
+       QMAKE=`$PKG_CONFIG --variable=qmake Qt`
+       if test x"$QMAKE" == x""; then
+               QMAKE=qmake-qt4
+       fi
+       AC_SUBST(QMAKE)
 fi
-AC_SUBST(QMAKE)
 
 # Check for x11
 PKG_CHECK_MODULES(X11, [
@@ -139,6 +149,27 @@ AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT_VERSION(0.16.1)
 
 
+# define configure arguments
+AC_ARG_WITH(gtk-im-module-dir,
+       AS_HELP_STRING([--with-gtk-im-module-dir[=DIR]],
+               [Select gtk immodule dir]),
+       GTK_IM_MODULEDIR=$with_gtk_im_module_dir
+)
+AC_SUBST(GTK_IM_MODULEDIR)
+
+AC_ARG_ENABLE(qt4-immodule,
+       AS_HELP_STRING([--disable-qt4-immodule],
+               [do not build qt4 immodule]),
+       [enable_qt4=$enableval],
+       [enable_qt4=yes],
+)
+if test x"$IBUS_HAS_QT4" != x"yes"; then
+       enable_qt4=no
+fi
+AM_CONDITIONAL(IBUS_BUILD_QT4, [test x"$enable_qt4" = x"yes" ])
+AC_SUBST(IBUS_BUILD_QT4)
+
+
 # OUTPUT files
 AC_CONFIG_FILES([ po/Makefile.in
 Makefile
@@ -166,3 +197,14 @@ m4/Makefile
 ])
 
 AC_OUTPUT
+
+AC_MSG_RESULT([
+Build options:
+  Version                  $VERSION
+  Install prefix           $prefix
+  Build shared libs        $enable_shared
+  Build static libs        $enable_static
+  Gtk immodule dir         $GTK_IM_MODULEDIR
+  Enable Qt4 IM module     $enable_qt4
+])
+
index f7ee86d61778a33264da6027f44280dabf255b31..0d996bbbe9511950edca60cf651783015fe456fa 100644 (file)
@@ -19,5 +19,5 @@
 # Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 # Boston, MA  02111-1307  USA
 
-exec python /usr/share/ibus/gconf/main.py $@
+exec python /usr/local/share/ibus/gconf/main.py $@
 
index 1ef494a4e81e4b9c5d16119f7e08a4490d96fab9..d824e44b2632d241f6d00bfbce66deeac3d3bea0 100644 (file)
@@ -40,7 +40,8 @@ libibus_gtk_la_LDFLAGS = \
        @DBUS_LIBS@ \
        $(NULL)
 
-immoduledir = $(libdir)/gtk-2.0/immodules
+immoduledir = @GTK_IM_MODULEDIR@
+# $(libdir)/gtk-2.0/immodules
 immodule_LTLIBRARIES = im-ibus.la
 im_ibus_la_DEPENDENCIES = libibus-gtk.la
 im_ibus_la_SOURCES = \
index 476ea6bd30eb372909c915f2ed9e7a5dd4d84fbf..012a6b0c9373e3b96b6a48ddb4fbc0c9005a0091 100644 (file)
@@ -28,6 +28,7 @@ EXTRA_DIST = \
        im-ibus-qt.cpp \
        $(NULL)
 
+if IBUS_BUILD_QT4
 Makefile.qmake: ibus.pro
        $(QMAKE) -makefile -o Makefile.qmake $(srcdir)/ibus.pro
 
@@ -50,3 +51,5 @@ uninstall-local: Makefile.qmake
 
 test: all
        QT_IM_MODULE=ibus kwrite
+endif
+