From 5e0f867779fe6edb178f401fcf4175cab2a26cea Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 May 2011 00:06:38 +0200 Subject: [PATCH] unsetenv: Move AC_LIBOBJ invocations to module description. * m4/setenv.m4 (gl_FUNC_UNSETENV): Set HAVE_UNSETENV. Move AC_LIBOBJ and gl_PREREQ_UNSETENV invocations from here... * modules/unsetenv (configure.ac): ... to here. (Depends-on): Update. --- ChangeLog | 8 ++++++++ m4/setenv.m4 | 8 +++----- modules/unsetenv | 8 ++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57e3815d2..5fe5fcef2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2011-05-21 Bruno Haible + unsetenv: Move AC_LIBOBJ invocations to module description. + * m4/setenv.m4 (gl_FUNC_UNSETENV): Set HAVE_UNSETENV. Move AC_LIBOBJ + and gl_PREREQ_UNSETENV invocations from here... + * modules/unsetenv (configure.ac): ... to here. + (Depends-on): Update. + +2011-05-21 Bruno Haible + setenv: Move AC_LIBOBJ invocations to module description. * m4/setenv.m4 (gl_FUNC_SETENV): Move AC_LIBOBJ invocations from here... diff --git a/m4/setenv.m4 b/m4/setenv.m4 index eaa53b1e3..8927a6cac 100644 --- a/m4/setenv.m4 +++ b/m4/setenv.m4 @@ -1,4 +1,4 @@ -# setenv.m4 serial 23 +# setenv.m4 serial 24 dnl Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -62,9 +62,9 @@ AC_DEFUN([gl_FUNC_UNSETENV], fi AC_CHECK_FUNCS([unsetenv]) if test $ac_cv_func_unsetenv = no; then - AC_LIBOBJ([unsetenv]) - gl_PREREQ_UNSETENV + HAVE_UNSETENV=0 else + HAVE_UNSETENV=1 dnl Some BSDs return void, failing to do error checking. AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret], [AC_COMPILE_IFELSE( @@ -90,7 +90,6 @@ int unsetenv(); AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void instead of int.]) REPLACE_UNSETENV=1 - AC_LIBOBJ([unsetenv]) fi dnl Solaris 10 unsetenv does not remove all copies of a name. @@ -123,7 +122,6 @@ int unsetenv(); [gl_cv_func_unsetenv_works="guessing no"])]) if test "$gl_cv_func_unsetenv_works" != yes; then REPLACE_UNSETENV=1 - AC_LIBOBJ([unsetenv]) fi fi ]) diff --git a/modules/unsetenv b/modules/unsetenv index 26662b349..2be6e46d7 100644 --- a/modules/unsetenv +++ b/modules/unsetenv @@ -7,11 +7,15 @@ m4/setenv.m4 Depends-on: stdlib -unistd [test $ac_cv_func_unsetenv = no || test $REPLACE_UNSETENV = 1] -environ [test $ac_cv_func_unsetenv = no || test $REPLACE_UNSETENV = 1] +unistd [test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1] +environ [test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1] configure.ac: gl_FUNC_UNSETENV +if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + AC_LIBOBJ([unsetenv]) + gl_PREREQ_UNSETENV +fi gl_STDLIB_MODULE_INDICATOR([unsetenv]) Makefile.am: -- 2.11.0