Imported Upstream version 1.49.1
[platform/upstream/gobject-introspection.git] / configure.ac
index 4a899c8..0d837b8 100644 (file)
@@ -3,25 +3,29 @@
 
 dnl the gi version number
 m4_define(gi_major_version, 1)
-m4_define(gi_minor_version, 37)
+m4_define(gi_minor_version, 49)
 m4_define(gi_micro_version, 1)
 m4_define(gi_version, gi_major_version.gi_minor_version.gi_micro_version)
 
 AC_PREREQ([2.63])
 AC_INIT([gobject-introspection],
         [gi_version],
-        [http://bugzilla.gnome.org/enter_bug.cgi?product=glib&component=introspection],
+        [http://bugzilla.gnome.org/enter_bug.cgi?product=gobject-introspection],
         [gobject-introspection])
 
 AC_CONFIG_HEADER([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 
-AM_INIT_AUTOMAKE([1.11 tar-ustar dist-xz no-dist-gzip foreign -Wno-portability])
+AM_INIT_AUTOMAKE([1.11 tar-ustar dist-xz no-dist-gzip foreign -Wno-portability parallel-tests])
 AM_MAINTAINER_MODE([enable])
 
 AM_SILENT_RULES([yes])
 
+# Used in docs/reference/version.xml
+GI_VERSION=gi_version
+AC_SUBST(GI_VERSION)
+
 # Check for Win32
 AC_CANONICAL_HOST
 case "$host" in
@@ -124,7 +128,7 @@ GIR_DIR="$EXPANDED_DATADIR/$GIR_SUFFIX"
 AC_SUBST(GIR_DIR)
 AC_DEFINE_UNQUOTED(GIR_DIR, "$GIR_DIR", [Director prefix for gir installation])
 
-PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.36.0])
+PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.49.4])
 PKG_CHECK_MODULES(GOBJECT, [gobject-2.0])
 PKG_CHECK_MODULES(GMODULE, [gmodule-2.0])
 PKG_CHECK_MODULES(GIO, [gio-2.0])
@@ -167,7 +171,7 @@ AC_SUBST(CAIRO_GIR_PACKAGE)
 PKG_CHECK_MODULES(SCANNER, [gobject-2.0 gio-2.0])
 
 dnl libffi
-PKG_CHECK_MODULES(FFI, libffi, have_ffi_pkgconfig=yes, have_ffi_pkgconfig=no)
+PKG_CHECK_MODULES(FFI, [libffi >= 3.0.0 ], have_ffi_pkgconfig=yes, have_ffi_pkgconfig=no)
 FFI_PC_CFLAGS=""
 FFI_PC_LIBS=""
 FFI_PC_PACKAGES=""
@@ -229,7 +233,7 @@ GIREPO_CFLAGS="$GIREPO_CFLAGS $GCOV_CFLAGS"
 # gtkdocize greps for ^GTK_DOC_CHECK and parses it, so you need to have
 # it on it's own line.
 m4_ifdef([GTK_DOC_CHECK], [
-GTK_DOC_CHECK([1.15], [--flavour no-tmpl])
+GTK_DOC_CHECK([1.19], [--flavour no-tmpl])
 ],[
 AM_CONDITIONAL([ENABLE_GTK_DOC],[false])
 ])
@@ -247,7 +251,20 @@ AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull])
 AC_CHECK_FUNCS([backtrace backtrace_symbols])
 
 # Python
-AM_PATH_PYTHON([2.6])
+# option to specify python interpreter to use; this just sets $PYTHON, so that
+# we will fallback to reading $PYTHON if --with-python is not given, and
+# python.m4 will get the expected input
+AC_ARG_WITH(python,
+  AS_HELP_STRING([--with-python=PATH],[Path to Python interpreter; searches $PATH if only a program name is given; if not given, searches for a few standard names such as "python3" or "python2"]),
+  [PYTHON="$withval"], [])
+if test x"$PYTHON" = xyes; then
+    AC_MSG_ERROR([--with-python option requires a path or program argument])
+fi
+if test -n "$PYTHON" && ! which "$PYTHON"; then
+    AC_MSG_ERROR([Python interpreter $PYTHON does not exist])
+fi
+
+AM_PATH_PYTHON([2.7])
 case "$host" in
 *-*-mingw*)
        # Change backslashes to forward slashes in pyexecdir to avoid
