Commit graph

243 commits

Author SHA1 Message Date
joerg
89f19b4095 libnbcompat-20090302:
Add TAILQ_LAST.
2009-03-02 13:54:55 +00:00
joerg
f01efe1be7 Provide TAILQ_FOREACH_SAFE if it is missing. 2009-02-26 16:14:18 +00:00
abs
44dc2856b0 Fix PR 40151 - bootstrap of pkgsrc fails on Ubuntu 8.10
- At least Ubuntu 8.1 sets __attribute__((warn_unused_result)) on fwrite()
  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509
  which means (void)fwrite(...) will *always* generate a warning, so
  set -Wno-error to bypass this in Linux.sys.mk
- Ubuntu 8.1 also jumps through hoops to ensure ARG_MAX is *undefined*, so
  work around this in tnftp and libnbcompat
2009-02-19 00:51:12 +00:00
joerg
051e2fcd6a Only use issetugid if it exists. Fixes reported build issues on QNX and
AIX.
2009-02-09 20:35:21 +00:00
obache
9244674af5 Need to include stdint.h for unit64_t on SUA 6.0. 2008-12-14 07:50:49 +00:00
joerg
fba094a13c OpenBSD headers are still not standalone, even though SUS is pretty
explicit about it at least for netinet/in.h. Include sys/types.h before
checking for content of sys/socket.h and netinet/in.h to fix this.
Reported and tested by Georg Schwarz.
2008-11-08 21:35:57 +00:00
joerg
6d6f20fbaf Add some forgotten ifndefs to fix issues on DragonFly. 2008-11-06 00:25:42 +00:00
joerg
1cb2d826a6 Define __UNCONST. From PR 39797. 2008-10-30 19:27:20 +00:00
joerg
18058a4e57 Avoid STAT as macro, it exists in sys/dir.h on AIX already. 2008-10-30 16:00:54 +00:00
joerg
69064b82e8 Don't use __RENAME. 2008-10-29 16:39:03 +00:00
joerg
8dee63e644 Provide more compat glue for ndbm interface as shown in PR 39738.
Bump to libnbcompat-20081029.
2008-10-29 11:23:17 +00:00
joerg
7f9c816849 Define away O_EXLOCK and O_SHLOCK if they are missing. 2008-10-28 18:01:06 +00:00
joerg
dde0f32833 Use nbcompat/paths.h, Solaris is missing paths.h. From Uwe Klaus. 2008-10-28 17:57:36 +00:00
joerg
83613e330d Add circleq support. Bump to 20081028. Should fix IRIX build from
PR 39797.
2008-10-28 15:15:18 +00:00
joerg
eece6e89de Replace EFTYPE with EINVAL if the former doesn't exist. 2008-10-28 15:06:26 +00:00
joerg
9944df4826 Provide and use local mpool.h. 2008-10-26 12:51:59 +00:00
joerg
690ac5928f Explicitly check for libnsl and libsocket as required by Solaris.
Based on patches from Aleksey Cheusov.
2008-10-26 12:31:30 +00:00
joerg
c071594cda Include nbcompat/types.h early to make sure that uintX_t are defined.
Reported by Aleksey Cheusov and Joern Clausen in PR 39738.
2008-10-19 21:02:07 +00:00
joerg
bb59fdd51d pkg_install-20081010:
Add optional bdb. Make it included by default for standalone builds.
2008-10-10 00:21:43 +00:00
joerg
aa020a8ff4 Mac OS X doesn't define uintXX_t in sys/types.h, so explicitly pull in
inttypes.h if present. Make md5.h, sha1.h and sha2.h self contained by
including nbcompat/types.h. Problem reported by Greg Troxel.
2008-10-08 14:28:14 +00:00
joerg
98648e83e3 Check for existance of sysexits.h and regen config.h.in. 2008-10-07 16:03:10 +00:00
joerg
9542074cb2 libnbcompat-20080922:
- DESTDIR support
- Add check for inttypes.h and sys/socket.h
- Provide compatibility fallback for netdb.h and the RFC2553 API
(getaddrinfo), supoprting IPv4 only. Code from OpenSSH.
- Use normal autoconf checks for fixed size bit types. Stop using the
older BSD types (u_intXX_t) in libnbcompat.
- Add implementation of shquote (from NetBSD).
- Fix a buglet in the getenv/setenv/unsetenv detection.
- Fix a buglet in the mkdtemp/mkstemp detection.
2008-10-06 12:36:19 +00:00
joerg
69ed4e430d Determine both for setmode.c and pwcache.c if any of the functions is
provided by the system and if one is lacking use the file. Don't short
cut the list as before and do a second iteration, it is just confusing.

