# <mclasen> on the unstable (ie master), interface age = 0
m4_define([glib_major_version], [2])
-m4_define([glib_minor_version], [35])
+m4_define([glib_minor_version], [36])
m4_define([glib_micro_version], [4])
-m4_define([glib_interface_age], [0])
+m4_define([glib_interface_age], [4])
m4_define([glib_binary_age],
[m4_eval(100 * glib_minor_version + glib_micro_version)])
m4_define([glib_version],
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}
-AM_INIT_AUTOMAKE([1.11 no-define no-dist-gzip dist-xz tar-ustar])
+AM_INIT_AUTOMAKE([1.11 -Wno-portability no-define no-dist-gzip dist-xz tar-ustar])
AM_MAINTAINER_MODE([enable])
# Support silent build rules. Disable
])
AM_CONDITIONAL(MS_LIB_AVAILABLE, [test x$ms_librarian = xyes])
-if test "$glib_native_win32" != yes; then
- # libtool option to control which symbols are exported
- # right now, symbols starting with _ are not exported
- LIBTOOL_EXPORT_OPTIONS='-export-symbols-regex "^g.*"'
-else
- # We currently use .def files on Windows
- LIBTOOL_EXPORT_OPTIONS=
-fi
-AC_SUBST(LIBTOOL_EXPORT_OPTIONS)
-
AS_IF([test "x$glib_have_carbon" = "xyes"], [
AC_DEFINE(HAVE_CARBON, 1, [define to 1 if Carbon is available])
LDFLAGS="$LDFLAGS -Wl,-framework,Carbon"
AC_CHECK_HEADERS([sys/uio.h sys/mkdev.h])
AC_CHECK_HEADERS([linux/magic.h])
AC_CHECK_HEADERS([sys/prctl.h])
-AC_CHECK_HEADERS([sys/ioctl.h])
AC_CHECK_HEADERS([sys/mount.h sys/sysctl.h], [], [],
[#if HAVE_SYS_PARAM_H
# Check for some functions
AC_CHECK_FUNCS(lstat strerror strsignal memmove vsnprintf stpcpy strcasecmp strncasecmp poll getcwd vasprintf setenv unsetenv getc_unlocked readlink symlink fdwalk memmem)
AC_CHECK_FUNCS(chown lchmod lchown fchmod fchown link utimes getgrgid getpwuid getresuid)
-AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getfsstat getvfsstat)
+AC_CHECK_FUNCS(getmntent_r setmntent endmntent hasmntopt getfsstat getvfsstat fallocate)
# Check for high-resolution sleep functions
AC_CHECK_FUNCS(splice)
AC_CHECK_FUNCS(prlimit)
AC_SUBST(WSPIAPI_INCLUDE)
], [
AC_MSG_CHECKING([if arpa/nameser_compat.h is needed])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <arpa/nameser.h>],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
+ #include <arpa/nameser.h>],
[int qclass = C_IN;])],
[AC_MSG_RESULT([no])],
- [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <arpa/nameser.h>
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
+ #include <arpa/nameser.h>
#include <arpa/nameser_compat.h>],
[int qclass = C_IN;])],
[AC_MSG_RESULT([yes])
dnl We can currently support the atomic ops natively when building GLib
dnl with recent versions of GCC or MSVC. MSVC doesn't run ./configure,
dnl so we skip that case here and define G_ATOMIC_LOCK_FREE exactly when
-dnl we are using GCC.
+dnl we are using GCC (and not mingw*).
dnl
dnl Note that the atomic ops are only available with GCC on x86 when
dnl using -march=i486 or higher. If we detect that the atomic ops are
dnl We may add other compilers here in the future...
AC_CACHE_CHECK([for lock-free atomic intrinsics], glib_cv_g_atomic_lock_free, [
- AC_TRY_COMPILE([],
- [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],
- [glib_cv_g_atomic_lock_free=yes],
- [glib_cv_g_atomic_lock_free=no])])
-
-if test "$glib_cv_g_atomic_lock_free" = "no"; then
- SAVE_CFLAGS="${CFLAGS}"
- CFLAGS="-march=i486"
- AC_TRY_COMPILE([],
- [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],
- [AC_MSG_ERROR([GLib must be build with -march=i486 or later.])],
- [])
- CFLAGS="${SAVE_CFLAGS}"
-fi
+ case $host in
+ *-*-mingw*)
+ glib_cv_g_atomic_lock_free=yes
+ ;;
+ *)
+ AC_TRY_COMPILE([],
+ [volatile int atomic = 2;\
+ __sync_bool_compare_and_swap (&atomic, 2, 3);],
+ [glib_cv_g_atomic_lock_free=yes],
+ [glib_cv_g_atomic_lock_free=no])
+ if test "$glib_cv_g_atomic_lock_free" = "no"; then
+ SAVE_CFLAGS="${CFLAGS}"
+ CFLAGS="-march=i486"
+ AC_TRY_COMPILE([],
+ [volatile int atomic = 2;\
+ __sync_bool_compare_and_swap (&atomic, 2, 3);],
+ [AC_MSG_ERROR([GLib must be build with -march=i486 or later.])],
+ [])
+ CFLAGS="${SAVE_CFLAGS}"
+ fi
+ ;;
+ esac])
+
+
+case $host in
+ *-*-mingw*)
+ ;;
+ *)
+ # Some compilers support atomic operations but do not define
+ # __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4, like clang
+ if test x"$glib_cv_g_atomic_lock_free" = xyes; then
+ AC_TRY_COMPILE([],
+ [__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4;],
+ [],
+ [AC_DEFINE(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4, 1, [ compiler supports atomic operations])])
+ fi
+ ;;
+ esac
dnl We need a more robust approach here...
case $host_cpu in
dnl Compiler flags; macro originates from systemd
dnl See https://bugzilla.gnome.org/show_bug.cgi?id=608953
-CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
+AC_ARG_ENABLE(compile-warnings,
+ [AS_HELP_STRING([--disable-compile-warnings],
+ [Don't use builtin compiler warnings])],,
+ enable_compile_warnings=yes)
+AS_IF([test "x$enable_compile_warnings" = xyes], [
+ CC_CHECK_FLAGS_APPEND([GLIB_WARN_CFLAGS], [CFLAGS], [\
-Wall -Wstrict-prototypes -Werror=declaration-after-statement \
-Werror=missing-prototypes -Werror=implicit-function-declaration \
-Werror=pointer-arith -Werror=init-self -Werror=format-security \
-Werror=format=2 -Werror=missing-include-dirs])
-CFLAGS="$with_cflags $CFLAGS"
+])
+AC_SUBST(GLIB_WARN_CFLAGS)
#
# Define variables corresponding to the correct include paths to use for