CVS commit: src/tools/compat

2023-09-02 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Sep  2 18:45:48 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 10 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-09-02 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Sep  2 18:45:48 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 10 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/README
diff -u src/tools/compat/README:1.28 src/tools/compat/README:1.29
--- src/tools/compat/README:1.28	Thu Aug 24 19:30:48 2023
+++ src/tools/compat/README	Sat Sep  2 18:45:48 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.28 2023/08/24 19:30:48 palle Exp $
+$NetBSD: README,v 1.29 2023/09/02 18:45:48 palle Exp $
 
 Special notes for cross-hosting a NetBSD build on certain platforms.  
 Only those platforms which have been tested to complete a "build.sh" run
@@ -117,7 +117,7 @@ Solaris 10:
 * Solaris 10 1/13 (u11)
  * POSIX.1-2001, SUSv3 (see standards(7))
  * Using gcc-5 from opencsw.org
- * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
+ * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:/usr/ccs/bin
  * Set HOST_CC to /opt/csw/bin/gcc
  * Set HOST_SH to /usr/bin/bash
 



CVS commit: src/tools/compat

2023-08-24 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Thu Aug 24 19:30:48 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.3 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/README
diff -u src/tools/compat/README:1.27 src/tools/compat/README:1.28
--- src/tools/compat/README:1.27	Wed Aug 23 19:09:53 2023
+++ src/tools/compat/README	Thu Aug 24 19:30:48 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.27 2023/08/23 19:09:53 palle Exp $
+$NetBSD: README,v 1.28 2023/08/24 19:30:48 palle Exp $
 
 Special notes for cross-hosting a NetBSD build on certain platforms.  
 Only those platforms which have been tested to complete a "build.sh" run
@@ -126,9 +126,9 @@ Solaris 11:
 
 * Solaris 11.3
  * POSIX.1-2001, SUSv3 (see standards(7))
- * Using gcc-12 from pkgsrc.org (installed in GCC12INSTALLDIR)
+ * Using gcc-12 from pkgsrc.org (installed in $GCC12INSTALLDIR)
  * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:$GCC12INSTALLDIR/bin
- * Set HOST_CC to /usr/bin/gcc
+ * Set HOST_CC to $GCC12INSTALLDIR/bin/gcc
  * Set HOST_SH to /usr/bin/bash
 
 * Solaris 11.4 (CBE)



CVS commit: src/tools/compat

2023-08-24 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Thu Aug 24 19:30:48 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.3 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-08-23 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Wed Aug 23 19:09:53 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.3 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/README
diff -u src/tools/compat/README:1.26 src/tools/compat/README:1.27
--- src/tools/compat/README:1.26	Tue Aug 15 19:13:12 2023
+++ src/tools/compat/README	Wed Aug 23 19:09:53 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.26 2023/08/15 19:13:12 palle Exp $
+$NetBSD: README,v 1.27 2023/08/23 19:09:53 palle Exp $
 
 Special notes for cross-hosting a NetBSD build on certain platforms.  
 Only those platforms which have been tested to complete a "build.sh" run
@@ -126,8 +126,8 @@ Solaris 11:
 
 * Solaris 11.3
  * POSIX.1-2001, SUSv3 (see standards(7))
- * Using gcc-??
- * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
+ * Using gcc-12 from pkgsrc.org (installed in GCC12INSTALLDIR)
+ * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin:$GCC12INSTALLDIR/bin
  * Set HOST_CC to /usr/bin/gcc
  * Set HOST_SH to /usr/bin/bash
 



CVS commit: src/tools/compat

2023-08-23 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Wed Aug 23 19:09:53 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.3 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-08-15 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Tue Aug 15 19:13:12 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 10 and Solaris 11.3 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/README
diff -u src/tools/compat/README:1.25 src/tools/compat/README:1.26
--- src/tools/compat/README:1.25	Mon Aug 14 18:49:45 2023
+++ src/tools/compat/README	Tue Aug 15 19:13:12 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.25 2023/08/14 18:49:45 palle Exp $
+$NetBSD: README,v 1.26 2023/08/15 19:13:12 palle Exp $
 
 Special notes for cross-hosting a NetBSD build on certain platforms.  
 Only those platforms which have been tested to complete a "build.sh" run
@@ -88,7 +88,7 @@ NetBSD (earlier releases)
 Solaris
 ---
 
-(updated instruction for Solaris 11 further below)
+(updated instruction for Solaris 10 and 11 further below)
 
 * Tested on Solaris/x86 8 (5.8) with gcc 2.95.2 and Solaris/sparc 8 (5.8)
   with gcc 3.2 (not yet tested with SUNWspro).
@@ -111,11 +111,25 @@ Solaris
   but /usr/ucb *MUST NOT* be before /usr/ccs/bin or before the path to
   the host C and C++ compilers.
 
+
+Solaris 10:
+
+* Solaris 10 1/13 (u11)
+ * POSIX.1-2001, SUSv3 (see standards(7))
+ * Using gcc-5 from opencsw.org
+ * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
+ * Set HOST_CC to /opt/csw/bin/gcc
+ * Set HOST_SH to /usr/bin/bash
+
+
 Solaris 11:
 
 * Solaris 11.3
+ * POSIX.1-2001, SUSv3 (see standards(7))
+ * Using gcc-??
  * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
  * Set HOST_CC to /usr/bin/gcc
+ * Set HOST_SH to /usr/bin/bash
 
 * Solaris 11.4 (CBE)
  * POSIX.1-2008, SUSv4 (see standards(7))



CVS commit: src/tools/compat

2023-08-15 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Tue Aug 15 19:13:12 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 10 and Solaris 11.3 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-08-14 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Aug 14 18:49:45 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.4 (CBE) hosts


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/README
diff -u src/tools/compat/README:1.24 src/tools/compat/README:1.25
--- src/tools/compat/README:1.24	Sun Jul 30 19:03:50 2023
+++ src/tools/compat/README	Mon Aug 14 18:49:45 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.24 2023/07/30 19:03:50 palle Exp $
+$NetBSD: README,v 1.25 2023/08/14 18:49:45 palle Exp $
 
 Special notes for cross-hosting a NetBSD build on certain platforms.  
 Only those platforms which have been tested to complete a "build.sh" run
@@ -122,6 +122,7 @@ Solaris 11:
  * Using gcc-11
  * Set PATH to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
  * Set HOST_CC to /usr/bin/gcc
+ * Set HOST_SH to /usr/bin/bash
 
 * Solaris 11.4 (SRU57)
  * POSIX.1-2008, SUSv4 (see standards(7))



CVS commit: src/tools/compat

2023-08-14 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Mon Aug 14 18:49:45 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.4 (CBE) hosts


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-07-30 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Jul 30 19:03:50 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instruction for Solaris 11.4 (CBE) hosts


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/README
diff -u src/tools/compat/README:1.23 src/tools/compat/README:1.24
--- src/tools/compat/README:1.23	Sun Jul 16 18:09:54 2023
+++ src/tools/compat/README	Sun Jul 30 19:03:50 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.23 2023/07/16 18:09:54 palle Exp $
+$NetBSD: README,v 1.24 2023/07/30 19:03:50 palle Exp $
 
 Special notes for cross-hosting a NetBSD build on certain platforms.  
 Only those platforms which have been tested to complete a "build.sh" run
@@ -118,7 +118,10 @@ Solaris 11:
  * Set HOST_CC to /usr/bin/gcc
 
 * Solaris 11.4 (CBE)
- * TBD
+ * POSIX.1-2008, SUSv4 (see standards(7))
+ * Using gcc-11
+ * Set PATH to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
+ * Set HOST_CC to /usr/bin/gcc
 
 * Solaris 11.4 (SRU57)
  * POSIX.1-2008, SUSv4 (see standards(7))



CVS commit: src/tools/compat

2023-07-30 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Jul 30 19:03:50 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instruction for Solaris 11.4 (CBE) hosts


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-07-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Jul 21 22:05:04 UTC 2023

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
tools/compat/compat_defs.h: improve NAME_MAX compat

Move the NAME_MAX workaround to the  section,
and don't assume that _XOPEN_NAME_MAX is available.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/tools/compat/compat_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.121 src/tools/compat/compat_defs.h:1.122
--- src/tools/compat/compat_defs.h:1.121	Sat Jul  8 19:10:00 2023
+++ src/tools/compat/compat_defs.h	Fri Jul 21 22:05:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.121 2023/07/08 19:10:00 palle Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.122 2023/07/21 22:05:04 lukem Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -31,17 +31,6 @@
 #endif	/* __linux__ && HAVE_FEATURES_H */
 
 /*
- * Solaris:
- * No NAME_MAX define is available (as documented in the Solaris
- * limits.h file), so use the XOPEN defined constant.
- */
-
-#if defined(__sun__)
-#define NAME_MAX _XOPEN_NAME_MAX
-#endif
-
-
-/*
  * Type substitutes.
  * These are controlled via HAVE_TYPE protections and some of them are needed
  * in other header files (in the build tree not in the host). This is because
@@ -1007,6 +996,15 @@ void *setmode(const char *);
 #ifndef MAXPATHLEN
 #define MAXPATHLEN	4096
 #endif
+
+#ifndef NAME_MAX
+#ifdef _XOPEN_NAME_MAX
+#define NAME_MAX _XOPEN_NAME_MAX
+#else
+#error "Both NAME_MAX and _XOPEN_NAME_MAX are not defined"
+#endif
+#endif
+
 #ifndef PATH_MAX
 #define PATH_MAX	MAXPATHLEN
 #endif



CVS commit: src/tools/compat

2023-07-21 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Fri Jul 21 22:05:04 UTC 2023

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
tools/compat/compat_defs.h: improve NAME_MAX compat

Move the NAME_MAX workaround to the  section,
and don't assume that _XOPEN_NAME_MAX is available.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/tools/compat/compat_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 16:22:30 UTC 2023

Modified Files:
src/tools/compat: configure nbtool_config.h.in

Log Message:
tools/compat: regen


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/tools/compat/configure
cvs rdiff -u -r1.55 -r1.56 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.104 src/tools/compat/configure:1.105
--- src/tools/compat/configure:1.104	Thu Jul 20 15:18:34 2023
+++ src/tools/compat/configure	Thu Jul 20 16:22:30 2023
@@ -5306,7 +5306,7 @@ for ac_func in atoll asprintf asnprintf 
 	dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \
 	getopt getopt_long group_from_gid gid_from_group \
 	heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \
-	mkdtemp poll pread putc_unlocked pwcache_userdb pwcache_groupdb \
+	mkdtemp poll posix_spawn pread putc_unlocked pwcache_userdb pwcache_groupdb \
 	pwrite raise_default_signal random reallocarr reallocarray setenv \
 	setgroupent setprogname setpassent \
 	snprintb_m snprintf strlcat strlcpy strmode \

Index: src/tools/compat/nbtool_config.h.in
diff -u src/tools/compat/nbtool_config.h.in:1.55 src/tools/compat/nbtool_config.h.in:1.56
--- src/tools/compat/nbtool_config.h.in:1.55	Tue May 30 19:04:42 2023
+++ src/tools/compat/nbtool_config.h.in	Thu Jul 20 16:22:30 2023
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated from configure.ac by autoheader.  */
 
-/*  $NetBSD: nbtool_config.h.in,v 1.55 2023/05/30 19:04:42 lukem Exp $*/
+/*  $NetBSD: nbtool_config.h.in,v 1.56 2023/07/20 16:22:30 lukem Exp $*/
  
 #ifndef __NETBSD_NBTOOL_CONFIG_H__
 #define __NETBSD_NBTOOL_CONFIG_H__
@@ -581,6 +581,9 @@
 /* Define to 1 if you have the `poll' function. */
 #undef HAVE_POLL
 
+/* Define to 1 if you have the `posix_spawn' function. */
+#undef HAVE_POSIX_SPAWN
+
 /* Define to 1 if you have the `pread' function. */
 #undef HAVE_PREAD
 



CVS commit: src/tools/compat

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 16:22:30 UTC 2023

Modified Files:
src/tools/compat: configure nbtool_config.h.in

Log Message:
tools/compat: regen


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/tools/compat/configure
cvs rdiff -u -r1.55 -r1.56 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 15:18:34 UTC 2023

Modified Files:
src/tools/compat: aclocal.m4 configure

Log Message:
tools/compat: regen


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tools/compat/aclocal.m4
cvs rdiff -u -r1.103 -r1.104 src/tools/compat/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/aclocal.m4
diff -u src/tools/compat/aclocal.m4:1.1 src/tools/compat/aclocal.m4:1.2
--- src/tools/compat/aclocal.m4:1.1	Tue May 30 19:04:42 2023
+++ src/tools/compat/aclocal.m4	Thu Jul 20 15:18:34 2023
@@ -13,3 +13,4 @@
 
 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 m4_include([buildaux/ax_check_compile_flag.m4])
+m4_include([buildaux/nb_check_cc_flag.m4])

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.103 src/tools/compat/configure:1.104
--- src/tools/compat/configure:1.103	Sat Jun  3 09:18:14 2023
+++ src/tools/compat/configure	Thu Jul 20 15:18:34 2023
@@ -6278,7 +6278,7 @@ done
 
 
 