This breaks the regression introduced by the last commit on OS X.
2008-09-12 13:47:26 +00:00
joerg
2c43b4f278 libnbcompat-20080908:
- declare endpwent and endgrent if system headers are missing them
- check for existance of statfs.f_flags before using it
- drop a bunch of redundant function checks

Based on the work of Timothy Larson.
2008-09-08 20:20:22 +00:00
joerg
e33690ba5d Make style more consistent. 2008-06-19 17:28:09 +00:00
joerg
4aa5709b48 libnbcompat-20080519:
Many of the hash function headers are incompatible with the OpenSSL
headers, so don't include them by default and require the caller to
include them on demand.
2008-05-19 12:52:57 +00:00
martin
d86d72404e Drop clauses 3 and 4 from TNF licenses 2008-04-29 05:46:08 +00:00
joerg
41548023fd libnbcompat-20080422:
Check if stdio.h declares vasprintf and snprintf and provide a prototype
otherwise.
2008-04-21 22:24:43 +00:00
joerg
b9495db99b Don't let a mathematican add numbers with less than 20 digits. Fix the
the offset for November and December and welcome libnbcompat-20080416.
2008-04-17 08:11:12 +00:00
joerg
6279818d31 Add an implement of timegm(3) from nsd (based on Python code). 2008-04-04 15:20:00 +00:00
joerg
25637e137b Add an implement of timegm(3) from nsd (based on Python code). 2008-04-04 15:19:10 +00:00
joerg
46474f9f02 libnbcompat-20080322:
Add an option to force a BSDish getopt (e.g. one with optreset).
Use the correct macros to decide when to define optind and friends.
2008-03-21 23:28:08 +00:00
tnn
53c9094bb3 libnbcompat-20080221:
- Use AC_FUNC_VFORK, needed on IRIX to get missing vfork() defined
  to fork(). Ok by joerg.
