This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: non-portable construct in gcc configure script


> In the test labeled
>
> AC_MSG_CHECKING(linker read-only and read-write section mixing)
>
> gcc/configure.in in 3.3 uses "grep -A1".  This feature is not in Solaris's
> grep.  It's not in the HP-UX grep either.
>
> The result is that the configure output looks like
>
>
> checking linker read-only and read-write section mixing... grep: illegal
> option -- A grep: illegal option -- 1
> Usage: grep -hblcnsviw pattern file . . .
>
> on Solaris 2.8.  The failure appears harmless, but I'm not sure.

Does the attached patch cure it? The construct works on the 5 Solaris 
versions I have access to, but I can't directly test the configure check 
because it dies earlier with the native Sun tools.

-- 
Eric Botcazou
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/configure.in,v
retrieving revision 1.627.2.8
diff -u -r1.627.2.8 configure.in
--- configure.in	12 May 2003 18:49:18 -0000	1.627.2.8
+++ configure.in	24 May 2003 20:04:38 -0000
@@ -2319,7 +2319,10 @@
      && $gcc_cv_ld -shared -o conftest1.so conftest1.o \
 	conftest2.o conftest3.o; then
     gcc_cv_ld_ro_rw_mix=`$gcc_cv_objdump -h conftest1.so \
-			 | grep -A1 myfoosect`
+			 | sed -n '/.*myfoosect.*/{
+						  N
+						  p
+						  }'`
     if echo "$gcc_cv_ld_ro_rw_mix" | grep CONTENTS > /dev/null; then
       if echo "$gcc_cv_ld_ro_rw_mix" | grep READONLY > /dev/null; then
 	gcc_cv_ld_ro_rw_mix=read-only

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]