From: Christoph Scholtes <cschol2112@googlemail.com>
To: emacs-devel@gnu.org
Cc: Eli Zaretskii <eliz@gnu.org>
Subject: Checking for sed during configure on Windows
Date: Sat, 07 May 2011 13:58:39 -0600 [thread overview]
Message-ID: <4DC5A46F.9030601@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
When I run a `make bootstrap' after `maintainer-clean' or a fresh
checkout I have to remember to regenerate `getopt_.h'.
The following patch checks if sed is available and if it is, does this
automatically.
Christoph
[-- Attachment #2: check_sed.patch --]
[-- Type: text/plain, Size: 2973 bytes --]
=== modified file 'ChangeLog'
--- ChangeLog 2011-05-06 07:13:19 +0000
+++ ChangeLog 2011-05-07 19:56:48 +0000
@@ -1,3 +1,8 @@
+2011-05-07 Christoph Scholtes <cschol2112@googlemail.com>
+
+ * lib/makefile.w32-in: If sed is available build `getopt._h' as
+ part of bootstrap.
+
2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
=== modified file 'lib/makefile.w32-in'
--- lib/makefile.w32-in 2011-04-06 16:05:49 +0000
+++ lib/makefile.w32-in 2011-05-07 19:42:57 +0000
@@ -157,7 +157,11 @@
doit:
getopt_.h: getopt.in.h $(ARG_NONNULL_H)
+ifdef HAVE_SED
+ $(MAKE) $(MFLAGS) getopt_h
+else
$(MAKE) $(MFLAGS) getopt_.h-$(SHELLTYPE)
+endif
getopt_.h-CMD: doit
@echo getopt.in.h or $(ARG_NONNULL_H) is newer than getopt_.h.
=== modified file 'nt/ChangeLog'
--- nt/ChangeLog 2011-05-07 04:00:12 +0000
+++ nt/ChangeLog 2011-05-07 19:55:07 +0000
@@ -1,3 +1,7 @@
+2011-05-07 Christoph Scholtes <cschol2112@googlemail.com>
+
+ * configure.bat: Check if sed is available on system.
+
2011-05-07 Ben Key <bkey76@gmail.com>
* configure.bat: Renamed the fusercflags variable to escusercflags
=== modified file 'nt/configure.bat'
--- nt/configure.bat 2011-05-07 04:00:12 +0000
+++ nt/configure.bat 2011-05-07 19:38:54 +0000
@@ -356,7 +356,7 @@
echo Checking for 'rm'...
rm junk.bat
if exist junk.bat goto needrm
-goto checkcompiler
+goto checkmaintutils
:needcp
echo You need 'cp' (the Unix file copy program) to build Emacs.
@@ -368,6 +368,34 @@
goto end
rem ----------------------------------------------------------------------
+rem Check if maintainer tools are present (optional).
+
+:checkmaintutils
+
+rem Checking for sed requires command extensions, if not available skip
+if "%use_extensions%" == "1" goto :checksed
+goto checkcompiler
+
+:checksed
+echo Checking for 'sed' (optional)...
+set junk=junk
+for /f "tokens=*" %%a in (
+'"echo foo | sed -e s/foo/bar/g"'
+) do (
+set junk=%%a
+)
+if not %junk% == bar goto donthavesed
+
+set havesed=Y
+set junk=
+goto checkcompiler
+
+:donthavesed
+set junk=
+set havesed=
+goto checkcompiler
+
+rem ----------------------------------------------------------------------
rem Auto-detect compiler if not specified, and validate GCC if chosen.
:checkcompiler
@@ -735,6 +763,7 @@
if (%nocygwin%) == (Y) echo NOCYGWIN=1 >>config.settings
if not "(%prefix%)" == "()" echo INSTALL_DIR=%prefix%>>config.settings
if not "(%distfiles%)" == "()" echo DIST_FILES=%distfiles%>>config.settings
+if (%havesed%) == (Y) echo HAVE_SED=1 >>config.settings
rem We go thru docflags because usercflags could be "-DFOO=bar" -something
rem and the if command cannot cope with this
for %%v in (%usercflags%) do if not (%%v)==() set docflags=Y
@@ -894,6 +923,7 @@
set distfiles=
set HAVE_DISTFILES=
set distFilesOk=
+set havesed=
set pngsupport=
set tlssupport=
set jpegsupport=
next reply other threads:[~2011-05-07 19:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-07 19:58 Christoph Scholtes [this message]
2011-05-07 20:31 ` Checking for sed during configure on Windows Juanma Barranquero
2011-05-07 21:20 ` Christoph Scholtes
2011-05-07 21:36 ` Juanma Barranquero
2011-05-07 22:28 ` Christoph Scholtes
2011-05-08 3:02 ` Eli Zaretskii
2011-05-08 3:30 ` Christoph Scholtes
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=4DC5A46F.9030601@gmail.com \
--to=cschol2112@googlemail.com \
--cc=eliz@gnu.org \
--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.