Make it possible to compile setenv.c separately, unconditionally.
authorBruno Haible <bruno@clisp.org>
Sat, 3 Mar 2007 19:42:31 +0000 (19:42 +0000)
committerBruno Haible <bruno@clisp.org>
Sat, 3 Mar 2007 19:42:31 +0000 (19:42 +0000)
ChangeLog
lib/setenv.c
m4/setenv.m4

index 3754e7ca21131c807511d46b02feadfb2ea63f88..5b669a07466b3a7f54c1e42730f3d57bc61840b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-03-03  Bruno Haible  <bruno@clisp.org>
 
+       * m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): New macro.
+       * lib/setenv.c: Compile the file only if _LIBC || !HAVE_SETENV.
+
        * m4/readlink.m4 (gl_FUNC_READLINK_SEPARATE): New macro.
        (gl_FUNC_READLINK): Update.
 
index 23832485a9f27a0adb3d1e207ad2da873d523c56..c54c28d973d39aeb5f8aab32b82b9ea62a137fc4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,1995-1999,2000-2003,2005,2006 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-1999,2000-2003,2005-2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -31,6 +31,8 @@
 # include <unistd.h>
 #endif
 
+#if _LIBC || !HAVE_SETENV
+
 #if !_LIBC
 # include "allocsa.h"
 #endif
@@ -326,3 +328,5 @@ text_set_element (__libc_subfreeres, free_mem);
 weak_alias (__setenv, setenv)
 weak_alias (__clearenv, clearenv)
 #endif
+
+#endif /* _LIBC || !HAVE_SETENV */
index 0d54a9613e64645119c791128b7fbf346164c551..d6901de240d60e38379a5fbe6bd807a133b19ba3 100644 (file)
@@ -1,4 +1,4 @@
-# setenv.m4 serial 7
+# setenv.m4 serial 8
 dnl Copyright (C) 2001-2004, 2006-2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -13,6 +13,13 @@ AC_DEFUN([gl_FUNC_SETENV],
   fi
 ])
 
+# Like gl_FUNC_SETENV, except prepare for separate compilation (no AC_LIBOBJ).
+AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
+[
+  AC_CHECK_FUNCS_ONCE([setenv])
+  gl_PREREQ_SETENV
+])
+
 AC_DEFUN([gl_FUNC_UNSETENV],
 [
   AC_CHECK_FUNCS([unsetenv])