-cc_fail_unknown=
+nb_cv_check_cc_flags=
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unknown-warning-option" >&5
 $as_echo_n "checking whether C compiler accepts -Werror=unknown-warning-option... " >&6; }
 if ${ax_cv_check_cflags___Werror_unknown_warning_option+:} false; then :
@@ -6309,17 +6309,13 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Werror_unknown_warning_option" >&5
 $as_echo "$ax_cv_check_cflags___Werror_unknown_warning_option" >&6; }
 if test "x$ax_cv_check_cflags___Werror_unknown_warning_option" = xyes; then :
-  as_fn_append cc_fail_unknown -Werror=unknown-warning-option
+  nb_cv_check_cc_flags=-Werror=unknown-warning-option
 else
   :
 fi
 
 
-
-
-
-
-as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-no-cpp-precomp" | $as_tr_sh`
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$nb_cv_check_cc_flags_-no-cpp-precomp" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -no-cpp-precomp" >&5
 $as_echo_n "checking whether C compiler accepts -no-cpp-precomp... " >&6; }
 if eval \${$as_CACHEVAR+:} false; then :
@@ -6327,7 +6323,7 @@ if eval \${$as_CACHEVAR+:} false; then :
 else
 
   ax_check_save_flags=$CFLAGS
-  CFLAGS="$CFLAGS $cc_fail_unknown -no-cpp-precomp"
+  CFLAGS="$CFLAGS $nb_cv_check_cc_flags -no-cpp-precomp"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -6359,14 +6355,7 @@ fi
 
 
 
-
-
-
-
-
-
-
-as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-Waddress-of-packed-member" | $as_tr_sh`
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$nb_cv_check_cc_flags_-Waddress-of-packed-member" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Waddress-of-packed-member" >&5
 $as_echo_n "checking whether C compiler accepts -Waddress-of-packed-member... " >&6; }
 if eval \${$as_CACHEVAR+:} false; then :
@@ -6374,7 +6363,7 @@ if eval \${$as_CACHEVAR+:} false; then :
 else
 
   ax_check_save_flags=$CFLAGS
-  CFLAGS="$CFLAGS $cc_fail_unknown -Waddress-of-packed-member"
+  CFLAGS="$CFLAGS $nb_cv_check_cc_flags -Waddress-of-packed-member"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -6405,14 +6394,7 @@ fi
 
 
 
-
-
-
-
-
-
-
-as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-Wcast-function-type" | $as_tr_sh`
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$nb_cv_check_cc_flags_-Wcast-function-type" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wcast-function-type" >&5
 $as_echo_n "checking whether C compiler accepts -Wcast-function-type... " >&6; }
 if eval \${$as_CACHEVAR+:} false; then :
@@ -6420,7 +6402,7 @@ if eval \${$as_CACHEVAR+:} false; then :
 else
 
   ax_check_save_flags=$CFLAGS
-  CFLAGS="$CFLAGS $cc_fail_unknown -Wcast-function-type"
+  CFLAGS="$CFLAGS $nb_cv_check_cc_flags -Wcast-function-type"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -6451,14 +6433,7 @@ fi
 
 
 
-
-
-
-
-
-
-
-as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-Werror=address-of-packed-member" | $as_tr_sh`
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$nb_cv_check_cc_flags_-Werror=address-of-packed-member" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=address-of-packed-member" >&5
 $as_echo_n "checking whether C compiler accepts -Werror=address-of-packed-member... " >&6; }
 if eval \${$as_CACHEVAR+:} false; then :
@@ -6466,7 +6441,7 @@ if eval \${$as_CACHEVAR+:} false; then :
 else
 
   ax_check_save_flags=$CFLAGS
-  CFLAGS="$CFLAGS $cc_fail_unknown -Werror=address-of-packed-member"
+  CFLAGS="$CFLAGS $nb_cv_check_cc_flags -Werror=address-of-packed-member"
   cat confdefs.h - <<_ACEOF >conf

CVS commit: src/tools/compat

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 15:18:34 UTC 2023

Modified Files:
src/tools/compat: aclocal.m4 configure

Log Message:
tools/compat: regen


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tools/compat/aclocal.m4
cvs rdiff -u -r1.103 -r1.104 src/tools/compat/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 15:15:23 UTC 2023

Modified Files:
src/tools/compat: configure.ac
Added Files:
src/tools/compat/buildaux: nb_check_cc_flag.m4

Log Message:
tools/compat: provide nb_check_cc_flag.m4

Implement m4 macro NB_CHECK_CC_FLAG(FLAG, [VAR=FLAG_DERIVED])
Determine if the C compiler supports FLAG,
and sets output variable VAR to FLAG if FLAG is supported.

If VAR is not provided, default to FLAG_DERIVED, which is
FLAG converted to upper-case and all special characters
replaced with "_", and the result prepended with "CC_".
FLAG_DERIVED is appended to the m4 macro NB_CHECK_CC_FLAG_VARS.
E.g., if FLAG is "-Wexample=yes", FLAG_DERIVED is "CC_WEXAMPLE_YES".

This is implemented in separate buildaux/nb_check_cc_flag.m4,
based on configure's NB_CC_FLAG(), but supports VAR override.

Adapt configure from internal NB_CC_FLAG() to NB_CHECK_CC_FLAG().

(Note: AX_CHECK_COMPILE_FLAG() from autoconf-archive could be enhanced
to support the clang and gcc workarounds I've implemented here.)


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/tools/compat/configure.ac
cvs rdiff -u -r0 -r1.1 src/tools/compat/buildaux/nb_check_cc_flag.m4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.105 src/tools/compat/configure.ac:1.106
--- src/tools/compat/configure.ac:1.105	Sat Jun  3 09:10:13 2023
+++ src/tools/compat/configure.ac	Thu Jul 20 15:15:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.105 2023/06/03 09:10:13 lukem Exp $
+#	$NetBSD: configure.ac,v 1.106 2023/07/20 15:15:23 lukem Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -327,50 +327,27 @@ dnl
 dnl Set per-warning CC_* variables if supported by HOST_CC.
 dnl
 
-dnl clang needs to fail if given an unknown -WWARN.
-cc_fail_unknown=
-AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],
- [AS_VAR_APPEND([cc_fail_unknown], [-Werror=unknown-warning-option])])
-
-dnl NB_CC_FLAG(FLAG)
-dnl	Determine if HOST_CC supports FLAG, and
-dnl	sets output variable VAR (derived from FLAG)
-dnl	to FLAG if it is supported.
-dnl
-AC_DEFUN([NB_CC_FLAG], [dnl
-m4_pushdef([NB_FLAG], [$1])
-dnl gcc ignores unknown -Wno-WARN but will fail unknown equivalent -WWARN.
-m4_pushdef([NB_WFLAG], m4_bpatsubst(NB_FLAG, [^-Wno-], [-W]))
-m4_pushdef([NB_VAR], [CC]m4_translit(NB_FLAG, [-=a-z], [__A-Z]))
-AX_CHECK_COMPILE_FLAG(NB_WFLAG, [AS_VAR_SET(NB_VAR,NB_FLAG)], [], [$cc_fail_unknown])
-AC_SUBST(NB_VAR)
-m4_append([NB_CC_FLAG_VARS], NB_VAR, [ ])
-m4_popdef([NB_FLAG])
-m4_popdef([NB_WFLAG])
-m4_popdef([NB_VAR])
-]) dnl NB_CC_FLAG
-
 dnl Disable use of pre-compiled headers on Darwin.
-NB_CC_FLAG([-no-cpp-precomp])
+NB_CHECK_CC_FLAG([-no-cpp-precomp])
 
 dnl Detect HOST_CC support for  CC_* warnings
-NB_CC_FLAG([-Wno-address-of-packed-member])
-NB_CC_FLAG([-Wno-cast-function-type])
-NB_CC_FLAG([-Wno-error=address-of-packed-member])
-NB_CC_FLAG([-Wno-format-overflow])
-NB_CC_FLAG([-Wno-format-truncation])
-NB_CC_FLAG([-Wno-implicit-fallthrough])
-NB_CC_FLAG([-Wno-maybe-uninitialized])
-NB_CC_FLAG([-Wno-return-local-addr])
-NB_CC_FLAG([-Wno-stringop-overflow])
-NB_CC_FLAG([-Wno-stringop-truncation])
+NB_CHECK_CC_FLAG([-Wno-address-of-packed-member])
+NB_CHECK_CC_FLAG([-Wno-cast-function-type])
+NB_CHECK_CC_FLAG([-Wno-error=address-of-packed-member])
+NB_CHECK_CC_FLAG([-Wno-format-overflow])
+NB_CHECK_CC_FLAG([-Wno-format-truncation])
+NB_CHECK_CC_FLAG([-Wno-implicit-fallthrough])
+NB_CHECK_CC_FLAG([-Wno-maybe-uninitialized])
+NB_CHECK_CC_FLAG([-Wno-return-local-addr])
+NB_CHECK_CC_FLAG([-Wno-stringop-overflow])
+NB_CHECK_CC_FLAG([-Wno-stringop-truncation])
 
 AC_OUTPUT()
 
 dnl Display results
 dnl
