gnulib-tool --import environ; rely on gnulib for environ definitions
* libguile/posix.c: * libguile/stime.c: Remove environ definition, gnulib provides it now.
This commit is contained in:
parent
442f3f20dd
commit
b579617b2d
6 changed files with 42 additions and 28 deletions
|
|
@ -9,7 +9,7 @@
|
|||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# Generated by gnulib-tool.
|
||||
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild count-one-bits extensions flock fpieee full-read full-write lib-symbol-visibility putenv stdlib strcase strftime
|
||||
# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild count-one-bits environ extensions flock fpieee full-read full-write lib-symbol-visibility putenv stdlib strcase strftime
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.5 gnits
|
||||
|
||||
|
|
|
|||
|
|
@ -101,8 +101,6 @@ extern char *ttyname();
|
|||
|
||||
#include <signal.h>
|
||||
|
||||
extern char ** environ;
|
||||
|
||||
#ifdef HAVE_GRP_H
|
||||
#include <grp.h>
|
||||
#endif
|
||||
|
|
@ -140,10 +138,6 @@ extern char ** environ;
|
|||
|
||||
#include <sys/file.h> /* from Gnulib */
|
||||
|
||||
#if HAVE_CRT_EXTERNS_H
|
||||
#include <crt_externs.h> /* for Darwin _NSGetEnviron */
|
||||
#endif
|
||||
|
||||
/* Some Unix systems don't define these. CPP hair is dangerous, but
|
||||
this seems safe enough... */
|
||||
#ifndef R_OK
|
||||
|
|
@ -196,13 +190,6 @@ int sethostname (char *name, size_t namelen);
|
|||
|
||||
|
||||
|
||||
/* On Apple Darwin in a shared library there's no "environ" to access
|
||||
directly, instead the address of that variable must be obtained with
|
||||
_NSGetEnviron(). */
|
||||
#if HAVE__NSGETENVIRON && defined (PIC)
|
||||
#define environ (*_NSGetEnviron())
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Two often used patterns
|
||||
|
|
|
|||
|
|
@ -77,10 +77,6 @@
|
|||
# include <sys/timeb.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_CRT_EXTERNS_H
|
||||
#include <crt_externs.h> /* for Darwin _NSGetEnviron */
|
||||
#endif
|
||||
|
||||
#ifndef tzname /* For SGI. */
|
||||
extern char *tzname[]; /* RS6000 and others reject char **tzname. */
|
||||
#endif
|
||||
|
|
@ -98,15 +94,6 @@ extern char *strptime ();
|
|||
# define timet long
|
||||
#endif
|
||||
|
||||
extern char ** environ;
|
||||
|
||||
/* On Apple Darwin in a shared library there's no "environ" to access
|
||||
directly, instead the address of that variable must be obtained with
|
||||
_NSGetEnviron(). */
|
||||
#if HAVE__NSGETENVIRON && defined (PIC)
|
||||
#define environ (*_NSGetEnviron())
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_TIMES
|
||||
static
|
||||
|
|
|
|||
36
m4/environ.m4
Normal file
36
m4/environ.m4
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# environ.m4 serial 2
|
||||
dnl Copyright (C) 2001-2004, 2006-2009 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.
|
||||
|
||||
AC_DEFUN([gl_ENVIRON],
|
||||
[
|
||||
AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
|
||||
dnl Persuade glibc <unistd.h> to declare environ.
|
||||
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
|
||||
gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
|
||||
if test $gt_cv_var_environ_declaration != yes; then
|
||||
HAVE_DECL_ENVIRON=0
|
||||
fi
|
||||
])
|
||||
|
||||
# Check if a variable is properly declared.
|
||||
# gt_CHECK_VAR_DECL(includes,variable)
|
||||
AC_DEFUN([gt_CHECK_VAR_DECL],
|
||||
[
|
||||
define([gt_cv_var], [gt_cv_var_]$2[_declaration])
|
||||
AC_MSG_CHECKING([if $2 is properly declared])
|
||||
AC_CACHE_VAL([gt_cv_var], [
|
||||
AC_TRY_COMPILE([$1
|
||||
extern struct { int foo; } $2;],
|
||||
[$2.foo = 1;],
|
||||
gt_cv_var=no,
|
||||
gt_cv_var=yes)])
|
||||
AC_MSG_RESULT([$gt_cv_var])
|
||||
if test $gt_cv_var = yes; then
|
||||
AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_DECL], 1,
|
||||
[Define if you have the declaration of $2.])
|
||||
fi
|
||||
undefine([gt_cv_var])
|
||||
])
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
# Specification in the form of a command-line invocation:
|
||||
# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild count-one-bits extensions flock fpieee full-read full-write lib-symbol-visibility putenv stdlib strcase strftime
|
||||
# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl --libtool --macro-prefix=gl --no-vc-files alloca-opt autobuild count-one-bits environ extensions flock fpieee full-read full-write lib-symbol-visibility putenv stdlib strcase strftime
|
||||
|
||||
# Specification in the form of a few gnulib-tool.m4 macro invocations:
|
||||
gl_LOCAL_DIR([])
|
||||
|
|
@ -23,6 +23,7 @@ gl_MODULES([
|
|||
alloca-opt
|
||||
autobuild
|
||||
count-one-bits
|
||||
environ
|
||||
extensions
|
||||
flock
|
||||
fpieee
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ AC_DEFUN([gl_INIT],
|
|||
gl_source_base='lib'
|
||||
gl_FUNC_ALLOCA
|
||||
gl_COUNT_ONE_BITS
|
||||
gl_ENVIRON
|
||||
gl_UNISTD_MODULE_INDICATOR([environ])
|
||||
gl_FUNC_FLOCK
|
||||
gl_HEADER_SYS_FILE_MODULE_INDICATOR([flock])
|
||||
gl_INLINE
|
||||
|
|
@ -251,6 +253,7 @@ AC_DEFUN([gl_FILE_LIST], [
|
|||
m4/autobuild.m4
|
||||
m4/codeset.m4
|
||||
m4/count-one-bits.m4
|
||||
m4/environ.m4
|
||||
m4/extensions.m4
|
||||
m4/flock.m4
|
||||
m4/fpieee.m4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue