From 7e4a3ea582fe5a1224685a0bc852e22f91f18abc Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Jun 2003 16:41:48 +0000 Subject: [PATCH] Make .h file creation more reliable. --- ChangeLog | 8 ++++++++ m4/ChangeLog | 14 ++++++++++++-- m4/fnmatch.m4 | 8 ++++++-- m4/poll.m4 | 9 ++++++--- modules/alloca | 5 +++-- modules/fnmatch | 12 +++++++++--- modules/poll | 11 +++++++++-- 7 files changed, 53 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index e4f8ed59f..1a8957af7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-06-07 Bruno Haible + + * modules/poll (Makefile.am): Use explicit creation rule for poll.h, to + avoid AC_CONFIG_LINKS. + * modules/fnmatch (Makefile.am): Use explicit creation rule for + fnmatch.h, to avoid AC_CONFIG_LINKS. + * modules/alloca (Makefile.am): Make creation of alloca.h Ctrl-C safe. + 2003-06-07 Jim Meyering * modules/strtod: Use $(...) notation, not @...@ for diff --git a/m4/ChangeLog b/m4/ChangeLog index fe0d3096e..1b46f78c9 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,13 @@ +2003-06-07 Bruno Haible + + * fnmatch.m4 (_AC_LIBOBJ_FNMATCH, gl_FUNC_FNMATCH_POSIX, + gl_FUNC_FNMATCH_GNU): Set FNMATCH_H instead of invoking + AC_CONFIG_LINKS. Needed to allow for a different name of the lib + directory. + * poll.m4 (gl_FUNC_POLL): Set POLL_H instead of invoking + AC_CONFIG_LINKS. Needed to allow for a different name of the lib + directory. + 2003-06-04 Paul Eggert * human.m4 (gl_HUMAN): Require AM_STDBOOL_H. Check for @@ -1953,7 +1963,7 @@ 2000-02-09 Jim Meyering * lib-check.m4 (jm_LIB_CHECK): Fix typo: check for sp_pwdp in - struct spwd, rather than in struct passwd. Reported by Gaël Quéri. + struct spwd, rather than in struct passwd. Reported by Ga� Qu�i. 2000-02-08 Akim Demaille @@ -2011,7 +2021,7 @@ 2000-01-28 Jim Meyering * perl.m4: Change format of warning message to look more like that - from the missing script. Suggestion from François Pinard. + from the missing script. Suggestion from Fran�is Pinard. 2000-01-25 Jim Meyering diff --git a/m4/fnmatch.m4 b/m4/fnmatch.m4 index ec66a1721..d281d9ef2 100644 --- a/m4/fnmatch.m4 +++ b/m4/fnmatch.m4 @@ -3,7 +3,7 @@ # This is a modified version of autoconf's AC_FUNC_FNMATCH. # This file should be simplified after Autoconf 2.57 is required. -# Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +# Copyright (C) 2000-2003 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -73,7 +73,7 @@ AC_CHECK_DECLS([getenv]) AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmempcpy]) AC_CHECK_HEADERS([wchar.h wctype.h]) AC_LIBOBJ([fnmatch]) -AC_CONFIG_LINKS([lib/fnmatch.h:lib/fnmatch_.h]) +FNMATCH_H=fnmatch.h AC_DEFINE(fnmatch, rpl_fnmatch, [Define to rpl_fnmatch if the replacement function should be used.]) ])# _AC_LIBOBJ_FNMATCH @@ -89,6 +89,7 @@ AC_DEFUN([gl_PREREQ_FNMATCH_EXTRA], AC_DEFUN([gl_FUNC_FNMATCH_POSIX], [ + FNMATCH_H= _AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_posix], [rm -f lib/fnmatch.h], [_AC_LIBOBJ_FNMATCH]) @@ -100,6 +101,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_POSIX], AC_DEFINE([fnmatch], [posix_fnmatch], [Define to a replacement function name for fnmatch().]) fi + AC_SUBST([FNMATCH_H]) ]) @@ -108,6 +110,7 @@ AC_DEFUN([gl_FUNC_FNMATCH_GNU], dnl Persuade glibc to declare FNM_CASEFOLD etc. AC_REQUIRE([AC_GNU_SOURCE]) + FNMATCH_H= _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu], [rm -f lib/fnmatch.h], [_AC_LIBOBJ_FNMATCH]) @@ -119,4 +122,5 @@ AC_DEFUN([gl_FUNC_FNMATCH_GNU], AC_DEFINE([fnmatch], [gnu_fnmatch], [Define to a replacement function name for fnmatch().]) fi + AC_SUBST([FNMATCH_H]) ]) diff --git a/m4/poll.m4 b/m4/poll.m4 index a23f504f1..5bfc33c6f 100644 --- a/m4/poll.m4 +++ b/m4/poll.m4 @@ -1,4 +1,4 @@ -# poll.m4 serial 1 +# poll.m4 serial 2 dnl Copyright (c) 2003 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General @@ -9,9 +9,12 @@ dnl the same distribution terms as the rest of the program. AC_DEFUN([gl_FUNC_POLL], [ AC_CHECK_HEADERS(poll.h) - if test x$ac_cv_header_poll_h = xno; then - AC_CONFIG_LINKS([lib/poll.h:lib/poll_.h]) + if test "$ac_cv_header_poll_h" = no; then + POLL_H=poll.h + else + POLL_H= fi + AC_SUBST([POLL_H]) AC_REPLACE_FUNCS(poll) if test $ac_cv_func_poll = no; then diff --git a/modules/alloca b/modules/alloca index bf9515d90..dab7d00de 100644 --- a/modules/alloca +++ b/modules/alloca @@ -19,8 +19,9 @@ EXTRA_DIST += alloca_.h # doesn't have one that works with the given compiler. all-local $(lib_OBJECTS): @ALLOCA_H@ alloca.h: alloca_.h - cp $(srcdir)/alloca_.h alloca.h -MOSTLYCLEANFILES += alloca.h + cp $(srcdir)/alloca_.h alloca.h-t + mv alloca.h-t alloca.h +MOSTLYCLEANFILES += alloca.h alloca.h-t Include: #include diff --git a/modules/fnmatch b/modules/fnmatch index dfec965ac..75e5189f1 100644 --- a/modules/fnmatch +++ b/modules/fnmatch @@ -15,9 +15,15 @@ configure.ac: # No macro. You should also use one of fnmatch-posix or fnmatch-gnu. Makefile.am: -lib_SOURCES += fnmatch_.h -EXTRA_DIST += fnmatch_loop.c -DISTCLEANFILES += fnmatch.h +EXTRA_DIST += fnmatch_.h fnmatch_loop.c + +# We need the following in order to create an when the system +# doesn't have one that supports the required API. +all-local $(lib_OBJECTS): @FNMATCH_H@ +fnmatch.h: fnmatch_.h + cp $(srcdir)/fnmatch_.h fnmatch.h-t + mv fnmatch.h-t fnmatch.h +MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t Include: diff --git a/modules/poll b/modules/poll index 1d796adc2..a03affbbc 100644 --- a/modules/poll +++ b/modules/poll @@ -12,8 +12,15 @@ configure.ac: gl_FUNC_POLL Makefile.am: -noinst_HEADERS += poll_.h -DISTCLEANFILES += poll.h +EXTRA_DIST += poll_.h + +# We need the following in order to create an when the system +# doesn't have one. +all-local $(lib_OBJECTS): @POLL_H@ +poll.h: poll_.h + cp $(srcdir)/poll_.h poll.h-t + mv poll.h-t poll.h +MOSTLYCLEANFILES += poll.h poll.h-t Include: #include -- 2.11.0