-AC_MSG_NOTICE([= Configuration results =])
-m4_foreach_w([NB_VAR], [CC LIBS ]NB_CC_FLAG_VARS, [dnl
+AC_MSG_NOTICE([= configure results for compat ==])
+m4_foreach_w([NB_VAR], [CC LIBS ]NB_CHECK_CC_FLAG_VARS, [dnl
 AC_MSG_NOTICE(m4_format([%-40s],NB_VAR)[$NB_VAR])
 ])
 AC_MSG_NOTICE([])

Added files:

Index: src/tools/compat/buildaux/nb_check_cc_flag.m4
diff -u /dev/null src/tools/compat/buildaux/nb_check_cc_flag.m4:1.1
--- /dev/null	Thu Jul 20 15:15:23 2023
+++ src/tools/compat/buildaux/nb_check_cc_flag.m4	Thu Jul 20 15:15:23 2023
@@ -0,0 +1,55 @@
+#
+# Copyright (c) 2023, Luke Mewburn 
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.  This file is offered as-is,
+# without any warranty.
+#
+
+#
+# _NB_CHECK_CC_FLAG_PREPARE
+#	Check for flags to force a compiler (e.g., clang) to fail
+#	if given an unknown -WWARN, and set $nb_cv_check_cc_flags
+#	to that flag for NB_CHECK_C

CVS commit: src/tools/compat

2023-07-20 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul 20 15:15:23 UTC 2023

Modified Files:
src/tools/compat: configure.ac
Added Files:
src/tools/compat/buildaux: nb_check_cc_flag.m4

Log Message:
tools/compat: provide nb_check_cc_flag.m4

Implement m4 macro NB_CHECK_CC_FLAG(FLAG, [VAR=FLAG_DERIVED])
Determine if the C compiler supports FLAG,
and sets output variable VAR to FLAG if FLAG is supported.

If VAR is not provided, default to FLAG_DERIVED, which is
FLAG converted to upper-case and all special characters
replaced with "_", and the result prepended with "CC_".
FLAG_DERIVED is appended to the m4 macro NB_CHECK_CC_FLAG_VARS.
E.g., if FLAG is "-Wexample=yes", FLAG_DERIVED is "CC_WEXAMPLE_YES".

This is implemented in separate buildaux/nb_check_cc_flag.m4,
based on configure's NB_CC_FLAG(), but supports VAR override.

Adapt configure from internal NB_CC_FLAG() to NB_CHECK_CC_FLAG().

(Note: AX_CHECK_COMPILE_FLAG() from autoconf-archive could be enhanced
to support the clang and gcc workarounds I've implemented here.)


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/tools/compat/configure.ac
cvs rdiff -u -r0 -r1.1 src/tools/compat/buildaux/nb_check_cc_flag.m4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-07-16 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Jul 16 18:09:54 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.4 hosts: specify HOST_SH and note 
standards


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/README
diff -u src/tools/compat/README:1.22 src/tools/compat/README:1.23
--- src/tools/compat/README:1.22	Wed Jul  5 16:26:29 2023
+++ src/tools/compat/README	Sun Jul 16 18:09:54 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.22 2023/07/05 16:26:29 palle Exp $
+$NetBSD: README,v 1.23 2023/07/16 18:09:54 palle Exp $
 
 Special notes for cross-hosting a NetBSD build on certain platforms.  
 Only those platforms which have been tested to complete a "build.sh" run
@@ -121,7 +121,8 @@ Solaris 11:
  * TBD
 
 * Solaris 11.4 (SRU57)
+ * POSIX.1-2008, SUSv4 (see standards(7))
  * Using gcc-12
  * Set PATH to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
  * Set HOST_CC to /usr/bin/gcc
-
+ * Set HOST_SH to /usr/bin/bash



CVS commit: src/tools/compat

2023-07-16 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sun Jul 16 18:09:54 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instructions for Solaris 11.4 hosts: specify HOST_SH and note 
standards


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/tools/compat

2023-07-08 Thread Luke Mewburn
On 23-07-08 19:10, Palle Lyckegaard wrote:
  | Module Name:src
  | Committed By:   palle
  | Date:   Sat Jul  8 19:10:00 UTC 2023
  | 
  | Modified Files:
  | src/tools/compat: compat_defs.h
  | 
  | Log Message:
  | Add support for missing NAME_MAX when building on Solaris hosts
  | 

  | 
  | Index: src/tools/compat/compat_defs.h
  | diff -u src/tools/compat/compat_defs.h:1.120 
src/tools/compat/compat_defs.h:1.121
  | --- src/tools/compat/compat_defs.h:1.120Sun May 30 10:39:41 2021
  | +++ src/tools/compat/compat_defs.h  Sat Jul  8 19:10:00 2023
  | @@ -1,4 +1,4 @@
  | -/* $NetBSD: compat_defs.h,v 1.120 2021/05/30 10:39:41 cjep Exp $   */
  | +/* $NetBSD: compat_defs.h,v 1.121 2023/07/08 19:10:00 palle Exp $  */
  |  
  |  #ifndef__NETBSD_COMPAT_DEFS_H__
  |  #define__NETBSD_COMPAT_DEFS_H__
  | @@ -31,6 +31,17 @@
  |  #endif /* __linux__ && HAVE_FEATURES_H */
  |  
  |  /*
  | + * Solaris:
  | + * No NAME_MAX define is available (as documented in the Solaris
  | + * limits.h file), so use the XOPEN defined constant.
  | + */
  | +
  | +#if defined(__sun__)
  | +#define NAME_MAX _XOPEN_NAME_MAX
  | +#endif
  | +

This might be better as a check for NAME_MAX not being defined
and _XOPEN_NAME_MAX being defined?

Something like:
#if !defined(NAME_MAX)
#if defined(_XOPEN_NAME_MAX)
#define NAME_MAX _XOPEN_NAME_MAX
#else
#error "Unable to determine NAME_MAX"
#endif
#endif

There might be an even cleaner idiom.


regards,
Luke.


CVS commit: src/tools/compat

2023-07-08 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Jul  8 19:10:00 UTC 2023

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
Add support for missing NAME_MAX when building on Solaris hosts


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/tools/compat/compat_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.120 src/tools/compat/compat_defs.h:1.121
--- src/tools/compat/compat_defs.h:1.120	Sun May 30 10:39:41 2021
+++ src/tools/compat/compat_defs.h	Sat Jul  8 19:10:00 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.120 2021/05/30 10:39:41 cjep Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.121 2023/07/08 19:10:00 palle Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -31,6 +31,17 @@
 #endif	/* __linux__ && HAVE_FEATURES_H */
 
 /*
+ * Solaris:
+ * No NAME_MAX define is available (as documented in the Solaris
+ * limits.h file), so use the XOPEN defined constant.
+ */
+
+#if defined(__sun__)
+#define NAME_MAX _XOPEN_NAME_MAX
+#endif
+
+
+/*
  * Type substitutes.
  * These are controlled via HAVE_TYPE protections and some of them are needed
  * in other header files (in the build tree not in the host). This is because



CVS commit: src/tools/compat

2023-07-08 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Sat Jul  8 19:10:00 UTC 2023

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
Add support for missing NAME_MAX when building on Solaris hosts


To generate a diff of this commit:
cvs rdiff -u -r1.120 -r1.121 src/tools/compat/compat_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-07-05 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Wed Jul  5 16:26:29 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instruction for Solaris 11.4 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-07-05 Thread Palle Lyckegaard
Module Name:src
Committed By:   palle
Date:   Wed Jul  5 16:26:29 UTC 2023

Modified Files:
src/tools/compat: README

Log Message:
Update build instruction for Solaris 11.4 hosts


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/tools/compat/README

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/README
diff -u src/tools/compat/README:1.21 src/tools/compat/README:1.22
--- src/tools/compat/README:1.21	Sun Jul 11 06:15:42 2021
+++ src/tools/compat/README	Wed Jul  5 16:26:29 2023
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.21 2021/07/11 06:15:42 cjep Exp $
+$NetBSD: README,v 1.22 2023/07/05 16:26:29 palle Exp $
 
 Special notes for cross-hosting a NetBSD build on certain platforms.  
 Only those platforms which have been tested to complete a "build.sh" run
@@ -117,9 +117,11 @@ Solaris 11:
  * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
  * Set HOST_CC to /usr/bin/gcc
 
-* Solaris 11.4
- * Install gcc-5 since the default installed gcc-7 has issues when compiling 
-   toolchain version of groff (hypot())
+* Solaris 11.4 (CBE)
+ * TBD
+
+* Solaris 11.4 (SRU57)
+ * Using gcc-12
  * Set PATH to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
- * set HOST_CC to /usr/gcc/5/bin/gcc
- * set HOST_CXX to /usr/gcc/5/bin/g++
+ * Set HOST_CC to /usr/bin/gcc
+



CVS commit: src/tools/compat

2023-07-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul  3 18:50:42 UTC 2023

Modified Files:
src/tools/compat: regex.h

Log Message:
PR/57500: Palle Lyckegaard: include missing tools/compat/regex.h for
__{BEGIN,END}_DECLS.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tools/compat/regex.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/regex.h
diff -u src/tools/compat/regex.h:1.5 src/tools/compat/regex.h:1.6
--- src/tools/compat/regex.h:1.5	Sun Mar 11 14:32:43 2018
+++ src/tools/compat/regex.h	Mon Jul  3 14:50:42 2023
@@ -1,3 +1,4 @@
-/*	$NetBSD: regex.h,v 1.5 2018/03/11 18:32:43 christos Exp $ */
+/*	$NetBSD: regex.h,v 1.6 2023/07/03 18:50:42 christos Exp $ */
 
+#include "nbtool_config.h"
 #include "../../include/regex.h"



CVS commit: src/tools/compat

2023-07-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Jul  3 18:50:42 UTC 2023

Modified Files:
src/tools/compat: regex.h

Log Message:
PR/57500: Palle Lyckegaard: include missing tools/compat/regex.h for
__{BEGIN,END}_DECLS.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tools/compat/regex.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-06-03 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun  3 09:18:14 UTC 2023

Modified Files:
src/tools/compat: configure

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/tools/compat/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.102 src/tools/compat/configure:1.103
--- src/tools/compat/configure:1.102	Tue May 30 19:04:42 2023
+++ src/tools/compat/configure	Sat Jun  3 09:18:14 2023
@@ -625,8 +625,14 @@ ac_subst_vars='LTLIBOBJS
 LIBOBJS
 CC_WNO_STRINGOP_TRUNCATION
 CC_WNO_STRINGOP_OVERFLOW
+CC_WNO_RETURN_LOCAL_ADDR
 CC_WNO_MAYBE_UNINITIALIZED
+CC_WNO_IMPLICIT_FALLTHROUGH
 CC_WNO_FORMAT_TRUNCATION
+CC_WNO_FORMAT_OVERFLOW
+CC_WNO_ERROR_ADDRESS_OF_PACKED_MEMBER
+CC_WNO_CAST_FUNCTION_TYPE
+CC_WNO_ADDRESS_OF_PACKED_MEMBER
 CC_NO_CPP_PRECOMP
 ALLOCA
 BSHELL
@@ -6360,6 +6366,190 @@ fi
 
 
 
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-Waddress-of-packed-member" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Waddress-of-packed-member" >&5
+$as_echo_n "checking whether C compiler accepts -Waddress-of-packed-member... " >&6; }
+if eval \${$as_CACHEVAR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS $cc_fail_unknown -Waddress-of-packed-member"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_CACHEVAR=yes"
+else
+  eval "$as_CACHEVAR=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+eval ac_res=\$$as_CACHEVAR
+	   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+  CC_WNO_ADDRESS_OF_PACKED_MEMBER=-Wno-address-of-packed-member
+else
+  :
+fi
+
+
+
+
+
+
+
+
+
+
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-Wcast-function-type" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wcast-function-type" >&5
+$as_echo_n "checking whether C compiler accepts -Wcast-function-type... " >&6; }
+if eval \${$as_CACHEVAR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS $cc_fail_unknown -Wcast-function-type"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_CACHEVAR=yes"
+else
+  eval "$as_CACHEVAR=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+eval ac_res=\$$as_CACHEVAR
+	   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+  CC_WNO_CAST_FUNCTION_TYPE=-Wno-cast-function-type
+else
+  :
+fi
+
+
+
+
+
+
+
+
+
+
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-Werror=address-of-packed-member" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=address-of-packed-member" >&5
+$as_echo_n "checking whether C compiler accepts -Werror=address-of-packed-member... " >&6; }
+if eval \${$as_CACHEVAR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS $cc_fail_unknown -Werror=address-of-packed-member"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_CACHEVAR=yes"
+else
+  eval "$as_CACHEVAR=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+eval ac_res=\$$as_CACHEVAR
+	   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+  CC_WNO_ERROR_ADDRESS_OF_PACKED_MEMBER=-Wno-error=address-of-packed-member
+else
+  :
+fi
+
+
+
+
+
+
+
+
+
+
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-Wformat-overflow" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wformat-overflow" >&5
+$as_echo_n "checking whether C compiler accepts -Wformat-overflow... " >&6; }
+if eval \${$as_CACHEVAR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS $cc_fail_unknown -Wformat-overflow"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_CACHEVAR=yes"
+else
+  eval "$as_CACHEVAR=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS=$ax_check_save_fl

CVS commit: src/tools/compat

2023-06-03 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun  3 09:18:14 UTC 2023

Modified Files:
src/tools/compat: configure

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/tools/compat/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-06-03 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun  3 09:10:13 UTC 2023

Modified Files:
src/tools/compat: configure.ac defs.mk.in

Log Message:
tools/compat: support all bsd.own.mk disabled warnings

Check the host CC support for all the warnings now in 
and override appropriately in defs.mk.

In general there's a 1:1 mapping, with the special case
CC_WNO_ADDRESS_OF_PACKED_MEMBER which is set from both
@CC_WNO_ADDRESS_OF_PACKED_MEMBER@ (gcc) and
@CC_WNO_ERROR_ADDRESS_OF_PACKED_MEMBER@ (clang).


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/tools/compat/configure.ac
cvs rdiff -u -r1.16 -r1.17 src/tools/compat/defs.mk.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.104 src/tools/compat/configure.ac:1.105
--- src/tools/compat/configure.ac:1.104	Tue May 30 18:54:21 2023
+++ src/tools/compat/configure.ac	Sat Jun  3 09:10:13 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.104 2023/05/30 18:54:21 lukem Exp $
+#	$NetBSD: configure.ac,v 1.105 2023/06/03 09:10:13 lukem Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -332,11 +332,16 @@ cc_fail_unknown=
 AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],
  [AS_VAR_APPEND([cc_fail_unknown], [-Werror=unknown-warning-option])])
 
+dnl NB_CC_FLAG(FLAG)
+dnl	Determine if HOST_CC supports FLAG, and
+dnl	sets output variable VAR (derived from FLAG)
+dnl	to FLAG if it is supported.
+dnl
 AC_DEFUN([NB_CC_FLAG], [dnl
 m4_pushdef([NB_FLAG], [$1])
 dnl gcc ignores unknown -Wno-WARN but will fail unknown equivalent -WWARN.
 m4_pushdef([NB_WFLAG], m4_bpatsubst(NB_FLAG, [^-Wno-], [-W]))
-m4_pushdef([NB_VAR], [CC]m4_translit(NB_FLAG, [-a-z], [_A-Z]))
+m4_pushdef([NB_VAR], [CC]m4_translit(NB_FLAG, [-=a-z], [__A-Z]))
 AX_CHECK_COMPILE_FLAG(NB_WFLAG, [AS_VAR_SET(NB_VAR,NB_FLAG)], [], [$cc_fail_unknown])
 AC_SUBST(NB_VAR)
 m4_append([NB_CC_FLAG_VARS], NB_VAR, [ ])
@@ -349,8 +354,14 @@ dnl Disable use of pre-compiled headers 
 NB_CC_FLAG([-no-cpp-precomp])
 
 dnl Detect HOST_CC support for  CC_* warnings
+NB_CC_FLAG([-Wno-address-of-packed-member])
+NB_CC_FLAG([-Wno-cast-function-type])
+NB_CC_FLAG([-Wno-error=address-of-packed-member])
+NB_CC_FLAG([-Wno-format-overflow])
 NB_CC_FLAG([-Wno-format-truncation])
+NB_CC_FLAG([-Wno-implicit-fallthrough])
 NB_CC_FLAG([-Wno-maybe-uninitialized])
+NB_CC_FLAG([-Wno-return-local-addr])
 NB_CC_FLAG([-Wno-stringop-overflow])
 NB_CC_FLAG([-Wno-stringop-truncation])
 
@@ -358,10 +369,8 @@ AC_OUTPUT()
 
 dnl Display results
 dnl
-AC_MSG_NOTICE([= Configuration results =])
-AC_MSG_NOTICE([CC  $CC])
-m4_foreach_w([NB_VAR], NB_CC_FLAG_VARS, [dnl
-AC_MSG_NOTICE(m4_format([%-32s],NB_VAR)[$NB_VAR])
+AC_MSG_NOTICE([= Configuration results =])
+m4_foreach_w([NB_VAR], [CC LIBS ]NB_CC_FLAG_VARS, [dnl
+AC_MSG_NOTICE(m4_format([%-40s],NB_VAR)[$NB_VAR])
 ])
-AC_MSG_NOTICE([LIBS$LIBS])
-AC_MSG_NOTICE([=])
+AC_MSG_NOTICE([])

Index: src/tools/compat/defs.mk.in
diff -u src/tools/compat/defs.mk.in:1.16 src/tools/compat/defs.mk.in:1.17
--- src/tools/compat/defs.mk.in:1.16	Sat Jun  3 09:09:16 2023
+++ src/tools/compat/defs.mk.in	Sat Jun  3 09:10:13 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: defs.mk.in,v 1.16 2023/06/03 09:09:16 lukem Exp $
+#	$NetBSD: defs.mk.in,v 1.17 2023/06/03 09:10:13 lukem Exp $
 #
 # Makefile fragment for building with libnbcompat and associated
 # include files.  It can also be used for building just with
@@ -75,8 +75,13 @@ HOST_CFLAGS+=	@CC_NO_CPP_PRECOMP@
 
 # Override HOST_CC support for  CC_* warnings
 #
+CC_WNO_ADDRESS_OF_PACKED_MEMBER=@CC_WNO_ADDRESS_OF_PACKED_MEMBER@ @CC_WNO_ERROR_ADDRESS_OF_PACKED_MEMBER@
+CC_WNO_CAST_FUNCTION_TYPE=@CC_WNO_CAST_FUNCTION_TYPE@
+CC_WNO_FORMAT_OVERFLOW=@CC_WNO_FORMAT_OVERFLOW@
 CC_WNO_FORMAT_TRUNCATION=@CC_WNO_FORMAT_TRUNCATION@
+CC_WNO_IMPLICIT_FALLTHROUGH=@CC_WNO_IMPLICIT_FALLTHROUGH@
 CC_WNO_MAYBE_UNINITIALIZED=@CC_WNO_MAYBE_UNINITIALIZED@
+CC_WNO_RETURN_LOCAL_ADDR=@CC_WNO_RETURN_LOCAL_ADDR@
 CC_WNO_STRINGOP_OVERFLOW=@CC_WNO_STRINGOP_OVERFLOW@
 CC_WNO_STRINGOP_TRUNCATION=@CC_WNO_STRINGOP_TRUNCATION@
 



CVS commit: src/tools/compat

2023-06-03 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Sat Jun  3 09:10:13 UTC 2023

Modified Files:
src/tools/compat: configure.ac defs.mk.in

Log Message:
tools/compat: support all bsd.own.mk disabled warnings

Check the host CC support for all the warnings now in 
and override appropriately in defs.mk.

In general there's a 1:1 mapping, with the special case
CC_WNO_ADDRESS_OF_PACKED_MEMBER which is set from both
@CC_WNO_ADDRESS_OF_PACKED_MEMBER@ (gcc) and
@CC_WNO_ERROR_ADDRESS_OF_PACKED_MEMBER@ (clang).


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/tools/compat/configure.ac
cvs rdiff -u -r1.16 -r1.17 src/tools/compat/defs.mk.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 19:04:43 UTC 2023

Modified Files:
src/tools/compat: configure nbtool_config.h.in
Added Files:
src/tools/compat: aclocal.m4

Log Message:
tools/compat: regen


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tools/compat/aclocal.m4
cvs rdiff -u -r1.101 -r1.102 src/tools/compat/configure
cvs rdiff -u -r1.54 -r1.55 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.101 src/tools/compat/configure:1.102
--- src/tools/compat/configure:1.101	Mon May 29 21:34:57 2023
+++ src/tools/compat/configure	Tue May 30 19:04:42 2023
@@ -623,7 +623,11 @@ ac_includes_default="\
 
 ac_subst_vars='LTLIBOBJS
 LIBOBJS
-HAVE_PTHREAD_H
+CC_WNO_STRINGOP_TRUNCATION
+CC_WNO_STRINGOP_OVERFLOW
+CC_WNO_MAYBE_UNINITIALIZED
+CC_WNO_FORMAT_TRUNCATION
+CC_NO_CPP_PRECOMP
 ALLOCA
 BSHELL
 EGREP
@@ -2249,6 +2253,8 @@ ac_config_files="$ac_config_files defs.m
 
 
 
+
+
 # Autoheader header and footer
 
 
@@ -6265,8 +6271,275 @@ fi
 done
 
 
-# Variables substituted via @VARNAME@ in defs.mk.in
-HAVE_PTHREAD_H=$ac_cv_header_pthread_h
+
+cc_fail_unknown=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Werror=unknown-warning-option" >&5
+$as_echo_n "checking whether C compiler accepts -Werror=unknown-warning-option... " >&6; }
+if ${ax_cv_check_cflags___Werror_unknown_warning_option+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS  -Werror=unknown-warning-option"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ax_cv_check_cflags___Werror_unknown_warning_option=yes
+else
+  ax_cv_check_cflags___Werror_unknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Werror_unknown_warning_option" >&5
+$as_echo "$ax_cv_check_cflags___Werror_unknown_warning_option" >&6; }
+if test "x$ax_cv_check_cflags___Werror_unknown_warning_option" = xyes; then :
+  as_fn_append cc_fail_unknown -Werror=unknown-warning-option
+else
+  :
+fi
+
+
+
+
+
+
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-no-cpp-precomp" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -no-cpp-precomp" >&5
+$as_echo_n "checking whether C compiler accepts -no-cpp-precomp... " >&6; }
+if eval \${$as_CACHEVAR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS $cc_fail_unknown -no-cpp-precomp"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_CACHEVAR=yes"
+else
+  eval "$as_CACHEVAR=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+eval ac_res=\$$as_CACHEVAR
+	   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+  CC_NO_CPP_PRECOMP=-no-cpp-precomp
+else
+  :
+fi
+
+
+
+
+
+
+
+
+
+
+
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-Wformat-truncation" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wformat-truncation" >&5
+$as_echo_n "checking whether C compiler accepts -Wformat-truncation... " >&6; }
+if eval \${$as_CACHEVAR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS $cc_fail_unknown -Wformat-truncation"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_CACHEVAR=yes"
+else
+  eval "$as_CACHEVAR=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  CFLAGS=$ax_check_save_flags
+fi
+eval ac_res=\$$as_CACHEVAR
+	   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
+  CC_WNO_FORMAT_TRUNCATION=-Wno-format-truncation
+else
+  :
+fi
+
+
+
+
+
+
+
+
+
+
+as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$cc_fail_unknown_-Wmaybe-uninitialized" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wmaybe-uninitialized" >&5
+$as_echo_n "checking whether C compiler accepts -Wmaybe-uninitialized... " >&6; }
+if eval \${$as_CACHEVAR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+  ax_check_save_flags=$CFLAGS
+  CFLAGS="$CFLAGS $cc_fail_unknown -Wmaybe-uninitialized"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confd

CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 19:04:43 UTC 2023

Modified Files:
src/tools/compat: configure nbtool_config.h.in
Added Files:
src/tools/compat: aclocal.m4

Log Message:
tools/compat: regen


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tools/compat/aclocal.m4
cvs rdiff -u -r1.101 -r1.102 src/tools/compat/configure
cvs rdiff -u -r1.54 -r1.55 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:54:21 UTC 2023

Modified Files:
src/tools/compat: configure.ac defs.mk.in

Log Message:
tools/compat: disable host CC warnings

Determine if the host CC supports flags to disable various
warnings similar to  GCC_*, CLANG_*, and CC_*,
and override the  equivalents in defs.mk.

Silences "warning: unknown warning option '...'" from our source.
External source (e.g., binutils and gcc) need their own fixes
to enhance their detection of supported clang compiler flags.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/tools/compat/configure.ac
cvs rdiff -u -r1.14 -r1.15 src/tools/compat/defs.mk.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.103 src/tools/compat/configure.ac:1.104
--- src/tools/compat/configure.ac:1.103	Tue May 30 18:39:19 2023
+++ src/tools/compat/configure.ac	Tue May 30 18:54:21 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.103 2023/05/30 18:39:19 lukem Exp $
+#	$NetBSD: configure.ac,v 1.104 2023/05/30 18:54:21 lukem Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -339,6 +339,7 @@ m4_pushdef([NB_WFLAG], m4_bpatsubst(NB_F
 m4_pushdef([NB_VAR], [CC]m4_translit(NB_FLAG, [-a-z], [_A-Z]))
 AX_CHECK_COMPILE_FLAG(NB_WFLAG, [AS_VAR_SET(NB_VAR,NB_FLAG)], [], [$cc_fail_unknown])
 AC_SUBST(NB_VAR)
+m4_append([NB_CC_FLAG_VARS], NB_VAR, [ ])
 m4_popdef([NB_FLAG])
 m4_popdef([NB_WFLAG])
 m4_popdef([NB_VAR])
@@ -347,13 +348,20 @@ m4_popdef([NB_VAR])
 dnl Disable use of pre-compiled headers on Darwin.
 NB_CC_FLAG([-no-cpp-precomp])
 
+dnl Detect HOST_CC support for  CC_* warnings
+NB_CC_FLAG([-Wno-format-truncation])
+NB_CC_FLAG([-Wno-maybe-uninitialized])
+NB_CC_FLAG([-Wno-stringop-overflow])
+NB_CC_FLAG([-Wno-stringop-truncation])
 
 AC_OUTPUT()
 
-# Display results
-#
+dnl Display results
+dnl
 AC_MSG_NOTICE([= Configuration results =])
 AC_MSG_NOTICE([CC  $CC])
-AC_MSG_NOTICE([CC_NO_CPP_PRECOMP   $CC_NO_CPP_PRECOMP])
+m4_foreach_w([NB_VAR], NB_CC_FLAG_VARS, [dnl
+AC_MSG_NOTICE(m4_format([%-32s],NB_VAR)[$NB_VAR])
+])
 AC_MSG_NOTICE([LIBS$LIBS])
 AC_MSG_NOTICE([=])

Index: src/tools/compat/defs.mk.in
diff -u src/tools/compat/defs.mk.in:1.14 src/tools/compat/defs.mk.in:1.15
--- src/tools/compat/defs.mk.in:1.14	Tue May 30 18:39:19 2023
+++ src/tools/compat/defs.mk.in	Tue May 30 18:54:21 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: defs.mk.in,v 1.14 2023/05/30 18:39:19 lukem Exp $
+#	$NetBSD: defs.mk.in,v 1.15 2023/05/30 18:54:21 lukem Exp $
 #
 # Makefile fragment for building with libnbcompat and associated
 # include files.  It can also be used for building just with
@@ -73,6 +73,13 @@ BUILD_OSTYPE!=  uname -s
 
 HOST_CFLAGS+=	@CC_NO_CPP_PRECOMP@
 
+# Override HOST_CC support for  CC_* warnings
+#
+GCC_NO_FORMAT_TRUNCATION=@CC_WNO_FORMAT_TRUNCATION@
+GCC_NO_MAYBE_UNINITIALIZED=@CC_WNO_MAYBE_UNINITIALIZED@
+GCC_NO_STRINGOP_OVERFLOW=@CC_WNO_STRINGOP_OVERFLOW@
+GCC_NO_STRINGOP_TRUNCATION=@CC_WNO_STRINGOP_TRUNCATION@
+
 HOST_CPPFLAGS+=	${COMPATINCFLAGS} -I${NETBSDSRCDIR}/tools/compat \
 		-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
 



CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:54:21 UTC 2023

Modified Files:
src/tools/compat: configure.ac defs.mk.in

Log Message:
tools/compat: disable host CC warnings

Determine if the host CC supports flags to disable various
warnings similar to  GCC_*, CLANG_*, and CC_*,
and override the  equivalents in defs.mk.

Silences "warning: unknown warning option '...'" from our source.
External source (e.g., binutils and gcc) need their own fixes
to enhance their detection of supported clang compiler flags.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/tools/compat/configure.ac
cvs rdiff -u -r1.14 -r1.15 src/tools/compat/defs.mk.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:39:19 UTC 2023

Modified Files:
src/tools/compat: configure.ac defs.mk.in

Log Message:
tools/compat: detect supported host compiler flags

Define NB_CC_FLAG(FLAG) to use AX_CHECK_COMPILE_FLAG
to determine if the host compiler supports FLAG
and define and AC_SUBST CC_FLAG if so.

Use workarounds to force clang to hard-fail on unknown -Wwarning,
and gcc to use -WWARN to check unknown -Wno-WARN because the
latter doesn't cause an error in gcc.

In the future we could use NB_CC_FLAG([-fcommon]) for
older NetBSD release branches compiled with host gcc 10+.

Rework Darwin -no-cpp-precomp check to use NB_CC_FLAG().
Note: this flag probably hasn't been required on macOS (Darwin)
for a long time, but serves as a good example on how to use this.

Display varaibles at the end of configure to show what was detected.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/tools/compat/configure.ac
cvs rdiff -u -r1.13 -r1.14 src/tools/compat/defs.mk.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.102 src/tools/compat/configure.ac:1.103
--- src/tools/compat/configure.ac:1.102	Tue May 30 18:31:55 2023
+++ src/tools/compat/configure.ac	Tue May 30 18:39:19 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.102 2023/05/30 18:31:55 lukem Exp $
+#	$NetBSD: configure.ac,v 1.103 2023/05/30 18:39:19 lukem Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -20,9 +20,11 @@
 #
 
 AC_INIT([libnbcompat], [noversion], [lib-bug-peo...@netbsd.org])
-AC_CONFIG_HEADERS(nbtool_config.h)
-AC_CONFIG_FILES(defs.mk)
+AC_CONFIG_HEADERS([nbtool_config.h])
+AC_CONFIG_FILES([defs.mk])
+AC_CONFIG_MACRO_DIR([buildaux])
 
+m4_pattern_forbid([^AX_])
 m4_pattern_forbid([^NB_])
 
 # Autoheader header and footer
@@ -321,4 +323,37 @@ main(void)
 )
 ])
 
+dnl
+dnl Set per-warning CC_* variables if supported by HOST_CC.
+dnl
+
+dnl clang needs to fail if given an unknown -WWARN.
+cc_fail_unknown=
+AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],
+ [AS_VAR_APPEND([cc_fail_unknown], [-Werror=unknown-warning-option])])
+
+AC_DEFUN([NB_CC_FLAG], [dnl
+m4_pushdef([NB_FLAG], [$1])
+dnl gcc ignores unknown -Wno-WARN but will fail unknown equivalent -WWARN.
+m4_pushdef([NB_WFLAG], m4_bpatsubst(NB_FLAG, [^-Wno-], [-W]))
+m4_pushdef([NB_VAR], [CC]m4_translit(NB_FLAG, [-a-z], [_A-Z]))
+AX_CHECK_COMPILE_FLAG(NB_WFLAG, [AS_VAR_SET(NB_VAR,NB_FLAG)], [], [$cc_fail_unknown])
+AC_SUBST(NB_VAR)
+m4_popdef([NB_FLAG])
+m4_popdef([NB_WFLAG])
+m4_popdef([NB_VAR])
+]) dnl NB_CC_FLAG
+
+dnl Disable use of pre-compiled headers on Darwin.
+NB_CC_FLAG([-no-cpp-precomp])
+
+
 AC_OUTPUT()
