1
# Portability macros for glibc argz. -*- Autoconf -*-
3
# Copyright (C) 2004-2007, 2011-2015 Free Software Foundation, Inc.
4
# Written by Gary V. Vaughan <gary@gnu.org>
6
# This file is free software; the Free Software Foundation gives
7
# unlimited permission to copy and/or distribute it, with or without
8
# modifications, as long as this notice is preserved.
12
AC_DEFUN([LT_FUNC_ARGZ], [
13
AC_CHECK_HEADERS([argz.h], [], [], [AC_INCLUDES_DEFAULT])
15
AC_CHECK_TYPES([error_t],
17
[AC_DEFINE([error_t], [int],
18
[Define to a type to use for 'error_t' if it is not otherwise available.])
19
AC_DEFINE([__error_t_defined], [1], [Define so that glibc/gnulib argp.h
20
does not typedef error_t.])],
21
[#if defined(HAVE_ARGZ_H)
26
AC_CHECK_FUNCS([argz_add argz_append argz_count argz_create_sep argz_insert \
27
argz_next argz_stringify], [], [LT_ARGZ_H=lt__argz.h; AC_LIBOBJ([lt__argz])])
29
dnl if have system argz functions, allow forced use of
30
dnl libltdl-supplied implementation (and default to do so
31
dnl on "known bad" systems). Could use a runtime check, but
32
dnl (a) detecting malloc issues is notoriously unreliable
33
dnl (b) only known system that declares argz functions,
34
dnl provides them, yet they are broken, is cygwin
35
dnl releases prior to 16-Mar-2007 (1.5.24 and earlier)
36
dnl So, it's more straightforward simply to special case
37
dnl this for known bad systems.
38
AS_IF([test -z "$LT_ARGZ_H"],
40
[if argz actually works],
41
[lt_cv_sys_argz_works],
44
lt_cv_sys_argz_works=no
45
if test no != "$cross_compiling"; then
46
lt_cv_sys_argz_works="guessing no"
48
lt_sed_extract_leading_digits='s/^\([0-9\.]*\).*/\1/'
51
set x `uname -r | sed -e "$lt_sed_extract_leading_digits"`
56
if test 1 -lt "$lt_os_major" \
57
|| { test 1 -eq "$lt_os_major" \
58
&& { test 5 -lt "$lt_os_minor" \
59
|| { test 5 -eq "$lt_os_minor" \
60
&& test 24 -lt "$lt_os_micro"; }; }; }; then
61
lt_cv_sys_argz_works=yes
65
*) lt_cv_sys_argz_works=yes ;;
67
AS_IF([test yes = "$lt_cv_sys_argz_works"],
68
[AC_DEFINE([HAVE_WORKING_ARGZ], 1,
69
[This value is set to 1 to indicate that the system argz facility works])],
71
AC_LIBOBJ([lt__argz])])])