diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-01-18 20:54:29 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-01-18 20:55:09 -0800 |
commit | 35a1a007bb7506c72ee6d9757a79014c679e7bae (patch) | |
tree | 256bdc2f880c3e34bdeb99d8b675a0610602bc66 /m4 | |
parent | 52baaca152135e3b67edb13df392ae9047af015c (diff) | |
download | emacs-35a1a007bb7506c72ee6d9757a79014c679e7bae.tar.gz |
Remove Gnulib putenv code
It’s not needed, since Emacs always uses the system putenv and all
platforms have putenv. This improves on the fix for Bug#19874.
Suggested by Bruno Haible.
* admin/merge-gnulib (GNULIB_MODULES): Remove putenv.
* configure.ac: Remove workarounds for Gnulib putenv module.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/putenv.c, m4/putenv.m4: Remove.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/gnulib-comp.m4 | 9 | ||||
-rw-r--r-- | m4/putenv.m4 | 60 |
2 files changed, 0 insertions, 69 deletions
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index cb3b89dd72f..48d8030f539 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -133,7 +133,6 @@ AC_DEFUN([gl_EARLY], # Code from module pipe2: # Code from module pselect: # Code from module pthread_sigmask: - # Code from module putenv: # Code from module qcopy-acl: # Code from module readlink: # Code from module readlinkat: @@ -368,12 +367,6 @@ AC_DEFUN([gl_INIT], gl_PREREQ_PTHREAD_SIGMASK fi gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask]) - gl_FUNC_PUTENV - if test $REPLACE_PUTENV = 1; then - AC_LIBOBJ([putenv]) - gl_PREREQ_PUTENV - fi - gl_STDLIB_MODULE_INDICATOR([putenv]) gl_FUNC_READLINK if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then AC_LIBOBJ([readlink]) @@ -973,7 +966,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/pipe2.c lib/pselect.c lib/pthread_sigmask.c - lib/putenv.c lib/qcopy-acl.c lib/readlink.c lib/readlinkat.c @@ -1112,7 +1104,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/pipe2.m4 m4/pselect.m4 m4/pthread_sigmask.m4 - m4/putenv.m4 m4/readlink.m4 m4/readlinkat.m4 m4/regex.m4 diff --git a/m4/putenv.m4 b/m4/putenv.m4 deleted file mode 100644 index e38f8c56940..00000000000 --- a/m4/putenv.m4 +++ /dev/null @@ -1,60 +0,0 @@ -# putenv.m4 serial 24 -dnl Copyright (C) 2002-2020 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl From Jim Meyering. -dnl -dnl Check whether putenv ("FOO") removes FOO from the environment. -dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that. - -AC_DEFUN([gl_FUNC_PUTENV], -[ - AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles - AC_CACHE_CHECK([for putenv compatible with GNU and SVID], - [gl_cv_func_svid_putenv], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ - /* Put it in env. */ - if (putenv ("CONFTEST_putenv=val")) - return 1; - - /* Try to remove it. */ - if (putenv ("CONFTEST_putenv")) - return 2; - - /* Make sure it was deleted. */ - if (getenv ("CONFTEST_putenv") != 0) - return 3; - - return 0; - ]])], - gl_cv_func_svid_putenv=yes, - gl_cv_func_svid_putenv=no, - dnl When crosscompiling, assume putenv is broken. - [case "$host_os" in - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_svid_putenv="guessing yes" ;; - # Guess yes on musl systems. - *-musl*) gl_cv_func_svid_putenv="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_svid_putenv="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_svid_putenv="$gl_cross_guess_normal" ;; - esac - ]) - ]) - case "$gl_cv_func_svid_putenv" in - *yes) ;; - *) - REPLACE_PUTENV=1 - ;; - esac -]) - -# Prerequisites of lib/putenv.c. -AC_DEFUN([gl_PREREQ_PUTENV], -[ - AC_CHECK_DECLS([_putenv]) -]) |