[Lsb-messages] /var/www/bzr/lsb/devel/build_env r2175: add patch to quiet compat warning when using as preprocessor (bug 3886)

Mats Wichmann mats at linuxfoundation.org
Thu Jan 2 16:38:30 UTC 2014


------------------------------------------------------------
revno: 2175
committer: Mats Wichmann <mats at linuxfoundation.org>
branch nick: build_env
timestamp: Thu 2014-01-02 09:38:30 -0700
message:
  add patch to quiet compat warning when using as preprocessor (bug 3886)
modified:
  lsbdev-cc/lsbcc.c
  lsbdev-cc/lsbcpp.c
  package/Makefile
-------------- next part --------------
=== modified file 'lsbdev-cc/lsbcc.c'
--- a/lsbdev-cc/lsbcc.c	2013-09-27 19:05:02 +0000
+++ b/lsbdev-cc/lsbcc.c	2014-01-02 16:38:30 +0000
@@ -135,7 +135,8 @@
 
 #define WARN_LIB_CHANGES	0x0001
 
-int lsbcc_debug = 0;		/* Default to none. ./configure likes things to be quiet. */
+int lsbcc_debug = 0;		/* off by default, autoconf fails on msg to stderr */
+int cpp_only = 0;		/* another flag to help autoconf */
 int lsbcc_warn = 0;
 int lsbcc_buildingshared = 0;
 
@@ -497,8 +498,13 @@
 	/*
 	 * Some other value we don't recognize.  
 	 * Following the previous pattern, assume we need it here.
+	 *
+	 * Bug 3816 comment #4 notes that it breaks autoconf scripts if 
+	 * "lsbcc -E" writes to stderr.  Since we're trying to let untested 
+	 * new versions still work, avoid doing this in the preprocessor case.
 	 */
-	fprintf(stderr, "unrecognized gcc version: \"%s\"\n", gccversion);
+	if (! cpp_only)
+	    fprintf(stderr, "unrecognized gcc version: \"%s\"\n", gccversion);
 	return 1;
     }
 }
@@ -1419,6 +1425,8 @@
 	    }
 	    break;
 	case 'E':
+	    cpp_only = 1;
+	    /* fallthrough */
 	case 'S':
 	case 'c':
 	    found_gcc_arg = 1;
@@ -1547,9 +1555,10 @@
 	case '?':
 	    if (strncmp(argv[optind_old], "--lsb-", 6) == 0) {
 		/*
-		 * Refuse to pass --lsb- prefixed options along to gcc, 
-		 * likely just typos of legit --lsb- options..
-		 * No chance gcc would recognize anyway.
+		 * Refuse to pass unrecognized --lsb- prefixed options 
+		 * along to the real compiler. Likely just typos of 
+		 * legitmate --lsb- options.
+		 * No chance compiler would recognize anyway.
 		 */
 		usage(argv[0]);
 		exit(EXIT_FAILURE);

=== modified file 'lsbdev-cc/lsbcpp.c'
--- a/lsbdev-cc/lsbcpp.c	2013-09-27 19:05:02 +0000
+++ b/lsbdev-cc/lsbcpp.c	2014-01-02 16:38:30 +0000
@@ -374,9 +374,10 @@
 	case '?':
 	    if (strncmp(argv[optind - 1], "--lsb-", 6) == 0) {
 		/*
-		 * We simply refuse to pass --lsb- prefixed
-		 * options along to cpp, since they are likely
-		 * just typos of legit --lsb- options..
+		 * Refuse to pass unrecognized --lsb- prefixed options 
+		 * along to the real compiler. Likely just typos of 
+		 * legitmate --lsb- options.
+		 * No chance compiler would recognize anyway.
 		 */
 		usage(argv[0]);
 		exit(EXIT_FAILURE);

=== modified file 'package/Makefile'
--- a/package/Makefile	2013-10-31 22:48:27 +0000
+++ b/package/Makefile	2014-01-02 16:38:30 +0000
@@ -42,7 +42,7 @@
 # Should have leading "."
 # a big number (80-99) is leading up to the next minor spec
 # build_env is version-independent so can wait till late to bump this
-SUB_VERSION=.48
+SUB_VERSION=.49
 
 # We define this here instead of directly in the spec file as
 # we need to be able to work out what the produced rpm files will be called



More information about the lsb-messages mailing list