PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/configure.ac

http://scim-python.googlecode.com/
m4 | 218 lines | 150 code | 33 blank | 35 comment | 0 complexity | abf803454237a162fb58e9479864cea4 MD5 | raw file
  1# vim:set noet ts=4:
  2#
  3# scim-python
  4#
  5# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
  6#
  7#
  8# This library is free software; you can redistribute it and/or
  9# modify it under the terms of the GNU Lesser General Public
 10# License as published by the Free Software Foundation; either
 11# version 2 of the License, or (at your option) any later version.
 12#
 13# This library is distributed in the hope that it will be useful,
 14# but WITHOUT ANY WARRANTY; without even the implied warranty of
 15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16# GNU Lesser General Public License for more details.
 17#
 18# You should have received a copy of the GNU Lesser General Public
 19# License along with this program; if not, write to the
 20# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 21# Boston, MA  02111-1307  USA
 22#
 23# $Id: $
 24#
 25
 26# if not 1, append svn revision to the version number.
 27m4_define([scim_python_released], [0])
 28m4_define([scim_python_major_version], [0])
 29m4_define([scim_python_minor_version], [1])
 30m4_define([scim_python_micro_version], [13rc1])
 31m4_define([scim_python_maybe_revision],
 32          m4_esyscmd([if test x]scim_python_released[ != x1; then echo -n .svn`svn info . --xml|grep revision | sed "s/ *revision=\"\([0-9]*\)\">/\1/g"|head -n 1`; fi]))
 33
 34m4_define([scim_python_version],
 35          scim_python_major_version.scim_python_minor_version.scim_python_micro_version[]scim_python_maybe_revision)
 36
 37AC_INIT([scim-python], [scim_python_version], [http://code.google.com/p/scim-python/issues/entry],[scim-python])
 38  
 39AM_INIT_AUTOMAKE([1.9])
 40AC_CONFIG_HEADERS([config.h])
 41AC_CONFIG_MACRO_DIR([m4])
 42AC_GNU_SOURCE
 43
 44# define PACKAGE_VERSION_* variables
 45AS_VERSION
 46AS_NANO
 47
 48AM_SANITY_CHECK
 49AM_MAINTAINER_MODE
 50AM_DISABLE_STATIC
 51AC_PROG_CC
 52AM_PROG_CC_C_O
 53AC_PROG_CXX
 54AC_ISC_POSIX
 55AC_HEADER_STDC
 56AM_PROG_LIBTOOL
 57AM_PATH_GLIB_2_0
 58AM_PATH_PYTHON([2.5])
 59
 60AC_PROG_LIBTOOL
 61
 62
 63# check gtk & pygtk
 64PKG_CHECK_MODULES(GTK2, [
 65	gtk+-2.0
 66])
 67
 68PKG_CHECK_MODULES(PYGTK2, [
 69	pygtk-2.0
 70])
 71
 72
 73# define PYTHOPN_CFLAGS & PYTHON_LIBS
 74PYTHON_CONFIG=`type -p python$PYTHON_VERSION-config`
 75if test "$PYTHON_CONFIG" != ""; then
 76	PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
 77	PYTHON_LIBS=`$PYTHON_CONFIG --libs`
 78else
 79	PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
 80	PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
 81fi
 82
 83AC_SUBST(PYTHON_CFLAGS)
 84AC_SUBST(PYTHON_LIBS)
 85
 86# setup debian dpkg
 87AC_ARG_ENABLE([debian-dpkg],
 88	[AC_HELP_STRING([--enable-debian-dpkg], 
 89		[enale build dpkg for Debian or Ubuntu Linux.]
 90		)
 91	]
 92)
 93
 94if test "$enable_debian_dpkg" != "yes"; then
 95	AM_CONDITIONAL(ENABLE_DEBIAN_DPKG, [false])
 96else
 97	AM_CONDITIONAL(ENABLE_DEBIAN_DPKG, [true])
 98fi
 99
100# check python-enchant
101AC_MSG_CHECKING([for python-enchant])
102if ! $PYTHON -c "import enchant" 2>/dev/null; then
103	AC_MSG_RESULT([no])
104	have_python_enchant=no
105else
106	AC_MSG_RESULT([yes])
107	have_python_enchant=yes
108fi
109
110AC_ARG_ENABLE([english-writer],
111	[AC_HELP_STRING([--disable-english-writer], 
112		[Don't build and install EnglishWirter Engine & SetupUI]
113		)
114	]
115)
116
117if test "$enable_english_writer" == "force"; then
118	AM_CONDITIONAL(ENABLE_ENGLISH_WRITER, [true])
119elif test "$enable_english_writer" == "no"; then
120	AM_CONDITIONAL(ENABLE_ENGLISH_WRITER, [false])
121else
122	if test "$have_python_enchant" == "no"; then
123		AC_MSG_ERROR([
124		Your system does not have python-enchant, please install it or run "./configure --disable-english-writer".
125		You may also use "./configure --enable-english-writer=force" to foce build this english engine.])
126	else
127		AM_CONDITIONAL(ENABLE_ENGLISH_WRITER, [true])
128	fi
129fi
130
131# setup PinYin option
132AC_ARG_ENABLE([pinyin],
133	[AC_HELP_STRING([--disable-pinyin], 
134		[Don't build and install PinYin]
135		)
136	]
137)
138
139if test "$enable_pinyin" != "no"; then
140	AM_CONDITIONAL(ENABLE_PINYIN, [true])
141else
142	AM_CONDITIONAL(ENABLE_PINYIN, [false])
143fi
144
145# setup XingMa option
146AC_ARG_ENABLE([xingma],
147	[AC_HELP_STRING([--disable-xingma],
148		[Don't build and install XingMa]
149		)
150	]
151)
152
153if test "$enable_xingma" != "no"; then
154	AM_CONDITIONAL(ENABLE_XINGMA, [true])
155else
156	AM_CONDITIONAL(ENABLE_XINGMA, [false])
157fi
158
159
160# check scim and define SCIM_* variables
161PKG_CHECK_MODULES(SCIM, [
162	scim >= 1.4
163])
164SCIM_BIN_VER=`$PKG_CONFIG --variable=scim_binary_version scim`
165
166if test "$SCIM_BIN_VER" = ""; then
167	SCIM_BIN_VER=1.4.0
168fi
169
170if test "$SCIM_ICONDIR" = ""; then
171	SCIM_ICONDIR=${datadir}/scim/icons
172fi
173
174if test "$SCIM_MODULEDIR" = ""; then
175	SCIM_MODULEDIR=${libdir}/scim-1.0/$SCIM_BIN_VER
176fi
177
178if test "$SCIM_DATADIR" = ""; then
179	SCIM_DATADIR=${datadir}/scim
180fi
181
182AC_SUBST(SCIM_ICONDIR)
183AC_SUBST(SCIM_MODULEDIR)
184AC_SUBST(SCIM_DATADIR)
185AC_SUBST(SCIM_BIN_VER)
186
187# define GETTEXT_* variables
188GETTEXT_PACKAGE=scim-python
189AC_SUBST(GETTEXT_PACKAGE)
190AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Package name for gettext])
191
192AM_GNU_GETTEXT([external])
193AM_GNU_GETTEXT_VERSION(0.16.1)
194
195# OUTPUT files
196AC_CONFIG_FILES([ po/Makefile.in
197Makefile
198scim-python.spec
199src/Makefile
200src/scim.pth
201data/Makefile
202data/icons/Makefile
203python/Makefile
204python/scim/Makefile
205python/engine/Makefile
206python/engine/EnglishWriter/Makefile
207python/engine/PinYin/Makefile
208python/engine/XingMa/Makefile
209python/engine/XingMa/tables/Makefile
210python/setupui/Makefile
211python/setupui/EnglishWriter/Makefile
212python/helper/Makefile
213python/helper/PinYinSetup/Makefile
214python/helper/ZhengJuSetup/Makefile
215m4/Makefile
216])
217
218AC_OUTPUT