1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279
|
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.64)
m4_define(gtksourceview_major_version, 3)
m4_define(gtksourceview_minor_version, 24)
m4_define(gtksourceview_micro_version, 11)
m4_define(gtksourceview_version, gtksourceview_major_version.gtksourceview_minor_version.gtksourceview_micro_version)
AC_INIT([gtksourceview],
[gtksourceview_version],
[http://bugzilla.gnome.org/enter_bug.cgi?product=gtksourceview],
[gtksourceview],
[https://wiki.gnome.org/Projects/GtkSourceView])
AX_IS_RELEASE([git-directory])
GTK_SOURCE_MAJOR_VERSION=gtksourceview_major_version
GTK_SOURCE_MINOR_VERSION=gtksourceview_minor_version
GTK_SOURCE_MICRO_VERSION=gtksourceview_micro_version
AC_SUBST(GTK_SOURCE_MAJOR_VERSION)
AC_SUBST(GTK_SOURCE_MINOR_VERSION)
AC_SUBST(GTK_SOURCE_MICRO_VERSION)
# Libtool versioning
#
# For development releases (if the minor package version is odd), keep the same
# Libtool version.
#
# For a new minor stable release (when incrementing the minor package version
# to an even number), apply the following algorithm step by step:
# 1. If the library source code has changed at all since the last
# update, then increment REVISION.
# 2. If any exported functions or data have been added, removed, or
# changed since the last update, increment CURRENT and set REVISION
# to 0.
# 3. If any exported functions or data have been added since the last
# public release, increment AGE.
# 4. If any exported functions or data have been removed since the last
# public release, set AGE to 0.
#
# When incrementing the API version (usually for a new major package version),
# set CURRENT, REVISION and AGE to 0 since it's like a new library.
GSV_LT_CURRENT=9
GSV_LT_REVISION=0
GSV_LT_AGE=8
GSV_LT_VERSION="$GSV_LT_CURRENT:$GSV_LT_REVISION:$GSV_LT_AGE"
AC_SUBST(GSV_LT_VERSION)
# API version, used for parallel installability.
# Not used in:
# - po/Makevars
# - the docs/reference/gtksourceview-3.0-sections.txt filename
# - the gtksourceview/ directory and sub-directories, because make variables
# need to be transformed (3.0 -> 3_0), and it doesn't work if two different
# variables are used (it must be the same variable). With GSV_API_VERSION
# defined to a single digit (4 instead of 4.0), then it would work.
# Because as far as I've tested, it is not easily feasible to not hardcode the
# API version in those places (swilmet).
GSV_API_VERSION=3.0
GSV_MAJOR_API_VERSION=3
AC_SUBST(GSV_API_VERSION)
AC_SUBST(GSV_MAJOR_API_VERSION)
# Dependencies
glib_req=2.48
gtk_req=3.20
libxml_req=2.6
gladeui_req=3.9
AC_CONFIG_SRCDIR([gtksourceview/gtksourcebuffer.h])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
# gnu strictness to generate the INSTALL file
AM_INIT_AUTOMAKE([1.13 tar-ustar dist-xz no-dist-gzip -Wno-portability gnu])
AM_MAINTAINER_MODE([enable])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Check for programs
AC_PROG_CC
AC_PROG_INSTALL
AX_REQUIRE_DEFINED([PKG_PROG_PKG_CONFIG])
AX_REQUIRE_DEFINED([PKG_INSTALLDIR])
PKG_PROG_PKG_CONFIG
PKG_INSTALLDIR
# Initialize libtool
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
# Check for header files
AC_CHECK_HEADERS([unistd.h])
# Pull glib-mkenums & co.
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
AC_PATH_PROG(ITSTOOL, itstool)
# Compile warnings
AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS])
AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS])
AC_ARG_ENABLE(deprecations,
[AS_HELP_STRING([--disable-deprecations],
[remove deprecated symbols from the header files])],
[enable_deprecations=$enableval],
[enable_deprecations="yes"])
if test "$enable_deprecations" = "no"; then
DISABLE_DEPRECATED_CFLAGS="\
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED"
AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
fi
# Symbol visibility handling
HIDDEN_VISIBILITY_CFLAGS=""
case "$host" in
*-*-mingw*)
dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
AC_DEFINE([_GTK_SOURCE_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
[defines how to decorate public symbols while building])
HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
;;
*)
dnl on other compilers, check if we can do -fvisibility=hidden
SAVED_CFLAGS="${CFLAGS}"
CFLAGS="-fvisibility=hidden"
AC_MSG_CHECKING([for -fvisibility=hidden compiler flag])
AC_TRY_COMPILE([], [return 0],
AC_MSG_RESULT(yes)
enable_fvisibility_hidden=yes,
AC_MSG_RESULT(no)
enable_fvisibility_hidden=no)
CFLAGS="${SAVED_CFLAGS}"
AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [
AC_DEFINE([_GTK_SOURCE_EXTERN], [__attribute__((visibility("default"))) extern],
[defines how to decorate public symbols while building])
HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
])
;;
esac
AC_SUBST(HIDDEN_VISIBILITY_CFLAGS)
AX_REQUIRE_DEFINED([AX_PKG_CHECK_MODULES])
AX_PKG_CHECK_MODULES([DEP],
[glib-2.0 >= $glib_req gio-2.0 >= $glib_req gtk+-3.0 >= $gtk_req],
[libxml-2.0 >= $libxml_req])
dnl check for native osx
AC_MSG_CHECKING([for native Mac OS X])
AX_REQUIRE_DEFINED([GTK_CHECK_BACKEND])
GTK_CHECK_BACKEND([quartz], [3.0.0], [os_osx=yes], [os_osx=no])
AC_MSG_RESULT([$os_osx])
AM_CONDITIONAL([OS_OSX], [ test "$os_osx" = "yes" ])
if test "$os_osx" = "yes"; then
AC_DEFINE([OS_OSX], [1], [Defined if os is Mac OSX])
fi
# Check for Glade3
AC_ARG_ENABLE([glade-catalog],
[AS_HELP_STRING([--enable-glade-catalog],
[Install a glade catalog file [default=no]])],
[glade_catalog=$enableval],
[glade_catalog=no])
AM_CONDITIONAL([GLADE_CATALOG], [ test "$glade_catalog" = "yes" ])
AS_IF([ test "$glade_catalog" = "yes" ],
[PKG_CHECK_MODULES(GLADE, [gladeui-2.0 >= $gladeui_req])
AC_MSG_CHECKING([whether to install Glade catalog])
GLADE_CATALOG_DIR=`$PKG_CONFIG --variable=catalogdir gladeui-2.0 2>&AS_MESSAGE_LOG_FD`
AC_MSG_RESULT([$GLADE_CATALOG_DIR])
AC_SUBST(GLADE_CATALOG_DIR)])
# i18n
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.4])
AS_IF([test "$USE_NLS" = "yes"],
[AC_DEFINE([ENABLE_NLS], [1], [Defined if native language support should be enabled.])])
AC_SUBST([GETTEXT_PACKAGE], [gtksourceview-$GSV_API_VERSION])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Define to the gettext package name.])
# Documentation
AX_REQUIRE_DEFINED([GTK_DOC_CHECK])
GTK_DOC_CHECK([1.25], [--flavour=no-tmpl])
# Installed Tests for gnome continuous integration
AC_ARG_ENABLE(installed_tests,
AS_HELP_STRING([--enable-installed-tests],
[Install test programs (default: no)]),,
[enable_installed_tests=no])
AM_CONDITIONAL(INSTALLED_TESTS, test "x$enable_installed_tests" = "xyes")
# Introspection
AX_REQUIRE_DEFINED([GOBJECT_INTROSPECTION_CHECK])
GOBJECT_INTROSPECTION_CHECK([1.42.0])
# Valgrind check
AX_REQUIRE_DEFINED([AX_VALGRIND_CHECK])
AX_VALGRIND_CHECK
# Vala
AX_REQUIRE_DEFINED([VAPIGEN_CHECK])
VAPIGEN_CHECK
# test-widget uses this to find lang files and gtksourcebuffer.c
ABS_TOP_SRCDIR=`cd $srcdir && pwd`
AC_SUBST(ABS_TOP_SRCDIR)
# Check whether MSVC toolset is explicitly set
AM_CONDITIONAL(MSVC_BASE_NO_TOOLSET_SET, [test x$MSVC_BASE_TOOLSET = x])
AM_CONDITIONAL(MSVC_NO_TOOLSET_SET, [test x$MSVC_TOOLSET = x])
# Output files
AC_CONFIG_FILES([
gtksourceview-${GSV_API_VERSION}.pc:gtksourceview.pc.in
Makefile
config.h.win32
win32/Makefile
win32/vs9/Makefile
win32/vs9/gtksourceview-version-paths.vsprops
win32/vs10/Makefile
win32/vs10/gtksourceview-version-paths.props
win32/vs11/Makefile
win32/vs12/Makefile
win32/vs14/Makefile
win32/vs15/Makefile
data/Makefile
data/glade/Makefile
data/glade/gtksourceview.xml
data/language-specs/Makefile
data/styles/Makefile
docs/Makefile
docs/reference/Makefile
docs/reference/gtksourceview-docs.xml
docs/reference/intro.xml
docs/reference/lang-reference.xml
docs/reference/style-reference.xml
gtksourceview/Makefile
gtksourceview/gtksourceversion.h
gtksourceview/GtkSource-${GSV_API_VERSION}.metadata:gtksourceview/GtkSource.metadata.in
gtksourceview/completion-providers/Makefile
gtksourceview/completion-providers/words/Makefile
po/Makefile.in
tests/Makefile
testsuite/Makefile
])
AC_OUTPUT
echo "
Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
Glade Catalog: ${glade_catalog}
Documentation: ${enable_gtk_doc}
GObject introspection: ${found_introspection}
Vala: ${enable_vala}
Code coverage: ${enable_code_coverage}
Valgrind check: ${enable_valgrind}
Installed tests: ${enable_installed_tests}
"
|