@@ -262,7 +279,7 @@ fi
 
 dnl Not enabled by default until 3.6 cycle when we can propose mako as
 dnl an external dependency
-AC_ARG_ENABLE(doctool,[  --disable-doctool           disable g-ir-doctool ],,enable_doctool=auto)
+AC_ARG_ENABLE(doctool,[  --disable-doctool           disable g-ir-doc-tool ],,enable_doctool=auto)
 AS_IF([ test x$enable_doctool != xno], [
    AM_CHECK_PYMOD(mako,,have_python_mako=yes,have_python_mako=no)
 ])
@@ -282,12 +299,45 @@ AC_MSG_CHECKING([for glib source directory to use for documentation])
 AC_ARG_WITH(glib-src,
        [  --with-glib-src=PATH    Source directory for glib - needed to add docs to gir],
        GLIBSRC=$withval
-) 
+)
 AM_CONDITIONAL(WITH_GLIBSRC, test x"$GLIBSRC" != x)
 AC_SUBST(GLIBSRC)
 AC_MSG_RESULT([$GLIBSRC])
 
 dnl
+dnl Check for -fvisibility=hidden to determine if we can do GNU-style
+dnl visibility attributes for symbol export control
+dnl
+GI_HIDDEN_VISIBILITY_CFLAGS=""
+case "$host" in
+  *-*-mingw*)
+    dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport)
+    AC_DEFINE([_GI_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
+              [defines how to decorate public symbols while building])
+    CFLAGS="${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([], [int main (void) { 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([_GI_EXTERN], [__attribute__((visibility("default"))) extern],
+                [defines how to decorate public symbols while building])
+      GI_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
+    ])
+    ;;
+esac
+AC_SUBST(GI_HIDDEN_VISIBILITY_CFLAGS)
+
+dnl
 dnl Check for -Bsymbolic-functions linker flag used to avoid
 dnl intra-library PLT jumps, if available.
 dnl
@@ -297,11 +347,11 @@ AC_ARG_ENABLE(Bsymbolic,
               [SAVED_LDFLAGS="${LDFLAGS}"
                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
                LDFLAGS=-Wl,-Bsymbolic-functions
-               AC_TRY_LINK([], [int main (void) { return 0; }],
-                           AC_MSG_RESULT(yes)
-                           enable_Bsymbolic=yes,
-                           AC_MSG_RESULT(no)
-                           enable_Bsymbolic=no)
+               AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int main (void) { return 0; }]])],
+                              [AC_MSG_RESULT(yes)
+                               enable_Bsymbolic=yes],
+                              [AC_MSG_RESULT(no)
+                               enable_Bsymbolic=no])
                LDFLAGS="${SAVED_LDFLAGS}"])
 
 if test "x${enable_Bsymbolic}" = "xyes"; then
@@ -312,19 +362,25 @@ AC_SUBST(EXTRA_LINK_FLAGS)
 
 AC_CONFIG_FILES([
 Makefile
-m4/Makefile
 tests/Makefile
 tests/offsets/Makefile
 tests/scanner/Makefile
+tests/scanner/annotationparser/Makefile
 tests/repository/Makefile
 tests/warn/Makefile
 docs/Makefile
 docs/reference/Makefile
+docs/reference/version.xml
 gobject-introspection-1.0.pc
 gobject-introspection-no-export-1.0.pc
 config.h.win32
 build/Makefile
 build/win32/Makefile
 build/win32/vs9/Makefile
-build/win32/vs10/Makefile])
+build/win32/vs9/gi-version-paths.vsprops
+build/win32/vs10/Makefile
+build/win32/vs10/gi-version-paths.props
+build/win32/vs11/Makefile
+build/win32/vs12/Makefile
+build/win32/vs14/Makefile])
 AC_OUTPUT