diff options
| author | Paul Eggert | 2020-01-18 20:54:29 -0800 |
|---|---|---|
| committer | Paul Eggert | 2020-01-18 20:55:09 -0800 |
| commit | 35a1a007bb7506c72ee6d9757a79014c679e7bae (patch) | |
| tree | 256bdc2f880c3e34bdeb99d8b675a0610602bc66 /m4 | |
| parent | 52baaca152135e3b67edb13df392ae9047af015c (diff) | |
| download | emacs-35a1a007bb7506c72ee6d9757a79014c679e7bae.tar.gz emacs-35a1a007bb7506c72ee6d9757a79014c679e7bae.zip | |
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], | |||
| 133 | # Code from module pipe2: | 133 | # Code from module pipe2: |
| 134 | # Code from module pselect: | 134 | # Code from module pselect: |
| 135 | # Code from module pthread_sigmask: | 135 | # Code from module pthread_sigmask: |
| 136 | # Code from module putenv: | ||
| 137 | # Code from module qcopy-acl: | 136 | # Code from module qcopy-acl: |
| 138 | # Code from module readlink: | 137 | # Code from module readlink: |
| 139 | # Code from module readlinkat: | 138 | # Code from module readlinkat: |
| @@ -368,12 +367,6 @@ AC_DEFUN([gl_INIT], | |||
| 368 | gl_PREREQ_PTHREAD_SIGMASK | 367 | gl_PREREQ_PTHREAD_SIGMASK |
| 369 | fi | 368 | fi |
| 370 | gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask]) | 369 | gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask]) |
| 371 | gl_FUNC_PUTENV | ||
| 372 | if test $REPLACE_PUTENV = 1; then | ||
| 373 | AC_LIBOBJ([putenv]) | ||
| 374 | gl_PREREQ_PUTENV | ||
| 375 | fi | ||
| 376 | gl_STDLIB_MODULE_INDICATOR([putenv]) | ||
| 377 | gl_FUNC_READLINK | 370 | gl_FUNC_READLINK |
| 378 | if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then | 371 | if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then |
| 379 | AC_LIBOBJ([readlink]) | 372 | AC_LIBOBJ([readlink]) |
| @@ -973,7 +966,6 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 973 | lib/pipe2.c | 966 | lib/pipe2.c |
| 974 | lib/pselect.c | 967 | lib/pselect.c |
| 975 | lib/pthread_sigmask.c | 968 | lib/pthread_sigmask.c |
| 976 | lib/putenv.c | ||
| 977 | lib/qcopy-acl.c | 969 | lib/qcopy-acl.c |
| 978 | lib/readlink.c | 970 | lib/readlink.c |
| 979 | lib/readlinkat.c | 971 | lib/readlinkat.c |
| @@ -1112,7 +1104,6 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 1112 | m4/pipe2.m4 | 1104 | m4/pipe2.m4 |
| 1113 | m4/pselect.m4 | 1105 | m4/pselect.m4 |
| 1114 | m4/pthread_sigmask.m4 | 1106 | m4/pthread_sigmask.m4 |
| 1115 | m4/putenv.m4 | ||
| 1116 | m4/readlink.m4 | 1107 | m4/readlink.m4 |
| 1117 | m4/readlinkat.m4 | 1108 | m4/readlinkat.m4 |
| 1118 | m4/regex.m4 | 1109 | 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 @@ | |||
| 1 | # putenv.m4 serial 24 | ||
| 2 | dnl Copyright (C) 2002-2020 Free Software Foundation, Inc. | ||
| 3 | dnl This file is free software; the Free Software Foundation | ||
| 4 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 5 | dnl with or without modifications, as long as this notice is preserved. | ||
| 6 | |||
| 7 | dnl From Jim Meyering. | ||
| 8 | dnl | ||
| 9 | dnl Check whether putenv ("FOO") removes FOO from the environment. | ||
| 10 | dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that. | ||
| 11 | |||
| 12 | AC_DEFUN([gl_FUNC_PUTENV], | ||
| 13 | [ | ||
| 14 | AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) | ||
| 15 | AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles | ||
| 16 | AC_CACHE_CHECK([for putenv compatible with GNU and SVID], | ||
| 17 | [gl_cv_func_svid_putenv], | ||
| 18 | [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[ | ||
| 19 | /* Put it in env. */ | ||
| 20 | if (putenv ("CONFTEST_putenv=val")) | ||
| 21 | return 1; | ||
| 22 | |||
| 23 | /* Try to remove it. */ | ||
| 24 | if (putenv ("CONFTEST_putenv")) | ||
| 25 | return 2; | ||
| 26 | |||
| 27 | /* Make sure it was deleted. */ | ||
| 28 | if (getenv ("CONFTEST_putenv") != 0) | ||
| 29 | return 3; | ||
| 30 | |||
| 31 | return 0; | ||
| 32 | ]])], | ||
| 33 | gl_cv_func_svid_putenv=yes, | ||
| 34 | gl_cv_func_svid_putenv=no, | ||
| 35 | dnl When crosscompiling, assume putenv is broken. | ||
| 36 | [case "$host_os" in | ||
| 37 | # Guess yes on glibc systems. | ||
| 38 | *-gnu* | gnu*) gl_cv_func_svid_putenv="guessing yes" ;; | ||
| 39 | # Guess yes on musl systems. | ||
| 40 | *-musl*) gl_cv_func_svid_putenv="guessing yes" ;; | ||
| 41 | # Guess no on native Windows. | ||
| 42 | mingw*) gl_cv_func_svid_putenv="guessing no" ;; | ||
| 43 | # If we don't know, obey --enable-cross-guesses. | ||
| 44 | *) gl_cv_func_svid_putenv="$gl_cross_guess_normal" ;; | ||
| 45 | esac | ||
| 46 | ]) | ||
| 47 | ]) | ||
| 48 | case "$gl_cv_func_svid_putenv" in | ||
| 49 | *yes) ;; | ||
| 50 | *) | ||
| 51 | REPLACE_PUTENV=1 | ||
| 52 | ;; | ||
| 53 | esac | ||
| 54 | ]) | ||
| 55 | |||
| 56 | # Prerequisites of lib/putenv.c. | ||
| 57 | AC_DEFUN([gl_PREREQ_PUTENV], | ||
| 58 | [ | ||
| 59 | AC_CHECK_DECLS([_putenv]) | ||
| 60 | ]) | ||