Sun May 24 21:51:54 2020 UTC ()
libnbcompat: Update to 20200524

One change: use AC_PROG_CC_C99 and regen configure

This helps bootstrapping on legacy systems where the compiler doesn't
default to c99 without additional guidance.

Patch from ky0ko@disroot.org, tested on NetBSD and Alpine Linux by myself
and on IRIX with mipspro by ky0ko.


(nia)
diff -r1.86 -r1.87 pkgsrc/pkgtools/libnbcompat/Makefile
diff -r1.24 -r1.25 pkgsrc/pkgtools/libnbcompat/files/README
diff -r1.86 -r1.87 pkgsrc/pkgtools/libnbcompat/files/configure
diff -r1.87 -r1.88 pkgsrc/pkgtools/libnbcompat/files/configure.ac

cvs diff -r1.86 -r1.87 pkgsrc/pkgtools/libnbcompat/Makefile (expand / switch to unified diff)

--- pkgsrc/pkgtools/libnbcompat/Makefile 2020/01/18 23:33:25 1.86
+++ pkgsrc/pkgtools/libnbcompat/Makefile 2020/05/24 21:51:54 1.87
@@ -1,21 +1,21 @@ @@ -1,21 +1,21 @@
1# $NetBSD: Makefile,v 1.86 2020/01/18 23:33:25 rillig Exp $ 1# $NetBSD: Makefile,v 1.87 2020/05/24 21:51:54 nia Exp $
2# 2#
3# NOTE: If you update this package, it is *mandatory* that you update 3# NOTE: If you update this package, it is *mandatory* that you update
4# pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual 4# pkgsrc/pkgtools/libnbcompat/files/README to reflect the actual
5# list of tested and supported platforms. 5# list of tested and supported platforms.
6# 6#
7 7
8PKGNAME= libnbcompat-20190708 8PKGNAME= libnbcompat-20200524
9CATEGORIES= pkgtools devel 9CATEGORIES= pkgtools devel
10 10
11MAINTAINER= joerg@NetBSD.org 11MAINTAINER= joerg@NetBSD.org
12HOMEPAGE= https://www.NetBSD.org/ 12HOMEPAGE= https://www.NetBSD.org/
13COMMENT= Portable NetBSD compatibility library 13COMMENT= Portable NetBSD compatibility library
14 14
15GNU_CONFIGURE= yes 15GNU_CONFIGURE= yes
16MAKE_ENV+= LIBMODE=${LIBMODE} 16MAKE_ENV+= LIBMODE=${LIBMODE}
17 17
18# Enable by default for standalone builds 18# Enable by default for standalone builds
19CONFIGURE_ARGS+= --enable-db 19CONFIGURE_ARGS+= --enable-db
20 20
21do-extract: 21do-extract:

cvs diff -r1.24 -r1.25 pkgsrc/pkgtools/libnbcompat/files/README (expand / switch to unified diff)

