/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. # if not 1, append svn revision to the version number.
  26. m4_define([scim_python_released], [0])
  27. m4_define([scim_python_major_version], [0])
  28. m4_define([scim_python_minor_version], [1])
  29. m4_define([scim_python_micro_version], [13rc1])
  30. m4_define([scim_python_maybe_revision],
  31. 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]))
  32. m4_define([scim_python_version],
  33. scim_python_major_version.scim_python_minor_version.scim_python_micro_version[]scim_python_maybe_revision)
  34. AC_INIT([scim-python], [scim_python_version], [http://code.google.com/p/scim-python/issues/entry],[scim-python])
  35. AM_INIT_AUTOMAKE([1.9])
  36. AC_CONFIG_HEADERS([config.h])
  37. AC_CONFIG_MACRO_DIR([m4])
  38. AC_GNU_SOURCE
  39. # define PACKAGE_VERSION_* variables
  40. AS_VERSION
  41. AS_NANO
  42. AM_SANITY_CHECK
  43. AM_MAINTAINER_MODE
  44. AM_DISABLE_STATIC
  45. AC_PROG_CC
  46. AM_PROG_CC_C_O
  47. AC_PROG_CXX
  48. AC_ISC_POSIX
  49. AC_HEADER_STDC
  50. AM_PROG_LIBTOOL
  51. AM_PATH_GLIB_2_0
  52. AM_PATH_PYTHON([2.5])
  53. AC_PROG_LIBTOOL
  54. # check gtk & pygtk
  55. PKG_CHECK_MODULES(GTK2, [
  56. gtk+-2.0
  57. ])
  58. PKG_CHECK_MODULES(PYGTK2, [
  59. pygtk-2.0
  60. ])
  61. # define PYTHOPN_CFLAGS & PYTHON_LIBS
  62. PYTHON_CONFIG=`type -p python$PYTHON_VERSION-config`
  63. if test "$PYTHON_CONFIG" != ""; then
  64. PYTHON_CFLAGS=`$PYTHON_CONFIG --includes`
  65. PYTHON_LIBS=`$PYTHON_CONFIG --libs`
  66. else
  67. PYTHON_CFLAGS=`$PYTHON $srcdir/python-config.py --includes`
  68. PYTHON_LIBS=`$PYTHON $srcdir/python-config.py --libs`
  69. fi
  70. AC_SUBST(PYTHON_CFLAGS)
  71. AC_SUBST(PYTHON_LIBS)
  72. # setup debian dpkg
  73. AC_ARG_ENABLE([debian-dpkg],
  74. [AC_HELP_STRING([--enable-debian-dpkg],
  75. [enale build dpkg for Debian or Ubuntu Linux.]
  76. )
  77. ]
  78. )
  79. if test "$enable_debian_dpkg" != "yes"; then
  80. AM_CONDITIONAL(ENABLE_DEBIAN_DPKG, [false])
  81. else
  82. AM_CONDITIONAL(ENABLE_DEBIAN_DPKG, [true])
  83. fi
  84. # check python-enchant
  85. AC_MSG_CHECKING([for python-enchant])
  86. if ! $PYTHON -c "import enchant" 2>/dev/null; then
  87. AC_MSG_RESULT([no])
  88. have_python_enchant=no
  89. else
  90. AC_MSG_RESULT([yes])
  91. have_python_enchant=yes
  92. fi
  93. AC_ARG_ENABLE([english-writer],
  94. [AC_HELP_STRING([--disable-english-writer],
  95. [Don't build and install EnglishWirter Engine & SetupUI]
  96. )
  97. ]
  98. )
  99. if test "$enable_english_writer" == "force"; then
  100. AM_CONDITIONAL(ENABLE_ENGLISH_WRITER, [true])
  101. elif test "$enable_english_writer" == "no"; then
  102. AM_CONDITIONAL(ENABLE_ENGLISH_WRITER, [false])
  103. else
  104. if test "$have_python_enchant" == "no"; then
  105. AC_MSG_ERROR([
  106. Your system does not have python-enchant, please install it or run "./configure --disable-english-writer".
  107. You may also use "./configure --enable-english-writer=force" to foce build this english engine.])
  108. else
  109. AM_CONDITIONAL(ENABLE_ENGLISH_WRITER, [true])
  110. fi
  111. fi
  112. # setup PinYin option
  113. AC_ARG_ENABLE([pinyin],
  114. [AC_HELP_STRING([--disable-pinyin],
  115. [Don't build and install PinYin]
  116. )
  117. ]
  118. )
  119. if test "$enable_pinyin" != "no"; then
  120. AM_CONDITIONAL(ENABLE_PINYIN, [true])
  121. else
  122. AM_CONDITIONAL(ENABLE_PINYIN, [false])
  123. fi
  124. # setup XingMa option
  125. AC_ARG_ENABLE([xingma],
  126. [AC_HELP_STRING([--disable-xingma],
  127. [Don't build and install XingMa]
  128. )
  129. ]
  130. )
  131. if test "$enable_xingma" != "no"; then
  132. AM_CONDITIONAL(ENABLE_XINGMA, [true])
  133. else
  134. AM_CONDITIONAL(ENABLE_XINGMA, [false])
  135. fi
  136. # check scim and define SCIM_* variables
  137. PKG_CHECK_MODULES(SCIM, [
  138. scim >= 1.4
  139. ])
  140. SCIM_BIN_VER=`$PKG_CONFIG --variable=scim_binary_version scim`
  141. if test "$SCIM_BIN_VER" = ""; then
  142. SCIM_BIN_VER=1.4.0
  143. fi
  144. if test "$SCIM_ICONDIR" = ""; then
  145. SCIM_ICONDIR=${datadir}/scim/icons
  146. fi
  147. if test "$SCIM_MODULEDIR" = ""; then
  148. SCIM_MODULEDIR=${libdir}/scim-1.0/$SCIM_BIN_VER
  149. fi
  150. if test "$SCIM_DATADIR" = ""; then
  151. SCIM_DATADIR=${datadir}/scim
  152. fi
  153. AC_SUBST(SCIM_ICONDIR)
  154. AC_SUBST(SCIM_MODULEDIR)
  155. AC_SUBST(SCIM_DATADIR)
  156. AC_SUBST(SCIM_BIN_VER)
  157. # define GETTEXT_* variables
  158. GETTEXT_PACKAGE=scim-python
  159. AC_SUBST(GETTEXT_PACKAGE)
  160. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Package name for gettext])
  161. AM_GNU_GETTEXT([external])
  162. AM_GNU_GETTEXT_VERSION(0.16.1)
  163. # OUTPUT files
  164. AC_CONFIG_FILES([ po/Makefile.in
  165. Makefile
  166. scim-python.spec
  167. src/Makefile
  168. src/scim.pth
  169. data/Makefile
  170. data/icons/Makefile
  171. python/Makefile
  172. python/scim/Makefile
  173. python/engine/Makefile
  174. python/engine/EnglishWriter/Makefile
  175. python/engine/PinYin/Makefile
  176. python/engine/XingMa/Makefile
  177. python/engine/XingMa/tables/Makefile
  178. python/setupui/Makefile
  179. python/setupui/EnglishWriter/Makefile
  180. python/helper/Makefile
  181. python/helper/PinYinSetup/Makefile
  182. python/helper/ZhengJuSetup/Makefile
  183. m4/Makefile
  184. ])
  185. AC_OUTPUT