Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Oct 2008 18:37:43 GMT
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 152232 for review
Message-ID:  <200810301837.m9UIbhgm086178@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=152232

Change 152232 by peter@peter_overcee on 2008/10/30 18:37:13

	Explicitly locate the path to to gnu sed.  I configure with:
	$ env SED=/usr/local/bin/gsed ./configure --prefix=/whatever ...
	Undo hacks that depended on messing with $PATH.  Specify $(SED) for
	known places that depend on gnu sed syntax.

Affected files ...

.. //depot/projects/valgrind/Makefile.am#8 edit
.. //depot/projects/valgrind/Makefile.install.am#3 edit
.. //depot/projects/valgrind/Makefile.tool-inplace.am#3 edit
.. //depot/projects/valgrind/autogen.sh#6 edit
.. //depot/projects/valgrind/configure.in#8 edit

Differences ...

==== //depot/projects/valgrind/Makefile.am#8 (text+ko) ====

@@ -213,14 +213,14 @@
 # So we search for the line with a hex value "+ SIZEOF_HEADERS", and replace
 # all the hex values in that line with "valt_load_address".
 valt_load_address_x86_freebsd.lds: Makefile
-	$(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
+	$(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | $(SED) \
 		-e '1,/^=====\+$$/d' \
 		-e '/^=====\+$$/d' \
 		-e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
 	|| rm -f $@
 
 valt_load_address_amd64_freebsd.lds: Makefile
-	$(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
+	$(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | $(SED) \
 		-e '1,/^=====\+$$/d' \
 		-e '/^=====\+$$/d' \
 		-e '/ALIGN/s/0x100000/0x1000/g' \
@@ -228,28 +228,28 @@
 	|| rm -f $@
 
 valt_load_address_x86_linux.lds: Makefile
-	$(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
+	$(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | $(SED) \
 		-e '1,/^=====\+$$/d' \
 		-e '/^=====\+$$/d' \
 		-e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
 	|| rm -f $@
 
 valt_load_address_amd64_linux.lds: Makefile
-	$(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
+	$(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | $(SED) \
 		-e '1,/^=====\+$$/d' \
 		-e '/^=====\+$$/d' \
 		-e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
 	|| rm -f $@
 
 valt_load_address_ppc32_linux.lds: Makefile
-	$(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | sed \
+	$(CC) @FLAG_M32@ -Wl,--verbose -nostdlib 2>&1 | $(SED) \
 		-e '1,/^=====\+$$/d' \
 		-e '/^=====\+$$/d' \
 		-e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \
 	|| rm -f $@
 
 valt_load_address_ppc64_linux.lds: Makefile
-	$(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | sed \
+	$(CC) -m64 -Wl,--verbose -nostdlib 2>&1 | $(SED) \
 		-e '1,/^=====\+$$/d' \
 		-e '/^=====\+$$/d' \
 		-e '/\. = 0x[0-9A-Fa-f]\+ + SIZEOF_HEADERS/s/0x[0-9A-Fa-f]\+/valt_load_address/g' > $@ \

==== //depot/projects/valgrind/Makefile.install.am#3 (text+ko) ====

@@ -25,8 +25,8 @@
 install-exec-local:
 	if [ -n "$(noinst_PROGRAMS)" ] ; then \
 	  for f in $(noinst_PROGRAMS); do \
-	    name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \
-	    plat=`echo $$f | sed -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\?$$/\1/'`; \
+	    name=`echo $$f | $(SED) -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \
+	    plat=`echo $$f | $(SED) -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\?$$/\1/'`; \
 	    $(mkinstalldirs) $(DESTDIR)$(valdir)/$$plat; \
 	    $(INSTALL_PROGRAM) $$f $(DESTDIR)$(valdir)/$$plat/$$name; \
 	  done ; \

==== //depot/projects/valgrind/Makefile.tool-inplace.am#3 (text+ko) ====

@@ -5,8 +5,8 @@
 all-local:
 	if [ -n "$(noinst_PROGRAMS)" ] ; then \
 	  for f in $(noinst_PROGRAMS); do \
-	    name=`echo $$f | sed -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \
-	    plat=`echo $$f | sed -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\?$$/\1/'`; \
+	    name=`echo $$f | $(SED) -e 's/-\([^-]*-[^-.]*\)\(\..*\)\?$$/\2/'`; \
+	    plat=`echo $$f | $(SED) -e 's/^.*-\([^-]*-[^-.]*\)\(\..*\)\?$$/\1/'`; \
 	    mkdir -p $(inplacedir)/$$plat; \
 	    rm -f $(inplacedir)/$$plat/$$name; \
 	    ln -f -s ../../$(subdir)/$$f $(inplacedir)/$$plat/$$name; \

==== //depot/projects/valgrind/autogen.sh#6 (text+kox) ====

@@ -1,8 +1,5 @@
 #!/bin/sh
 
-PATH=/usr/bin:$PATH
-export PATH
-
 run ()
 {
     echo "running: $*"

==== //depot/projects/valgrind/configure.in#8 (text+ko) ====

@@ -76,6 +76,9 @@
 # figure out where perl lives
 AC_PATH_PROG(PERL, perl)
 
+# find sed
+AC_PATH_PROG(SED, sed)
+
 # figure out where gdb lives
 AC_PATH_PROG(GDB, gdb)
 AC_DEFINE_UNQUOTED(GDB_PATH, "$GDB", [path to GDB])
@@ -97,15 +100,15 @@
 
 AC_MSG_CHECKING([for GNU sed])
 
-[sed_firstline=`sed --version | head -n 1`]
+[sed_firstline=`${SED} --version | head -n 1`]
 
 case "${sed_firstline}" in
     GNU*)
 	AC_MSG_RESULT([ok, looks like GNU sed])
 	;;
     *)
-	AC_MSG_RESULT([please ensure first 'sed' in your path is GNU sed])
-	AC_MSG_RESULT([note: GNU sed is only required at build/install time])
+	AC_MSG_RESULT([please specify the path to GNU 'sed' in the SED environment variable])
+	AC_MSG_RESULT([note: GNU sed is only required at build/install time, not run time])
 	AC_MSG_ERROR([build/install requires that 'sed' is GNU sed])
 	;;
 esac
@@ -114,7 +117,7 @@
 # We don't want gcc < 3.0
 AC_MSG_CHECKING([for a supported version of gcc])
 
-[gcc_version=`${CC} --version | head -n 1 | sed 's/^[^0-9]*\([0-9.]*\).*$/\1/'`]
+[gcc_version=`${CC} --version | head -n 1 | ${SED} 's/^[^0-9]*\([0-9.]*\).*$/\1/'`]
 
 case "${gcc_version}" in
      2.*)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810301837.m9UIbhgm086178>