--- pkgsrc/pkgtools/libnbcompat/files/README 2019/07/08 20:34:54 1.24
+++ pkgsrc/pkgtools/libnbcompat/files/README 2020/05/24 21:51:54 1.25
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: README,v 1.24 2019/07/08 20:34:54 sevan Exp $ 1$NetBSD: README,v 1.25 2020/05/24 21:51:54 nia Exp $
2 2
3 0 Introduction 3 0 Introduction
4 ============== 4 ==============
5 5
6libnbcompat builds and installs a portable NetBSD-compatibility library 6libnbcompat builds and installs a portable NetBSD-compatibility library
7that supplies routines missing on operating systems that are used by 7that supplies routines missing on operating systems that are used by
8the family of pkgsrc bootstrap tools. Note that libnbcompat is very 8the family of pkgsrc bootstrap tools. Note that libnbcompat is very
9much a work-in-progress. Only the functions that are directly used 9much a work-in-progress. Only the functions that are directly used
10by the bootstrap tools are implemented in the library. At the moment, 10by the bootstrap tools are implemented in the library. At the moment,
11this includes the following packages: 11this includes the following packages:
12 12
13 archivers/pax 13 archivers/pax
14 pkgtools/mtree 14 pkgtools/mtree
@@ -108,26 +108,33 @@ on the following operating systems: @@ -108,26 +108,33 @@ on the following operating systems:
108libnbcompat-20150419 has been tested to build and install correctly 108libnbcompat-20150419 has been tested to build and install correctly
109on the following operating systems: 109on the following operating systems:
110 110
111 NetBSD/i386 5.2.3 <tnn@NetBSD.org> 111 NetBSD/i386 5.2.3 <tnn@NetBSD.org>
112 HP-UX/hppa 11.11 <tnn@NetBSD.org> 112 HP-UX/hppa 11.11 <tnn@NetBSD.org>
113  113
114libnbcompat-20190608 has been tested to build and install correctly 114libnbcompat-20190608 has been tested to build and install correctly
115on the following operating systems: 115on the following operating systems:
116 116
117 NetBSD/amd64 8.99.49 <sevan@NetBSD.org> 117 NetBSD/amd64 8.99.49 <sevan@NetBSD.org>
118 Darwin/powerpc 8.11.0 <sevan@NetBSD.org> 118 Darwin/powerpc 8.11.0 <sevan@NetBSD.org>
119 FreeBSD/amd64 13-CURRENT <sevan@NetBSD.org> 119 FreeBSD/amd64 13-CURRENT <sevan@NetBSD.org>
120 120
 121libnbcompat-20200524 has been tested to build and install correctly
 122on the following operating systems:
 123
 124 NetBSD/amd64 9.0 <nia@NetBSD.org>
 125 Alpine Linux 3.11.6 x86_64 <nia@NetBSD.org>
 126 IRIX 6.5.22, mipspro 7.4.3 <ky0ko@disroot.org>
 127
121 3 Usage 128 3 Usage
122 ======= 129 =======
123 130
124This library is intended to simplify porting NetBSD software. To that 131This library is intended to simplify porting NetBSD software. To that
125end, the changes to NetBSD sources to use libnbcompat are minor. The 132end, the changes to NetBSD sources to use libnbcompat are minor. The
126procedure is: 133procedure is:
127 134
128 (1) Add #include <nbcompat.h> at the top of the source files that 135 (1) Add #include <nbcompat.h> at the top of the source files that
129 include system headers, but below the inclusion of any 136 include system headers, but below the inclusion of any
130 "config.h". 137 "config.h".
131 138
132 (2) Surround each system header file included in the source file 139 (2) Surround each system header file included in the source file
133 with #if HAVE_<header_name>_H ... #endif. 140 with #if HAVE_<header_name>_H ... #endif.

cvs diff -r1.86 -r1.87 pkgsrc/pkgtools/libnbcompat/files/configure (expand / switch to unified diff)