+
+# Display results
+#
+AC_MSG_NOTICE([= Configuration results =])
+AC_MSG_NOTICE([CC  $CC])
+AC_MSG_NOTICE([CC_NO_CPP_PRECOMP   $CC_NO_CPP_PRECOMP])
+AC_MSG_NOTICE([LIBS$LIBS])
+AC_MSG_NOTICE([=])

Index: src/tools/compat/defs.mk.in
diff -u src/tools/compat/defs.mk.in:1.13 src/tools/compat/defs.mk.in:1.14
--- src/tools/compat/defs.mk.in:1.13	Tue May 30 18:31:55 2023
+++ src/tools/compat/defs.mk.in	Tue May 30 18:39:19 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: defs.mk.in,v 1.13 2023/05/30 18:31:55 lukem Exp $
+#	$NetBSD: defs.mk.in,v 1.14 2023/05/30 18:39:19 lukem Exp $
 #
 # Makefile fragment for building with libnbcompat and associated
 # include files.  It can also be used for building just with
@@ -71,10 +71,7 @@ HOST_BSHELL=	@BSHELL@
 
 BUILD_OSTYPE!=  uname -s
 
-# Disable use of pre-compiled headers on Darwin.
-.if ${BUILD_OSTYPE} == "Darwin"
-HOST_CPPFLAGS+=	-no-cpp-precomp
-.endif
+HOST_CFLAGS+=	@CC_NO_CPP_PRECOMP@
 
 HOST_CPPFLAGS+=	${COMPATINCFLAGS} -I${NETBSDSRCDIR}/tools/compat \
 		-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64



CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:39:19 UTC 2023

Modified Files:
src/tools/compat: configure.ac defs.mk.in

Log Message:
tools/compat: detect supported host compiler flags

Define NB_CC_FLAG(FLAG) to use AX_CHECK_COMPILE_FLAG
to determine if the host compiler supports FLAG
and define and AC_SUBST CC_FLAG if so.

Use workarounds to force clang to hard-fail on unknown -Wwarning,
and gcc to use -WWARN to check unknown -Wno-WARN because the
latter doesn't cause an error in gcc.

In the future we could use NB_CC_FLAG([-fcommon]) for
older NetBSD release branches compiled with host gcc 10+.

Rework Darwin -no-cpp-precomp check to use NB_CC_FLAG().
Note: this flag probably hasn't been required on macOS (Darwin)
for a long time, but serves as a good example on how to use this.

Display varaibles at the end of configure to show what was detected.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/tools/compat/configure.ac
cvs rdiff -u -r1.13 -r1.14 src/tools/compat/defs.mk.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat/buildaux

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:35:16 UTC 2023

Added Files:
src/tools/compat/buildaux: ax_check_compile_flag.m4

Log Message:
tools/compat: import AX_CHECK_COMPILE_FLAG

Import AX_CHECK_COMPILE_FLAG serial 6 from autoconf-archive
  https://github.com/autoconf-archive/autoconf-archive.git
as at commit 5b5ce7f on 2023-05-01.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tools/compat/buildaux/ax_check_compile_flag.m4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/tools/compat/buildaux/ax_check_compile_flag.m4
diff -u /dev/null src/tools/compat/buildaux/ax_check_compile_flag.m4:1.1
--- /dev/null	Tue May 30 18:35:16 2023
+++ src/tools/compat/buildaux/ax_check_compile_flag.m4	Tue May 30 18:35:16 2023
@@ -0,0 +1,53 @@
+# ===
+#  https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
+# ===
+#
+# SYNOPSIS
+#
+#   AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+#   Check whether the given FLAG works with the current language's compiler
+#   or gives an error.  (Warnings, however, are ignored)
+#
+#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+#   success/failure.
+#
+#   If EXTRA-FLAGS is defined, it is added to the current language's default
+#   flags (e.g. CFLAGS) when the check is done.  The check is thus made with
+#   the flags: "CFLAGS EXTRA-FLAGS FLAG".  This can for example be used to
+#   force the compiler to issue an error when a bad flag is given.
+#
+#   INPUT gives an alternative input source to AC_COMPILE_IFELSE.
+#
+#   NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+#   macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Guido U. Draheim 
+#   Copyright (c) 2011 Maarten Bosmans 
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.  This file is offered as-is, without any
+#   warranty.
+
+#serial 6
+
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
+  ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
+  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
+  AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+[AS_VAR_SET(CACHEVAR,[yes])],
+[AS_VAR_SET(CACHEVAR,[no])])
+  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+  [m4_default([$2], :)],
+  [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_COMPILE_FLAGS



CVS commit: src/tools/compat/buildaux

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:35:16 UTC 2023

Added Files:
src/tools/compat/buildaux: ax_check_compile_flag.m4

Log Message:
tools/compat: import AX_CHECK_COMPILE_FLAG

Import AX_CHECK_COMPILE_FLAG serial 6 from autoconf-archive
  https://github.com/autoconf-archive/autoconf-archive.git
as at commit 5b5ce7f on 2023-05-01.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tools/compat/buildaux/ax_check_compile_flag.m4

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:31:55 UTC 2023

Modified Files:
src/tools/compat: configure.ac defs.mk.in

Log Message:
tools/compat: don't expose HAVE_PTHREAD_H to make

Non of the tools Makefiles needs HAVE_PTHREAD_H, so don't
AC_SUBST it or provide in defs.mk.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/tools/compat/configure.ac
cvs rdiff -u -r1.12 -r1.13 src/tools/compat/defs.mk.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.101 src/tools/compat/configure.ac:1.102
--- src/tools/compat/configure.ac:1.101	Mon May 29 21:30:42 2023
+++ src/tools/compat/configure.ac	Tue May 30 18:31:55 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.101 2023/05/29 21:30:42 lukem Exp $
+#	$NetBSD: configure.ac,v 1.102 2023/05/30 18:31:55 lukem Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -321,7 +321,4 @@ main(void)
 )
 ])
 
-# Variables substituted via @VARNAME@ in defs.mk.in
-AC_SUBST(HAVE_PTHREAD_H, $ac_cv_header_pthread_h)
-
 AC_OUTPUT()

Index: src/tools/compat/defs.mk.in
diff -u src/tools/compat/defs.mk.in:1.12 src/tools/compat/defs.mk.in:1.13
--- src/tools/compat/defs.mk.in:1.12	Sun Dec  2 13:05:14 2012
+++ src/tools/compat/defs.mk.in	Tue May 30 18:31:55 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: defs.mk.in,v 1.12 2012/12/02 13:05:14 apb Exp $
+#	$NetBSD: defs.mk.in,v 1.13 2023/05/30 18:31:55 lukem Exp $
 #
 # Makefile fragment for building with libnbcompat and associated
 # include files.  It can also be used for building just with
@@ -83,5 +83,3 @@ HOST_CPPFLAGS+=	${COMPATINCFLAGS} -I${NE
 DPADD+=		${COMPATLIBDIR}/libnbcompat.a
 LDADD+=		-L${COMPATLIBDIR} -lnbcompat @LIBS@
 .endif # ! COMPATLIB_NO_LIB
-
-HAVE_PTHREAD_H=	@HAVE_PTHREAD_H@



CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:31:55 UTC 2023

Modified Files:
src/tools/compat: configure.ac defs.mk.in

Log Message:
tools/compat: don't expose HAVE_PTHREAD_H to make

Non of the tools Makefiles needs HAVE_PTHREAD_H, so don't
AC_SUBST it or provide in defs.mk.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/tools/compat/configure.ac
cvs rdiff -u -r1.12 -r1.13 src/tools/compat/defs.mk.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:27:04 UTC 2023

Modified Files:
src/tools/compat: Makefile

Log Message:
tools/compat: use autoreconf, support MAKEVERBOSE

Use autoreconf instead of autoconf + autoheader;
we'll need aclocal in the near future.

If MAKEVERBOSE >= 2, add -v to autoreconf.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/tools/compat/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/Makefile
diff -u src/tools/compat/Makefile:1.91 src/tools/compat/Makefile:1.92
--- src/tools/compat/Makefile:1.91	Tue May 23 20:20:54 2023
+++ src/tools/compat/Makefile	Tue May 30 18:27:04 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.91 2023/05/23 20:20:54 lukem Exp $
+#	$NetBSD: Makefile,v 1.92 2023/05/30 18:27:04 lukem Exp $
 
 HOSTLIB=	nbcompat
 
@@ -166,7 +166,6 @@ INSTALL=	${INSTALL_OBJ}/xinstall
 # Run "${TOOLDIR}/bin/nbmake-${MACHINE} regen" by hand after editing
 # configure.ac.  See more detailed instructions in configure.ac.
 regen:
-	${_MKMSG_REGEN} configure
-	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoconf
-	${_MKMSG_REGEN} nbtool_config.h.in
-	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoheader
+	${_MKMSG_REGEN} configure nbtool_config.h.in
+	cd ${.CURDIR} && ${TOOLDIR}/bin/${_TOOL_PREFIX}autoreconf \
+		${${MAKEVERBOSE} >= 2 :? -v :}



CVS commit: src/tools/compat

2023-05-30 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 30 18:27:04 UTC 2023

Modified Files:
src/tools/compat: Makefile

Log Message:
tools/compat: use autoreconf, support MAKEVERBOSE

Use autoreconf instead of autoconf + autoheader;
we'll need aclocal in the near future.

If MAKEVERBOSE >= 2, add -v to autoreconf.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/tools/compat/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-05-29 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Mon May 29 21:34:57 UTC 2023

Modified Files:
src/tools/compat: configure

Log Message:
tools/compat: regen


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/tools/compat/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.100 src/tools/compat/configure:1.101
--- src/tools/compat/configure:1.100	Tue May 23 20:22:11 2023
+++ src/tools/compat/configure	Mon May 29 21:34:57 2023
@@ -2247,12 +2247,13 @@ ac_config_headers="$ac_config_headers nb
 ac_config_files="$ac_config_files defs.mk"
 
 
+
+
 # Autoheader header and footer
 
 
 
 
-# AC_NETBSD
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -3312,7 +3313,7 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetBSD" >&5
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NetBSD" >&5
 $as_echo_n "checking for NetBSD... " >&6; }
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -4356,8 +4357,6 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
-
-
 	ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "$ac_includes_default"
 if test "x$ac_cv_type_uint8_t" = xyes; then :
 
@@ -4393,7 +4392,6 @@ fi
 fi
 
 
-
 	ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "$ac_includes_default"
 if test "x$ac_cv_type_uint16_t" = xyes; then :
 
@@ -4429,7 +4427,6 @@ fi
 fi
 
 
-
 	ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "$ac_includes_default"
 if test "x$ac_cv_type_uint32_t" = xyes; then :
 
@@ -4465,7 +4462,6 @@ fi
 fi
 
 
