all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Checking for sed during configure on Windows
@ 2011-05-07 19:58 Christoph Scholtes
  2011-05-07 20:31 ` Juanma Barranquero
  2011-05-08  3:02 ` Eli Zaretskii
  0 siblings, 2 replies; 7+ messages in thread
From: Christoph Scholtes @ 2011-05-07 19:58 UTC (permalink / raw)
  To: emacs-devel; +Cc: Eli Zaretskii

[-- 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=


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-05-08  3:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-07 19:58 Checking for sed during configure on Windows Christoph Scholtes
2011-05-07 20:31 ` 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

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.