aboutsummaryrefslogtreecommitdiffstats
path: root/aclocal-fallback/glib-2.0.m4
diff options
context:
space:
mode:
authorDhiru Kholia <kholia@kth.se>2015-11-04 11:00:21 +0100
committerPeter Wu <peter@lekensteyn.nl>2015-11-04 12:16:17 +0000
commit58528f6d911c7dfec3c8c550abc5d717861c60ee (patch)
tree146f98b0043f67dfff6e9bf848525ecd99bdbfe6 /aclocal-fallback/glib-2.0.m4
parentcde99ec5354d95960a52e1fd49bc68e108e918d7 (diff)
Fix AddressSanitizer (./configure --enable-asan) builds
"./configure --enable-asan" currently fails to detect installed libraries because aclocal-fallback/* built programs have memory leaks in them. configure:34516: checking for GTK+ - version >= 3.0.0 configure:34626: gcc -o conftest ... ... configure:34626: $? = 0 configure:34626: ./conftest ================================================================= ==29007==ERROR: LeakSanitizer: detected memory leaks Direct leak of 6 byte(s) in 1 object(s) allocated from: #0 0x7fa5c95dd9aa in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x989aa) #1 0x7fa5c8995578 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4f578) SUMMARY: AddressSanitizer: 6 byte(s) leaked in 1 allocation(s). configure:34626: $? = 23 configure: program exited with status 23 ... configure:34649: result: no configure:34699: error: GTK+ 3 is not available ... This system is running 64-bit Ubuntu Linux 15.10 with GCC 5.2.1 compiler. The glib-2-0.m4 leak, and the gtk-3.0.m4 leak are fixed by updating "glib-2.0.m4" to the latest upstream version. Whitespace errors are fixed locally to keep the BuildBot happy. Change-Id: I01a5f4c494a59ae6d0ee19cd2611fab163ebf9b4 Reviewed-on: https://code.wireshark.org/review/11283 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'aclocal-fallback/glib-2.0.m4')
-rw-r--r--aclocal-fallback/glib-2.0.m456
1 files changed, 28 insertions, 28 deletions
diff --git a/aclocal-fallback/glib-2.0.m4 b/aclocal-fallback/glib-2.0.m4
index f0ae170e0e..f6b58396b1 100644
--- a/aclocal-fallback/glib-2.0.m4
+++ b/aclocal-fallback/glib-2.0.m4
@@ -1,11 +1,12 @@
# Configure paths for GLIB
# Owen Taylor 1997-2001
+
dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
-dnl gthread is specified in MODULES, pass to pkg-config
+dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject,
+dnl gthread, or gio is specified in MODULES, pass to pkg-config
dnl
AC_DEFUN([AM_PATH_GLIB_2_0],
-[dnl
+[dnl
dnl Get the cflags and libraries from pkg-config
dnl
AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program],
@@ -15,32 +16,31 @@ AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run
for module in . $4
do
case "$module" in
- gmodule)
+ gmodule)
pkg_config_args="$pkg_config_args gmodule-2.0"
;;
- gobject)
+ gmodule-no-export)
+ pkg_config_args="$pkg_config_args gmodule-no-export-2.0"
+ ;;
+ gobject)
pkg_config_args="$pkg_config_args gobject-2.0"
;;
- gthread)
+ gthread)
pkg_config_args="$pkg_config_args gthread-2.0"
;;
+ gio*)
+ pkg_config_args="$pkg_config_args $module-2.0"
+ ;;
esac
done
- AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ PKG_PROG_PKG_CONFIG([0.16])
no_glib=""
- if test x$PKG_CONFIG != xno ; then
- if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
- :
- else
- echo *** pkg-config too old; version 0.7 or better required.
- no_glib=yes
- PKG_CONFIG=no
- fi
- else
+ if test "x$PKG_CONFIG" = x ; then
no_glib=yes
+ PKG_CONFIG=no
fi
min_glib_version=ifelse([$1], ,2.0.0,$1)
@@ -64,6 +64,7 @@ AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run
GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
+ GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
@@ -88,17 +89,14 @@ dnl
#include <stdio.h>
#include <stdlib.h>
-int
+int
main ()
{
- int major, minor, micro;
- char *tmp_version;
+ unsigned int major, minor, micro;
- system ("touch conf.glibtest");
+ fclose (fopen ("conf.glibtest", "w"));
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = g_strdup("$min_glib_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ if (sscanf("$min_glib_version", "%u.%u.%u", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_glib_version");
exit(1);
}
@@ -107,7 +105,7 @@ main ()
(glib_minor_version != $glib_config_minor_version) ||
(glib_micro_version != $glib_config_micro_version))
{
- printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
+ printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
$glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
glib_major_version, glib_minor_version, glib_micro_version);
printf ("*** was found! If pkg-config was correct, then it is best\n");
@@ -117,7 +115,7 @@ main ()
printf("*** required on your system.\n");
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
printf("*** to point to the correct configuration files\n");
- }
+ }
else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
(glib_minor_version != GLIB_MINOR_VERSION) ||
(glib_micro_version != GLIB_MICRO_VERSION))
@@ -137,9 +135,9 @@ main ()
}
else
{
- printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
+ printf("\n*** An old version of GLIB (%u.%u.%u) was found.\n",
glib_major_version, glib_minor_version, glib_micro_version);
- printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
+ printf("*** You need a version of GLIB newer than %u.%u.%u. The latest version of\n",
major, minor, micro);
printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
@@ -161,7 +159,7 @@ main ()
fi
if test "x$no_glib" = x ; then
AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
- ifelse([$2], , :, [$2])
+ ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$PKG_CONFIG" = "no" ; then
@@ -200,6 +198,7 @@ main ()
GLIB_GENMARSHAL=""
GOBJECT_QUERY=""
GLIB_MKENUMS=""
+ GLIB_COMPILE_RESOURCES=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GLIB_CFLAGS)
@@ -207,5 +206,6 @@ main ()
AC_SUBST(GLIB_GENMARSHAL)
AC_SUBST(GOBJECT_QUERY)
AC_SUBST(GLIB_MKENUMS)
+ AC_SUBST(GLIB_COMPILE_RESOURCES)
rm -f conf.glibtest
])