You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

261 lines
7.4 KiB

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_PREREQ(2.63.2)
  3. m4_define(xed_major_version, 1)
  4. m4_define(xed_minor_version, 4)
  5. m4_define(xed_micro_version, 6)
  6. m4_define(xed_version, xed_major_version.xed_minor_version.xed_micro_version)
  7. AC_INIT([xed], [xed_version],
  8. [https://github.com/linuxmint/xed/issues],
  9. [xed], [http://github.com/linuxmint/xed])
  10. AC_CONFIG_HEADERS(config.h)
  11. AC_CONFIG_SRCDIR(xed/xed.c)
  12. AC_CONFIG_MACRO_DIR([m4])
  13. AC_DEFINE(XED_MAJOR_VERSION, xed_major_version, [Xed major version])
  14. AC_SUBST(XED_MAJOR_VERSION, xed_major_version)
  15. AC_DEFINE(XED_MINOR_VERSION, xed_minor_version, [Xed minor version])
  16. AC_SUBST(XED_MINOR_VERSION, xed_minor_version)
  17. AC_DEFINE(XED_MICRO_VERSION, xed_micro_version, [Xed micro version])
  18. AC_SUBST(XED_MICRO_VERSION, xed_micro_version)
  19. AM_INIT_AUTOMAKE([1.10 dist-xz no-dist-gzip -Wno-portability check-news])
  20. AM_MAINTAINER_MODE
  21. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  22. # Checks for programs
  23. AC_PROG_CC
  24. AC_PROG_INSTALL
  25. AC_PROG_MAKE_SET
  26. AC_SYS_LARGEFILE
  27. PKG_PROG_PKG_CONFIG
  28. # Initialize libtool
  29. LT_PREREQ([2.2.6])
  30. LT_INIT(disable-static)
  31. GTK_DOC_CHECK([1.0],[--flavour=no-tmpl])
  32. AC_CHECK_FUNC(sigaction)
  33. AC_CHECK_LIB(m, floor)
  34. dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
  35. AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
  36. dnl toolbar style for GSettings schemas
  37. TOOLBAR_STYLE="XED_TOOLBAR_SYSTEM"
  38. AC_SUBST(TOOLBAR_STYLE)
  39. dnl ===============================================================
  40. dnl Expanded dirs
  41. dnl ===============================================================
  42. # This macro expands DIR and assigns it to RET.
  43. # If DIR is NONE, then it's replaced by DEFAULT.
  44. # Based on AC_DEFINE_DIR
  45. AC_DEFUN([XED_FULLPATH], [
  46. test "x$prefix" = xNONE && prefix="$ac_default_prefix"
  47. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  48. ac_expand=[$]$1
  49. test "x$ac_expand" = xNONE && ac_expand="[$]$2"
  50. ac_expand=`eval echo [$]ac_expand`
  51. $3=`eval echo [$]ac_expand`
  52. ])
  53. dnl ================================================================
  54. dnl Gettext stuff.
  55. dnl ================================================================
  56. IT_PROG_INTLTOOL([0.50.1])
  57. GETTEXT_PACKAGE=xed
  58. AC_SUBST([GETTEXT_PACKAGE])
  59. AM_GLIB_GNU_GETTEXT
  60. AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Define to the Gettext package name])
  61. dnl ================================================================
  62. dnl Use gvfs metadata or the old xml file store.
  63. dnl ================================================================
  64. AC_ARG_ENABLE([gvfs-metadata],
  65. AS_HELP_STRING([--enable-gvfs-metadata], [Enable using gvfs to store metadata]),
  66. [enable_gvfs_metadata=$enableval],
  67. [enable_gvfs_metadata=yes])
  68. AM_CONDITIONAL(ENABLE_GVFS_METADATA, test "x$enable_gvfs_metadata" != "xno")
  69. if test "x$enable_gvfs_metadata" != "xno"; then
  70. AC_DEFINE([ENABLE_GVFS_METADATA], [1], [Define to enable using gvfs metadata])
  71. fi
  72. dnl ================================================================
  73. dnl spell plugins checks: enchant and iso-codes
  74. dnl ================================================================
  75. ENCHANT_REQUIRED=1.2.0
  76. ISO_CODES_REQUIRED=0.35
  77. AC_ARG_ENABLE([spell],
  78. AS_HELP_STRING([--disable-spell],[Disable spell plugin (default: enabled)]),
  79. [enable_enchant=$enableval],
  80. [enable_enchant=yes])
  81. if test "x$enable_enchant" = "xyes" ; then
  82. PKG_CHECK_MODULES(ENCHANT, enchant >= $ENCHANT_REQUIRED, \
  83. have_enchant=yes, have_enchant=no)
  84. if test "x$have_enchant" = "xyes"; then
  85. PKG_CHECK_EXISTS([iso-codes >= $ISO_CODES_REQUIRED],
  86. [have_iso_codes=yes],[have_iso_codes=no])
  87. if test "x$have_iso_codes" = "xyes"; then
  88. AC_MSG_CHECKING([whether iso-codes has iso-639 and iso-3166 domains])
  89. if $PKG_CONFIG --variable=domains iso-codes | grep 639 > /dev/null && \
  90. $PKG_CONFIG --variable=domains iso-codes | grep 3166 > /dev/null ; then
  91. result=yes
  92. else
  93. result=no
  94. have_iso_codes=no
  95. fi
  96. AC_MSG_RESULT([$result])
  97. fi
  98. if test "x$have_iso_codes" = "xyes"; then
  99. AC_DEFINE_UNQUOTED([ISO_CODES_PREFIX],["`$PKG_CONFIG --variable=prefix iso-codes`"],[ISO codes prefix])
  100. AC_DEFINE([HAVE_ISO_CODES],[1],[Define if you have the iso-codes package])
  101. else
  102. AC_MSG_ERROR([iso-codes is required to build the spell plugin. Use --disable-spell to build without spell plugin.])
  103. fi
  104. else
  105. enable_enchant=no
  106. AC_MSG_ERROR([Enchant library not found or too old. Use --disable-spell to build without spell plugin.])
  107. fi
  108. fi
  109. AM_CONDITIONAL(ENABLE_ENCHANT, test x"$enable_enchant" = "xyes")
  110. dnl ================================================================
  111. dnl Start of pkg-config checks
  112. dnl ================================================================
  113. PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""])
  114. PKG_CHECK_MODULES(XED, [
  115. libxml-2.0 >= 2.5.0
  116. glib-2.0 >= 2.40.0
  117. $GMODULE_ADD
  118. gthread-2.0 >= 2.13.0
  119. gio-2.0 >= 2.40.0
  120. gtk+-3.0 >= 3.18.0
  121. gtksourceview-3.0 >= 3.18.0
  122. libpeas-1.0 >= 1.12.0
  123. libpeas-gtk-1.0 >= 1.12.0
  124. ])
  125. PKG_CHECK_MODULES(X11, [x11])
  126. XED_CFLAGS="$XED_CFLAGS $X11_CFLAGS"
  127. XED_LIBS="$XED_LIBS $X11_LIBS"
  128. AC_SUBST(XED_CFLAGS)
  129. AC_SUBST(XED_LIBS)
  130. # Introspection
  131. GOBJECT_INTROSPECTION_CHECK([0.9.3])
  132. if test "$found_introspection" = "yes"; then
  133. enable_introspection=yes
  134. AC_DEFINE([ENABLE_INTROSPECTION], [1], [Define to enable GObject Introspection])
  135. else
  136. enable_introspection=no
  137. fi
  138. AM_PATH_PYTHON([3.4])
  139. dnl ================================================================
  140. dnl GSettings related settings
  141. dnl ================================================================
  142. GLIB_GSETTINGS
  143. dnl ================================================================
  144. dnl Misc
  145. dnl ================================================================
  146. AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
  147. AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
  148. AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
  149. GNOME_COMPILE_WARNINGS(yes)
  150. AC_ARG_ENABLE(deprecations,
  151. [AS_HELP_STRING([--enable-deprecations],
  152. [warn about deprecated usages [default=no]])],,
  153. [enable_deprecations=no])
  154. if test "x$enable_deprecations" = "xyes"; then
  155. DISABLE_DEPRECATED_CFLAGS="\
  156. -DG_DISABLE_DEPRECATED \
  157. -DGDK_DISABLE_DEPRECATED \
  158. -DGTK_DISABLE_DEPRECATED \
  159. -DGDK_PIXBUF_DISABLE_DEPRECATED \
  160. -DGNOME_DISABLE_DEPRECATED"
  161. AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
  162. fi
  163. PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
  164. AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
  165. XED_PLUGINS_DATA_DIR="$datadir/xed/plugins"
  166. AC_SUBST(XED_PLUGINS_DATA_DIR)
  167. XED_PLUGINS_LIBS_DIR="$libdir/xed/plugins"
  168. AC_SUBST(XED_PLUGINS_LIBS_DIR)
  169. YELP_HELP_INIT
  170. AC_CONFIG_FILES([
  171. Makefile
  172. data/xed.desktop.in
  173. data/xed-bugreport.sh
  174. data/xed.pc
  175. data/org.x.editor.gschema.xml
  176. data/Makefile
  177. docs/Makefile
  178. docs/reference/Makefile
  179. xed/Makefile
  180. help/Makefile
  181. pixmaps/Makefile
  182. plugins/Makefile
  183. plugins/docinfo/Makefile
  184. plugins/filebrowser/Makefile
  185. plugins/filebrowser/org.x.editor.plugins.filebrowser.gschema.xml
  186. plugins/modelines/Makefile
  187. plugins/sort/Makefile
  188. plugins/spell/Makefile
  189. plugins/spell/org.x.editor.plugins.spell.gschema.xml
  190. plugins/taglist/Makefile
  191. plugins/textsize/Makefile
  192. plugins/textsize/textsize/Makefile
  193. plugins/time/Makefile
  194. plugins/time/org.x.editor.plugins.time.gschema.xml
  195. plugins/trailsave/Makefile
  196. po/Makefile.in
  197. ])
  198. AC_OUTPUT
  199. echo "
  200. Configuration:
  201. Source code location: ${srcdir}
  202. Compiler: ${CC}
  203. Spell Plugin enabled: $enable_enchant
  204. Gvfs metadata enabled: $enable_gvfs_metadata
  205. GObject Introspection: ${enable_introspection}
  206. "