From: Paul Eggert <eggert@cs.ucla.edu>
To: Angelo Graziosi <angelo.graziosi@alice.it>,
Emacs developers <emacs-devel@gnu.org>
Subject: Re: Last commit breaks macOS build
Date: Wed, 4 Jan 2017 19:21:11 -0800 [thread overview]
Message-ID: <f2f2042a-f1a8-5f8f-63e5-c0b713d86979@cs.ucla.edu> (raw)
In-Reply-To: <103c5ca4-dba4-9cf1-1c15-535684235be9@alice.it>
[-- Attachment #1: Type: text/plain, Size: 538 bytes --]
Angelo Graziosi wrote:
> Interfering nt/gnulib.mk from lib/gnulib.mk ...
Did it really say "Interfering"? :-)
> sed: 46: "This is of m...": command c expects \ followed by text
>
> and the 'configure' is not created...
This is caused by our recent attempt to better-automate MS-Windows builds. I
fixed one nonportable construct, but evidently there are others.
It's time to break out a bigger hammer. Please try the attached patch. I have
tested it on Fedora, but not on MS-Windows and so have not installed it yet.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-GNU-Make-instead-of-sed-Automake-for-nt-lib.patch --]
[-- Type: text/x-diff; name="0001-Use-GNU-Make-instead-of-sed-Automake-for-nt-lib.patch", Size: 10602 bytes --]
From d59053569fb37f80487810f6e18da0ac9030a0da Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 4 Jan 2017 19:13:14 -0800
Subject: [PATCH] Use GNU Make instead of sed+Automake for nt lib
Problem reported by Angelo Graziosi. Instead of continuing to
hack something in autogen.sh, which is a pain to port and which
is a prepass to Automake, this patch uses GNU Make instead,
so that there is no need to have anything in autogen.sh and
no need for an nt/gnulib.mk file.
* .gitignore: Remove nt/gnulib.mk.
* Makefile.in (gnulib_mk, $(srcdir)/nt/gnulib.mk): Remove.
(AUTOMAKE_INPUTS): Use $(srcdir)/lib/gnulib.mk, not gnulib_mk.
* autogen.sh: Do not build nt/gnulib.mk.
* configure.ac (GNULIB_MK): Remove.
(SYSTEM_TYPE): Subst.
(MT): New macro. Subst it.
* lib/Makefile.am: Do not include ../nt/gnulib.mk.
Use $(SYSTEM_TYPE), not BUILDING_FOR_WINDOWSNT.
(libgnu_a_SOURCES_not, EXTRA_libgnu_a_SOURCES_not): New macros.
(libgnu_a_SOURCES, EXTRA_libgnu_a_SOURCES) [windows-nt]:
Filter out unwanted modules.
* make-dist: Omit removed files.
* nt/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0)
(am__v_GEN_1, ${srcdir}/gnulib.mk): Remove.
* nt/gnulib-modules-to-delete.cfg: Remove.
---
.gitignore | 1 -
Makefile.in | 8 +----
autogen.sh | 10 +------
configure.ac | 22 ++++----------
lib/Makefile.am | 19 ++++++++----
make-dist | 2 +-
nt/Makefile.in | 10 -------
nt/gnulib-modules-to-delete.cfg | 66 -----------------------------------------
8 files changed, 23 insertions(+), 115 deletions(-)
delete mode 100644 nt/gnulib-modules-to-delete.cfg
diff --git a/.gitignore b/.gitignore
index e8eb4fd..85c06c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -288,6 +288,5 @@ lib/SYS/
/site-lisp/
nt/emacs.rc
nt/emacsclient.rc
-nt/gnulib.mk
src/gdb.ini
/var/
diff --git a/Makefile.in b/Makefile.in
index b9aaf5b..3cb1f5e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -98,9 +98,6 @@ configuration=
### The nt/ subdirectory gets built only for MinGW
NTDIR=@NTDIR@
-### $(srcdir)/nt/gnulib.mk for MinGW, else $(srcdir)/lib/gnulib.mk
-gnulib_mk=@GNULIB_MK@
-
# 'make' verbosity.
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -454,13 +451,10 @@ $(srcdir)/aclocal.m4:
cd $(srcdir) && ACLOCAL_PATH='$(ACLOCAL_PATH)' $(ACLOCAL) -I m4
AUTOMAKE_INPUTS = $(srcdir)/aclocal.m4 $(srcdir)/lib/Makefile.am \
- $(gnulib_mk)
+ $(srcdir)/lib/gnulib.mk
$(srcdir)/lib/Makefile.in: $(AUTOMAKE_INPUTS)
cd $(srcdir) && $(AUTOMAKE) --gnu -a -c lib/Makefile
-$(srcdir)/nt/gnulib.mk: $(srcdir)/lib/Makefile.in
- $(MAKE) -C $(srcdir)/nt gnulib.mk
-
# Regenerate files that this makefile would have made, if this makefile
# had been built by Automake. The name 'am--refresh' is for
# compatibility with subsidiary Automake-generated makefiles.
diff --git a/autogen.sh b/autogen.sh
index f6bfde6..7381bc3 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -220,17 +220,9 @@ do_git=
fi
echo 'Your system has the required tools.'
-
- ## Create nt/gnulib.mk if it doesn't exist, as autoreconf will need it.
- if test ! -f nt/gnulib.mk; then
- echo 'Inferring nt/gnulib.mk from lib/gnulib.mk ...'
- metascript='/^[^#]/s|^.*$|/^## begin *gnulib module &/,/^## end *gnulib module &/c ## gnulib module & removed|'
- script=`sed "$metascript" nt/gnulib-modules-to-delete.cfg` || exit
- sed "$script" lib/gnulib.mk > nt/gnulib.mk || exit
- fi
-
echo "Running 'autoreconf -fi -I m4' ..."
+
## Let autoreconf figure out what, if anything, needs doing.
## Use autoreconf's -f option in case autoreconf itself has changed.
autoreconf -fi -I m4 || exit $?
diff --git a/configure.ac b/configure.ac
index 262f367..7fd4988 100644
--- a/configure.ac
+++ b/configure.ac
@@ -771,22 +771,6 @@ AC_DEFUN
test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
fi
-dnl This is used in lib/Makefile.am to use nt/gnulib.mk, the
-dnl alternative to lib/gnulib.mk, so as to avoid generating header files
-dnl that clash with MinGW.
-case $opsys in
- mingw32 )
- GNULIB_MK='$(srcdir)/nt/gnulib.mk'
- ;;
- * )
- GNULIB_MK='$(srcdir)/lib/gnulib.mk'
- ;;
-
-esac
-AC_SUBST([GNULIB_MK])
-
-AM_CONDITIONAL([BUILDING_FOR_WINDOWSNT], [test "x$opsys" = "xmingw32"])
-
# Avoid gnulib's tests for -lcrypto, so that there's no static dependency on it.
AC_DEFUN([gl_CRYPTO_CHECK])
# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW,
@@ -1555,7 +1539,13 @@ AC_DEFUN
AC_SUBST(LIB_MATH)
AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE",
[The type of system you are compiling for; sets 'system-type'.])
+AC_SUBST([SYSTEM_TYPE])
+# The empty (MT) string.
+# Use this in Makefile.am before GNU Make conditionals;
+# otherwise, Automake gets confused.
+MT=
+AC_SUBST([MT])
pre_PKG_CONFIG_CFLAGS=$CFLAGS
pre_PKG_CONFIG_LIBS=$LIBS
diff --git a/lib/Makefile.am b/lib/Makefile.am
index e6d90dd..141838c 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -29,13 +29,22 @@ SUFFIXES =
AM_CFLAGS = $(PROFILING_CFLAGS) $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS)
DEFAULT_INCLUDES = -I. -I$(top_srcdir)/lib -I../src -I$(top_srcdir)/src
-if BUILDING_FOR_WINDOWSNT
-include ../nt/gnulib.mk
-else
include gnulib.mk
-libgnu_a_SOURCES += openat-die.c save-cwd.c
-endif
+@MT@ifeq ($(SYSTEM_TYPE), windows-nt)
+@MT@ libgnu_a_SOURCES_not = \
+@MT@ acl-errno-valid.c acl-internal.c allocator.c \
+@MT@ careadlinkat.c get-permissions.c pipe2.c \
+@MT@ set-permissions.c tempname.c unistd.c
+@MT@ libgnu_a_SOURCES := \
+@MT@ $(filter-out $(libgnu_a_SOURCES_not), $(libgnu_a_SOURCES))
+@MT@ EXTRA_libgnu_a_SOURCES_not = \
+@MT@ acl_entries.c dirfd.c fcntl.c mkostemp.c openat-proc.c secure_getenv.c
+@MT@ EXTRA_libgnu_a_SOURCES := \
+@MT@ $(filter-out $(EXTRA_libgnu_a_SOURCES_not), $(EXTRA_libgnu_a_SOURCES))
+@MT@else
+@MT@ libgnu_a_SOURCES += openat-die.c save-cwd.c
+@MT@endif
if HYBRID_MALLOC_LIB
noinst_LIBRARIES += libegnu.a
diff --git a/make-dist b/make-dist
index 41203b2..2d1a218 100755
--- a/make-dist
+++ b/make-dist
@@ -482,7 +482,7 @@ files=
(cd nt
ln emacs-x86.manifest emacs-x64.manifest ../${tempdir}/nt
ln [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt
- ln *.in gnulib.mk gnulib-modules-to-delete.cfg ../${tempdir}/nt
+ ln *.in ../${tempdir}/nt
ln mingw-cfg.site epaths.nt INSTALL.W64 ../${tempdir}/nt
ln ChangeLog.*[0-9] INSTALL README README.W32 ../${tempdir}/nt)
diff --git a/nt/Makefile.in b/nt/Makefile.in
index 89f4460..7e911db 100644
--- a/nt/Makefile.in
+++ b/nt/Makefile.in
@@ -54,11 +54,6 @@ am__v_CCLD_ =
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-AM_V_GEN = $(am__v_GEN_@AM_V@)
-am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
-am__v_GEN_0 = @echo " GEN " $@;
-am__v_GEN_1 =
-
AM_V_RC = $(am__v_RC_@AM_V@)
am__v_RC_ = $(am__v_RC_@AM_DEFAULT_V@)
am__v_RC_0 = @echo " RC " $@;
@@ -260,8 +255,3 @@ runemacs${EXEEXT}:
emacs.res ../src/emacs.res: emacs.rc ${srcdir}/icons/emacs.ico \
${srcdir}/icons/hand.cur ${srcdir}/$(EMACS_MANIFEST)
$(AM_V_RC)${WINDRES} -I ${srcdir} -O coff -o $@ $<
-
-${srcdir}/gnulib.mk: ${srcdir}/gnulib-modules-to-delete.cfg ${srcdir}/../lib/gnulib.mk
- $(AM_V_GEN)sed '/^[^#]/s|^.*$$|/^## begin *gnulib module &/,/^## end *gnulib module &/c ## gnulib module & removed|' < $< | \
- sed -f- ${srcdir}/../lib/gnulib.mk > $@-t && \
- ${srcdir}/../build-aux/move-if-change $@-t $@
diff --git a/nt/gnulib-modules-to-delete.cfg b/nt/gnulib-modules-to-delete.cfg
deleted file mode 100644
index 09bea0e..0000000
--- a/nt/gnulib-modules-to-delete.cfg
+++ /dev/null
@@ -1,66 +0,0 @@
-# This is the list of modules to be deleted from ../lib/gnulib.mk.
-#
-# We delete them because they either conflict with MinGW headers or
-# headers in nt/inc, or because those modules won't compile with
-# MinGW, or because Emacs already has the corresponding facilities as
-# part of Emacs sources, and their implementation is incompatible with
-# Gnulib's.
-#
-# In general, do NOT remove anything from ../lib/gnulib.mk that
-# doesn't need to be removed, to minimize the differences from
-# upstream gnulib.mk and thus make the maintenance easier. Every
-# header file whose generation is controlled by configure-time tests
-# does NOT need to be removed; instead, force the configure script to
-# accept whatever MinGW has to offer, by defining the appropriate
-# Autoconf variable in the nt/mingw-cfg.site file. Headers that are
-# generated conditionally have the tell-tale "if GL_GENERATE_foo_H"
-# condition before their Makefile snippet in this file. Likewise, do
-# NOT remove gnulib modules which introduce header files that don't
-# exist in MinGW and in nt/inc/, since they cannot possibly clash
-# with anything. Gnulib modules that introduce source *.c files also
-# need not be removed; if they define functions that could clash with
-# the w32 substitutes in Emacs, disable their compilation by defining
-# suitable variables in nt/mingw-cfg.site.
-# ----------------------------------------------------------------------
-#
-# Copyright (C) 2017 Free Software Foundation, Inc.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This file is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this file. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License,
-# this file may be distributed as part of a program that
-# contains a configuration script generated by Autoconf, under
-# the same distribution terms as the rest of that program.
-#
-acl-permissions
-allocator
-at-internal
-careadlinkat
-dirent
-dirfd
-fcntl
-fcntl-h
-inttypes-incomplete
-mkostemp
-pipe2
-secure_getenv
-signal-h
-stdio
-stdlib
-sys_select
-sys_stat
-sys_time
-sys_types
-tempname
-unistd
--
2.7.4
next prev parent reply other threads:[~2017-01-05 3:21 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-04 10:08 Last commit breaks macOS build Angelo Graziosi
2017-01-05 3:21 ` Paul Eggert [this message]
2017-01-05 9:30 ` Richard Copley
2017-01-05 9:54 ` Angelo Graziosi
2017-01-05 15:42 ` Eli Zaretskii
2017-01-05 16:16 ` Eli Zaretskii
2017-01-05 16:37 ` Angelo Graziosi
2017-01-05 17:04 ` Eli Zaretskii
2017-01-05 17:21 ` Angelo Graziosi
2017-01-05 17:52 ` Eli Zaretskii
2017-01-05 18:18 ` Andreas Schwab
2017-01-05 18:24 ` Eli Zaretskii
2017-01-05 18:32 ` Andreas Schwab
2017-01-05 18:38 ` Eli Zaretskii
2017-01-05 18:53 ` Andreas Schwab
2017-01-05 19:38 ` Eli Zaretskii
2017-01-05 22:41 ` Angelo Graziosi
2017-01-06 7:45 ` Eli Zaretskii
2017-01-06 23:33 ` Angelo Graziosi
2017-01-06 23:43 ` Paul Eggert
2017-01-05 16:24 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f2f2042a-f1a8-5f8f-63e5-c0b713d86979@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=angelo.graziosi@alice.it \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.