summaryrefslogtreecommitdiff
path: root/m4/getdelim.m4
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-03-05 10:08:25 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-03-05 10:08:25 +0900
commit0600edaa5c1a04547bd6b1e0431660d6833074cd (patch)
treed099efc896b831b1046baf83d8ba3edb60c6e65c /m4/getdelim.m4
parent4a9ac8023543db82c39c3db6138a8e8582f51797 (diff)
downloadwget-0600edaa5c1a04547bd6b1e0431660d6833074cd.tar.gz
wget-0600edaa5c1a04547bd6b1e0431660d6833074cd.tar.bz2
wget-0600edaa5c1a04547bd6b1e0431660d6833074cd.zip
Imported Upstream version 1.20.2upstream/1.20.2
Diffstat (limited to 'm4/getdelim.m4')
-rw-r--r--m4/getdelim.m442
1 files changed, 25 insertions, 17 deletions
diff --git a/m4/getdelim.m4 b/m4/getdelim.m4
index e50af81..e77c379 100644
--- a/m4/getdelim.m4
+++ b/m4/getdelim.m4
@@ -1,6 +1,6 @@
-# getdelim.m4 serial 12
+# getdelim.m4 serial 13
-dnl Copyright (C) 2005-2007, 2009-2018 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2007, 2009-2019 Free Software Foundation, Inc.
dnl
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -11,6 +11,7 @@ AC_PREREQ([2.59])
AC_DEFUN([gl_FUNC_GETDELIM],
[
AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
dnl Persuade glibc <stdio.h> to declare getdelim().
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -21,9 +22,10 @@ AC_DEFUN([gl_FUNC_GETDELIM],
if test $ac_cv_func_getdelim = yes; then
HAVE_GETDELIM=1
dnl Found it in some library. Verify that it works.
- AC_CACHE_CHECK([for working getdelim function], [gl_cv_func_working_getdelim],
- [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ AC_CACHE_CHECK([for working getdelim function],
+ [gl_cv_func_working_getdelim],
+ [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -53,25 +55,31 @@ AC_DEFUN([gl_FUNC_GETDELIM],
fclose (in);
return 0;
}
- ]])], [gl_cv_func_working_getdelim=yes] dnl The library version works.
- , [gl_cv_func_working_getdelim=no] dnl The library version does NOT work.
- , dnl We're cross compiling. Assume it works on glibc2 systems.
- [AC_EGREP_CPP([Lucky GNU user],
- [
+ ]])],
+ [gl_cv_func_working_getdelim=yes],
+ [gl_cv_func_working_getdelim=no],
+ [dnl We're cross compiling.
+ dnl Guess it works on glibc2 systems and musl systems.
+ AC_EGREP_CPP([Lucky GNU user],
+ [
#include <features.h>
#ifdef __GNU_LIBRARY__
#if (__GLIBC__ >= 2) && !defined __UCLIBC__
Lucky GNU user
#endif
#endif
- ],
- [gl_cv_func_working_getdelim="guessing yes"],
- [gl_cv_func_working_getdelim="guessing no"])]
- )])
+ ],
+ [gl_cv_func_working_getdelim="guessing yes"],
+ [case "$host_os" in
+ *-musl*) gl_cv_func_working_getdelim="guessing yes" ;;
+ *) gl_cv_func_working_getdelim="guessing no" ;;
+ esac
+ ])
+ ])
+ ])
case "$gl_cv_func_working_getdelim" in
- *no)
- REPLACE_GETDELIM=1
- ;;
+ *yes) ;;
+ *) REPLACE_GETDELIM=1 ;;
esac
else
HAVE_GETDELIM=0