2008-02-21 16:50:07 +00:00
tnn
c89a3c6b68 Move my code to two-clause license. 2008-02-14 19:14:54 +00:00
joerg
153a030a7f libnbcompat-20080212:
Add digest length defines for md5, rmd160 and sha1. Use
__BEGIN_DECLS/__END_DECLS. Drop _KERNEL conditionals.
2008-02-12 13:43:23 +00:00
joerg
e1263c0baa If dirfd is either a function or a macro, use it. If it doesn't exist,
but DIR contains dd_fd, define it as macro. Otherwise use -1 when
calling fts_safe_changedir in fts(3). Based on patch from Sean Boudreau.
2007-09-21 19:51:58 +00:00
jlam
09587da60b Use only features available in nawk. 2007-09-06 21:19:42 +00:00
obache
a22621e7ed Ensure undef before typedef, to avoid error when a application detect missing
types by itself and define (ex, pkgtools/pkg_install).
2007-09-04 09:47:38 +00:00
joerg
0e17f71497 Don't use u_{char,short,int,long} as they are non-standard.
Bump version to 20070731.
2007-07-31 13:17:33 +00:00
tnn
310e0cf3e1 Another version bump due to added configure check for uintptr_t 2007-07-21 14:39:25 +00:00
tnn
dc991988c1 * configure.ac: Add AC_TYPE_UINTPTR_T, needed by sha2.c.
Fixes build on Interix. Suggested by joerg@
* configure, config.h.in: regen
2007-07-21 13:57:33 +00:00
tnn
f698f7ba2b Bump version due to changes in asprintf, snprintf and vsnprintf. 2007-07-20 00:32:01 +00:00
tnn
a4439a21a6 * configure.ac: Test for a standards-conformant vsnprintf. If it is found
to be broken, fall back to the one provided by libnbcompat.
* configure:    regen
* config.h.in:  regen
2007-07-20 00:21:02 +00:00
tnn
943cff783d Handle trailing NUL correctly. 2007-07-20 00:11:25 +00:00
tnn
4d407c5bcb Fix logic error in buffer handling (Hi Joerg!) 2007-07-20 00:10:06 +00:00
tnn
587152daa8 Replace "poor man's printf" implementation of (v)snprintf with an
imlementation using vfprintf. The advantage is that format strings behave
like other *printf functions on the host, the drawback is that it is slower.
2007-07-19 22:06:43 +00:00
joerg
9b00c3e863 Fix SHA256/SHA512 to work on strict alignment platforms. This was
exposed by the C version of audit-packages and report in PR pkg/36662.
2007-07-18 14:09:55 +00:00
dmcmahill
8b94264115 Protect TAILQ_INSERT_{AFTER,BEFORE} from being redefined. Lets
pbulk build on netbsd-2/alpha (and probably other netbsd platforms)
again.
2007-06-26 22:10:46 +00:00
joerg
c13f697f19 Add asprintf implementation based on snprintf.
Add vsnprintf prototype as the function is implemented and used.
Add all the macros from NetBSD's sys/queue.h defined for the types
implemented.
Bump version to libnbcompat-20070622.

Tested by dmcmahill@NetBSD.org on Solaris.
OK jlam@, agc@
2007-06-25 21:35:03 +00:00
joerg
1b2b5a9255 Obfuscate embedded $NetBSD$ strings a bit, so that pkgsrc doesn't pick
them up for +BUILD_VERSION. This makes matching against the output of
ident impossible to verify whether the package is up-to-date.
2007-06-19 00:45:13 +00:00
rillig
ed9f7c753d Updated libnbcompat to 20070531.
Changes since 20070507:

Completely rewrote the fgetln implementation, since the previous version
couldn't handle files that don't end with a '\n' character. Tested on IRIX,
NetBSD and Solaris.
2007-05-31 10:18:49 +00:00
tnn
40a096eee2 Add a couple of success reports. 2007-05-22 18:06:39 +00:00
joerg
953c56fd09 Fix bug in configure script, noticed by Thorsten Glaser. 2007-05-07 21:41:33 +00:00
joerg
a71c676de2 Add SHA256/SHA384/SHA512 to libnbcompat. Update version to 20070507. 2007-05-07 16:38:47 +00:00
joerg
1b6ca55b58 Sync config.{guess,sub} with mk/gnu-configure. 2007-03-12 00:48:28 +00:00
jschauma
ef55401d33 note a few platforms where I've confirmed this version of libnbcompat to
be working
2006-12-17 19:27:57 +00:00
seb
7abfde914a For the benefit of Mr. Kite^W^Wsnprint.c add long double type detection. 2006-08-26 21:28:21 +00:00
joerg
70affd6c4b Update AC_C___ATTRIBUTE__ macro from heimdal, fixes detection with
GCC 4.
2006-03-01 16:47:54 +00:00
schwarz
68b7d980c7 added support for systems such as IRIX 5 that do not have _POSIX2_RE_DUP_MAX
defined. Changes approved by grant.
2005-11-28 20:47:29 +00:00
grant
f1ad5d68f5 revert last, and apply the simpler fix to the MAKEEXTRALIST macro in
NetBSD libc from martin@
2005-11-18 09:03:06 +00:00
grant
6e2b4f07ec pass const empty string to MAKEEXTRALIST macro instead of the
anonymous empty string. the macro uses the argument multiple times
and the logic relies on identical strings having the same address,
which is compiler dependent and not guaranteed to be the case.