-
 	ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "$ac_includes_default"
 if test "x$ac_cv_type_uint64_t" = xyes; then :
 



CVS commit: src/tools/compat

2023-05-29 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Mon May 29 21:34:57 UTC 2023

Modified Files:
src/tools/compat: configure

Log Message:
tools/compat: regen


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/tools/compat/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-05-29 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Mon May 29 21:30:42 UTC 2023

Modified Files:
src/tools/compat: configure.ac

Log Message:
tools/compat/configure.ac: style tweaks

Use "NB_" prefix not "AC_" for our macros ("AC_" is for autoconf).
Fail is NB_ macro isn't defined.
Use AC_DEFUN() instead of define().
Consistently use () in zero argument macro calls.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/tools/compat/configure.ac

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.100 src/tools/compat/configure.ac:1.101
--- src/tools/compat/configure.ac:1.100	Tue May 23 19:53:24 2023
+++ src/tools/compat/configure.ac	Mon May 29 21:30:42 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.100 2023/05/23 19:53:24 lukem Exp $
+#	$NetBSD: configure.ac,v 1.101 2023/05/29 21:30:42 lukem Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -23,6 +23,8 @@ AC_INIT([libnbcompat], [noversion], [lib
 AC_CONFIG_HEADERS(nbtool_config.h)
 AC_CONFIG_FILES(defs.mk)
 