--- pkgsrc/pkgtools/libnbcompat/files/configure 2019/07/08 20:34:54 1.86
+++ pkgsrc/pkgtools/libnbcompat/files/configure 2020/05/24 21:51:54 1.87
@@ -3979,564 +3979,202 @@ case `${MAKE-make} -f conftest.make 2>/d @@ -3979,564 +3979,202 @@ case `${MAKE-make} -f conftest.make 2>/d
3979esac 3979esac
3980rm -f conftest.make 3980rm -f conftest.make
3981fi 3981fi
3982if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then 3982if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
3983 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 3983 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3984$as_echo "yes" >&6; } 3984$as_echo "yes" >&6; }
3985 SET_MAKE= 3985 SET_MAKE=
3986else 3986else
3987 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 3987 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3988$as_echo "no" >&6; } 3988$as_echo "no" >&6; }
3989 SET_MAKE="MAKE=${MAKE-make}" 3989 SET_MAKE="MAKE=${MAKE-make}"
3990fi 3990fi
3991 3991
3992ac_ext=c 3992 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
3993ac_cpp='$CPP $CPPFLAGS' 3993$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
3994ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 3994if ${ac_cv_prog_cc_c99+:} false; then :
3995ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 
3996ac_compiler_gnu=$ac_cv_c_compiler_gnu 
3997if test -n "$ac_tool_prefix"; then 
3998 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. 
3999set dummy ${ac_tool_prefix}gcc; ac_word=$2 
4000{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 
4001$as_echo_n "checking for $ac_word... " >&6; } 
4002if ${ac_cv_prog_CC+:} false; then : 
4003 $as_echo_n "(cached) " >&6 
4004else 
4005 if test -n "$CC"; then 
4006 ac_cv_prog_CC="$CC" # Let the user override the test. 
4007else 
4008as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
4009for as_dir in $PATH 
4010do 
4011 IFS=$as_save_IFS 
4012 test -z "$as_dir" && as_dir=. 
4013 for ac_exec_ext in '' $ac_executable_extensions; do 
4014 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 
4015 ac_cv_prog_CC="${ac_tool_prefix}gcc" 
4016 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 
4017 break 2 
4018 fi 
4019done 
4020 done 
4021IFS=$as_save_IFS 
4022 
4023fi 
4024fi 
4025CC=$ac_cv_prog_CC 
4026if test -n "$CC"; then 
4027 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 
4028$as_echo "$CC" >&6; } 
4029else 
4030 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
4031$as_echo "no" >&6; } 
4032fi 
4033 
4034 
4035fi 
4036if test -z "$ac_cv_prog_CC"; then 
4037 ac_ct_CC=$CC 
4038 # Extract the first word of "gcc", so it can be a program name with args. 
4039set dummy gcc; ac_word=$2 
4040{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 
4041$as_echo_n "checking for $ac_word... " >&6; } 
4042if ${ac_cv_prog_ac_ct_CC+:} false; then : 
4043 $as_echo_n "(cached) " >&6 
4044else 
4045 if test -n "$ac_ct_CC"; then 
4046 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. 
4047else 
4048as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
4049for as_dir in $PATH 
4050do 
4051 IFS=$as_save_IFS 
4052 test -z "$as_dir" && as_dir=. 
4053 for ac_exec_ext in '' $ac_executable_extensions; do 
4054 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 
4055 ac_cv_prog_ac_ct_CC="gcc" 
4056 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 
4057 break 2 
4058 fi 
4059done 
4060 done 
4061IFS=$as_save_IFS 
4062 
4063fi 
4064fi 
4065ac_ct_CC=$ac_cv_prog_ac_ct_CC 
4066if test -n "$ac_ct_CC"; then 
4067 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 
4068$as_echo "$ac_ct_CC" >&6; } 
4069else 
4070 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
4071$as_echo "no" >&6; } 
4072fi 
4073 
4074 if test "x$ac_ct_CC" = x; then 
4075 CC="" 
4076 else 
4077 case $cross_compiling:$ac_tool_warned in 
4078yes:) 
4079{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 
4080$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} 
4081ac_tool_warned=yes ;; 
4082esac 
4083 CC=$ac_ct_CC 
4084 fi 
4085else 
4086 CC="$ac_cv_prog_CC" 
4087fi 
4088 
4089if test -z "$CC"; then 
4090 if test -n "$ac_tool_prefix"; then 
4091 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. 
4092set dummy ${ac_tool_prefix}cc; ac_word=$2 
4093{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 
4094$as_echo_n "checking for $ac_word... " >&6; } 
4095if ${ac_cv_prog_CC+:} false; then : 
4096 $as_echo_n "(cached) " >&6 
4097else 
4098 if test -n "$CC"; then 
4099 ac_cv_prog_CC="$CC" # Let the user override the test. 
4100else 
4101as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
4102for as_dir in $PATH 
4103do 
4104 IFS=$as_save_IFS 
4105 test -z "$as_dir" && as_dir=. 
4106 for ac_exec_ext in '' $ac_executable_extensions; do 
4107 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 
4108 ac_cv_prog_CC="${ac_tool_prefix}cc" 
4109 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 
4110 break 2 
4111 fi 
4112done 
4113 done 
4114IFS=$as_save_IFS 
4115 
4116fi 
4117fi 
4118CC=$ac_cv_prog_CC 
4119if test -n "$CC"; then 
4120 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 
4121$as_echo "$CC" >&6; } 
4122else 
4123 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
4124$as_echo "no" >&6; } 
4125fi 
4126 
4127 
4128 fi 
4129fi 
4130if test -z "$CC"; then 
4131 # Extract the first word of "cc", so it can be a program name with args. 
4132set dummy cc; ac_word=$2 
4133{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 
4134$as_echo_n "checking for $ac_word... " >&6; } 
4135if ${ac_cv_prog_CC+:} false; then : 
4136 $as_echo_n "(cached) " >&6 3995 $as_echo_n "(cached) " >&6
4137else 3996else
4138 if test -n "$CC"; then 3997 ac_cv_prog_cc_c99=no
4139 ac_cv_prog_CC="$CC" # Let the user override the test. 3998ac_save_CC=$CC
4140else 3999cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4141 ac_prog_rejected=no 
4142as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
4143for as_dir in $PATH 
4144do 
4145 IFS=$as_save_IFS 
4146 test -z "$as_dir" && as_dir=. 
4147 for ac_exec_ext in '' $ac_executable_extensions; do 
4148 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 
4149 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then 
4150 ac_prog_rejected=yes 
4151 continue 
4152 fi 
4153 ac_cv_prog_CC="cc" 
4154 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 
4155 break 2 
4156 fi 
4157done 
4158 done 
4159IFS=$as_save_IFS 
4160 
4161if test $ac_prog_rejected = yes; then 
4162 # We found a bogon in the path, so make sure we never use it. 
4163 set dummy $ac_cv_prog_CC 
4164 shift 
4165 if test $# != 0; then 
4166 # We chose a different compiler from the bogus one. 
4167 # However, it has the same basename, so the bogon will be chosen 
4168 # first if we set CC to just the basename; use the full file name. 
4169 shift 
4170 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" 
4171 fi 
4172fi 
4173fi 
4174fi 
4175CC=$ac_cv_prog_CC 
4176if test -n "$CC"; then 
4177 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 
4178$as_echo "$CC" >&6; } 
4179else 
4180 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
4181$as_echo "no" >&6; } 
4182fi 
4183 
4184 
4185fi 
4186if test -z "$CC"; then 
4187 if test -n "$ac_tool_prefix"; then 
4188 for ac_prog in cl.exe 
4189 do 
4190 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. 
4191set dummy $ac_tool_prefix$ac_prog; ac_word=$2 
4192{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 
4193$as_echo_n "checking for $ac_word... " >&6; } 
4194if ${ac_cv_prog_CC+:} false; then : 
4195 $as_echo_n "(cached) " >&6 
4196else 
4197 if test -n "$CC"; then 
4198 ac_cv_prog_CC="$CC" # Let the user override the test. 
4199else 
4200as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
4201for as_dir in $PATH 
4202do 
4203 IFS=$as_save_IFS 
4204 test -z "$as_dir" && as_dir=. 
4205 for ac_exec_ext in '' $ac_executable_extensions; do 
4206 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 
4207 ac_cv_prog_CC="$ac_tool_prefix$ac_prog" 
4208 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 
4209 break 2 
4210 fi 
4211done 
4212 done 
4213IFS=$as_save_IFS 
4214 
4215fi 
4216fi 
4217CC=$ac_cv_prog_CC 
4218if test -n "$CC"; then 
4219 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 
4220$as_echo "$CC" >&6; } 
4221else 
4222 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
4223$as_echo "no" >&6; } 
4224fi 
4225 
4226 
4227 test -n "$CC" && break 
4228 done 
4229fi 
4230if test -z "$CC"; then 
4231 ac_ct_CC=$CC 
4232 for ac_prog in cl.exe 
4233do 
4234 # Extract the first word of "$ac_prog", so it can be a program name with args. 
4235set dummy $ac_prog; ac_word=$2 
4236{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 
4237$as_echo_n "checking for $ac_word... " >&6; } 
4238if ${ac_cv_prog_ac_ct_CC+:} false; then : 
4239 $as_echo_n "(cached) " >&6 
4240else 
4241 if test -n "$ac_ct_CC"; then 
4242 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. 
4243else 
4244as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 
4245for as_dir in $PATH 
4246do 
4247 IFS=$as_save_IFS 
4248 test -z "$as_dir" && as_dir=. 
4249 for ac_exec_ext in '' $ac_executable_extensions; do 
4250 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 
4251 ac_cv_prog_ac_ct_CC="$ac_prog" 
4252 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 
4253 break 2 
4254 fi 
4255done 
4256 done 
4257IFS=$as_save_IFS 
4258 
4259fi 
4260fi 
4261ac_ct_CC=$ac_cv_prog_ac_ct_CC 
4262if test -n "$ac_ct_CC"; then 
4263 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 
4264$as_echo "$ac_ct_CC" >&6; } 
4265else 
4266 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 
4267$as_echo "no" >&6; } 
4268fi 
4269 
4270 
4271 test -n "$ac_ct_CC" && break 
4272done 
4273 
4274 if test "x$ac_ct_CC" = x; then 
4275 CC="" 
4276 else 
4277 case $cross_compiling:$ac_tool_warned in 
4278yes:) 
4279{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 
4280$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} 
4281ac_tool_warned=yes ;; 
4282esac 
4283 CC=$ac_ct_CC 
4284 fi 
4285fi 
4286 
4287fi 
4288 
4289 
4290test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 
4291$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} 
4292as_fn_error $? "no acceptable C compiler found in \$PATH 
4293See \`config.log' for more details" "$LINENO" 5; } 
4294 
4295# Provide some information about the compiler. 
4296$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 
4297set X $ac_compile 
4298ac_compiler=$2 
4299for ac_option in --version -v -V -qversion; do 
4300 { { ac_try="$ac_compiler $ac_option >&5" 
4301case "(($ac_try" in 
4302 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; 
4303 *) ac_try_echo=$ac_try;; 
4304esac 
4305eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" 
4306$as_echo "$ac_try_echo"; } >&5 
4307 (eval "$ac_compiler $ac_option >&5") 2>conftest.err 
4308 ac_status=$? 
4309 if test -s conftest.err; then 
4310 sed '10a\ 
4311... rest of stderr output deleted ... 
4312 10q' conftest.err >conftest.er1 
4313 cat conftest.er1 >&5 
4314 fi 
4315 rm -f conftest.er1 conftest.err 
4316 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 
4317 test $ac_status = 0; } 
4318done 
4319 
4320{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 
4321$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } 
4322if ${ac_cv_c_compiler_gnu+:} false; then : 
4323 $as_echo_n "(cached) " >&6 
4324else 
4325 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
4326/* end confdefs.h. */ 4000/* end confdefs.h. */
 4001#include <stdarg.h>
 4002#include <stdbool.h>
 4003#include <stdlib.h>
 4004#include <wchar.h>
 4005#include <stdio.h>
4327 4006
4328int 4007// Check varargs macros. These examples are taken from C99 6.10.3.5.
4329main () 4008#define debug(...) fprintf (stderr, __VA_ARGS__)
 4009#define showlist(...) puts (#__VA_ARGS__)
 4010#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
 4011static void
 4012test_varargs_macros (void)
4330{ 4013{
4331#ifndef __GNUC__ 4014 int x = 1234;
4332 choke me 4015 int y = 5678;
 4016 debug ("Flag");
 4017 debug ("X = %d\n", x);
 4018 showlist (The first, second, and third items.);
 4019 report (x>y, "x is %d but y is %d", x, y);
 4020}
 4021
 4022// Check long long types.
 4023#define BIG64 18446744073709551615ull
 4024#define BIG32 4294967295ul
 4025#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
 4026#if !BIG_OK
 4027 your preprocessor is broken;
4333#endif 4028#endif
 4029#if BIG_OK
 4030#else
 4031 your preprocessor is broken;
 4032#endif
 4033static long long int bignum = -9223372036854775807LL;
 4034static unsigned long long int ubignum = BIG64;
4334 4035
4335 ; 4036struct incomplete_array
 4037{
 4038 int datasize;
 4039 double data[];
 4040};
 4041
 4042struct named_init {
 4043 int number;
 4044 const wchar_t *name;
 4045 double average;
 4046};
 4047
 4048typedef const char *ccp;
 4049
 4050static inline int
 4051test_restrict (ccp restrict text)
 4052{
 4053 // See if C++-style comments work.
 4054 // Iterate through items via the restricted pointer.
 4055 // Also check for declarations in for loops.
 4056 for (unsigned int i = 0; *(text+i) != '\0'; ++i)
 4057 continue;
4336 return 0; 4058 return 0;
4337} 4059}
4338_ACEOF 
4339if ac_fn_c_try_compile "$LINENO"; then : 
4340 ac_compiler_gnu=yes 
4341else 
4342 ac_compiler_gnu=no 
4343fi 
4344rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
4345ac_cv_c_compiler_gnu=$ac_compiler_gnu 
4346 
4347fi 
4348{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 
4349$as_echo "$ac_cv_c_compiler_gnu" >&6; } 
4350if test $ac_compiler_gnu = yes; then 
4351 GCC=yes 
4352else 
4353 GCC= 
4354fi 
4355ac_test_CFLAGS=${CFLAGS+set} 
4356ac_save_CFLAGS=$CFLAGS 
4357{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 
4358$as_echo_n "checking whether $CC accepts -g... " >&6; } 
4359if ${ac_cv_prog_cc_g+:} false; then : 
4360 $as_echo_n "(cached) " >&6 
4361else 
4362 ac_save_c_werror_flag=$ac_c_werror_flag 
4363 ac_c_werror_flag=yes 
4364 ac_cv_prog_cc_g=no 
4365 CFLAGS="-g" 
4366 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
4367/* end confdefs.h. */ 
4368 4060
4369int 4061// Check varargs and va_copy.
4370main () 4062static void
 4063test_varargs (const char *format, ...)
4371{ 4064{
 4065 va_list args;
 4066 va_start (args, format);
 4067 va_list args_copy;
 4068 va_copy (args_copy, args);
 4069
 4070 const char *str;
 4071 int number;
 4072 float fnumber;
4372 4073
4373 ; 4074 while (*format)
4374 return 0; 4075 {
 4076 switch (*format++)
 4077 {
 4078 case 's': // string
 4079 str = va_arg (args_copy, const char *);
 4080 break;
 4081 case 'd': // int
 4082 number = va_arg (args_copy, int);
 4083 break;
 4084 case 'f': // float
 4085 fnumber = va_arg (args_copy, double);
 4086 break;
 4087 default:
 4088 break;
 4089 }
 4090 }
 4091 va_end (args_copy);
 4092 va_end (args);
4375} 4093}
4376_ACEOF 
4377if ac_fn_c_try_compile "$LINENO"; then : 
4378 ac_cv_prog_cc_g=yes 
4379else 
4380 CFLAGS="" 
4381 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
4382/* end confdefs.h. */ 
4383 4094
4384int 4095int
4385main () 4096main ()
4386{ 4097{
4387 4098
4388 ; 4099 // Check bool.
4389 return 0; 4100 _Bool success = false;
4390} 
4391_ACEOF 
4392if ac_fn_c_try_compile "$LINENO"; then : 
4393 
4394else 
4395 ac_c_werror_flag=$ac_save_c_werror_flag 
4396 CFLAGS="-g" 
4397 cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
4398/* end confdefs.h. */ 
4399 4101
4400int 4102 // Check restrict.
4401main () 4103 if (test_restrict ("String literal") == 0)
4402{ 4104 success = true;
 4105 char *restrict newvar = "Another string";
 4106
 4107 // Check varargs.
 4108 test_varargs ("s, d' f .", "string", 65, 34.234);
 4109 test_varargs_macros ();
 4110
 4111 // Check flexible array members.
 4112 struct incomplete_array *ia =
 4113 malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
 4114 ia->datasize = 10;
 4115 for (int i = 0; i < ia->datasize; ++i)
 4116 ia->data[i] = i * 1.234;
 4117
 4118 // Check named initializers.
 4119 struct named_init ni = {
 4120 .number = 34,
 4121 .name = L"Test wide string",
 4122 .average = 543.34343,
 4123 };
 4124
 4125 ni.number = 58;
 4126
 4127 int dynamic_array[ni.number];
 4128 dynamic_array[ni.number - 1] = 543;
 4129
 4130 // work around unused variable warnings
 4131 return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
 4132 || dynamic_array[ni.number - 1] != 543);
4403 4133
4404 ; 4134 ;
4405 return 0; 4135 return 0;
4406} 4136}
4407_ACEOF 4137_ACEOF
4408if ac_fn_c_try_compile "$LINENO"; then : 4138for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
4409 ac_cv_prog_cc_g=yes 
4410fi 
4411rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
4412fi 
4413rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
4414fi 
4415rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 
4416 ac_c_werror_flag=$ac_save_c_werror_flag 
4417fi 
4418{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 
4419$as_echo "$ac_cv_prog_cc_g" >&6; } 
4420if test "$ac_test_CFLAGS" = set; then 
4421 CFLAGS=$ac_save_CFLAGS 
4422elif test $ac_cv_prog_cc_g = yes; then 
4423 if test "$GCC" = yes; then 
4424 CFLAGS="-g -O2" 
4425 else 
4426 CFLAGS="-g" 
4427 fi 
4428else 
4429 if test "$GCC" = yes; then 
4430 CFLAGS="-O2" 
4431 else 
4432 CFLAGS= 
4433 fi 
4434fi 
4435{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 
4436$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } 
4437if ${ac_cv_prog_cc_c89+:} false; then : 
4438 $as_echo_n "(cached) " >&6 
4439else 
4440 ac_cv_prog_cc_c89=no 
4441ac_save_CC=$CC 
4442cat confdefs.h - <<_ACEOF >conftest.$ac_ext 
4443/* end confdefs.h. */ 
4444#include <stdarg.h> 
4445#include <stdio.h> 
4446struct stat; 
4447/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ 
4448struct buf { int x; }; 
4449FILE * (*rcsopen) (struct buf *, struct stat *, int); 
4450static char *e (p, i) 
4451 char **p; 
4452 int i; 
4453{ 
4454 return p[i]; 
4455} 
4456static char *f (char * (*g) (char **, int), char **p, ...) 
4457{ 
4458 char *s; 
4459 va_list v; 
4460 va_start (v,p); 
4461 s = g (p, va_arg (v,int)); 
4462 va_end (v); 
4463 return s; 
4464} 
4465 
4466/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has 
4467 function prototypes and stuff, but not '\xHH' hex character constants. 
4468 These don't provoke an error unfortunately, instead are silently treated 
4469 as 'x'. The following induces an error, until -std is added to get 
4470 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an 
4471 array size at least. It's necessary to write '\x00'==0 to get something 
4472 that's true only with -std. */ 
4473int osf4_cc_array ['\x00' == 0 ? 1 : -1]; 
4474 
4475/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters 
4476 inside strings and character constants. */ 
4477#define FOO(x) 'x' 
4478int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; 
4479 
4480int test (int i, double x); 
4481struct s1 {int (*f) (int a);}; 
4482struct s2 {int (*f) (double a);}; 
4483int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); 
4484int argc; 
4485char **argv; 
4486int 
4487main () 
4488{ 
4489return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; 
4490 ; 
4491 return 0; 
4492} 
4493_ACEOF 
4494for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ 
4495 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" 
4496do 4139do
4497 CC="$ac_save_CC $ac_arg" 4140 CC="$ac_save_CC $ac_arg"
4498 if ac_fn_c_try_compile "$LINENO"; then : 4141 if ac_fn_c_try_compile "$LINENO"; then :
4499 ac_cv_prog_cc_c89=$ac_arg 4142 ac_cv_prog_cc_c99=$ac_arg
4500fi 4143fi
4501rm -f core conftest.err conftest.$ac_objext 4144rm -f core conftest.err conftest.$ac_objext
4502 test "x$ac_cv_prog_cc_c89" != "xno" && break 4145 test "x$ac_cv_prog_cc_c99" != "xno" && break
4503done 4146done
4504rm -f conftest.$ac_ext 4147rm -f conftest.$ac_ext
4505CC=$ac_save_CC 4148CC=$ac_save_CC
4506 4149
4507fi 4150fi
4508# AC_CACHE_VAL 4151# AC_CACHE_VAL
4509case "x$ac_cv_prog_cc_c89" in 4152case "x$ac_cv_prog_cc_c99" in
4510 x) 4153 x)
4511 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 4154 { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4512$as_echo "none needed" >&6; } ;; 4155$as_echo "none needed" >&6; } ;;
4513 xno) 4156 xno)
4514 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 4157 { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4515$as_echo "unsupported" >&6; } ;; 4158$as_echo "unsupported" >&6; } ;;
4516 *) 4159 *)
4517 CC="$CC $ac_cv_prog_cc_c89" 4160 CC="$CC $ac_cv_prog_cc_c99"
4518 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 4161 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
4519$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; 4162$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
4520esac 4163esac
4521if test "x$ac_cv_prog_cc_c89" != xno; then : 4164if test "x$ac_cv_prog_cc_c99" != xno; then :
4522 4165
4523fi 4166fi
4524 4167
4525ac_ext=c 
4526ac_cpp='$CPP $CPPFLAGS' 
4527ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 
4528ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 
4529ac_compiler_gnu=$ac_cv_c_compiler_gnu 
4530 4168
4531# Find a good install program. We prefer a C program (faster), 4169# Find a good install program. We prefer a C program (faster),
4532# so one script is as good as another. But avoid the broken or 4170# so one script is as good as another. But avoid the broken or
4533# incompatible versions: 4171# incompatible versions:
4534# SysV /etc/install, /usr/sbin/install 4172# SysV /etc/install, /usr/sbin/install
4535# SunOS /usr/etc/install 4173# SunOS /usr/etc/install
4536# IRIX /sbin/install 4174# IRIX /sbin/install
4537# AIX /bin/install 4175# AIX /bin/install
4538# AmigaOS /C/install, which installs bootblocks on floppy discs 4176# AmigaOS /C/install, which installs bootblocks on floppy discs
4539# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag 4177# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
4540# AFS /usr/afsws/bin/install, which mishandles nonexistent args 4178# AFS /usr/afsws/bin/install, which mishandles nonexistent args
4541# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" 4179# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
4542# OS/2's system install, which has a completely different semantic 4180# OS/2's system install, which has a completely different semantic

cvs diff -r1.87 -r1.88 pkgsrc/pkgtools/libnbcompat/files/configure.ac (expand / switch to unified diff)

--- pkgsrc/pkgtools/libnbcompat/files/configure.ac 2019/07/08 20:34:54 1.87
+++ pkgsrc/pkgtools/libnbcompat/files/configure.ac 2020/05/24 21:51:54 1.88
@@ -1,30 +1,30 @@ @@ -1,30 +1,30 @@
1dnl $NetBSD: configure.ac,v 1.87 2019/07/08 20:34:54 sevan Exp $ 1dnl $NetBSD: configure.ac,v 1.88 2020/05/24 21:51:54 nia Exp $
2 2
3dnl Process this file with autoconf to produce a configure script. 3dnl Process this file with autoconf to produce a configure script.
4AC_PREREQ(2.52) 4AC_PREREQ(2.52)
5AC_INIT([libnbcompat], [20190708], [joerg@NetBSD.org]) 5AC_INIT([libnbcompat], [20190708], [joerg@NetBSD.org])
6AC_CONFIG_HEADER(nbcompat/config.h) 6AC_CONFIG_HEADER(nbcompat/config.h)
7AC_ARG_PROGRAM 7AC_ARG_PROGRAM
8 8
9AC_CANONICAL_HOST 9AC_CANONICAL_HOST
10AC_GNU_SOURCE 10AC_GNU_SOURCE
11CANONICAL_HOST=$host 11CANONICAL_HOST=$host
12AC_SUBST(CANONICAL_HOST) 12AC_SUBST(CANONICAL_HOST)
13AC_SUBST(INCLUDES) 13AC_SUBST(INCLUDES)
14 14
15# Checks for programs. 15# Checks for programs.
16AC_PROG_MAKE_SET 16AC_PROG_MAKE_SET
17AC_PROG_CC 17AC_PROG_CC_C99
18AC_PROG_INSTALL 18AC_PROG_INSTALL
19AC_PROG_LN_S 19AC_PROG_LN_S
20AC_PROG_RANLIB 20AC_PROG_RANLIB
21AC_PROG_AWK 21AC_PROG_AWK
22AC_CHECK_PROG(AR, ar, ar) 22AC_CHECK_PROG(AR, ar, ar)
23 23
24AUTOCONF=${AUTOCONF-"$srcdir/missing --run autoconf"} 24AUTOCONF=${AUTOCONF-"$srcdir/missing --run autoconf"}
25AC_SUBST(AUTOCONF) 25AC_SUBST(AUTOCONF)
26AUTOHEADER=${AUTOHEADER-"$srcdir/missing --run autoheader"} 26AUTOHEADER=${AUTOHEADER-"$srcdir/missing --run autoheader"}
27AC_SUBST(AUTOHEADER) 27AC_SUBST(AUTOHEADER)
28 28
29dnl Checks for libraries 29dnl Checks for libraries
30AC_CHECK_LIB(util, fparseln) 30AC_CHECK_LIB(util, fparseln)