pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files Reverse the order that the ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e0abd919c665
branches:  trunk
changeset: 460640:e0abd919c665
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Tue Sep 02 08:07:16 2003 +0000

description:
Reverse the order that the config.h file and <nbcompat.h> are included,
since the latter has all sorts of checks to make sure we don't stomp on
any macros defined in config.h, but the reverse isn't true.

diffstat:

 pkgtools/pkg_install/files/src2nbcompat |  19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diffs (38 lines):

diff -r 925976b80530 -r e0abd919c665 pkgtools/pkg_install/files/src2nbcompat
--- a/pkgtools/pkg_install/files/src2nbcompat   Tue Sep 02 07:35:44 2003 +0000
+++ b/pkgtools/pkg_install/files/src2nbcompat   Tue Sep 02 08:07:16 2003 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#      $NetBSD: src2nbcompat,v 1.2 2003/09/01 22:49:42 jlam Exp $
+#      $NetBSD: src2nbcompat,v 1.3 2003/09/02 08:07:16 jlam Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -87,15 +87,20 @@
                # "#if HAVE_FOO_H ... #endif" guards.
                #
                awk '                                                   \
-                       BEGIN { seen = 0 }                              \
-                       /^\#[   ]*include[      ]+<[^   ]*>/ {          \
-                               guard = toupper(gensub("[-/.]", "_", "g", gensub("\#[   ]*include[      ]+<\([^         ]*\)>", "HAVE_\\1", "g"))); \
-                               if (seen == 0) {                        \
-                                       print "\#include <nbcompat.h>"; \
+                       BEGIN { config = 0; nbcompat = 0 }              \
+                       /^\#[   ]*include[      ]+/ {                   \
+                               if (config == 0) {                      \
                                        print "\#if HAVE_CONFIG_H";     \
                                        print "\#include \"config.h\""; \
                                        print "\#endif";                \
-                                       seen = 1;                       \
+                                       config = 1;                     \
+                               }                                       \
+                       }                                               \
+                       /^\#[   ]*include[      ]+<[^   ]*>/ {          \
+                               guard = toupper(gensub("[-/.]", "_", "g", gensub("\#[   ]*include[      ]+<\([^         ]*\)>", "HAVE_\\1", "g"))); \
+                               if (nbcompat == 0) {                    \
+                                       print "\#include <nbcompat.h>"; \
+                                       nbcompat = 1;                   \
                                };                                      \
                                print "\#if " guard;                    \
                                print $0;                               \



Home | Main Index | Thread Index | Old Index