problem observed with pax(1) built with sunpro 11 on Solaris.

from segv@netctl.net in PR pkg/32097.
2005-11-18 03:31:11 +00:00
reed
3f94d58331 Instead of using hard-coded 555 mode for installing library,
use BINMODE setting. This helps with non-privileged pkgsrc use.
2005-10-10 18:28:08 +00:00
grant
c6169cc95b don't use the implied source in the `bits' rule, just specify the
source. appeases make(1) on Solaris.
2005-02-20 05:55:51 +00:00
grant
5285b5ad9c redo previous in a slightly different way to appease NetBSD make(1). 2005-02-15 23:35:42 +00:00
wiz
d47bf7c083 Revert previous, since it breaks compilation on 2.0 and -current.
See PR 29387.
2005-02-15 16:04:42 +00:00
grant
a0c0ad2340 honour LDFLAGS when linking the `bits' binary. 2005-02-15 08:55:55 +00:00
jlam
6721ca445b src2nbcompat uses \n backreferences in gensub, which isn't supported in
the NetBSD 2.0 awk, so make explicit that we're using gawk.
2005-02-04 00:43:42 +00:00
grant
495ab8cee9 update config.{sub,guess} for various bootstrap tools. fixes build on
newer platforms such as DragonFly.

fixes PR pkg/28579 from Todd Willey.
2004-12-12 00:46:28 +00:00
grant
2066da3966 re-work workaround for __unvis13 namespace clash by renaming it to
__nbcompat_unvis13. fixes build on older NetBSD and Linux/sparc.
2004-12-04 23:31:40 +00:00
grant
72937576a9 fix previous. 2004-12-03 13:19:09 +00:00
grant
0d916fad86 backout previous; it causes build failure on Solaris. must investigate
further...
2004-12-03 13:12:55 +00:00
grant
322fb324cd add workaround for __unvis13 symbol clash on NetBSD 1.4.3. bootstrap
now builds successfully on NetBSD 1.4.3.
2004-12-03 00:09:02 +00:00
grant
92f150c93f fix detection of poll() for Darwin 7.x which has a poll()
compatibility function, but none of the required headers.

fixes bootstrap on Darwin 7.5.0 with gcc and xlc.
2004-10-24 11:18:33 +00:00
jlam
436503fdba Update pkgtools/libnbcompat to 20040911. Changes from version 20040822
include fixing fgetln() to account for \0 characters due to implementing
it using fgets() (analysis provided by Urban Boquist).  Also add a
definition for __restrict if not present since it is used in the regex
implementation code from src HEAD.

This has been tested to work correctly on:

	FreeBSD-4.8/i386
	NetBSD-1.6.2/i386
	Solaris 9
2004-09-11 19:01:36 +00:00
jlam
4315850032 Change the way that we disable unwanted code regions... just #undef _LIBC. 2004-08-31 17:55:17 +00:00
jlam
01441c804d Fix minor problem in #if condition. 2004-08-23 03:49:05 +00:00
jlam
f8dd961144 Update pkgtools/libnbcompat to 20040822. Changes from version 20040814
include:

* Rework the way that poll() is detected so that it more closely
  follows how the rest of the replacement functions are detected.

* Split err*() and warn*() functions into separate err.c and warn.c
  files so that we can more finely isolate the objects files pulled
  in by the linker.  This should fix building textproc/nbsed on Solaris.

* Move more definitions from nbcompat.h into nbcompat/*.h.  This makes
  it more clear which NetBSD headers are expected to provide which
  function declarations and macro definitions.

* Clean out nbconfig.h by moving all of the relevant definitions into
  the correct nbcompat/*.h files.

* Update all of the library functions to the latest from src HEAD.
  Also change the way that sources are modified when imported -- we
  now include <nbcompat.h> before the first system header, include
  <nbcompat/*.h> versions of headers instead of system ones where
  available, and "#if 0" the sections that make no sense when being
  built outside of the NetBSD source tree.  This should make future
  updates from src HEAD, e.g. for security updates or bug fixes,
  easier.

* Move all private headers into a subdirectory and include the headers
  from the private directory.  This avoids any nameclashes with system
  headers with the same name.
2004-08-23 03:32:12 +00:00
jlam
d8c0df9fe5 Fix error in the use of "next"... it means to skip the line, not skip to
the next pattern.
2004-08-21 18:21:47 +00:00
jlam
a44209eeac Fix the version number of the package in the configure script, and modify
the Makefiles so that they can be built by really basic make programs.
Move the awk script in the Makefile into a separate file for clarity, and
so that really basick make programs won't choke on the continuation lines.
2004-08-21 06:36:13 +00:00
schmonz
f97318a24f Fix a spell-o and add a strategically valuable comma. 2004-08-20 23:30:30 +00:00
jlam
5840d5f65d Deal with HAVE_NBTOOL_CONFIG_H in some sources on the HEAD. 2004-08-20 23:10:32 +00:00
jlam
1a0833e181 Allow copying individual files instead of whole directory trees. 2004-08-20 22:22:24 +00:00
schmonz
d84a5f8de7 Works on Interix 3.5. 2004-08-19 22:15:31 +00:00
schmonz
3a05906cf0 Works on Red Hat Enterprise Linux 3. 2004-08-17 23:38:21 +00:00
jlam
80739d5835 Update pkgtools/libnbcompat to 20040814. Changes from version 20040813
include:

    * Adding a regex(3) implementation for those platforms that don't
      have one, e.g. IRIX 5.3.

    * Allow nbcompat.h to be included multiple times in case it's needed
      to override values of set by config.h in bootstrap packages.  This
      should fix problems with building pkg_install and pax on platforms
      that have /usr/include/glob.h.

    * Remove namespace.h, which should be a no-op since we're building
      a userland library separate from the NetBSD sources.

    * Remove HAVE_CONFIG_H checks from sources since we're always going
      to have and and we're always going to be including it.

    * Rename all inclusion guards in nbcompat/*.h to be _NBCOMPAT_*_H_ so
      that it won't get triggered by any settings in system headers.

This has been tested on:

	FreeBSD-4.8/i386	Debian Linux 3.0 (woody)
	IRIX 6.5		MacOS X 10.2.8
	MacOS X 10.3.5		NetBSD-1.6.2/i386
	NetBSD-2.0_BETA/i386	Red Hat Linux 7.3
	Solaris 7/sparc		Solaris 8/sparc
	Solaris 9/sparc
2004-08-16 17:24:42 +00:00
jlam
bf82bab34a Note working status on Solaris 2.7 (from PR pkg/26625). 2004-08-13 14:18:44 +00:00
jlam
9005f5c368 Update pkgtools/libnbcompat to 20040813. Changes from version 20040809
include working around an apparent bug in an autoconf macro defined in
aclocal.m4.  This should now cause getopt_long() to be built on systems
that are missing getopt.h.  This version of libnbcompat has been tested
on the following platforms:

	FreeBSD-4.8/i386
	MacOS X 10.2.8
	NetBSD-1.6.2/i386
2004-08-13 04:38:02 +00:00
jlam
7ed2eb6ab1 Verified to build on OpenBSD-3.3/i386. 2004-08-11 21:20:30 +00:00
jlam
079bcd0779 Update pkgtools/libnbcompat to 20040809. Changes from version 20040805
include:

   * Re-adding a default value for pkg_use_nbcompat_vis; this was
     causing the configure script to fail on platforms that had funky
     versions of vis().  This should fix reported problems on Solaris 8
     and on IRIX 5.3.

   * Added setgroupent() and setpassent() compatibility functions so
     that pwcache.c will build without complaining about an incompatible
     pointer type assignment.

   * Remove unused tests for <arpa/nameser.h>, <netdb.h>, h_errno and
     hstrerror().  These were originally used to bootstrap lukemftp, but
     tnftp doesn't need libnbcompat to build nowadays, so we don't need
     these anymore.

   * Cleanup: in cases where we test for a function using AC_REPLACE_FUNCS,
     move the function prototype into a nbcompat header that is the
     same name as the NetBSD header that contains that declaration,
     and include that file in place of the original one within
     nbcompat.h.

This version has been tested to build on the following systems:

	FreeBSD-4.8/i386	NetBSD-1.6.2/i386
	FreeBSD-5.2.1/i386	NetBSD-2.0_BETA/i386
	IRIX 6.5		Red Hat Linux 8.0
	MacOS X 10.3.4		Solaris 8
	MacOS X 10.3.5		Solaris 9
2004-08-10 18:47:55 +00:00
jlam
d80f435723 Update pkgtools/libnbcompat to 20040805. Changes from version 20040512
include:

  (1) Add a statvfs() implementation based on statfs(), and remove the
      statfs() NetBSD-compatibility implementation.  statvfs() is used
      in src/usr.sbin/pkg_install on the HEAD branch.

  (2) Add a fnmatch() implementation, needed by IRIX.  fnmatch() is used
      in src/usr.sbin/pkg_install on the HEAD branch.

  (3) Remove fseeko(), inet_ntop(), inet_pton(), sl_*() strptime(), and
      timegm() as they're not used by any of the bootstrap packages that
      require libnbcompat (pax, mtree, pkg_install).  All that's left is
      what's necessary to bootstrap those three packages.
2004-08-06 16:55:06 +00:00
grant
57355eed05 don't include poll.h or sys/poll.h, but instead, undefine HAVE_POLL_H
and HAVE_SYS_POLL_H if we don't have a native poll() implementation.
prevents including of libnbcompat's poll.h as well as the system's
poll.h where we should be ignoring the system's poll.h.

fix tested by Jeff Rizzo on MacOSX 10.3.3.
2004-05-12 21:50:43 +00:00
grant
c7c360f8eb make sure we define HAVE_POLL if a usable poll() implementation is
found, and re-arrange the test a little for clarity.

fixes build on (at least) FreeBSD 5.x.
2004-04-23 11:42:46 +00:00
grant
5ff49d0108 workaround poll() being a compatibility function on Darwin 7
(MacOSX 10.3) by adding a custom test for _POLL_EMUL_H_ which is
defined in poll.h on some MacOSX 10.3 systems.

not all 10.3 systems have poll.h, so only do the poll() test if at
least one of the header files is found.
2004-04-20 12:13:05 +00:00
grant
89ad0dbc4e no need to test for poll() twice. 2004-04-20 10:45:48 +00:00
heinz
afc767e6bc Include limits.h if available to shut down warnings about UINT_MAX on
Unixware.
Also tested on Linux, Solaris and NetBSD.
2004-04-18 06:02:19 +00:00
heinz
0f9f9185be Use statvfs on UnixWare, similar to Solaris and IRIX. 2004-04-16 23:59:32 +00:00
bouyer
d5416af48d Some compilers (e.g. Sunpro) emit one char[] per string, even when
multiple identical strings appear in a source file.
As a result, comparing char *o to the "" pointer gives the wrong result
in vis.c, as the "" pointer we're checking against isn't the same as the
"" which initialised char *o.
Use a global pointer initialised to "", and use it for MAKEEXTRALIST()
calls.
Thanks to Christos Zoulas for suggesting the right solution :)
2004-03-21 00:31:54 +00:00
grant
6a9f504b28 #if 0 out the __weak_alias stuff, which isn't needed here. should fix
build on OpenBSD ELF platforms.
2004-03-12 15:21:13 +00:00
sketch
4fa0de7b5c Solaris has fsid_t in sys/vfs.h, so include appropriately.
This gets the new pkgsrc bootstrap working on Solaris.
2004-03-11 18:35:29 +00:00
grant
e9479deda9 adding a file to cvs requires "cvs add". duh. 2004-03-11 14:11:04 +00:00