diff options
author | Michael Forney <mforney@mforney.org> | 2021-06-15 17:25:46 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2021-06-16 00:28:10 -0700 |
commit | fb10b3671f41a3e09837fd07b90da9c25a1bbf57 (patch) | |
tree | abbc5beff6b2beb8371ee59908ab942b105cb72b /.builds | |
parent | ab3187e9d02a9e4c3395c28858ac179d1fc5787b (diff) |
Add initial NetBSD support
Diffstat (limited to '.builds')
-rw-r--r-- | .builds/netbsd.diff | 72 | ||||
-rw-r--r-- | .builds/netbsd.yml | 15 |
2 files changed, 87 insertions, 0 deletions
diff --git a/.builds/netbsd.diff b/.builds/netbsd.diff new file mode 100644 index 0000000..14ca9af --- /dev/null +++ b/.builds/netbsd.diff @@ -0,0 +1,72 @@ +diff --git a/stdlib.h b/stdlib.h +index 51dbb0c70836..f47d0b9467ee 100644 +--- a/stdlib.h ++++ b/stdlib.h +@@ -186,12 +186,8 @@ void srandom(unsigned int) __RENAME(__srandom60); + #endif + #ifdef _NETBSD_SOURCE + #define RANDOM_MAX 0x7fffffff /* (((long)1 << 31) - 1) */ +-int mkostemp(char *, int); +-int mkostemps(char *, int, int); + #endif + +-char *mkdtemp(char *); +-int mkstemp(char *); + char *mktemp(char *) + #ifdef __MKTEMP_OK__ + __RENAME(_mktemp) +@@ -206,8 +202,6 @@ int ttyslot(void); + + void *valloc(size_t); /* obsoleted by malloc() */ + +-int getsubopt(char **, char * const *, char **); +- + int grantpt(int); + int unlockpt(int); + char *ptsname(int); +@@ -255,6 +249,24 @@ int posix_openpt(int); + int posix_memalign(void **, size_t, size_t); + #endif + ++/* ++ * The Open Group Base Specifications, Issue 7; IEEE Std 1003.1-2008 (POSIX) ++ * or ++ * X/Open Portability Guide >= Issue 4 Version 2 ++ */ ++#if (_POSIX_C_SOURCE - 0) >= 200809L || \ ++ (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \ ++ (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE) ++char *mkdtemp(char *); ++int mkstemp(char *); ++#ifdef _NETBSD_SOURCE ++int mkostemp(char *, int); ++int mkostemps(char *, int, int); ++#endif ++ ++int getsubopt(char **, char * const *, char **); ++#endif ++ + /* + * Implementation-defined extensions + */ +diff --git a/sys/cdefs.h b/sys/cdefs.h +index ac8f1e3b9faf..7370015eb513 100644 +--- a/sys/cdefs.h ++++ b/sys/cdefs.h +@@ -499,13 +499,11 @@ + #endif + + #if !defined(_STANDALONE) && !defined(_KERNEL) +-#if defined(__GNUC__) || defined(__PCC__) +-#define __RENAME(x) ___RENAME(x) +-#elif defined(__lint__) ++#if defined(__lint__) + #define __RENAME(x) __symbolrename(x) + #else +-#error "No function renaming possible" +-#endif /* __GNUC__ */ ++#define __RENAME(x) ___RENAME(x) ++#endif /* __lint__ */ + #else /* _STANDALONE || _KERNEL */ + #define __RENAME(x) no renaming in kernel/standalone environment + #endif diff --git a/.builds/netbsd.yml b/.builds/netbsd.yml new file mode 100644 index 0000000..bb9c20b --- /dev/null +++ b/.builds/netbsd.yml @@ -0,0 +1,15 @@ +image: netbsd/latest +sources: +- https://git.sr.ht/~mcf/cproc +- git://c9x.me/qbe.git +packages: +- gmake +tasks: +- setup: | + sudo patch -p1 -d /usr/include < cproc/.builds/netbsd.diff +- build: | + PATH=$HOME/qbe/obj:$PATH + gmake -C qbe + cd cproc + ./configure + make all check bootstrap |