+m4_pattern_forbid([^NB_])
+
 # Autoheader header and footer
 AH_TOP([/*  $][NetBSD$*/
  
@@ -32,8 +34,8 @@ AH_TOP([/*  $][NetBSD$*/
 AH_BOTTOM([#include "compat_defs.h"
 #endif /* !__NETBSD_NBTOOL_CONFIG_H__ */])
 
-AC_DEFUN([AC_NETBSD],
-[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_DEFUN([NB_NETBSD], [dnl
+  AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
   AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
   AC_MSG_CHECKING([for NetBSD])
   AC_EGREP_CPP(yes,
@@ -46,17 +48,17 @@ AC_DEFUN([AC_NETBSD],
 	 AC_DEFINE([_POSIX_C_SOURCE], 200112L, [Define for NetBSD headers.])
 	 AC_DEFINE([_XOPEN_SOURCE], 600, [Define for NetBSD headers.])],
 	[AC_MSG_RESULT([no])])
-])# AC_NETBSD
+])dnl NB_NETBSD
 
-AC_NETBSD
+NB_NETBSD()
 AC_PATH_PROG(BSHELL, sh, )
 if test x"$BSHELL" = x; then
 	AC_MSG_ERROR([sh must be somewhere on \$PATH])
 fi
 AC_DEFINE_UNQUOTED([PATH_BSHELL], "$BSHELL", [Path to sh(1).])
 
-AC_C_BIGENDIAN
-AC_HEADER_STDC
+AC_C_BIGENDIAN()
+AC_HEADER_STDC()
 
 # Confirm existence of zlib.  (This is available as a default install
 # option on many OS's; this could be added as a reachover build in the
@@ -77,7 +79,7 @@ AC_CHECK_HEADERS(sys/ioctl.h sys/mman.h 
 	AC_MSG_ERROR([standard system header file not found]))
 
 # Find headers that may not be available.
-AC_HEADER_DIRENT
+AC_HEADER_DIRENT()
 AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h stdio_ext.h \
 	getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h sys/uio.h)
 AC_CHECK_HEADERS(sys/bswap.h machine/bswap.h sys/cdefs.h machine/endian.h \
@@ -104,7 +106,7 @@ AC_CHECK_HEADERS(netconfig.h,,
 	fi])
 
 # Typedefs.
-AC_TYPE_SIZE_T
+AC_TYPE_SIZE_T()
 AC_CHECK_TYPES([id_t, long long, u_long, u_char, u_short, u_int, u_quad_t])
 AC_CHECK_TYPES([uchar_t, ushort_t, uint_t, ulong_t])
 AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1,
@@ -142,7 +144,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 dnl XXX - This is UGLY.  Need a better way to homogenize the bitsized types,
 dnl including use of compiler primitive types via AC_CHECK_SIZEOF.
 dnl
-define([NB_CHECK_INTTYPE], [
+AC_DEFUN([NB_CHECK_INTTYPE], [dnl
 	AC_CHECK_TYPE(uint][$1][_t,, [
 		AC_CHECK_TYPE(u_int][$1][_t,
 			AC_DEFINE(uint][$1][_t, u_int][$1][_t, \
@@ -155,7 +157,7 @@ define([NB_CHECK_INTTYPE], [
   [Define if you have uint][$1][_t, but not u_int][$1][_t.]),
 			AC_MSG_ERROR([cannot find a suitable type for u_int][$1][_t]))
 	])
-])
+])dnl NB_CHECK_INTTYPE
 
 NB_CHECK_INTTYPE(8)
 NB_CHECK_INTTYPE(16)
@@ -218,7 +220,7 @@ AC_CHECK_DECLS([optind, optreset],,, [
 AC_CHECK_DECLS(sys_signame,,, [#include ])
 
 # Library functions (where a .h check isn't enough).
-AC_FUNC_ALLOCA
+AC_FUNC_ALLOCA()
 AC_CHECK_FUNCS(atoll asprintf asnprintf basename devname dirfd dirname \
 	dispatch_semaphore_create \
 	dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \
@@ -322,4 +324,4 @@ main(void)
 # Variables substituted via @VARNAME@ in defs.mk.in
 AC_SUBST(HAVE_PTHREAD_H, $ac_cv_header_pthread_h)
 
-AC_OUTPUT
+AC_OUTPUT()



CVS commit: src/tools/compat

2023-05-29 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Mon May 29 21:30:42 UTC 2023

Modified Files:
src/tools/compat: configure.ac

Log Message:
tools/compat/configure.ac: style tweaks

Use "NB_" prefix not "AC_" for our macros ("AC_" is for autoconf).
Fail is NB_ macro isn't defined.
Use AC_DEFUN() instead of define().
Consistently use () in zero argument macro calls.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/tools/compat/configure.ac

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2023-05-23 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 23 20:22:11 UTC 2023

Modified Files:
src/tools/compat: configure nbtool_config.h.in

Log Message:
tools/compat: regen for dispatch_semaphore_create


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/tools/compat/configure
cvs rdiff -u -r1.53 -r1.54 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.99 src/tools/compat/configure:1.100
--- src/tools/compat/configure:1.99	Thu Feb 25 13:41:58 2021
+++ src/tools/compat/configure	Tue May 23 20:22:11 2023
@@ -5294,6 +5294,7 @@ _ACEOF
 fi
 
 for ac_func in atoll asprintf asnprintf basename devname dirfd dirname \
+	dispatch_semaphore_create \
 	dprintf esetfunc fgetln flock fpurge __fpurge futimes getline \
 	getopt getopt_long group_from_gid gid_from_group \
 	heapsort isblank issetugid lchflags lchmod lchown lutimes mkstemp \

Index: src/tools/compat/nbtool_config.h.in
diff -u src/tools/compat/nbtool_config.h.in:1.53 src/tools/compat/nbtool_config.h.in:1.54
--- src/tools/compat/nbtool_config.h.in:1.53	Thu Feb 25 13:41:58 2021
+++ src/tools/compat/nbtool_config.h.in	Tue May 23 20:22:11 2023
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated from configure.ac by autoheader.  */
 
-/*  $NetBSD: nbtool_config.h.in,v 1.53 2021/02/25 13:41:58 christos Exp $*/
+/*  $NetBSD: nbtool_config.h.in,v 1.54 2023/05/23 20:22:11 lukem Exp $*/
  
 #ifndef __NETBSD_NBTOOL_CONFIG_H__
 #define __NETBSD_NBTOOL_CONFIG_H__
@@ -8,7 +8,7 @@
 /* Define if building universal (internal helper macro) */
 #undef AC_APPLE_UNIVERSAL_BUILD
 
-/* Define to 1 if your `fparseln' function is broken. */
+/* Define to 1 if your 'fparseln' function is broken. */
 #undef BROKEN_FPARSELN
 
 /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
@@ -437,6 +437,9 @@
 /* Define to 1 if `__dd_fd' is a member of `DIR'. */
 #undef HAVE_DIR___DD_FD
 
+/* Define to 1 if you have the `dispatch_semaphore_create' function. */
+#undef HAVE_DISPATCH_SEMAPHORE_CREATE
+
 /* Define to 1 if you have the `dprintf' function. */
 #undef HAVE_DPRINTF
 



CVS commit: src/tools/compat

2023-05-23 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue May 23 20:22:11 UTC 2023

Modified Files:
src/tools/compat: configure nbtool_config.h.in

Log Message:
tools/compat: regen for dispatch_semaphore_create


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/tools/compat/configure
cvs rdiff -u -r1.53 -r1.54 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2019-06-22 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Jun 22 14:40:33 UTC 2019

Modified Files:
src/tools/compat: configure

Log Message:
Bring back two lines deleted by accident.  From Kamil Rytarowski.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/tools/compat/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.96 src/tools/compat/configure:1.97
--- src/tools/compat/configure:1.96	Sat Jun 22 13:42:53 2019
+++ src/tools/compat/configure	Sat Jun 22 14:40:33 2019
@@ -5130,6 +5130,8 @@ else
 # ifdef _MSC_VER
 #  include 
 #  define alloca _alloca
+# elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
+#   include 
 # else
 #  ifdef HAVE_ALLOCA_H
 #   include 



CVS commit: src/tools/compat

2019-06-22 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Sat Jun 22 14:40:33 UTC 2019

Modified Files:
src/tools/compat: configure

Log Message:
Bring back two lines deleted by accident.  From Kamil Rytarowski.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/tools/compat/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2019-06-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun 19 23:35:55 UTC 2019

Modified Files:
src/tools/compat: configure nbtool_config.h.in

Log Message:
regen tools/compat


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/tools/compat/configure
cvs rdiff -u -r1.50 -r1.51 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.94 src/tools/compat/configure:1.95
--- src/tools/compat/configure:1.94	Wed Jun 19 03:40:15 2019
+++ src/tools/compat/configure	Wed Jun 19 23:35:55 2019
@@ -4228,6 +4228,43 @@ _ACEOF
 
 fi
 
+ac_fn_c_check_type "$LINENO" "uchar_t" "ac_cv_type_uchar_t" "$ac_includes_default"
+if test "x$ac_cv_type_uchar_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UCHAR_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "ushort_t" "ac_cv_type_ushort_t" "$ac_includes_default"
+if test "x$ac_cv_type_ushort_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_USHORT_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "uint_t" "ac_cv_type_uint_t" "$ac_includes_default"
+if test "x$ac_cv_type_uint_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UINT_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "ulong_t" "ac_cv_type_ulong_t" "$ac_includes_default"
+if test "x$ac_cv_type_ulong_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ULONG_T 1
+_ACEOF
+
+
+fi
+
 ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include 
 #ifdef HAVE_RPC_TYPES_H
 #include 

Index: src/tools/compat/nbtool_config.h.in
diff -u src/tools/compat/nbtool_config.h.in:1.50 src/tools/compat/nbtool_config.h.in:1.51
--- src/tools/compat/nbtool_config.h.in:1.50	Wed Jun 19 03:40:15 2019
+++ src/tools/compat/nbtool_config.h.in	Wed Jun 19 23:35:55 2019
@@ -1,6 +1,6 @@
 /* nbtool_config.h.in.  Generated from configure.ac by autoheader.  */
 
-/*  $NetBSD: nbtool_config.h.in,v 1.50 2019/06/19 03:40:15 kamil Exp $*/
+/*  $NetBSD: nbtool_config.h.in,v 1.51 2019/06/19 23:35:55 kamil Exp $*/
  
 #ifndef __NETBSD_NBTOOL_CONFIG_H__
 #define __NETBSD_NBTOOL_CONFIG_H__
@@ -786,15 +786,27 @@
 /* Define to 1 if you have the  header file. */
 #undef HAVE_TERMIOS_H
 
+/* Define to 1 if the system has the type `uchar_t'. */
+#undef HAVE_UCHAR_T
+
 /* Define to 1 if you have the `uid_from_user' function. */
 #undef HAVE_UID_FROM_USER
 
+/* Define to 1 if the system has the type `uint_t'. */
+#undef HAVE_UINT_T
+
+/* Define to 1 if the system has the type `ulong_t'. */
+#undef HAVE_ULONG_T
+
 /* Define to 1 if you have the  header file. */
 #undef HAVE_UNISTD_H
 
 /* Define to 1 if you have the `user_from_uid' function. */
 #undef HAVE_USER_FROM_UID
 
+/* Define to 1 if the system has the type `ushort_t'. */
+#undef HAVE_USHORT_T
+
 /* Define to 1 if you have the  header file. */
 #undef HAVE_UTIL_H
 



CVS commit: src/tools/compat

2019-06-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun 19 23:35:55 UTC 2019

Modified Files:
src/tools/compat: configure nbtool_config.h.in

Log Message:
regen tools/compat


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/tools/compat/configure
cvs rdiff -u -r1.50 -r1.51 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2019-06-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun 19 23:33:07 UTC 2019

Modified Files:
src/tools/compat: compat_defs.h configure.ac

Log Message:
Add more SunOS types to tools/compat

Add fallback defintions of: uchar_t, ushort_t, uint_t, ulong_t.

Needed by the libctf code on Ubuntu 16.x.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/tools/compat/compat_defs.h
cvs rdiff -u -r1.95 -r1.96 src/tools/compat/configure.ac

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2019-06-19 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun 19 23:33:07 UTC 2019

Modified Files:
src/tools/compat: compat_defs.h configure.ac

Log Message:
Add more SunOS types to tools/compat

Add fallback defintions of: uchar_t, ushort_t, uint_t, ulong_t.

Needed by the libctf code on Ubuntu 16.x.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/tools/compat/compat_defs.h
cvs rdiff -u -r1.95 -r1.96 src/tools/compat/configure.ac

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.115 src/tools/compat/compat_defs.h:1.116
--- src/tools/compat/compat_defs.h:1.115	Wed Jun 19 03:40:15 2019
+++ src/tools/compat/compat_defs.h	Wed Jun 19 23:33:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.115 2019/06/19 03:40:15 kamil Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.116 2019/06/19 23:33:07 kamil Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -79,6 +79,22 @@ typedef unsigned int u_int;
 typedef unsigned short u_short;
 #endif
 
+#if !HAVE_UCHAR_T
+typedef unsigned char uchar_t;
+#endif
+
+#if !HAVE_USHORT_T
+typedef unsigned short ushort_t;
+#endif
+
+#if !HAVE_UINT_T
+typedef unsigned int uint_t;
+#endif
+
+#if !HAVE_ULONG_T
+typedef unsigned long ulong_t;
+#endif
+
 /* System headers needed for (re)definitions below. */
 
 #include 

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.95 src/tools/compat/configure.ac:1.96
--- src/tools/compat/configure.ac:1.95	Wed Jun 19 03:40:15 2019
+++ src/tools/compat/configure.ac	Wed Jun 19 23:33:07 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.95 2019/06/19 03:40:15 kamil Exp $
+#	$NetBSD: configure.ac,v 1.96 2019/06/19 23:33:07 kamil Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -98,6 +98,7 @@ AC_CHECK_HEADERS(rpc/types.h netconfig.h
 # Typedefs.
 AC_TYPE_SIZE_T
 AC_CHECK_TYPES([id_t, long long, u_long, u_char, u_short, u_int, u_quad_t])
+AC_CHECK_TYPES([uchar_t, ushort_t, uint_t, ulong_t])
 AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAVE_SOCKLEN_T], 1,
 			  [Define if you have the socklen_t type.])],,
 [#include 



CVS commit: src/tools/compat

2019-06-18 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun 19 03:40:15 UTC 2019

Modified Files:
src/tools/compat: compat_defs.h configure configure.ac
nbtool_config.h.in

Log Message:
Add sys/uio.h & enum uio_seg, enum uio_rw to tools/compat

This is needed for bootstrapping the tools on Ubuntu 16.x.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/tools/compat/compat_defs.h
cvs rdiff -u -r1.93 -r1.94 src/tools/compat/configure
cvs rdiff -u -r1.94 -r1.95 src/tools/compat/configure.ac
cvs rdiff -u -r1.49 -r1.50 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2019-06-18 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun 19 03:40:15 UTC 2019

Modified Files:
src/tools/compat: compat_defs.h configure configure.ac
nbtool_config.h.in

Log Message:
Add sys/uio.h & enum uio_seg, enum uio_rw to tools/compat

This is needed for bootstrapping the tools on Ubuntu 16.x.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.115 src/tools/compat/compat_defs.h
cvs rdiff -u -r1.93 -r1.94 src/tools/compat/configure
cvs rdiff -u -r1.94 -r1.95 src/tools/compat/configure.ac
cvs rdiff -u -r1.49 -r1.50 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/compat/compat_defs.h
diff -u src/tools/compat/compat_defs.h:1.114 src/tools/compat/compat_defs.h:1.115
--- src/tools/compat/compat_defs.h:1.114	Thu Aug 30 12:05:34 2018
+++ src/tools/compat/compat_defs.h	Wed Jun 19 03:40:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_defs.h,v 1.114 2018/08/30 12:05:34 christos Exp $	*/
+/*	$NetBSD: compat_defs.h,v 1.115 2019/06/19 03:40:15 kamil Exp $	*/
 
 #ifndef	__NETBSD_COMPAT_DEFS_H__
 #define	__NETBSD_COMPAT_DEFS_H__
@@ -52,6 +52,17 @@ typedef unsigned int id_t;
 typedef int socklen_t;
 #endif
 
+#if !HAVE_ENUM_UIO_RW
+enum uio_rw { UIO_READ, UIO_WRITE };
+#endif
+
+#if !HAVE_ENUM_UIO_SEG
+enum uio_seg {
+	UIO_USERSPACE,		/* from user data space */
+	UIO_SYSSPACE		/* from system space */
+};
+#endif
+
 #if !HAVE_U_LONG
 typedef unsigned long u_long;
 #endif
@@ -113,6 +124,10 @@ typedef unsigned short u_short;
 #include 
 #endif
 
+#if HAVE_SYS_UIO_H
+#include 
+#endif
+
 #ifdef _NETBSD_SOURCE
 #error _NETBSD_SOURCE is *not* to be defined.
 #endif

Index: src/tools/compat/configure
diff -u src/tools/compat/configure:1.93 src/tools/compat/configure:1.94
--- src/tools/compat/configure:1.93	Thu Aug 30 12:05:34 2018
+++ src/tools/compat/configure	Wed Jun 19 03:40:15 2019
@@ -4098,7 +4098,8 @@ fi
 fi
 
 for ac_header in sys/mtio.h sys/sysmacros.h sys/syslimits.h stdio_ext.h \
-	getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h
+	getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h \
+	sys/uio.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -4240,6 +4241,54 @@ $as_echo "#define HAVE_SOCKLEN_T 1" >>co
 fi
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enum uio_rw" >&5
+$as_echo_n "checking for enum uio_rw... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include 
+#ifdef HAVE_SYS_UIO_H
+#include 
+#endif
+int
+main ()
+{
+enum uio_rw rw;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_ENUM_UIO_RW 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for enum uio_seg" >&5
+$as_echo_n "checking for enum uio_seg... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include 
+#ifdef HAVE_SYS_UIO_H
+#include 
+#endif
+int
+main ()
+{
+enum uio_seg seg;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+$as_echo "#define HAVE_ENUM_UIO_SEG 1" >>confdefs.h
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 
 
 
@@ -7416,4 +7465,3 @@ if test -n "$ac_unrecognized_opts" && te
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
-

Index: src/tools/compat/configure.ac
diff -u src/tools/compat/configure.ac:1.94 src/tools/compat/configure.ac:1.95
--- src/tools/compat/configure.ac:1.94	Thu Aug 30 12:05:34 2018
+++ src/tools/compat/configure.ac	Wed Jun 19 03:40:15 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: configure.ac,v 1.94 2018/08/30 12:05:34 christos Exp $
+#	$NetBSD: configure.ac,v 1.95 2019/06/19 03:40:15 kamil Exp $
 #
 # Autoconf definition file for libnbcompat.
 #
@@ -79,7 +79,8 @@ AC_CHECK_HEADERS(sys/ioctl.h sys/mman.h 
 # Find headers that may not be available.
 AC_HEADER_DIRENT
 AC_CHECK_HEADERS(sys/mtio.h sys/sysmacros.h sys/syslimits.h stdio_ext.h \
-	getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h)
+	getopt.h features.h malloc.h sys/poll.h pthread.h stddef.h rpc/types.h \
+	sys/uio.h)
 AC_CHECK_HEADERS(sys/bswap.h machine/bswap.h sys/cdefs.h machine/endian.h \
 	sys/endian.h sys/featuretest.h err.h inttypes.h libgen.h paths.h \
 	libgen.h stdint.h util.h resolv.h arpa/nameser.h,,
@@ -105,6 +106,24 @@ AC_CHECK_TYPE(socklen_t, [AC_DEFINE([HAV
 #endif
 #include ])
 
+AC_MSG_CHECKING([for enum uio_rw])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include 
+#ifdef HAVE_SYS_UIO_H
+#include 
+#endif]],
+[[enum uio_rw rw;]])],[AC_DEFINE([HAVE_ENUM_UIO_RW], 1,
+			[Define if you have the enum uio_rw type.])

Re: CVS commit: src/tools/compat

2018-09-09 Thread Christos Zoulas
In article <20180909191722.120faf...@cvs.netbsd.org>,
Palle Lyckegaard  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  palle
>Date:  Sun Sep  9 19:17:21 UTC 2018
>
>Modified Files:
>   src/tools/compat: README
>
>Log Message:
>Add instructions for building NetBSD on modern Solaris 11 hosts
>
>
>To generate a diff of this commit:
>cvs rdiff -u -r1.12 -r1.13 src/tools/compat/README
>
>Please note that diffs are not public domain; they are subject to the
>copyright notices on the relevant files.
>
>
>-=-=-=-=-=-
>
>Modified files:
>
>Index: src/tools/compat/README
>diff -u src/tools/compat/README:1.12 src/tools/compat/README:1.13
>--- src/tools/compat/README:1.12   Tue Apr  5 00:21:22 2005
>+++ src/tools/compat/READMESun Sep  9 19:17:21 2018
>@@ -1,4 +1,4 @@
>-$NetBSD: README,v 1.12 2005/04/05 00:21:22 jmc Exp $
>+$NetBSD: README,v 1.13 2018/09/09 19:17:21 palle Exp $
> 
> Special notes for cross-hosting a NetBSD build on certain platforms.  
> Only those platforms which have been tested to complete a "build.sh" run
>@@ -65,6 +65,8 @@ NETBSD (earlier releases):
> 
> SOLARIS:
> 
>+(updated instruction for Solaris 11 further below)
>+
> * Tested on Solaris/x86 8 (5.8) with gcc 2.95.2 and Solaris/sparc 8 (5.8)
>   with gcc 3.2 (not yet tested with SUNWspro).
> 
>@@ -85,3 +87,16 @@ SOLARIS:
>   /usr/ucb may optionally be placed before /usr/bin, per your preference,
>   but /usr/ucb *MUST NOT* be before /usr/ccs/bin or before the path to
>   the host C and C++ compilers.
>+
>+Solaris 11:
>+
>+* Solaris 11.3
>+ * Set PATH to /usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
>+ * Set HOST_CC to /usr/bin/gcc
>+
>+* Solaris 11.4
>+ * Install gcc-5 since the default installed gcc-7 has issues when compiling 
>+   toolchain version of groff (hypot())

Is that the only problem? We should just fix it.
And we can set the path to /usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/usr/bin
for both versions... So there is only one set of instructions...


christos



Re: CVS commit: src/tools/compat

2017-12-09 Thread Joerg Sonnenberger
On Sat, Dec 09, 2017 at 04:22:53AM +, Sevan Janiyan wrote:
> Module Name:  src
> Committed By: sevan
> Date: Sat Dec  9 04:22:53 UTC 2017
> 
> Modified Files:
>   src/tools/compat: configure.ac
> 
> Log Message:
> Add asnprintf() to the AC_CHECK_DECLS list.
> Resolves conflict when cross compiling on Cygwin the provided implementation
> does not get picked up.
> 
> Closes PR toolchain/52797

This change is wrong and makes the situation worse. The asnprintf on
Cygwin is broken by the agreed upon interface of asnprintf.

Joerg


Re: CVS commit: src/tools/compat

2017-10-02 Thread David H. Gutteridge
> Module Name:src
> Committed By:   christos
> Date:   Mon Oct  2 22:19:45 UTC 2017
> 
> Modified Files:
> src/tools/compat: compat_defs.h configure.ac fpurge.c
> 
> Log Message:
> handle __fpurge being declared in 

This has broken the tools build of awk for me.

cc -O -D__EXTENSIONS__ -I/home/disciple/netbsd-
current/src/obj/tooldir.NetBSD-8.99.3-amd64/include/compat
-I/home/disciple/netbsd-current/src/tools/compat
-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -I/home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist -I. -c
-o run.lo.o -Wno-format-nonliteral   /home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist/run.c
/home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist/run.c:
In function 'closeall':
/home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist/run.c:1
873:12: error: void value not ignored as it ought to be
 stat = fpurge(files[i].fp) == EOF;
^

*** Failed target:  run.lo
*** Failed command: cc -O -D__EXTENSIONS__ -I/home/disciple/netbsd-
current/src/obj/tooldir.NetBSD-8.99.3-amd64/include/compat
-I/home/disciple/netbsd-current/src/tools/compat
-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -I/home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist -I. -c
-o run.lo.o -Wno-format-nonliteral /home/disciple/netbsd-
current/src/tools/awk/../../external/historical/nawk/bin/../dist/run.c
*** Error code 1

Stop.

Reverting this change fixes the build.

Regards,

Dave



Re: CVS commit: src/tools/compat

2016-02-29 Thread Aymeric Vincent

chris...@astron.com (Christos Zoulas) writes:

> Can you explain how it breaks? Is it because of the locale settings?

Sure, and no: it's simply because it uses [[:<:]] and [[:>:]] as word
delimiters, and that appears to be a BSD extension.

Regards,
 Aymeric


Re: CVS commit: src/tools/compat

2016-02-29 Thread Christos Zoulas
In article <20160229221929.7346bf...@cvs.netbsd.org>,
Aymeric Vincent  wrote:
>-=-=-=-=-=-
>
>Module Name:   src
>Committed By:  aymeric
>Date:  Mon Feb 29 22:19:29 UTC 2016
>
>Modified Files:
>   src/tools/compat: Makefile
>Added Files:
>   src/tools/compat: regex.h
>
>Log Message:
>add our libc's regex implementation to libnbcompat.
>
>This way, nbsed picks it up and it unbreaks the build of xf86-video-intel-old's
>man page under Linux and probably other future changes which rightfully expect
>the (net)bsd behaviour.

Can you explain how it breaks? Is it because of the locale settings?

christos



Re: CVS commit: src/tools/compat

2015-09-17 Thread Paul Goyette

(Resend with valid subject line)


Module Name:src
Committed By:   christos
Date:   Thu Sep 17 02:22:47 UTC 2015

Modified Files:
   src/tools/compat: Makefile

Log Message:
make this more robust by using .CURDIR to cd.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/tools/compat/Makefile


This seems to have broken the build for amd64.  The following failure occurs 
while building tools target:


...
#   install  /build/netbsd-local/tools/x86_64/amd64/include/compat/arpa
/build/netbsd-local/obj/amd64/tools/binstall/xinstall -d 
/build/netbsd-local/tools/x86_64/amd64/include/compat/arpa
#   install 
/build/netbsd-local/tools/x86_64/amd64/include/compat/nbtool_config.h
/build/netbsd-local/obj/amd64/tools/binstall/xinstall -c  -r nbtool_config.h 
/build/netbsd-local/tools/x86_64/amd64/include/compat/nbtool_config.h
cd: can't cd to /build/netbsd-local/src/tools/compat/include
*** [includes] Error code 2

nbmake[2]: stopped in /build/netbsd-local/src/tools/compat
1 error

+--+--+-+
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
+--+--+-+


Re: CVS commit: src/tools/compat

2013-02-16 Thread Christos Zoulas
On Feb 17,  9:49am, tsut...@ceres.dti.ne.jp (Izumi Tsutsui) wrote:
-- Subject: Re: CVS commit: src/tools/compat

| > Module Name:src
| > Committed By:   christos
| > Date:   Sun Feb 17 00:34:11 UTC 2013
| > 
| > Modified Files:
| > src/tools/compat: compat_defs.h configure.ac
| > 
| > Log Message:
| > cygwin defines u_quad_t in , so include this to the headers
| > we include and test by default.
| 
| Now does it work?
| Last time I tried, it failed because NetBSD's  defined
| enum_t and src/usr.bin/xlint/lint1/lint1.h for tools lint(1) also
| defined different enum_t.

I renamed lint's enum_t. And yes, it works. My build is doing libraries.

christos


Re: CVS commit: src/tools/compat

2013-02-16 Thread Izumi Tsutsui
> Module Name:  src
> Committed By: christos
> Date: Sun Feb 17 00:34:11 UTC 2013
> 
> Modified Files:
>   src/tools/compat: compat_defs.h configure.ac
> 
> Log Message:
> cygwin defines u_quad_t in , so include this to the headers
> we include and test by default.

Now does it work?
Last time I tried, it failed because NetBSD's  defined
enum_t and src/usr.bin/xlint/lint1/lint1.h for tools lint(1) also
defined different enum_t.
---
Izumi Tsutsui


Re: CVS commit: src/tools/compat

2012-12-02 Thread David Laight
On Sun, Dec 02, 2012 at 01:05:14PM +, Alan Barrett wrote:
> Module Name:  src
> Committed By: apb
> Date: Sun Dec  2 13:05:14 UTC 2012
> 
> Modified Files:
>   src/tools/compat: defs.mk.in
> 
> Log Message:
> Change the default value of COMPATLIB_UNINSTALLED to no, now that
> all users of comapt/defs.mk have been adjusted.  This is the last
> commit related to fixing PR 47188.

Phew :-)

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/tools/compat

2012-06-03 Thread Alan Barrett

On Sun, 03 Jun 2012, Joerg Sonnenberger wrote:

Log Message:
Add __predict_true / __predict_false definitions.



+#undef __predict_false
+#define __predict_false(x) x
+#undef __predict_true
+#define __predict_true(x) x


Please parenthesise the definitions.

I don't know whether it's worth defining them in a 
compiler-dependent way, or using #ifndef to pick up any definition 
provided by the host system.


--apb (Alan Barrett)


Re: CVS commit: src/tools/compat/sys

2010-03-27 Thread Christos Zoulas
On Mar 27,  8:19am, christoph_eg...@gmx.de (Christoph Egger) wrote:
-- Subject: Re: CVS commit: src/tools/compat/sys

| On 26.03.10 22:34, Christos Zoulas wrote:
| > In article <1933.1269630...@splode.eterna.com.au>,
| > matthew green   wrote:
| >>   
| >>   
| >>   tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
| >>   'CLOCK_REALTIME' undeclared (first use in this function)
| >>   
| >>
| >>
| >> shouldn't this be fixed with something in nbtool_config.h?
| > 
| > Just back the whole thing out; I fixed it in the dtrace sys/time.h where it
| > belongs.
| 
| Done. See
| http://mail-index.netbsd.org/source-changes/2010/03/27/msg008205.html
| 
| Christoph

Thanks!

christos


Re: CVS commit: src/tools/compat/sys

2010-03-27 Thread Christoph Egger
On 26.03.10 22:34, Christos Zoulas wrote:
> In article <1933.1269630...@splode.eterna.com.au>,
> matthew green   wrote:
>>   
>>   
>>   tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
>>   'CLOCK_REALTIME' undeclared (first use in this function)
>>   
>>
>>
>> shouldn't this be fixed with something in nbtool_config.h?
> 
> Just back the whole thing out; I fixed it in the dtrace sys/time.h where it
> belongs.

Done. See
http://mail-index.netbsd.org/source-changes/2010/03/27/msg008205.html

Christoph


Re: CVS commit: src/tools/compat/sys

2010-03-26 Thread Christos Zoulas
In article <1933.1269630...@splode.eterna.com.au>,
matthew green   wrote:
>   
>   
>   tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
>   'CLOCK_REALTIME' undeclared (first use in this function)
>   
>
>
>shouldn't this be fixed with something in nbtool_config.h?

Just back the whole thing out; I fixed it in the dtrace sys/time.h where it
belongs.

christos



Re: CVS commit: src/tools/compat/sys

2010-03-26 Thread Matt Thomas

On Mar 26, 2010, at 12:00 PM, matthew green wrote:

> 
>   
>   tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
>   'CLOCK_REALTIME' undeclared (first use in this function)
>   
> 
> 
> shouldn't this be fixed with something in nbtool_config.h?

That's what I was thinking since ctf on cross host isn't that useful.



re: CVS commit: src/tools/compat/sys

2010-03-26 Thread matthew green
   
   
   tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
   'CLOCK_REALTIME' undeclared (first use in this function)
   


shouldn't this be fixed with something in nbtool_config.h?


Re: CVS commit: src/tools/compat/sys

2010-03-26 Thread Christoph Egger

 Original-Nachricht 
> Datum: Sat, 27 Mar 2010 03:03:06 +1100
> Von: matthew green 
> An: "Christoph Egger" 
> CC: source-changes-d@NetBSD.org
> Betreff: re: CVS commit: src/tools/compat/sys

> 
>
>>toolchain buildfix on OSX with MKDTRACE=yes:
>>
>>The host  doesn't provide CLOCK_REALTIME but
>>ctf uses it.
>>See
> http://mail-index.netbsd.org/current-users/2010/03/20/msg012963.html
>> 
>> this seems bogus to me.
>> 
>> please only define it if it isn't defined, at least.
>
>
>I tried the other way around before I posted the my fix
>to the list:
>
>#include_next 
>
>#ifndef CLOCK_REALTIME
>#define CLOCK_REALTIME 0
>#endif
>
>But this failed the same way: CLOCK_REALTIME undeclared.
> 
> hmmm, could you post the error?  thanks.


tools/ctfconvert/../../external/cddl/osnet/sys/sys/time.h:71: error:
'CLOCK_REALTIME' undeclared (first use in this function)

   
>Note, ctf uses CLOCK_REALTIME in the same header where it
>includes sys/time.h.
> 
> BTW, i'm not sure that using #include_next is OK (it's gcc
> specific) and i don't see it used elsewhere in a quick look.

If you want to see that go away then ctf needs to be fixed first
(which implies to wait for darran@ to be back from vacation
in first place :))
See line 34 in ctf's sys/time.h (above file where error occured).
 
Christoph


re: CVS commit: src/tools/compat/sys

2010-03-26 Thread matthew green

   
   >toolchain buildfix on OSX with MKDTRACE=yes:
   >
   >The host  doesn't provide CLOCK_REALTIME but
   >ctf uses it.
   >See http://mail-index.netbsd.org/current-users/2010/03/20/msg012963.html
   > 
   > this seems bogus to me.
   > 
   > please only define it if it isn't defined, at least.
   
   
   I tried the other way around before I posted the my fix
   to the list:
   
   #include_next 
   
   #ifndef CLOCK_REALTIME
   #define CLOCK_REALTIME 0
   #endif
   
   But this failed the same way: CLOCK_REALTIME undeclared.

hmmm, could you post the error?  thanks.
   
   Note, ctf uses CLOCK_REALTIME in the same header where it
   includes sys/time.h.

BTW, i'm not sure that using #include_next is OK (it's gcc
specific) and i don't see it used elsewhere in a quick look.

   >No comments.
   > 
   > try posting to the right mailing list.  tech-toolchain would
   > be the right list for this sort of change.
   
   Thanks for the hint.

np.


Re: re: CVS commit: src/tools/compat/sys

2010-03-26 Thread Christoph Egger

> 
>Module Name:   src
>Committed By:  cegger
>Date:  Fri Mar 26 07:16:12 UTC 2010
>
>Added Files:
>   src/tools/compat/sys: time.h
>
>Log Message:
>toolchain buildfix on OSX with MKDTRACE=yes:
>
>The host  doesn't provide CLOCK_REALTIME but
>ctf uses it.
>See http://mail-index.netbsd.org/current-users/2010/03/20/msg012963.html
> 
> this seems bogus to me.
> 
> please only define it if it isn't defined, at least.


I tried the other way around before I posted the my fix
to the list:

#include_next 

#ifndef CLOCK_REALTIME
#define CLOCK_REALTIME 0
#endif

But this failed the same way: CLOCK_REALTIME undeclared.

Note, ctf uses CLOCK_REALTIME in the same header where it
includes sys/time.h.


>No comments.
> 
> try posting to the right mailing list.  tech-toolchain would
> be the right list for this sort of change.

Thanks for the hint.

Christoph


re: CVS commit: src/tools/compat/sys

2010-03-26 Thread matthew green

   Module Name: src
   Committed By:cegger
   Date:Fri Mar 26 07:16:12 UTC 2010
   
   Added Files:
src/tools/compat/sys: time.h
   
   Log Message:
   toolchain buildfix on OSX with MKDTRACE=yes:
   
   The host  doesn't provide CLOCK_REALTIME but ctf uses it.
   See http://mail-index.netbsd.org/current-users/2010/03/20/msg012963.html

this seems bogus to me.

please only define it if it isn't defined, at least.
   
   No comments.

try posting to the right mailing list.  tech-toolchain would
be the right list for this sort of change.


.mrg.


CVS commit: src/tools/compat

2010-01-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jan 21 12:55:04 UTC 2010

Modified Files:
src/tools/compat: nbtool_config.h.in

Log Message:
Regen this properly per procedure described in src/tools/compat/configure.ac.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2010-01-15 Thread Aleksej Saushev
Module Name:src
Committed By:   asau
Date:   Fri Jan 15 11:27:01 UTC 2010

Modified Files:
src/tools/compat: configure

Log Message:
Regenerate.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/tools/compat/configure

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2010-01-15 Thread Aleksej Saushev
Module Name:src
Committed By:   asau
Date:   Fri Jan 15 11:26:25 UTC 2010

Modified Files:
src/tools/compat: configure.ac nbtool_config.h.in

Log Message:
Test for  and provide HAVE_SYS_ENDIAN_H.
Fixes FreeBSD hosted builds (PR 42440 and PR 42470).

Approved by .


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/tools/compat/configure.ac
cvs rdiff -u -r1.23 -r1.24 src/tools/compat/nbtool_config.h.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2010-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 14 21:38:19 UTC 2010

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
undef and redefine instead of checking if it is define, from joerg


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/tools/compat/compat_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tools/compat

2010-01-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan 14 21:26:56 UTC 2010

Modified Files:
src/tools/compat: compat_defs.h

Log Message:
provide __arraycount for those that don't have it.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/tools/compat/compat_defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.