Hello all,
I’m trying to build s-nail/s-mailx on macOS to ultimately create a
Homebrew formula for it.
While configure works fine, the build process fails as soon as OpenSSL
is involved:
* make CONFIG=NULL: works
* make CONFIG=MINIMAL: works
* make CONFIG=MEDIUM: works
* make CONFIG=NETSEND: fails
* make CONFIG=MAXIMUM: fails
The output of
|C_INCLUDE_PATH="${C_INCLUDE_PATH}:/usr/local/opt/openssl/include"
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/opt/openssl/lib"
export C_INCLUDE_PATH LD_LIBRARY_PATH
make CONFIG=NETSEND OPT_DEBUG=yes all
|
is
|Undefined symbols for architecture x86_64:
"_PKCS7_final", referenced from:
_smime_sign in xssl.o
"_PKCS7_sign_add_signer", referenced from:
_smime_sign in xssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
|
The linked OpenSSL version is
|/usr/local/opt/openssl/bin/openssl version
OpenSSL 1.0.2l 25 May 2017
|
Attached all files from the process.
All help appreciated, Alexander
awk="/usr/bin/awk";export awk; cat="/bin/cat";export cat;
chmod="/bin/chmod";export chmod; chown="/usr/sbin/chown";export chown;
cp="/bin/cp";export cp; cmp="/usr/bin/cmp";export cmp;
grep="/usr/bin/grep";export grep; mkdir="/bin/mkdir";export mkdir;
mv="/bin/mv";export mv; rm="/bin/rm";export rm; sed="/usr/bin/sed";export sed;
sort="/usr/bin/sort";export sort; tee="/usr/bin/tee";export tee;
tr="/usr/bin/tr";export tr;
MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make";export MAKE;
MAKEFLAGS="OPT_DEBUG=yes CONFIG=NETSEND";export MAKEFLAGS;
make="/Applications/Xcode.app/Contents/Developer/usr/bin/make";export make;
SHELL="/bin/sh";export SHELL; strip="/usr/bin/strip";export strip;
cksum="/usr/bin/cksum";export cksum;
#ifndef n_MK_CONFIG_H
# define n_MK_CONFIG_H 1
#define VAL_CONTACT_MAIL "[email protected]"
#define VAL_CONTACT_WEB "https://www.sdaoden.eu/code.html"
#define VAL_PRIVSEP_USER "root"
#define VAL_PREFIX "/usr/local"
#define VAL_BINDIR "/usr/local/bin"
#define VAL_LIBEXECDIR "/usr/local/libexec"
#define VAL_MANDIR "/usr/local/share/man"
#define VAL_SYSCONFDIR "/usr/local/etc"
#define VAL_MAIL "/var/mail"
#define VAL_MTA "/usr/sbin/sendmail"
#define VAL_MTA_ARGV0 "sendmail"
#define VAL_SHELL "/bin/sh"
#define VAL_DEAD_BASENAME "dead.letter"
#define VAL_DEAD "~/dead.letter"
#define VAL_EDITOR "ed"
#define VAL_LISTER "ls"
#define VAL_MAILRC "~/.mailrc"
#define VAL_MBOX "~/mbox"
#define VAL_NETRC "~/.netrc"
#define VAL_PAGER "more"
#define VAL_TMPDIR "/tmp"
#define VAL_VISUAL "vi"
#define VAL_MIME_TYPES_USR "~/.mime.types"
#define VAL_MIME_TYPES_SYS "/etc/mime.types"
/* #undef OPT_ALWAYS_UNICODE_LOCALE */
/* #undef OPT_CROSS_BUILD */
/* #define OPT_AUTOCC */
/* #undef OPT_AMALGAMATION */
/* #define OPT_ICONV */
/* #define OPT_SOCKETS */
/* #define OPT_SSL */
/* #undef OPT_SSL_ALL_ALGORITHMS */
/* #define OPT_SMTP */
/* #undef OPT_POP3 */
/* #undef OPT_IMAP */
/* #define OPT_GSSAPI */
/* #undef OPT_MD5 */
/* #define OPT_NETRC */
/* #define OPT_AGENT */
/* #define OPT_IDNA */
/* #undef OPT_IMAP_SEARCH */
/* #define OPT_REGEX */
/* #define OPT_MLE */
/* #define OPT_HISTORY */
/* #define OPT_KEY_BINDINGS */
/* #undef OPT_TERMCAP */
/* #undef OPT_TERMCAP_VIA_TERMINFO */
/* #undef OPT_ERRORS */
/* #undef OPT_SPAM_SPAMC */
/* #undef OPT_SPAM_SPAMD */
/* #undef OPT_SPAM_FILTER */
/* #define OPT_DOCSTRINGS */
/* #undef OPT_QUOTE_FOLD */
/* #undef OPT_FILTER_HTML_TAGSOUP */
/* #define OPT_COLOUR */
/* #define OPT_DOTLOCK */
#define VAL_SID "s-"
#define VAL_MAILX "nail"
#define VAL_SYSCONFRC "s-nail.rc"
/* #define OPT_DEBUG */
/* #undef OPT_DEVEL */
/* #undef OPT_NOEXTMD5 */
/* #undef OPT_ASAN_ADDRESS */
/* #undef OPT_ASAN_MEMORY */
/* #define OPT_FORCED_STACKPROT */
/* #undef OPT_NOMEMDBG */
/* #undef OPT_NYD2 */
#define VAL_UAGENT "s-nail"
#define VAL_PRIVSEP "s-nail-privsep"
#define _GNU_SOURCE
#define VAL_BUILD_OS "darwin"
#define VAL_BUILD_OSENV "Darwin 16.7.0 x86_64"
/* checked OS error mapping table generated */
#define n__ERR_NUMBER_TYPE ui8_t
enum n_err_number{
n_ERR_NONE = 0,
n_ERR_PERM = 1,
n_ERR_NOENT = 2,
n_ERR_SRCH = 3,
n_ERR_INTR = 4,
n_ERR_IO = 5,
n_ERR_NXIO = 6,
n_ERR_2BIG = 7,
n_ERR_NOEXEC = 8,
n_ERR_BADF = 9,
n_ERR_CHILD = 10,
n_ERR_DEADLK = 11,
n_ERR_NOMEM = 12,
n_ERR_ACCES = 13,
n_ERR_FAULT = 14,
n_ERR_BUSY = 16,
n_ERR_EXIST = 17,
n_ERR_XDEV = 18,
n_ERR_NODEV = 19,
n_ERR_NOTDIR = 20,
n_ERR_ISDIR = 21,
n_ERR_INVAL = 22,
n_ERR_NFILE = 23,
n_ERR_MFILE = 24,
n_ERR_NOTTY = 25,
n_ERR_TXTBSY = 26,
n_ERR_FBIG = 27,
n_ERR_NOSPC = 28,
n_ERR_SPIPE = 29,
n_ERR_ROFS = 30,
n_ERR_MLINK = 31,
n_ERR_PIPE = 32,
n_ERR_DOM = 33,
n_ERR_RANGE = 34,
n_ERR_AGAIN = 35,
n_ERR_WOULDBLOCK = 35,
n_ERR_INPROGRESS = 36,
n_ERR_ALREADY = 37,
n_ERR_NOTSOCK = 38,
n_ERR_DESTADDRREQ = 39,
n_ERR_MSGSIZE = 40,
n_ERR_PROTOTYPE = 41,
n_ERR_NOPROTOOPT = 42,
n_ERR_PROTONOSUPPORT = 43,
n_ERR_NOTSUP = 45,
n_ERR_AFNOSUPPORT = 47,
n_ERR_ADDRINUSE = 48,
n_ERR_ADDRNOTAVAIL = 49,
n_ERR_NETDOWN = 50,
n_ERR_NETUNREACH = 51,
n_ERR_NETRESET = 52,
n_ERR_CONNABORTED = 53,
n_ERR_CONNRESET = 54,
n_ERR_NOBUFS = 55,
n_ERR_ISCONN = 56,
n_ERR_NOTCONN = 57,
n_ERR_TIMEDOUT = 60,
n_ERR_CONNREFUSED = 61,
n_ERR_NAMETOOLONG = 63,
n_ERR_HOSTUNREACH = 65,
n_ERR_NOTEMPTY = 66,
n_ERR_DQUOT = 69,
n_ERR_STALE = 70,
n_ERR_NOLCK = 77,
n_ERR_NOSYS = 78,
n_ERR_OVERFLOW = 84,
n_ERR_CANCELED = 89,
n_ERR_IDRM = 90,
n_ERR_NOMSG = 91,
n_ERR_ILSEQ = 92,
n_ERR_BADMSG = 94,
n_ERR_MULTIHOP = 95,
n_ERR_NODATA = 96,
n_ERR_NOLINK = 97,
n_ERR_NOSR = 98,
n_ERR_NOSTR = 99,
n_ERR_PROTO = 100,
n_ERR_TIME = 101,
n_ERR_OPNOTSUPP = 102,
n_ERR_NOTOBACCO = 255,
n__ERR_NUMBER = 80
};
#define n__ERR_NUMBER_TO_MAPOFF \
a_X(0, 0) \
a_X(1, 65) \
a_X(2, 44) \
a_X(3, 73) \
a_X(4, 27) \
a_X(5, 29) \
a_X(6, 62) \
a_X(7, 1) \
a_X(8, 45) \
a_X(9, 8) \
a_X(10, 12) \
a_X(11, 16) \
a_X(12, 48) \
a_X(13, 2) \
a_X(14, 21) \
a_X(16, 10) \
a_X(17, 20) \
a_X(18, 79) \
a_X(19, 43) \
a_X(20, 56) \
a_X(21, 31) \
a_X(22, 28) \
a_X(23, 40) \
a_X(24, 32) \
a_X(25, 61) \
a_X(26, 77) \
a_X(27, 22) \
a_X(28, 51) \
a_X(29, 72) \
a_X(30, 71) \
a_X(31, 33) \
a_X(32, 66) \
a_X(33, 18) \
a_X(34, 70) \
a_X(35, 6) \
a_X(36, 26) \
a_X(37, 7) \
a_X(38, 59) \
a_X(39, 17) \
a_X(40, 34) \
a_X(41, 69) \
a_X(42, 50) \
a_X(43, 68) \
a_X(45, 60) \
a_X(47, 5) \
a_X(48, 3) \
a_X(49, 4) \
a_X(50, 37) \
a_X(51, 39) \
a_X(52, 38) \
a_X(53, 13) \
a_X(54, 15) \
a_X(55, 41) \
a_X(56, 30) \
a_X(57, 55) \
a_X(60, 76) \
a_X(61, 14) \
a_X(63, 36) \
a_X(65, 23) \
a_X(66, 57) \
a_X(69, 19) \
a_X(70, 74) \
a_X(77, 46) \
a_X(78, 54) \
a_X(84, 64) \
a_X(89, 11) \
a_X(90, 24) \
a_X(91, 49) \
a_X(92, 25) \
a_X(94, 9) \
a_X(95, 35) \
a_X(96, 42) \
a_X(97, 47) \
a_X(98, 52) \
a_X(99, 53) \
a_X(100, 67) \
a_X(101, 75) \
a_X(102, 63) \
a_X(255, 58) \
/* 79 unique members */
#define n__ERR_NUMBER_VOIDOFF 58
/* OPT_ALWAYS_UNICODE_LOCALE=0 */
/* OPT_AMALGAMATION=0 */
/* OPT_CROSS_BUILD=0 */
#define HAVE_DOCSTRINGS
/* OPT_ERRORS=0 */
/* OPT_ASAN_ADDRESS=0 */
/* OPT_ASAN_MEMORY=0 */
#define HAVE_DEBUG
/* OPT_DEVEL=0 */
/* OPT_NYD2=0 */
/* OPT_NOMEMDBG=0 */
/* checked inline functions */
#define HAVE_INLINE
#define n_INLINE static inline
/* checked clock_gettime(2) */
#define HAVE_CLOCK_GETTIME
/* checked nanosleep(2) */
#define HAVE_NANOSLEEP
/* checked gete?[gu]id(2), getpwuid(3), getpwnam(3) */
/* checked ftruncate(2) */
#define HAVE_FTRUNCATE
/* checked SA_RESTART (for sigaction(2)) */
/* checked snprintf(3) */
/* checked environ(3) */
/* checked (un)?setenv(3) */
#define HAVE_SETENV
/* checked termios.h and tc*(3) family */
/* checked vsnprintf(3) */
/* checked va_copy(3) (as va_copy) */
#define HAVE_N_VA_COPY
#define n_va_copy va_copy
/* checked f?pathconf(2) */
#define HAVE_PATHCONF
/* checked pipe2(2) */
/* #define HAVE_PIPE2 */
/* checked utimensat(2) */
/* #define HAVE_UTIMENSAT */
/* checked arc4random(3) */
#define HAVE_POSIX_RANDOM 0
/* checked putc_unlocked(3) */
#define HAVE_PUTC_UNLOCKED
/* checked fchdir(3) */
#define HAVE_FCHDIR
/* checked realpath(3) */
#define HAVE_REALPATH
/* checked realpath(3) takes NULL */
#define HAVE_REALPATH_NULL
/* checked readlink(2) */
/* checked fchown(2) */
/* checked setlocale(3) */
#define HAVE_SETLOCALE
/* checked ISO/IEC 9899:1990/Amendment 1:1995 */
#define HAVE_C90AMEND1
/* checked wcwidth(3) */
#define HAVE_WCWIDTH
/* checked nl_langinfo(3) */
#define HAVE_NL_LANGINFO
/* checked fnmatch(3) */
#define HAVE_FNMATCH
/* checked struct dirent.d_type */
#define HAVE_DIRENT_TYPE
/* checked iconv(3) functionality */
/* #define HAVE_ICONV */
/* checked iconv(3) functionality (via -liconv) */
#define HAVE_ICONV
/* checked AF_UNIX sockets */
#define HAVE_UNIX_SOCKETS
/* checked sockets */
#define HAVE_SOCKETS
/* checked getaddrinfo(3) */
#define HAVE_GETADDRINFO
/* checked setsockopt(2) */
#define HAVE_SETSOCKOPT
/* checked SO_SNDTIMEO */
#define HAVE_SO_SNDTIMEO
/* checked SO_LINGER */
#define HAVE_SO_LINGER
/* checked TLS/SSL (LibreSSL) */
/* #define HAVE_SSL
#define HAVE_XSSL
#define HAVE_XSSL_RESSL
#define HAVE_XSSL_OPENSSL 0 */
/* checked TLS/SSL (OpenSSL >= v1.1.0) */
/* #define HAVE_SSL
#define HAVE_XSSL
#define HAVE_XSSL_OPENSSL 0x10100 */
/* checked TLS/SSL (OpenSSL) */
#define HAVE_SSL
#define HAVE_XSSL
#define HAVE_XSSL_OPENSSL 0x10000
/* checked TLS/SSL (new style *_client_method(3ssl)) */
/* #define n_XSSL_CLIENT_METHOD TLS_client_method */
/* checked TLS/SSL (old style *_client_method(3ssl)) */
#define n_XSSL_CLIENT_METHOD SSLv23_client_method
/* checked TLS/SSL STACK_OF() */
#define HAVE_XSSL_STACK_OF
/* checked TLS/SSL OpenSSL_modules_load_file() support */
#define HAVE_XSSL_CONFIG
/* checked TLS/SSL SSL_CONF_CTX support */
/* #define HAVE_XSSL_CONF_CTX */
/* checked TLS/SSL RAND_egd(3ssl) */
#define HAVE_XSSL_RAND_EGD
#define HAVE_SMIME
#define HAVE_SMTP
/* OPT_POP3=0 */
/* OPT_IMAP=0 */
/* checked GSS-API via krb5-config(1) */
#define HAVE_GSSAPI
#define HAVE_NETRC
#define HAVE_AGENT
/* checked GNU Libidn */
/* #define HAVE_IDNA HAVE_IDNA_LIBIDNA */
/* checked idnkit */
/* #define HAVE_IDNA HAVE_IDNA_IDNKIT */
/* OPT_IMAP_SEARCH=0 */
/* checked regular expressions */
#define HAVE_REGEX
#define HAVE_MLE
#define HAVE_HISTORY
#define HAVE_KEY_BINDINGS
/* OPT_TERMCAP=0 */
/* OPT_TERMCAP_VIA_TERMINFO=0 */
/* OPT_SPAM_SPAMC=0 */
/* OPT_SPAM_SPAMD=0 */
/* OPT_SPAM_FILTER=0 */
/* HAVE_SPAM */
/* OPT_QUOTE_FOLD=0 */
/* OPT_FILTER_HTML_TAGSOUP=0 */
#define HAVE_COLOUR
#define HAVE_DOTLOCK
/* OPT_MD5=0 */
/* OPT_NOMEMDBG=0 */
/* The "feature string" */
#define VAL_FEATURES_CNT 37
#define VAL_FEATURES
"#+locales,+multibyte-charsets,+terminal-charset,+wide-glyphs,+iconv,+sockets,+ssl,-ssl-all-algorithms,+smtp,-pop3,-imap,+gssapi,+netrc,-md5,-idna,-imap-search,+regex,+mle,+history,+key-bindings,-termcap,-termcap-via-terminfo,-errors,-spam-spamc,-spam-filter,+docstrings,-quote-fold,-filter-html-tagsoup,+colour,+dotlock,+mime,+smime,-cross-build,+debug,-devel"
#endif /* n_MK_CONFIG_H */
-I/usr/local/opt/openssl/include
-liconv -lssl -lcrypto -dynamic -Wl,-search_paths_first -lkrb5
**********
*** . OS error mapping table generated ...
*** test program is
#include <mk-config.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined __STDC_VERSION__ && __STDC_VERSION__ + 0 >= 199901L
# include <stdint.h>
#else
# include <inttypes.h>
#endif
#ifdef UINT32_MAX
typedef uint32_t ui32_t;
typedef int32_t si32_t;
#elif ULONG_MAX == 0xFFFFFFFFu
typedef unsigned long int ui32_t;
typedef signed long int si32_t;
#else
typedef unsigned int ui32_t;
typedef signed int si32_t;
#endif
struct a_in {struct a_in *next; char const *name; si32_t no; ui32_t uno;};
static int a_sortin(void const *a, void const *b){
return (*(struct a_in const* const *)a)->uno -
(*(struct a_in const* const *)b)->uno;
}
int main(void){
char line[1024], *lp;
struct a_in *head, *tail, *np, **nap;
ui32_t maxsub, umax;
si32_t xavail = 0, total = 1, imin = 0, imax = 0, voidoff = 0,
i, telloff, j;
FILE *ifp = fopen("gen-errors.h", "r"), *ofp = fopen("./mk-config.h",
"a");
if(ifp == NULL || ofp == NULL){
fprintf(stderr, "ERROR: cannot open in- or output\n");
return 1;
}
/* Create a list of all errors */
head = tail = malloc(sizeof *head);
head->next = NULL; head->name = "n_ERR_NONE"; head->no = 0;
++total;
#ifdef E2BIG
i = E2BIG;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_2BIG"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EACCES
i = EACCES;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_ACCES"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EADDRINUSE
i = EADDRINUSE;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_ADDRINUSE"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EADDRNOTAVAIL
i = EADDRNOTAVAIL;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_ADDRNOTAVAIL"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EAFNOSUPPORT
i = EAFNOSUPPORT;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_AFNOSUPPORT"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EAGAIN
i = EAGAIN;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_AGAIN"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EALREADY
i = EALREADY;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_ALREADY"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EBADF
i = EBADF;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_BADF"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EBADMSG
i = EBADMSG;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_BADMSG"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EBUSY
i = EBUSY;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_BUSY"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ECANCELED
i = ECANCELED;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_CANCELED"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ECHILD
i = ECHILD;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_CHILD"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ECONNABORTED
i = ECONNABORTED;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_CONNABORTED"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ECONNREFUSED
i = ECONNREFUSED;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_CONNREFUSED"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ECONNRESET
i = ECONNRESET;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_CONNRESET"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EDEADLK
i = EDEADLK;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_DEADLK"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EDESTADDRREQ
i = EDESTADDRREQ;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_DESTADDRREQ"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EDOM
i = EDOM;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_DOM"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EDQUOT
i = EDQUOT;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_DQUOT"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EEXIST
i = EEXIST;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_EXIST"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EFAULT
i = EFAULT;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_FAULT"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EFBIG
i = EFBIG;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_FBIG"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EHOSTUNREACH
i = EHOSTUNREACH;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_HOSTUNREACH"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EIDRM
i = EIDRM;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_IDRM"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EILSEQ
i = EILSEQ;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_ILSEQ"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EINPROGRESS
i = EINPROGRESS;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_INPROGRESS"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EINTR
i = EINTR;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_INTR"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EINVAL
i = EINVAL;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_INVAL"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EIO
i = EIO;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_IO"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EISCONN
i = EISCONN;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_ISCONN"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EISDIR
i = EISDIR;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_ISDIR"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EMFILE
i = EMFILE;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_MFILE"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EMLINK
i = EMLINK;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_MLINK"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EMSGSIZE
i = EMSGSIZE;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_MSGSIZE"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EMULTIHOP
i = EMULTIHOP;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_MULTIHOP"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENAMETOOLONG
i = ENAMETOOLONG;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NAMETOOLONG"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENETDOWN
i = ENETDOWN;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NETDOWN"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENETRESET
i = ENETRESET;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NETRESET"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENETUNREACH
i = ENETUNREACH;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NETUNREACH"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENFILE
i = ENFILE;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NFILE"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOBUFS
i = ENOBUFS;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOBUFS"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENODATA
i = ENODATA;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NODATA"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENODEV
i = ENODEV;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NODEV"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOENT
i = ENOENT;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOENT"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOEXEC
i = ENOEXEC;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOEXEC"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOLCK
i = ENOLCK;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOLCK"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOLINK
i = ENOLINK;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOLINK"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOMEM
i = ENOMEM;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOMEM"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOMSG
i = ENOMSG;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOMSG"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOPROTOOPT
i = ENOPROTOOPT;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOPROTOOPT"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOSPC
i = ENOSPC;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOSPC"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOSR
i = ENOSR;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOSR"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOSTR
i = ENOSTR;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOSTR"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOSYS
i = ENOSYS;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOSYS"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOTCONN
i = ENOTCONN;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOTCONN"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOTDIR
i = ENOTDIR;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOTDIR"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOTEMPTY
i = ENOTEMPTY;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOTEMPTY"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOTOBACCO
i = ENOTOBACCO;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOTOBACCO"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOTSOCK
i = ENOTSOCK;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOTSOCK"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOTSUP
i = ENOTSUP;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOTSUP"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENOTTY
i = ENOTTY;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NOTTY"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ENXIO
i = ENXIO;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_NXIO"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EOPNOTSUPP
i = EOPNOTSUPP;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_OPNOTSUPP"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EOVERFLOW
i = EOVERFLOW;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_OVERFLOW"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EPERM
i = EPERM;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_PERM"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EPIPE
i = EPIPE;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_PIPE"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EPROTO
i = EPROTO;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_PROTO"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EPROTONOSUPPORT
i = EPROTONOSUPPORT;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_PROTONOSUPPORT"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EPROTOTYPE
i = EPROTOTYPE;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_PROTOTYPE"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ERANGE
i = ERANGE;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_RANGE"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EROFS
i = EROFS;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_ROFS"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ESPIPE
i = ESPIPE;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_SPIPE"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ESRCH
i = ESRCH;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_SRCH"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ESTALE
i = ESTALE;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_STALE"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ETIME
i = ETIME;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_TIME"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ETIMEDOUT
i = ETIMEDOUT;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_TIMEDOUT"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef ETXTBSY
i = ETXTBSY;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_TXTBSY"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EWOULDBLOCK
i = EWOULDBLOCK;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_WOULDBLOCK"; np->no = i;
tail->next = np; tail = np;
++total;
#ifdef EXDEV
i = EXDEV;
#else
i = --xavail;
#endif
if(imin > i) imin = i; if(imax < i) imax = i;
np = malloc(sizeof *np);
np->next = NULL; np->name = "n_ERR_XDEV"; np->no = i;
tail->next = np; tail = np;
/* The unsigned type used for storage */
fputs("#define n__ERR_NUMBER_TYPE ", ofp);
if((ui32_t)imax <= 0xFFu && (ui32_t)-imin <= 0xFFu){
fputs("ui8_t\n", ofp);
maxsub = 0xFFu;
}else if(((ui32_t)imax <= 0xFFFFu && (ui32_t)-imin <= 0xFFFFu)){
fputs("ui16_t\n", ofp);
maxsub = 0xFFFFu;
}else{
fputs("ui32_t\n", ofp);
maxsub = 0xFFFFFFFFu;
}
/* Now that we know the storage type, create the unsigned numbers */
for(umax = 0, np = head; np != NULL; np = np->next){
if(np->no < 0)
np->uno = maxsub + np->no + 1;
else
np->uno = np->no;
if(np->uno > umax)
umax = np->uno;
}
if(umax <= (ui32_t)imax){
fprintf(stderr, "ERROR: errno ranges overlap\n");
return 1;
}
/* Sort this list */
nap = malloc(sizeof(*nap) * (unsigned)total);
for(i = 0, np = head; np != NULL; ++i, np = np->next)
nap[i] = np;
if(i != total){
fprintf(stderr, "ERROR: implementation error i != total\n");
return 1;
}
qsort(nap, (ui32_t)i, sizeof *nap, &a_sortin);
/* The enumeration of numbers */
fputs("enum n_err_number{\n", ofp);
for(i = 0; i < total; ++i)
fprintf(ofp, " %s = %lu,\n",
nap[i]->name, (unsigned long)nap[i]->uno);
fprintf(ofp, " n__ERR_NUMBER = %ld\n", (long)total);
fputs("};\n", ofp);
/* The binary search mapping table from OS error value to our internal
* a_aux_err_map[] error description table */
/* A real hack to have a fast NUMBER -> MAP mapping without compiling
* and running a second C program during config */
while((lp = fgets(line, sizeof line, ifp)) != NULL &&
strstr(lp, "a_aux_err_map[]") == NULL)
;
if(feof(ifp) || ferror(ifp)){
fprintf(stderr, "ERROR: I/O error when reading \"ifp\"\n");
return 1;
}
telloff = (int)ftell(ifp);
fprintf(ofp, "#define n__ERR_NUMBER_TO_MAPOFF \\\n");
for(xavail = 0, i = 0; i < total; ++i){
if(i == 0 || nap[i]->no != nap[i - 1]->no){
if(fseek(ifp, telloff, SEEK_SET) == -1){
fprintf(stderr, "ERROR: I/O error when searching \"ifp\", I.\n");
return 1;
}
j = 0;
while((lp = fgets(line, sizeof line, ifp)) != NULL &&
strstr(lp, nap[i]->name) == NULL)
++j;
if(feof(ifp) || ferror(ifp)){
fprintf(stderr, "ERROR: I/O error when reading \"ifp\", II.\n");
return 1;
}
fprintf(ofp, "\ta_X(%lu, %lu) %s%s%s\\\n",
(unsigned long)nap[i]->uno, (long)(ui32_t)j,
((0) ? "/* " : ""), ((0) ? nap[i]->name : ""),
((0) ? " */ " : ""));
if(!strcmp("n_ERR_NOTOBACCO", nap[i]->name))
voidoff = j;
++xavail;
}
}
fprintf(ofp, "\t/* %ld unique members */\n", (long)xavail);
fprintf(ofp, "#define n__ERR_NUMBER_VOIDOFF %ld\n", (long)voidoff);
fclose(ofp);
while((np = head) != NULL){
head = np->next;
free(np);
}
free(nap);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g -Wall
-Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 2
*** yes
**********
*** . inline functions ...
*** test program is
#include <mk-config.h>
static inline int ilf(int i){return ++i;}
int main(void){return ilf(-1);}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g -Wall
-Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 2
*** yes
**********
*** . clock_gettime(2) ...
*** test program is
#include <mk-config.h>
#include <time.h>
# include <errno.h>
int main(void){
struct timespec ts;
if(!clock_gettime(CLOCK_REALTIME, &ts) || errno != ENOSYS)
return 0;
return 1;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g -Wall
-Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . nanosleep(2) ...
*** test program is
#include <mk-config.h>
#include <time.h>
# include <errno.h>
int main(void){
struct timespec ts;
ts.tv_sec = 1;
ts.tv_nsec = 100000;
if(!nanosleep(&ts, NULL) || errno != ENOSYS)
return 0;
return 1;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g -Wall
-Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . gete?[gu]id(2), getpwuid(3), getpwnam(3) ...
*** test program is
#include <mk-config.h>
#include <pwd.h>
#include <unistd.h>
# include <errno.h>
int main(void){
struct passwd *pw;
gid_t gid;
uid_t uid;
if((gid = getgid()) != 0)
gid = getegid();
if((uid = getuid()) != 0)
uid = geteuid();
if((pw = getpwuid(uid)) == NULL && errno == ENOSYS)
return 1;
if((pw = getpwnam("root")) == NULL && errno == ENOSYS)
return 1;
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g -Wall
-Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . ftruncate(2) ...
*** test program is
#include <mk-config.h>
#include <unistd.h>
#include <sys/types.h>
int main(void){
return (ftruncate(0, 0) != 0);
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g -Wall
-Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . SA_RESTART (for sigaction(2)) ...
*** test program is
#include <mk-config.h>
#include <signal.h>
# include <errno.h>
int main(void){
struct sigaction nact, oact;
nact.sa_handler = SIG_DFL;
sigemptyset(&nact.sa_mask);
nact.sa_flags = SA_RESTART;
return !(!sigaction(SIGCHLD, &nact, &oact) || errno != ENOSYS);
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g -Wall
-Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . snprintf(3) ...
*** test program is
#include <mk-config.h>
#include <stdio.h>
int main(void){
char b[20];
snprintf(b, sizeof b, "%s", "string");
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g
-Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . environ(3) ...
*** test program is
#include <mk-config.h>
#include <stdio.h> /* For C89 NULL */
int main(void){
extern char **environ;
return environ[0] == NULL;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g
-Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . (un)?setenv(3) ...
*** test program is
#include <mk-config.h>
#include <stdlib.h>
int main(void){
setenv("s-mailx", "i want to see it cute!", 1);
unsetenv("s-mailx");
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g
-Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . termios.h and tc*(3) family ...
*** test program is
#include <mk-config.h>
#include <termios.h>
int main(void){
struct termios tios;
tcgetattr(0, &tios);
tcsetattr(0, TCSANOW | TCSADRAIN | TCSAFLUSH, &tios);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g
-Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . vsnprintf(3) ...
*** test program is
#include <mk-config.h>
#include <stdarg.h>
#include <stdio.h>
static void dome(char *buf, size_t blen, ...){
va_list ap;
va_start(ap, blen);
vsnprintf(buf, blen, "%s", ap);
va_end(ap);
}
int main(void){
char b[20];
dome(b, sizeof b, "string");
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g
-Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . va_copy(3) (as va_copy) ...
*** test program is
#include <mk-config.h>
#include <stdarg.h>
#include <stdio.h>
#if 0
# if defined __va_copy && !defined va_copy
# define va_copy __va_copy
# endif
#endif
static void dome2(char *buf, size_t blen, va_list src){
va_list ap;
va_copy(ap, src);
vsnprintf(buf, blen, "%s", ap);
va_end(ap);
}
static void dome(char *buf, size_t blen, ...){
va_list ap;
va_start(ap, blen);
dome2(buf, blen, ap);
va_end(ap);
}
int main(void){
char b[20];
dome(b, sizeof b, "string");
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O -g
-Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . f?pathconf(2) ...
*** test program is
#include <mk-config.h>
#include <unistd.h>
#include <errno.h>
int main(void){
int rv = 0;
errno = 0;
rv |= !(pathconf(".", _PC_NAME_MAX) >= 0 || errno == 0 || errno != ENOSYS);
errno = 0;
rv |= !(pathconf(".", _PC_PATH_MAX) >= 0 || errno == 0 || errno != ENOSYS);
/* Only link check */
fpathconf(0, _PC_NAME_MAX);
return rv;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O
-g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . pipe2(2) ...
*** test program is
#include <mk-config.h>
#include <fcntl.h>
#include <unistd.h>
# include <errno.h>
int main(void){
int fds[2];
if(!pipe2(fds, O_CLOEXEC) || errno != ENOSYS)
return 0;
return 1;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O
-g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
___tmp149129.c:8:8: warning: implicit declaration of function 'pipe2' is
invalid in C99 [-Wimplicit-function-declaration]
if(!pipe2(fds, O_CLOEXEC) || errno != ENOSYS)
^
1 warning generated.
Undefined symbols for architecture x86_64:
"_pipe2", referenced from:
_main in ___tmp149129-eb1d41.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [___tmp149129] Error 1
*** no
**********
*** . utimensat(2) ...
*** test program is
#include <mk-config.h>
#include <fcntl.h> /* For AT_* */
#include <sys/stat.h>
# include <errno.h>
int main(void){
struct timespec ts[2];
ts[0].tv_nsec = UTIME_NOW;
ts[1].tv_nsec = UTIME_OMIT;
if(!utimensat(AT_FDCWD, "", ts, 0) || errno != ENOSYS)
return 0;
return 1;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O
-g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
___tmp149129.c:8:20: error: use of undeclared identifier 'UTIME_NOW'
ts[0].tv_nsec = UTIME_NOW;
^
___tmp149129.c:9:20: error: use of undeclared identifier 'UTIME_OMIT'
ts[1].tv_nsec = UTIME_OMIT;
^
___tmp149129.c:10:8: warning: implicit declaration of function 'utimensat' is
invalid in C99 [-Wimplicit-function-declaration]
if(!utimensat(AT_FDCWD, "", ts, 0) || errno != ENOSYS)
^
1 warning and 2 errors generated.
make[1]: *** [___tmp149129] Error 1
*** no
**********
*** . arc4random(3) ...
*** test program is
#include <mk-config.h>
#include <stdlib.h>
int main(void){
arc4random();
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O
-g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . putc_unlocked(3) ...
*** test program is
#include <mk-config.h>
#include <stdio.h>
int main(void){
putc_unlocked('@', stdout);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99 -O
-g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . fchdir(3) ...
*** test program is
#include <mk-config.h>
#include <unistd.h>
int main(void){
fchdir(0);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99
-O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . realpath(3) ...
*** test program is
#include <mk-config.h>
#include <stdlib.h>
int main(void){
char x_buf[4096], *x = realpath(".", x_buf);
return (x != NULL) ? 0 : 1;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99
-O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . realpath(3) takes NULL ...
*** test program is
#include <mk-config.h>
#include <stdlib.h>
int main(void){
char *x = realpath(".", NULL);
if(x != NULL)
free(x);
return (x != NULL) ? 0 : 1;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include -std=c99
-O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Winit-self
-Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings -Wno-long-long -pedantic
-Wno-unused-result -fno-unwind-tables -fno-asynchronous-unwind-tables
-fstrict-aliasing -fstrict-overflow -fstack-protector-strong
-D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129 ___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . readlink(2) ...
*** test program is
#include <mk-config.h>
#include <unistd.h>
# include <errno.h>
int main(void){
char buf[128];
if(!readlink("here", buf, sizeof buf) || errno != ENOSYS)
return 0;
return 1;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . fchown(2) ...
*** test program is
#include <mk-config.h>
#include <unistd.h>
# include <errno.h>
int main(void){
if(!fchown(0, 0, 0) || errno != ENOSYS)
return 0;
return 1;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . setlocale(3) ...
*** test program is
#include <mk-config.h>
#include <locale.h>
int main(void){
setlocale(LC_ALL, "");
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . ISO/IEC 9899:1990/Amendment 1:1995 ...
*** test program is
#include <mk-config.h>
#include <limits.h>
#include <stdlib.h>
#include <wchar.h>
#include <wctype.h>
int main(void){
char mbb[MB_LEN_MAX + 1];
wchar_t wc;
iswprint(L'c');
towupper(L'c');
mbtowc(&wc, "x", 1);
mbrtowc(&wc, "x", 1, NULL);
wctomb(mbb, wc);
return (mblen("\0", 1) == 0);
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . wcwidth(3) ...
*** test program is
#include <mk-config.h>
#include <wchar.h>
int main(void){
wcwidth(L'c');
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . nl_langinfo(3) ...
*** test program is
#include <mk-config.h>
#include <langinfo.h>
#include <stdlib.h>
int main(void){
nl_langinfo(DAY_1);
return (nl_langinfo(CODESET) == NULL);
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . fnmatch(3) ...
*** test program is
#include <mk-config.h>
#include <fnmatch.h>
int main(void){
return (fnmatch("*", ".", FNM_PATHNAME | FNM_PERIOD) == FNM_NOMATCH);
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . struct dirent.d_type ...
*** test program is
#include <mk-config.h>
#include <dirent.h>
int main(void){
struct dirent de;
return !(de.d_type == DT_UNKNOWN ||
de.d_type == DT_DIR || de.d_type == DT_LNK);
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . iconv(3) functionality ...
*** test program is
#include <mk-config.h>
#include <stdio.h> /* For C89 NULL */
#include <iconv.h>
int main(void){
iconv_t id;
id = iconv_open("foo", "bar");
iconv(id, NULL, NULL, NULL, NULL);
iconv_close(id);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
_main in ___tmp149129-3007a6.o
"_iconv_close", referenced from:
_main in ___tmp149129-3007a6.o
"_iconv_open", referenced from:
_main in ___tmp149129-3007a6.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [___tmp149129] Error 1
*** no
**********
*** . iconv(3) functionality (via -liconv) ...
*** test program is
#include <mk-config.h>
#include <stdio.h> /* For C89 NULL */
#include <iconv.h>
int main(void){
iconv_t id;
id = iconv_open("foo", "bar");
iconv(id, NULL, NULL, NULL, NULL);
iconv_close(id);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<-liconv>; executed: 0
*** yes
**********
*** . AF_UNIX sockets ...
*** test program is
#include <mk-config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
# include <errno.h>
int main(void){
struct sockaddr_un soun;
if(socket(AF_UNIX, SOCK_STREAM, 0) == -1 && errno == ENOSYS)
return 1;
if(connect(0, (struct sockaddr*)&soun, 0) == -1 && errno == ENOSYS)
return 1;
if(shutdown(0, SHUT_RD | SHUT_WR | SHUT_RDWR) == -1 && errno == ENOSYS)
return 1;
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . sockets ...
*** test program is
#include <mk-config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
# include <errno.h>
int main(void){
struct sockaddr s;
if(socket(AF_INET, SOCK_STREAM, 0) == -1 && errno == ENOSYS)
return 1;
if(connect(0, &s, 0) == -1 && errno == ENOSYS)
return 1;
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . getaddrinfo(3) ...
*** test program is
#include <mk-config.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <stdio.h>
#include <netdb.h>
int main(void){
struct addrinfo a, *ap;
int lrv;
switch((lrv = getaddrinfo("foo", "0", &a, &ap))){
case EAI_NONAME:
case EAI_SERVICE:
default:
fprintf(stderr, "%s\n", gai_strerror(lrv));
case 0:
break;
}
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . setsockopt(2) ...
*** test program is
#include <mk-config.h>
#include <sys/socket.h>
#include <stdlib.h>
# include <errno.h>
int main(void){
int sockfd = 3;
if(setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE, NULL, 0) == -1 &&
errno == ENOSYS)
return 1;
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 1
*** yes
**********
*** . SO_SNDTIMEO ...
*** test program is
#include <mk-config.h>
#include <sys/socket.h>
#include <stdlib.h>
int main(void){
struct timeval tv;
int sockfd = 3;
tv.tv_sec = 42;
tv.tv_usec = 21;
setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof tv);
setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof tv);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . SO_LINGER ...
*** test program is
#include <mk-config.h>
#include <sys/socket.h>
#include <stdlib.h>
int main(void){
struct linger li;
int sockfd = 3;
li.l_onoff = 1;
li.l_linger = 42;
setsockopt(sockfd, SOL_SOCKET, SO_LINGER, &li, sizeof li);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . TLS/SSL (LibreSSL) ...
*** test program is
#include <mk-config.h>
#include <openssl/opensslv.h>
#ifdef LIBRESSL_VERSION_NUMBER
#else
# error nope
#endif
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -c ___tmp149129.c
___tmp149129.c:5:3: error: nope
# error nope
^
1 error generated.
make[1]: *** [___tmp149129.o] Error 1
*** no
**********
*** . TLS/SSL (OpenSSL >= v1.1.0) ...
*** test program is
#include <mk-config.h>
#include <openssl/opensslv.h>
#if OPENSSL_VERSION_NUMBER + 0 >= 0x10100000L
#else
# error nope
#endif
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -c ___tmp149129.c
___tmp149129.c:5:3: error: nope
# error nope
^
1 error generated.
make[1]: *** [___tmp149129.o] Error 1
*** no
**********
*** . TLS/SSL (OpenSSL) ...
*** test program is
#include <mk-config.h>
#include <openssl/opensslv.h>
#ifdef OPENSSL_VERSION_NUMBER
#else
# error nope
#endif
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual
-Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -c ___tmp149129.c
*** yes
**********
*** . TLS/SSL (new style *_client_method(3ssl)) ...
*** test program is
#include <mk-config.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/x509v3.h>
#include <openssl/x509.h>
#include <openssl/rand.h>
#ifdef OPENSSL_NO_TLS1 /* TODO only deduced from OPENSSL_NO_SSL[23]! */
# error We need TLSv1.
#endif
int main(void){
SSL_CTX *ctx = SSL_CTX_new(TLS_client_method());
SSL_CTX_free(ctx);
PEM_read_PrivateKey(0, 0, 0, 0);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv -lssl -lcrypto
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
___tmp149129.c:11:31: warning: implicit declaration of function
'TLS_client_method' is invalid in C99 [-Wimplicit-function-declaration]
SSL_CTX *ctx = SSL_CTX_new(TLS_client_method());
^
___tmp149129.c:11:31: warning: incompatible integer to pointer conversion
passing 'int' to parameter of type 'const SSL_METHOD *' (aka 'const struct
ssl_method_st *') [-Wint-conversion]
SSL_CTX *ctx = SSL_CTX_new(TLS_client_method());
^~~~~~~~~~~~~~~~~~~
/usr/local/opt/openssl/include/openssl/ssl.h:2131:40: note: passing argument to
parameter 'meth' here
SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
^
2 warnings generated.
Undefined symbols for architecture x86_64:
"_TLS_client_method", referenced from:
_main in ___tmp149129-b7b973.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [___tmp149129] Error 1
*** no
**********
*** . TLS/SSL (old style *_client_method(3ssl)) ...
*** test program is
#include <mk-config.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/x509v3.h>
#include <openssl/x509.h>
#include <openssl/rand.h>
#if defined OPENSSL_NO_SSL3 &&\
defined OPENSSL_NO_TLS1 /* TODO only deduced from OPENSSL_NO_SSL[23]! */
# error We need one of SSLv3 and TLSv1.
#endif
int main(void){
SSL_CTX *ctx = SSL_CTX_new(SSLv23_client_method());
SSL_CTX_free(ctx);
PEM_read_PrivateKey(0, 0, 0, 0);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv -lssl -lcrypto
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<-lssl -lcrypto>; executed: 0
*** yes
**********
*** . TLS/SSL STACK_OF() ...
*** test program is
#include <mk-config.h>
#include <stdio.h> /* For C89 NULL */
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/x509v3.h>
#include <openssl/x509.h>
#include <openssl/rand.h>
int main(void){
STACK_OF(GENERAL_NAME) *gens = NULL;
printf("%p", gens); /* to use it */
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -c ___tmp149129.c
___tmp149129.c:11:17: warning: format specifies type 'void *' but the argument
has type 'struct stack_st_GENERAL_NAME *' [-Wformat-pedantic]
printf("%p", gens); /* to use it */
~~ ^~~~
1 warning generated.
*** yes
**********
*** . TLS/SSL OpenSSL_modules_load_file() support ...
*** test program is
#include <mk-config.h>
#include <stdio.h> /* For C89 NULL */
#include <openssl/conf.h>
int main(void){
CONF_modules_load_file(NULL, NULL, CONF_MFLAGS_IGNORE_MISSING_FILE);
CONF_modules_free();
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv -lssl -lcrypto
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . TLS/SSL SSL_CONF_CTX support ...
*** test program is
#include <mk-config.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
int main(void){
SSL_CTX *ctx = SSL_CTX_new(n_XSSL_CLIENT_METHOD());
SSL_CONF_CTX *cctx = SSL_CONF_CTX_new();
SSL_CONF_CTX_set_flags(cctx,
SSL_CONF_FLAG_FILE | SSL_CONF_FLAG_CLIENT |
SSL_CONF_FLAG_CERTIFICATE | SSL_CONF_FLAG_SHOW_ERRORS);
SSL_CONF_CTX_set_ssl_ctx(cctx, ctx);
SSL_CONF_cmd(cctx, "Protocol", "ALL");
SSL_CONF_CTX_finish(cctx);
SSL_CONF_CTX_free(cctx);
SSL_CTX_free(ctx);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv -lssl -lcrypto
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
Undefined symbols for architecture x86_64:
"_SSL_CONF_CTX_finish", referenced from:
_main in ___tmp149129-1e01aa.o
"_SSL_CONF_CTX_free", referenced from:
_main in ___tmp149129-1e01aa.o
"_SSL_CONF_CTX_new", referenced from:
_main in ___tmp149129-1e01aa.o
"_SSL_CONF_CTX_set_flags", referenced from:
_main in ___tmp149129-1e01aa.o
"_SSL_CONF_CTX_set_ssl_ctx", referenced from:
_main in ___tmp149129-1e01aa.o
"_SSL_CONF_cmd", referenced from:
_main in ___tmp149129-1e01aa.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [___tmp149129] Error 1
*** no
**********
*** . TLS/SSL RAND_egd(3ssl) ...
*** test program is
#include <mk-config.h>
#include <openssl/rand.h>
int main(void){
return RAND_egd("some.where") > 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv -lssl -lcrypto
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
**********
*** . GSS-API via krb5-config(1) ...
*** test program is
#include <mk-config.h>
#include <gssapi/gssapi.h>
int main(void){
gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv -lssl -lcrypto -dynamic -Wl,-search_paths_first
-lkrb5
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
___tmp149129.c:4:4: warning: 'gss_import_name' is deprecated: use GSS.framework
[-Wdeprecated-declarations]
gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
^
/usr/include/gssapi/gssapi.h:586:1: note: 'gss_import_name' has been explicitly
marked deprecated here
gss_import_name(
^
___tmp149129.c:5:4: warning: 'gss_init_sec_context' is deprecated: use
GSS.framework [-Wdeprecated-declarations]
gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
^
/usr/include/gssapi/gssapi.h:461:1: note: 'gss_init_sec_context' has been
explicitly marked deprecated here
gss_init_sec_context(
^
2 warnings generated.
*** adding INCS<> LIBS<-dynamic -Wl,-search_paths_first -lkrb5>; executed: 0
*** yes
**********
*** . GNU Libidn ...
*** test program is
#include <mk-config.h>
#include <idna.h>
#include <idn-free.h>
#include <stringprep.h>
int main(void){
char *utf8, *idna_ascii, *idna_utf8;
utf8 = stringprep_locale_to_utf8("does.this.work");
if (idna_to_ascii_8z(utf8, &idna_ascii, IDNA_USE_STD3_ASCII_RULES)
!= IDNA_SUCCESS)
return 1;
idn_free(idna_ascii);
/* (Rather link check only here) */
idna_utf8 = stringprep_convert(idna_ascii, "UTF-8", "de_DE");
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv -lssl -lcrypto -dynamic -Wl,-search_paths_first
-lkrb5 -lidn
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
___tmp149129.c:2:10: fatal error: 'idna.h' file not found
#include <idna.h>
^
1 error generated.
make[1]: *** [___tmp149129] Error 1
*** no
**********
*** . idnkit ...
*** test program is
#include <mk-config.h>
#include <stdio.h>
#include <idn/api.h>
#include <idn/result.h>
int main(void){
idn_result_t r;
char ace_name[256];
char local_name[256];
r = idn_encodename(IDN_ENCODE_APP, "does.this.work", ace_name,
sizeof(ace_name));
if (r != idn_success) {
fprintf(stderr, "idn_encodename failed: %s\n", idn_result_tostring(r));
return 1;
}
r = idn_decodename(IDN_DECODE_APP, ace_name, local_name, sizeof(local_name));
if (r != idn_success) {
fprintf(stderr, "idn_decodename failed: %s\n", idn_result_tostring(r));
return 1;
}
return 0;
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv -lssl -lcrypto -dynamic -Wl,-search_paths_first
-lkrb5 -lidnkit
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
___tmp149129.c:3:10: fatal error: 'idn/api.h' file not found
#include <idn/api.h>
^
1 error generated.
make[1]: *** [___tmp149129] Error 1
*** no
**********
*** . regular expressions ...
*** test program is
#include <mk-config.h>
#include <regex.h>
#include <stdlib.h>
int main(void){
size_t xret;
int status;
regex_t re;
status = regcomp(&re, ".*bsd", REG_EXTENDED | REG_ICASE | REG_NOSUB);
xret = regerror(status, &re, NULL, 0);
status = regexec(&re, "plan9", 0,NULL, 0);
regfree(&re);
return !(status == REG_NOMATCH);
}
*** results are
/usr/bin/clang -I./ -I/usr/local/opt/openssl/include
-std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE -pie -o ___tmp149129
___tmp149129.c -liconv -lssl -lcrypto -dynamic -Wl,-search_paths_first
-lkrb5
clang: warning: argument unused during compilation: '-pie'
[-Wunused-command-line-argument]
*** adding INCS<> LIBS<>; executed: 0
*** yes
***
The following features are included (+) or not (-):
*** + locales: Locale support - printable characters etc. depend on environment
*** + multibyte-charsets: Multibyte character sets
*** + terminal-charset: Automatic detection of terminal character set
*** + wide-glyphs: Wide glyph support
*** + iconv: Character set conversion using iconv(3)
*** + sockets: Network support
*** + ssl: SSL/TLS (OpenSSL / LibreSSL)
*** - ssl-all-algorithms: Support of all digest and cipher algorithms
*** + smtp: Simple Mail Transfer Protocol client
*** - pop3: Post Office Protocol Version 3 client
*** - imap: IMAP v4r1 client
*** + gssapi: Generic Security Service authentication
*** + netrc: .netrc file support
*** - md5: MD5 message digest (APOP, CRAM-MD5)
*** - idna: Internationalized Domain Names for Applications (encode only)
*** - imap-search: IMAP-style search expressions
*** + regex: Regular expressions
*** + mle: Mailx Line Editor
*** + history: Line editor history management
*** + key-bindings: Configurable key bindings
*** - termcap: Terminal capability queries (termcap(5))
*** - termcap-via-terminfo: Terminal capability queries use terminfo(5)
*** - errors: Error log message ring
*** - spam-spamc: Spam management via spamc(1) of spamassassin(1)
*** - spam-filter: Freely configurable *spam-filter-..*s
*** + docstrings: Command documentation help strings
*** - quote-fold: Extended *quote-fold*ing
*** - filter-html-tagsoup: Simple built-in HTML-to-text display filter
*** + colour: Coloured message display
*** + dotlock: Dotlock files and privilege-separated dotlock program
*** + mime: Multipurpose Internet Mail Extensions
*** + smime: S/MIME message signing, verification, en- and decryption
*** - cross-build: Cross-compilation: trust any detected environment
*** + debug: Debug enabled binary, not for end-users: THANKS!
*** - devel: Computers do not blunder
***
Setup:
*** . System-wide resource file: /usr/local/etc/s-nail.rc
*** . bindir: /usr/local/bin
*** . libexecdir: /usr/local/libexec
*** . mandir: /usr/local/share/man
*** . M(ail)T(ransfer)A(gent): /usr/sbin/sendmail (argv0 sendmail)
*** . $MAIL spool directory: /var/mail
***
[email protected]
VAL_CONTACT_WEB=https://www.sdaoden.eu/code.html
VAL_PRIVSEP_USER=root
VAL_PREFIX=/usr/local
VAL_BINDIR=/usr/local/bin
VAL_LIBEXECDIR=/usr/local/libexec
VAL_MANDIR=/usr/local/share/man
VAL_SYSCONFDIR=/usr/local/etc
VAL_MAIL=/var/mail
VAL_MTA=/usr/sbin/sendmail
VAL_MTA_ARGV0=sendmail
VAL_SHELL=/bin/sh
VAL_DEAD_BASENAME=dead.letter
VAL_DEAD=~/dead.letter
VAL_EDITOR=ed
VAL_LISTER=ls
VAL_MAILRC=~/.mailrc
VAL_MBOX=~/mbox
VAL_NETRC=~/.netrc
VAL_PAGER=more
VAL_TMPDIR=/tmp
VAL_VISUAL=vi
VAL_MIME_TYPES_USR=~/.mime.types
VAL_MIME_TYPES_SYS=/etc/mime.types
OPT_ALWAYS_UNICODE_LOCALE=0
OPT_CROSS_BUILD=0
OPT_AUTOCC=1
OPT_AMALGAMATION=0
OPT_ICONV=require
OPT_SOCKETS=1
OPT_SSL=require
OPT_SSL_ALL_ALGORITHMS=0
OPT_SMTP=require
OPT_POP3=0
OPT_IMAP=0
OPT_GSSAPI=1
OPT_MD5=0
OPT_NETRC=1
OPT_AGENT=1
OPT_IDNA=1
OPT_IMAP_SEARCH=0
OPT_REGEX=1
OPT_MLE=1
OPT_HISTORY=1
OPT_KEY_BINDINGS=1
OPT_TERMCAP=0
OPT_TERMCAP_VIA_TERMINFO=0
OPT_ERRORS=0
OPT_SPAM_SPAMC=0
OPT_SPAM_SPAMD=0
OPT_SPAM_FILTER=0
OPT_DOCSTRINGS=1
OPT_QUOTE_FOLD=0
OPT_FILTER_HTML_TAGSOUP=0
OPT_COLOUR=1
OPT_DOTLOCK=require
VAL_SID=s-
VAL_MAILX=nail
VAL_SYSCONFRC=s-nail.rc
OPT_DEBUG=1
OPT_DEVEL=0
OPT_NOEXTMD5=0
OPT_ASAN_ADDRESS=0
OPT_ASAN_MEMORY=0
OPT_FORCED_STACKPROT=1
OPT_NOMEMDBG=0
OPT_NYD2=0
awk=/usr/bin/awk
cat=/bin/cat
chmod=/bin/chmod
chown=/usr/sbin/chown
cp=/bin/cp
cmp=/usr/bin/cmp
grep=/usr/bin/grep
mkdir=/bin/mkdir
mv=/bin/mv
rm=/bin/rm
sed=/usr/bin/sed
sort=/usr/bin/sort
tee=/usr/bin/tee
tr=/usr/bin/tr
MAKE=/Applications/Xcode.app/Contents/Developer/usr/bin/make
MAKEFLAGS=OPT_DEBUG=yes CONFIG=NETSEND
make=/Applications/Xcode.app/Contents/Developer/usr/bin/make
SHELL=/bin/sh
strip=/usr/bin/strip
cksum=/usr/bin/cksum
INCS= -I/usr/local/opt/openssl/include
LIBS=
CC=/usr/bin/clang
CFLAGS= -std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE
LDFLAGS= -pie
PATH=/usr/local/opt/python/libexec/bin:/usr/local/opt/node@6/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
C_INCLUDE_PATH=/usr/local/opt/openssl/include
LD_LIBRARY_PATH=
OSFULLSPEC=Darwin AlexanderMBP2013.local 16.7.0 Darwin Kernel Version 16.7.0:
Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
VAL_CONTACT_MAIL = [email protected]
VAL_CONTACT_WEB = https://www.sdaoden.eu/code.html
VAL_PRIVSEP_USER = root
VAL_PREFIX = /usr/local
VAL_BINDIR = /usr/local/bin
VAL_LIBEXECDIR = /usr/local/libexec
VAL_MANDIR = /usr/local/share/man
VAL_SYSCONFDIR = /usr/local/etc
VAL_MAIL = /var/mail
VAL_MTA = /usr/sbin/sendmail
VAL_MTA_ARGV0 = sendmail
VAL_SHELL = /bin/sh
VAL_DEAD_BASENAME = dead.letter
VAL_DEAD = ~/dead.letter
VAL_EDITOR = ed
VAL_LISTER = ls
VAL_MAILRC = ~/.mailrc
VAL_MBOX = ~/mbox
VAL_NETRC = ~/.netrc
VAL_PAGER = more
VAL_TMPDIR = /tmp
VAL_VISUAL = vi
VAL_MIME_TYPES_USR = ~/.mime.types
VAL_MIME_TYPES_SYS = /etc/mime.types
OPT_ALWAYS_UNICODE_LOCALE = 0
OPT_CROSS_BUILD = 0
OPT_AUTOCC = 1
OPT_AMALGAMATION = 0
OPT_ICONV = require
OPT_SOCKETS = 1
OPT_SSL = require
OPT_SSL_ALL_ALGORITHMS = 0
OPT_SMTP = require
OPT_POP3 = 0
OPT_IMAP = 0
OPT_GSSAPI = 1
OPT_MD5 = 0
OPT_NETRC = 1
OPT_AGENT = 1
OPT_IDNA = 1
OPT_IMAP_SEARCH = 0
OPT_REGEX = 1
OPT_MLE = 1
OPT_HISTORY = 1
OPT_KEY_BINDINGS = 1
OPT_TERMCAP = 0
OPT_TERMCAP_VIA_TERMINFO = 0
OPT_ERRORS = 0
OPT_SPAM_SPAMC = 0
OPT_SPAM_SPAMD = 0
OPT_SPAM_FILTER = 0
OPT_DOCSTRINGS = 1
OPT_QUOTE_FOLD = 0
OPT_FILTER_HTML_TAGSOUP = 0
OPT_COLOUR = 1
OPT_DOTLOCK = require
VAL_SID = s-
VAL_MAILX = nail
VAL_SYSCONFRC = s-nail.rc
OPT_DEBUG = 1
OPT_DEVEL = 0
OPT_NOEXTMD5 = 0
OPT_ASAN_ADDRESS = 0
OPT_ASAN_MEMORY = 0
OPT_FORCED_STACKPROT = 1
OPT_NOMEMDBG = 0
OPT_NYD2 = 0
VAL_UAGENT = s-nail
VAL_PRIVSEP = $(VAL_UAGENT)-privsep
OPTIONAL_PRIVSEP = $(VAL_PRIVSEP)
awk = /usr/bin/awk
cat = /bin/cat
chmod = /bin/chmod
chown = /usr/sbin/chown
cp = /bin/cp
cmp = /usr/bin/cmp
grep = /usr/bin/grep
mkdir = /bin/mkdir
mv = /bin/mv
rm = /bin/rm
sed = /usr/bin/sed
sort = /usr/bin/sort
tee = /usr/bin/tee
tr = /usr/bin/tr
MAKE = /Applications/Xcode.app/Contents/Developer/usr/bin/make
MAKEFLAGS = OPT_DEBUG=yes CONFIG=NETSEND
make = /Applications/Xcode.app/Contents/Developer/usr/bin/make
SHELL = /bin/sh
strip = /usr/bin/strip
cksum = /usr/bin/cksum
CC = /usr/bin/clang
CFLAGS = -std=c99 -O -g -Wall -Wextra -Wbad-function-cast -Wcast-align
-Wcast-qual -Winit-self -Wmissing-prototypes -Wshadow -Wunused -Wwrite-strings
-Wno-long-long -pedantic -Wno-unused-result -fno-unwind-tables
-fno-asynchronous-unwind-tables -fstrict-aliasing -fstrict-overflow
-fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIE
LDFLAGS = -pie
PATH =
/usr/local/opt/python/libexec/bin:/usr/local/opt/node@6/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
C_INCLUDE_PATH = /usr/local/opt/openssl/include
LD_LIBRARY_PATH =
OSFULLSPEC = Darwin AlexanderMBP2013.local 16.7.0 Darwin Kernel Version 16.7.0:
Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
ECHO_CC = @echo ' 'CC $(@);
ECHO_LINK = @echo ' 'LINK $(@);
ECHO_GEN = @echo ' 'GEN $(@);
ECHO_TEST = @
ECHO_CMD = @echo ' CMD';
ECHO_BLOCK_BEGIN = @(
ECHO_BLOCK_END = ) >/dev/null
BASE_LIBS =
BASE_INCS = -I/usr/local/opt/openssl/include
OBJ_SRC = accmacvar.c attachment.c auxlily.c cmd-cnd.c cmd-folder.c
cmd-headers.c cmd-message.c cmd-misc.c cmd-resend.c cmd-tab.c cmd-write.c
collect.c colour.c dotlock.c edit.c filter.c fio.c folder.c go.c head.c
ignore.c imap-search.c maildir.c main.c memory.c message.c mime-enc.c
mime-param.c mime-parse.c mime-types.c mime.c nam-a-grp.c obs-imap-cache.c
obs-imap.c obs-lzw.c path.c pop3.c popen.c quit.c send.c sendout.c shexp.c
signal.c smtp.c socket.c spam.c ssl.c strings.c termcap.c thread.c tty.c
ui-str.c urlcrecry.c xssl.c
AMALGAM_TARGET =
AMALGAM_DEP =
LIBS = -liconv -lssl -lcrypto -dynamic -Wl,-search_paths_first -lkrb5
INCS = -I/usr/local/opt/openssl/include
#@ make-config.in -- mk-config.mk template, completed by make-config.sh.
#@ Please see INSTALL and make.rc instead.
SIZE_CHECK = @if ( command -v size ) > /dev/null 2>&1; then size $(@); fi
_version_from_header = VERSION="`< gen-version.h $(sed) \
-e '/ n_VERSION /b X' -e d -e ':X' \
-e 's/[^\"]*\"v\([^\"]\{1,\}\)\"/\1/'`"
OBJ = $(OBJ_SRC:.c=.o)
.SUFFIXES: .o .c .y
.c.o:
$(ECHO_CC)$(CC) $(CFLAGS) $(INCS) -c $(<)
.c: ;
all: $(VAL_UAGENT) $(OPTIONAL_PRIVSEP)
$(VAL_UAGENT): $(OBJ) uman.1 urc.rc
$(ECHO_LINK)$(CC) $(LDFLAGS) -o $(@) $(OBJ) $(LIBS)
$(SIZE_CHECK)
$(OBJ): mk-config.h config.h nail.h nailfuns.h $(AMALGAM_DEP)
$(AMALGAM_TARGET) auxlily.c: gen-errors.h
$(AMALGAM_TARGET) accmacvar.o: gen-okeys.h gen-version.h
$(AMALGAM_TARGET) cmd-tab.o: cmd-tab.h
$(AMALGAM_TARGET) dotlock.o: dotlock.h
$(AMALGAM_TARGET) obs-imap.o: obs-imap-gssapi.h
$(AMALGAM_TARGET) mime-types.o: gen-mime-types.h
$(AMALGAM_TARGET) obs-imap.o pop3.o smtp.o urlcrecry.o: rfc1321.h
$(AMALGAM_TARGET) smtp.o: smtp-gssapi.h
$(AMALGAM_TARGET) termcap.o: gen-tcaps.h
$(VAL_PRIVSEP): privsep.o
$(ECHO_LINK)$(CC) $(LDFLAGS) -o $(@) privsep.o $(BASE_LIBS)
$(SIZE_CHECK)
privsep.o: privsep.c mk-config.h config.h nail.h dotlock.h
$(ECHO_CC)$(CC) $(CFLAGS) $(BASE_INCS) -c privsep.c
test: all
$(ECHO_TEST)\
MAKE=$(MAKE) \
awk=$(awk) cat=$(cat) cksum=$(cksum) rm=$(rm) sed=$(sed) grep=$(grep) \
$(SHELL) ./cc-test.sh --check-only ./$(VAL_UAGENT)
gen-mime-types.h: mime.types
$(ECHO_GEN)\
LC_ALL=C < ./mime.types > $(@) $(awk) '\
function add(mt, ln) {\
gsub(/[[:space:]]+/, " ", ln);\
i = split(ln, i_a);\
e = "";\
for (j = 1; j <= i; ++j) {\
k = i_a[j];\
e = (e ? e " " : "") k\
}\
if (e) {\
if (e_a[mt])\
e_a[mt] = e_a[mt] " ";\
e_a[mt] = e_a[mt] e\
}\
}\
/^[[:space:]]*#/ {next}\
/^[[:space:]]*$$/ {ltype = ""; next}\
/^[[:space:]]/ {\
if (!ltype)\
print "FAULTY CONTINUATION: " $$0 >> "/dev/stderr";\
add(ltype, $$0);\
next\
}\
/^(@([thH]@)? )?[[:alpha:]]/ {\
if ($$1 ~ /^@([thH]@)?$$/) {\
pa = $$1;\
$$1 = $$2;\
$$2 = ""\
} else\
pa = "";\
if ($$1 !~ /^([[:alnum:]]+)\/([[:alnum:]_+-]+)$$/)\
print "FAULTY MIME TYPE: <" $$1 ">" >> "/dev/stderr";\
ltype = $$1; $$1 = "";\
if (pa)\
p_a[ltype] = pa;\
if (!nt_a[ltype])\
no_a[++no_ai] = nt_a[ltype] = ltype;\
add(ltype, $$0)\
}\
END {\
for (z = 1; z <= no_ai; ++z) {\
t = no_a[z];\
j = index(t, "/");\
mt = toupper(substr(t, 1, j - 1));\
j = substr(t, j + 1);\
l = length(j);\
if (!p_a[t])\
mt = "_MT_" mt;\
else {\
tm = p_a[t];\
if (tm == "@" || tm == "@t@")\
mt = "_MT_" mt " | _MT_PLAIN";\
else if (tm == "@h@")\
mt = "_MT_" mt " | _MT_SOUP_h";\
else if (tm == "@H@")\
mt = "_MT_" mt " | _MT_SOUP_H";\
}\
print " {" mt ", " l ", \"" j e_a[t] "\"},"\
}\
}\
'
uman.1: nail.1
$(ECHO_GEN)\
LC_ALL=C _SYSCONFRC="$(VAL_SYSCONFRC)" _UAGENT="$(VAL_UAGENT)" \
$(_version_from_header) \
< ./nail.1 > $(@) $(awk) '\
BEGIN { written = 0 }\
/\.\\"--MKMAN-START--/, /\.\\"--MKMAN-END--/ {\
if (written++ != 0)\
next;\
OFS = "";\
print ".ds VV \\\\%v", ENVIRON["VERSION"];\
\
un = toupper(ENVIRON["_UAGENT"]);\
ln = tolower(un);\
cn = toupper(substr(ln, 1, 1)) substr(ln, 2);\
print ".ds UU \\\\%", un;\
print ".ds UA \\\\%", cn;\
print ".ds uA \\\\%", ln;\
\
path = ENVIRON["_SYSCONFRC"];\
gsub("/", "/\\:", path);\
print ".ds UR \\\\%", path;\
OFS = " ";\
next\
}\
{print}\
'
urc.rc: nail.rc
$(ECHO_GEN)\
LC_ALL=C _SYSCONFRC="$(VAL_SYSCONFRC)" _UAGENT="$(VAL_UAGENT)" \
$(_version_from_header) \
< ./nail.rc > $(@) $(awk) 'BEGIN {written = 0}\
/^#--MKRC-START--/, /^#--MKRC-END--/ {\
if (written == 1)\
next;\
written = 1;\
OFS = "";\
ln = tolower(ENVIRON["_UAGENT"]);\
cn = toupper(substr(ln, 1, 1)) substr(ln, 2);\
print "#@ ", ENVIRON["_SYSCONFRC"];\
print "#@ Configuration file for ", cn, " v",\
ENVIRON["VERSION"];\
OFS = " ";\
next\
}\
{print}\
'
install:
$(ECHO_BLOCK_BEGIN)\
__mkdir() {\
_dir="$(DESTDIR)$${1}";\
if [ -d "$${_dir}" ]; then :; else \
$(mkdir) -m 0755 -p "$${_dir}";\
fi;\
};\
__copyfile() {\
_mode=$${1} _src=$${2} _xdst=$${3} _dst="$(DESTDIR)$${3}";\
$(cp) -f "$${_src}" "$${_dst}";\
echo "rm -f \"\$${DESTDIR}$${_xdst}\"" >> \
"$(VAL_UAGENT)-uninstall.sh";\
$(chmod) $${_mode} "$${_dst}";\
\
};\
__copychownfile() {\
_mode=$${1} _ident=$${2} _src=$${3} \
_xdst=$${4} _dst="$(DESTDIR)$${4}";\
$(cp) -f "$${_src}" "$${_dst}";\
echo "rm -f \"\$${DESTDIR}$${_xdst}\"" >> \
"$(VAL_UAGENT)-uninstall.sh";\
$(chown) $${_ident} "$${_dst}" || true;\
$(chmod) $${_mode} "$${_dst}";\
\
};\
__stripfile() {\
_file=$${1};\
if [ "$(OPT_DEBUG)" != 0 ]; then :;\
elif [ -n "$(HAVE_STRIP)" ]; then \
$(strip) "$${_file}";\
fi;\
};\
\
echo '#!/bin/sh -' > "$(VAL_UAGENT)-uninstall.sh";\
echo '#@ Uninstall script for $(VAL_UAGENT)' >> \
"$(VAL_UAGENT)-uninstall.sh";\
echo >> "$(VAL_UAGENT)-uninstall.sh";\
echo 'DESTDIR="$(DESTDIR)"' >> "$(VAL_UAGENT)-uninstall.sh";\
echo 'DESTDIR=' >> "$(VAL_UAGENT)-uninstall.sh";\
echo >> "$(VAL_UAGENT)-uninstall.sh";\
\
if [ -n "$(DESTDIR)" ]; then __mkdir ''; fi;\
__mkdir "$(VAL_BINDIR)";\
__mkdir "$(VAL_MANDIR)/man1";\
__mkdir "$(VAL_SYSCONFDIR)";\
\
__stripfile "$(VAL_UAGENT)";\
__copyfile 0555 "$(VAL_UAGENT)" "$(VAL_BINDIR)/$(VAL_UAGENT)";\
__copyfile 0444 ./uman.1 "$(VAL_MANDIR)/man1/$(VAL_UAGENT).1";\
if [ -f "$(DESTDIR)$(VAL_SYSCONFDIR)/$(VAL_SYSCONFRC)" ]; then :; else \
__copyfile 0444 ./urc.rc "$(VAL_SYSCONFDIR)/$(VAL_SYSCONFRC)";\
fi;\
\
if [ -n "$(OPTIONAL_PRIVSEP)" ]; then \
__mkdir "$(VAL_LIBEXECDIR)";\
\
__stripfile "$(VAL_PRIVSEP)";\
m='o=rx' o=;\
if [ -n "$(_____PRIVSEP_GROUP)" ]; then \
m="g=rxs,$${m}" o=":$(VAL_PRIVSEP_GROUP)";\
else \
m="g=rx,$${m}";\
fi;\
if [ -n "$(VAL_PRIVSEP_USER)" ]; then \
m="u=rxs,$${m}" o="$(VAL_PRIVSEP_USER)$${o}";\
else \
m="u=rx,$${m}";\
fi;\
__copychownfile "$${m}" "$${o}" "$(VAL_PRIVSEP)" \
"$(VAL_LIBEXECDIR)/$(VAL_PRIVSEP)";\
fi;\
\
if [ -z "$(DESTDIR)" ]; then \
__copyfile 0555 "$(VAL_UAGENT)-uninstall.sh" \
"$(VAL_BINDIR)/$(VAL_UAGENT)-uninstall.sh";\
fi;\
$(ECHO_BLOCK_END)
uninstall:
@echo 'Invoke $(VAL_UAGENT)-uninstall.sh to uninstall $(VAL_UAGENT)'
clean:
$(ECHO_CMD)\
$(rm) -f $(OBJ) $(VAL_UAGENT) ./gen-mime-types.h ./uman.1 ./urc.rc;\
if [ -n "$(OPTIONAL_PRIVSEP)" ]; then \
$(rm) -f ./privsep.o ./$(VAL_PRIVSEP);\
fi;\
\
if [ -f "$(VAL_UAGENT)-uninstall.sh" ]; then \
$(rm) -f ./$(VAL_UAGENT)-uninstall.sh;\
fi
distclean: clean
$(ECHO_CMD)\
$(rm) -f ./mk-*
# MUST work with "grep=grep sed=sed cmp=cmp mv=mv", otherwise need to change
# make-release.inc
_update-version:
@LC_ALL=C; export LC_ALL;\
if [ -z "$(VERSION)" ]; then \
eval VERSION="`(git describe --tags) 2>/dev/null`";\
if [ -n "$${VERSION}" ]; then \
VERSION="`echo $${VERSION} |\
$(sed) -e 's/^v\{0,1\}\(.*\)/\1/'`";\
[ "`git status --porcelain |\
$(awk) '\
BEGIN {n=0}\
/gen-version\.h/ {next}\
/^\?\?/ {next}\
{++n}\
END {print n}\
'`" -ne 0 ] &&\
VERSION="$${VERSION}-dirty";\
else \
$(_version_from_header);\
echo "$${VERSION}" | $(grep) -q -F dirty ||\
VERSION="$${VERSION}-dirty";\
fi;\
fi;\
vmaj="`echo \"$${VERSION}\" |\
$(sed) -e 's/^\([^.]\{1,\}\).*/\1/'`";\
vmin="`echo \"$${VERSION}\" |\
$(sed) -e 's/^[^.]\{1,\}\.\([^.]\{1,\}\).*/\1/'`";\
[ "$${vmin}" = "$${VERSION}" ] && VERSION="$${VERSION}.0" vmin=0;\
vupd="`echo \"$${VERSION}\" |\
$(sed) -e 's/^[^.]\{1,\}\.[^.]\{1,\}\.\([^.-]\{1,\}\).*/\1/'`";\
[ "$${vupd}" = "$${VERSION}" ] && VERSION="$${VERSION}.0" vupd=0;\
trap "$(rm) -f ./version.tmp" 0 1 2 15;\
printf > ./version.tmp "#define n_VERSION \"v$${VERSION}\"\n";\
printf >> ./version.tmp \
"#define n_VERSION_DATE \"`date -u +'%Y-%m-%d'`\"\n";\
printf >> ./version.tmp "#define n_VERSION_MAJOR \"$${vmaj}\"\n";\
printf >> ./version.tmp "#define n_VERSION_MINOR \"$${vmin}\"\n";\
printf >> ./version.tmp "#define n_VERSION_UPDATE \"$${vupd}\"\n";\
$(cmp) ./version.tmp ./gen-version.h >/dev/null 2>&1 && exit;\
$(mv) ./version.tmp ./gen-version.h;\
trap : 0 1 2 15
# s-mk-mode