Fix Makefile.am not to build GTK setup module.
[framework/uifw/ise-engine-hangul.git] / skim / configure.in
1 dnl =======================================================
2 dnl FILE: ./admin/configure.in.min
3 dnl =======================================================
4
5 dnl    This file is part of the KDE libraries/packages
6 dnl    Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
7  
8 dnl    This file is free software; you can redistribute it and/or
9 dnl    modify it under the terms of the GNU Library General Public
10 dnl    License as published by the Free Software Foundation; either
11 dnl    version 2 of the License, or (at your option) any later version.
12  
13 dnl    This library is distributed in the hope that it will be useful,
14 dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
15 dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 dnl    Library General Public License for more details.
17  
18 dnl    You should have received a copy of the GNU Library General Public License
19 dnl    along with this library; see the file COPYING.LIB.  If not, write to
20 dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 dnl    Boston, MA 02111-1307, USA.
22
23 # Original Author was Kalle@kde.org
24 # I lifted it in some mater. (Stephan Kulow)
25 # I used much code from Janos Farkas
26
27 dnl Process this file with autoconf to produce a configure script.
28
29 AC_INIT(acinclude.m4) dnl a source file from your sub dir
30
31 dnl This is so we can use kde-common
32 AC_CONFIG_AUX_DIR(admin)
33
34 dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
35 unset CDPATH
36
37 dnl Checking host/target/build systems, for make, install etc.
38 AC_CANONICAL_SYSTEM 
39 dnl Perform program name transformation
40 AC_ARG_PROGRAM
41
42 dnl Automake doc recommends to do this only here. (Janos)
43 AM_INIT_AUTOMAKE(skim-scim-hangul, 0.3.2) dnl searches for some needed programs
44
45 KDE_SET_PREFIX
46
47 dnl generate the config header
48 AM_CONFIG_HEADER(config.h) dnl at the distribution this done
49
50 dnl Checks for programs.
51 AC_CHECK_COMPILERS
52 AC_ENABLE_SHARED(yes)
53 AC_ENABLE_STATIC(no)
54 KDE_PROG_LIBTOOL
55
56 dnl for NLS support. Call them in this order!
57 dnl WITH_NLS is for the po files
58 AM_KDE_WITH_NLS
59
60 KDE_USE_QT($REQUIRED_KDE_VERSION)
61 AC_PATH_KDE
62 dnl =======================================================
63 dnl FILE: configure.in.in
64 dnl =======================================================
65
66 REQUIRED_KDE_VERSION=3.2.0
67 #MIN_CONFIG($REQUIRED_KDE_VERSION)
68 ##AC_CONFIG_SRCDIR(src/main.cpp)
69 dnl PACKAGE set before
70
71 REQUIRED_SCIM_VERSION=1.3.0
72
73 PKG_CHECK_MODULES(SCIM, [scim >= $REQUIRED_SCIM_VERSION],
74                         [HAS_SCIM=yes],
75                         [HAS_SCIM=no])
76
77 AC_SUBST(REQUIRED_KDE_VERSION)
78 AC_SUBST(REQUIRED_SCIM_VERSION)
79
80 if test "x$HAS_SCIM" != "xyes"; then
81   AC_MSG_ERROR([SCIM library is not available or the version is too old!])
82 else
83   SCIM_VERSION=`$PKG_CONFIG --modversion scim`
84 fi
85
86 ##dnl PACKAGE set before
87 AM_GNU_GETTEXT([external])
88
89 ###########################################################
90 ##             Definiation of compile args.              ##
91 ###########################################################
92 AC_ARG_ENABLE(scim-debug,
93               [  --enable-scim-debug            Turn on debugging],
94               scim_debug=yes,
95               scim_debug=no)
96
97 if test "$scim_debug" = "yes"; then
98   AC_DEFINE(ENABLE_DEBUG,1,[Define this to enable the debug facility in scim-panel-lib])
99   CFLAGS="$CFLAGS -g"
100   CXXFLAGS="$CXXFLAGS -g"
101 else
102   AC_DEFINE(ENABLE_DEBUG,0)
103 fi
104
105 #AC_CHECK_HEAD
106 AC_C_BIGENDIAN
107 AC_CHECK_KDEMAXPATHLEN
108
109 ##AC_OUTPUT
110 REQUIRED_SKIM_VERSION=1.3.0
111 dnl skim probably has been installed under prefix=$KDEDIR, so add it to search path of pkgconfig
112 kde_libsuffix=`kde-config --libsuffix`
113 test -z "$KDEDIR" && KDEDIR=`kde-config --prefix`
114 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$KDEDIR/lib${kde_libsuffix}/pkgconfig
115 PKG_CHECK_MODULES(SKIM, [skim >= $REQUIRED_SKIM_VERSION],
116                         [HAS_SKIM=yes],
117                         [HAS_SKIM=no])
118
119 if test "x$HAS_SKIM" = "xyes"; then
120
121 PKG_CHECK_MODULES(SCIM_KDEUTILS,[scim_kdeutils >= $REQUIRED_SKIM_VERSION],
122                                 [HAS_KDEUTILS=yes],
123                                 [HAS_KDEUTILS=no])
124
125   if test "x$HAS_KDEUTILS" = "xyes"; then
126         SKIM_VERSION=`$PKG_CONFIG --modversion skim`
127         SCIM_PINYIN_ENABLE_SKIM_SUPPORT=1
128         skim_prefix=`$PKG_CONFIG --variable=prefix skim`
129         skim_libdir=`$PKG_CONFIG --variable=libdir skim`
130         AC_SUBST(skim_prefix)
131         AC_SUBST(skim_libdir)
132         ##we need to overwrite prefix with the same prefix of which skim was installed to
133         prefix=$skim_prefix
134         libdir=$skim_libdir
135         ##this is to get rid of the last warning
136         given_prefix=$skim_prefix
137   fi
138 else
139   AC_MSG_ERROR([skim library is not available or the version is too old!])
140 fi
141 KDE_CREATE_SUBDIRSLIST
142 AC_CONFIG_FILES([ Makefile ])
143 AC_CONFIG_FILES([ icons/Makefile ])
144 AC_CONFIG_FILES([ po/Makefile ])
145 AC_CONFIG_FILES([ setupui/Makefile ])
146 AC_OUTPUT
147 AC_MSG_RESULT([
148 skim Support Build options:
149   Version                $VERSION
150   Version of libscim     $SCIM_VERSION
151   Version of libskim     $SKIM_VERSION
152   Install prefix         $prefix
153   Build shared libs      $enable_shared
154   Build static libs      $enable_static
155   Enable debug           $scim_debug
156 ])
157 # Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
158 if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
159   # And if so, warn when they don't match
160   if test "$kde_libs_prefix" != "$given_prefix"; then
161     # And if kde doesn't know about the prefix yet
162     echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
163     if test $? -ne 0; then
164       echo ""
165       echo "Warning: you chose to install this package in $given_prefix,"
166       echo "but KDE was found in $kde_libs_prefix."
167       echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
168       echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
169       echo "Then restart KDE."
170       echo ""
171     fi
172   fi
173 fi
174
175 if test "$all_tests" = "bad"; then
176   if test ! "$cache_file" = "/dev/null"; then
177     echo ""
178     echo "Please remove the file $cache_file after changing your setup"
179     echo "so that configure will find the changes next time."
180     echo ""
181   fi
182 else
183   echo ""
184   echo "Good - your configure finished. Start make now"
185   echo ""
186 fi