summaryrefslogtreecommitdiff
path: root/libextra
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-11-12 17:01:22 +0100
committerSimon Josefsson <simon@josefsson.org>2008-11-12 17:01:22 +0100
commitbd94131fb59840e69fe621a2a346af56d927da23 (patch)
treeac18162490935faf62a8bf5297256383d5b2b230 /libextra
parentc2e5b92797a49247a419d49116295433e1f9be60 (diff)
downloadgnutls-bd94131fb59840e69fe621a2a346af56d927da23.tar.gz
Use more warning flags. Need extensions in libextra.
Diffstat (limited to 'libextra')
-rw-r--r--libextra/Makefile.am1
-rw-r--r--libextra/gl/Makefile.am2
-rw-r--r--libextra/gl/m4/extensions.m482
-rw-r--r--libextra/gl/m4/gnulib-cache.m43
-rw-r--r--libextra/gl/m4/gnulib-comp.m42
5 files changed, 88 insertions, 2 deletions
diff --git a/libextra/Makefile.am b/libextra/Makefile.am
index a0c742144b..ce01bd9830 100644
--- a/libextra/Makefile.am
+++ b/libextra/Makefile.am
@@ -23,6 +23,7 @@
ACLOCAL_AMFLAGS = -I m4 -I gl/m4 -I ../lib/m4
AM_CPPFLAGS = \
+ $(WARN_CFLAGS) \
-I$(srcdir)/../lib/gl \
-I$(builddir)/../lib/gl \
-I$(srcdir)/gl \
diff --git a/libextra/gl/Makefile.am b/libextra/gl/Makefile.am
index 160df6ce44..81622b721d 100644
--- a/libextra/gl/Makefile.am
+++ b/libextra/gl/Makefile.am
@@ -9,7 +9,7 @@
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libxgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dummy --avoid=stdint --libtool --macro-prefix=xgl --no-vc-files crypto/hmac-md5 crypto/md5 havelib
+# Reproduce by: gnulib-tool --import --dir=. --lib=libxgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dummy --avoid=stdint --libtool --macro-prefix=xgl --no-vc-files crypto/hmac-md5 crypto/md5 extensions havelib
AUTOMAKE_OPTIONS = 1.5 gnits
diff --git a/libextra/gl/m4/extensions.m4 b/libextra/gl/m4/extensions.m4
new file mode 100644
index 0000000000..917af94805
--- /dev/null
+++ b/libextra/gl/m4/extensions.m4
@@ -0,0 +1,82 @@
+# serial 5 -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# Autoconf. Perhaps we can remove this once we can assume Autoconf
+# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+# Remember that #undef in AH_VERBATIM gets replaced with #define by
+# AC_DEFINE. The goal here is to define all known feature-enabling
+# macros, then, if reports of conflicts are made, disable macros that
+# cause problems on some platforms (such as __EXTENSIONS__).
+AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+
+ AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
+ if test "$MINIX" = yes; then
+ AC_DEFINE([_POSIX_SOURCE], [1],
+ [Define to 1 if you need to in order for `stat' and other
+ things to work.])
+ AC_DEFINE([_POSIX_1_SOURCE], [2],
+ [Define to 2 if the system does not provide POSIX.1 features
+ except with this defined.])
+ AC_DEFINE([_MINIX], [1],
+ [Define to 1 if on MINIX.])
+ fi
+
+ AH_VERBATIM([__EXTENSIONS__],
+[/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+])
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+# define __EXTENSIONS__ 1
+ ]AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
+ AC_DEFINE([_ALL_SOURCE])
+ AC_DEFINE([_GNU_SOURCE])
+ AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+ AC_DEFINE([_TANDEM_SOURCE])
+])# AC_USE_SYSTEM_EXTENSIONS
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+ [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
diff --git a/libextra/gl/m4/gnulib-cache.m4 b/libextra/gl/m4/gnulib-cache.m4
index a1aeb720e6..f41efb2425 100644
--- a/libextra/gl/m4/gnulib-cache.m4
+++ b/libextra/gl/m4/gnulib-cache.m4
@@ -15,13 +15,14 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libxgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dummy --avoid=stdint --libtool --macro-prefix=xgl --no-vc-files crypto/hmac-md5 crypto/md5 havelib
+# gnulib-tool --import --dir=. --lib=libxgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=dummy --avoid=stdint --libtool --macro-prefix=xgl --no-vc-files crypto/hmac-md5 crypto/md5 extensions havelib
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
gl_MODULES([
crypto/hmac-md5
crypto/md5
+ extensions
havelib
])
gl_AVOID([dummy stdint])
diff --git a/libextra/gl/m4/gnulib-comp.m4 b/libextra/gl/m4/gnulib-comp.m4
index 8219bb8ebe..5921be18cf 100644
--- a/libextra/gl/m4/gnulib-comp.m4
+++ b/libextra/gl/m4/gnulib-comp.m4
@@ -25,6 +25,7 @@ AC_DEFUN([xgl_EARLY],
m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
AC_REQUIRE([AC_PROG_RANLIB])
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
])
# This macro should be invoked from ./configure.ac, in the section
@@ -178,6 +179,7 @@ AC_DEFUN([xgl_FILE_LIST], [
lib/md5.h
lib/memxor.c
lib/memxor.h
+ m4/extensions.m4
m4/gnulib-common.m4
m4/hmac-md5.m4
m4/lib-ld.m4