This is the mail archive of the gcc-patches@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]

sh/awk issues


Kaveh, I'm applying this patch.  This should get us down to
just issues with your native awk.  Thanks to Zack for his mail.

I need to know if your ${AWK} supports

1) functions
2) gsub

Based on your answer I'll update opts.sh.  It's possible that, with
this patch, we pick up a different awk and all is now OK.

Thanks,

Neil.

	* Makefile.in (c-options.c, c-options.h): Parallel make safe.
	* c.opt: End in blank line.
	* opts.sh: Take AWK from environment if available; use C locale.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1059
diff -u -p -r1.1059 Makefile.in
--- Makefile.in	31 May 2003 21:18:20 -0000	1.1059
+++ Makefile.in	1 Jun 2003 18:21:50 -0000
@@ -1320,8 +1320,11 @@ c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
 		$< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@
 
-c-options.h c-options.c: c.opt $(srcdir)/opts.sh
+c-options.c: c.opt $(srcdir)/opts.sh
 	$(SHELL) $(srcdir)/opts.sh c-options.c c-options.h $(srcdir)/c.opt
+
+c-options.h: c-options.c
+	@true
 
 c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
 	$(TREE_H) $(C_COMMON_H) c-pragma.h flags.h toplev.h langhooks.h \
Index: c.opt
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c.opt,v
retrieving revision 1.1
diff -u -p -r1.1 c.opt
--- c.opt	31 May 2003 21:18:21 -0000	1.1
+++ c.opt	1 Jun 2003 18:21:50 -0000
@@ -598,3 +598,5 @@ C ObjC C++ ObjC++
 
 w
 C ObjC C++ ObjC++
+
+; This comment is to ensure we retain the blank line above.
Index: opts.sh
===================================================================
RCS file: /cvs/gcc/gcc/gcc/opts.sh,v
retrieving revision 1.2
diff -u -p -r1.2 opts.sh
--- opts.sh	1 Jun 2003 13:19:50 -0000	1.2
+++ opts.sh	1 Jun 2003 18:21:50 -0000
@@ -19,7 +19,15 @@
 #
 # Usage: opts.sh outfile.c outfile.h file1.opt [file2.opt, ...]
 
-AWK=/usr/bin/awk
+# Always operate in the C locale.
+LANG=C
+LANGUAGE=C
+LC_ALL=C
+export LANG LANGUAGE LC_ALL
+
+# Set AWK if environment has not already set it.
+AWK=${AWK-awk}
+
 SORT=sort		# Could be /bin/sort or /usr/bin/sort
 
 C_FILE=$1; shift
@@ -30,7 +38,7 @@ cat "$@" | ${AWK} '
 	# Ignore comments and blank lines
 	/^[ \t]*(;|$)/	{ next }
 	/^[^ \t]/ 	{ gsub ("\n", "\034", $0); print }
-' | LANG=C ${SORT} | ${AWK} '
+' | ${SORT} | ${AWK} '
     function switch_flags (langs,   flags)
     {
 	langs = ":" langs ":"


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