guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. b579617b2db0e83f620c5


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. b579617b2db0e83f620c5b856dcc320cea9d6d1f
Date: Tue, 26 May 2009 16:15:22 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=b579617b2db0e83f620c5b856dcc320cea9d6d1f

The branch, master has been updated
       via  b579617b2db0e83f620c5b856dcc320cea9d6d1f (commit)
      from  442f3f20ddd33b43743ea181d95024c10622df52 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b579617b2db0e83f620c5b856dcc320cea9d6d1f
Author: Andy Wingo <address@hidden>
Date:   Tue May 26 18:06:21 2009 +0200

    gnulib-tool --import environ; rely on gnulib for environ definitions
    
    * libguile/posix.c:
    * libguile/stime.c: Remove environ definition, gnulib provides it now.

-----------------------------------------------------------------------

Summary of changes:
 lib/Makefile.am    |    2 +-
 libguile/posix.c   |   13 -------------
 libguile/stime.c   |   13 -------------
 m4/environ.m4      |   36 ++++++++++++++++++++++++++++++++++++
 m4/gnulib-cache.m4 |    3 ++-
 m4/gnulib-comp.m4  |    3 +++
 6 files changed, 42 insertions(+), 28 deletions(-)
 create mode 100644 m4/environ.m4

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 8f431c2..f321b0b 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -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
 
diff --git a/libguile/posix.c b/libguile/posix.c
index 2799209..5e6f05f 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -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
diff --git a/libguile/stime.c b/libguile/stime.c
index 34c8a98..5384783 100644
--- a/libguile/stime.c
+++ b/libguile/stime.c
@@ -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
diff --git a/m4/environ.m4 b/m4/environ.m4
new file mode 100644
index 0000000..b17bb60
--- /dev/null
+++ b/m4/environ.m4
@@ -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])
+])
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index fd6c4fe..c7cfb83 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -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
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 77100fa..b6d10a8 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -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


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]