summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4')
-rw-r--r--m4/gl-comp.m415
-rw-r--r--m4/gnulib-common.m456
-rw-r--r--m4/largefile.m420
-rw-r--r--m4/pthread_sigmask.m46
-rw-r--r--m4/strtoimax.m46
-rw-r--r--m4/strtoumax.m46
6 files changed, 82 insertions, 27 deletions
diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4
index becf95bef71..f7d99ca6f44 100644
--- a/m4/gl-comp.m4
+++ b/m4/gl-comp.m4
@@ -25,7 +25,7 @@ AC_DEFUN([gl_EARLY],
m4_pattern_allow([^gl_ES$])dnl a valid locale name
m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
- AC_REQUIRE([AC_PROG_RANLIB])
+ AC_REQUIRE([gl_PROG_AR_RANLIB])
# Code from module alloca-opt:
# Code from module allocator:
# Code from module careadlinkat:
@@ -48,6 +48,7 @@ AC_DEFUN([gl_EARLY],
# Code from module intprops:
# Code from module inttypes-incomplete:
# Code from module largefile:
+ AC_REQUIRE([AC_SYS_LARGEFILE])
# Code from module lstat:
# Code from module mktime:
# Code from module multiarch:
@@ -174,13 +175,13 @@ gl_STDIO_H
gl_STDLIB_H
gl_FUNC_GNU_STRFTIME
gl_FUNC_STRTOIMAX
-if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no; then
+if test $ac_cv_func_strtoimax = no; then
AC_LIBOBJ([strtoimax])
gl_PREREQ_STRTOIMAX
fi
gl_INTTYPES_MODULE_INDICATOR([strtoimax])
gl_FUNC_STRTOUMAX
-if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then
+if test $ac_cv_func_strtoumax = no; then
AC_LIBOBJ([strtoumax])
gl_PREREQ_STRTOUMAX
fi
@@ -297,16 +298,16 @@ gl_STDLIB_MODULE_INDICATOR([strtoull])
if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
func_gl_gnulib_m4code_stat
fi
- if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no; then
+ if test $ac_cv_func_strtoimax = no; then
func_gl_gnulib_m4code_verify
fi
- if test "$ac_cv_have_decl_strtoimax" != yes && test $ac_cv_func_strtoimax = no && test $ac_cv_type_long_long_int = yes; then
+ if test $ac_cv_func_strtoimax = no && test $ac_cv_type_long_long_int = yes; then
func_gl_gnulib_m4code_strtoll
fi
- if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no; then
+ if test $ac_cv_func_strtoumax = no; then
func_gl_gnulib_m4code_verify
fi
- if test "$ac_cv_have_decl_strtoumax" != yes && test $ac_cv_func_strtoumax = no && test $ac_cv_type_unsigned_long_long_int = yes; then
+ if test $ac_cv_func_strtoumax = no && test $ac_cv_type_unsigned_long_long_int = yes; then
func_gl_gnulib_m4code_strtoull
fi
m4_pattern_allow([^gl_GNULIB_ENABLED_])
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 6b5923a0ea6..8fc448fdc8f 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 28
+# gnulib-common.m4 serial 30
dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -211,6 +211,60 @@ m4_ifndef([AS_VAR_IF],
[m4_define([AS_VAR_IF],
[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
+# gl_PROG_AR_RANLIB
+# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
+# The user can set the variables AR, ARFLAGS, RANLIB if he wants to override
+# the values.
+AC_DEFUN([gl_PROG_AR_RANLIB],
+[
+ dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
+ dnl as "cc", and GCC as "gcc". They have different object file formats and
+ dnl library formats. In particular, the GNU binutils programs ar, ranlib
+ dnl produce libraries that work only with gcc, not with cc.
+ AC_REQUIRE([AC_PROG_CC])
+ AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
+ [
+ AC_EGREP_CPP([Amsterdam],
+ [
+#ifdef __ACK__
+Amsterdam
+#endif
+ ],
+ [gl_cv_c_amsterdam_compiler=yes],
+ [gl_cv_c_amsterdam_compiler=no])
+ ])
+ if test -z "$AR"; then
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ AR='cc -c.a'
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='-o'
+ fi
+ else
+ dnl Use the Automake-documented default values for AR and ARFLAGS,
+ dnl but prefer ${host}-ar over ar (useful for cross-compiling).
+ AC_CHECK_TOOL([AR], [ar], [ar])
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='cru'
+ fi
+ fi
+ else
+ if test -z "$ARFLAGS"; then
+ ARFLAGS='cru'
+ fi
+ fi
+ AC_SUBST([AR])
+ AC_SUBST([ARFLAGS])
+ if test -z "$RANLIB"; then
+ if test $gl_cv_c_amsterdam_compiler = yes; then
+ RANLIB=':'
+ else
+ dnl Use the ranlib program if it is available.
+ AC_PROG_RANLIB
+ fi
+ fi
+ AC_SUBST([RANLIB])
+])
+
# AC_PROG_MKDIR_P
# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
# for interoperability with automake-1.9.6 from autoconf-2.62.
diff --git a/m4/largefile.m4 b/m4/largefile.m4
index 6986244b396..d83fea1233d 100644
--- a/m4/largefile.m4
+++ b/m4/largefile.m4
@@ -19,8 +19,8 @@ m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
incorrectly reject 9223372036854775807. */
@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1]];[]dnl
+ && LARGE_OFF_T % 2147483647 == 1)
+ ? 1 : -1]];[]dnl
])
@@ -58,7 +58,7 @@ rm -rf conftest*[]dnl
# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
AC_DEFUN([AC_SYS_LARGEFILE],
[AC_ARG_ENABLE(largefile,
- [ --disable-largefile omit support for large files])
+ [ --disable-largefile omit support for large files])
if test "$enable_largefile" != no; then
AC_CACHE_CHECK([for special C compiler options needed for large files],
@@ -67,13 +67,13 @@ if test "$enable_largefile" != no; then
if test "$GCC" != yes; then
ac_save_CC=$CC
while :; do
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
- AC_COMPILE_IFELSE([], [break])
- CC="$CC -n32"
- AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
- break
+ # IRIX 6.2 and later do not support large files by default,
+ # so use the C compiler's -n32 option if that helps.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
+ AC_COMPILE_IFELSE([], [break])
+ CC="$CC -n32"
+ AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
+ break
done
CC=$ac_save_CC
rm -f conftest.$ac_ext
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
index f3522496cd5..f06bc119ff3 100644
--- a/m4/pthread_sigmask.m4
+++ b/m4/pthread_sigmask.m4
@@ -1,4 +1,4 @@
-# pthread_sigmask.m4 serial 11
+# pthread_sigmask.m4 serial 12
dnl Copyright (C) 2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -13,8 +13,8 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
dnl Some packages like Emacs use --avoid=threadlib.
dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
- m4_ifdef([gl_[]THREADLIB], [
- AC_REQUIRE([gl_[]THREADLIB])
+ m4_ifdef([gl_][THREADLIB], [
+ AC_REQUIRE([gl_][THREADLIB])
if test "$gl_threads_api" = posix; then
if test $ac_cv_func_pthread_sigmask = yes; then
diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4
index 47fb1bc9c38..a8d0b69c205 100644
--- a/m4/strtoimax.m4
+++ b/m4/strtoimax.m4
@@ -1,4 +1,4 @@
-# strtoimax.m4 serial 10
+# strtoimax.m4 serial 11
dnl Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,11 +8,11 @@ AC_DEFUN([gl_FUNC_STRTOIMAX],
[
AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ dnl On OSF/1 5.1 with cc, this function is declared but not defined.
+ AC_CHECK_FUNCS_ONCE([strtoimax])
AC_CHECK_DECLS_ONCE([strtoimax])
if test "$ac_cv_have_decl_strtoimax" != yes; then
HAVE_DECL_STRTOIMAX=0
-
- AC_CHECK_FUNCS([strtoimax])
fi
])
diff --git a/m4/strtoumax.m4 b/m4/strtoumax.m4
index 58b310de85a..1ddf6820e3f 100644
--- a/m4/strtoumax.m4
+++ b/m4/strtoumax.m4
@@ -1,4 +1,4 @@
-# strtoumax.m4 serial 10
+# strtoumax.m4 serial 11
dnl Copyright (C) 2002-2004, 2006, 2009-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -8,11 +8,11 @@ AC_DEFUN([gl_FUNC_STRTOUMAX],
[
AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+ dnl On OSF/1 5.1 with cc, this function is declared but not defined.
+ AC_CHECK_FUNCS_ONCE([strtoumax])
AC_CHECK_DECLS_ONCE([strtoumax])
if test "$ac_cv_have_decl_strtoumax" != yes; then
HAVE_DECL_STRTOUMAX=0
-
- AC_CHECK_FUNCS([strtoumax])
fi
])