uuid/0000755000176200001440000000000014550775645011242 5ustar liggesusersuuid/NAMESPACE0000644000176200001440000000113014550351455012441 0ustar liggesusersuseDynLib(uuid, UUID_gen, UUID_parse, UUID_unparse, UUID_is_NA, UUID_cmp) export(UUIDgenerate, UUIDfromName, UUIDparse, UUIDvalidate, as.UUID, is.UUID) S3method(print, UUID) S3method(as.character, UUID) S3method(as.UUID, UUID) S3method(as.UUID, raw) S3method(as.UUID, default) S3method(as.raw, UUID) S3method(rep, UUID) S3method(c, UUID) S3method(unique, UUID) S3method(is.na, UUID) S3method("[", UUID) S3method("[<-", UUID) S3method("[[", UUID) S3method("[[<-", UUID) S3method(Ops, UUID) S3method(Math, UUID) S3method(Complex, UUID) S3method(Summary, UUID) S3method("==", UUID) S3method("!=", UUID) uuid/LICENSE0000644000176200001440000000007514550351455012236 0ustar liggesusersYEAR: 2015 COPYRIGHT HOLDER: Simon Urbanek and Theodore Ts'o uuid/man/0000755000176200001440000000000014550351455012002 5ustar liggesusersuuid/man/UUIDgenerate.Rd0000644000176200001440000000715714550351455014564 0ustar liggesusers\name{UUIDgenerate} \alias{UUIDgenerate} \alias{UUIDparse} \alias{UUIDvalidate} \alias{UUIDfromName} \title{ UUID Functions } \description{ \code{UUIDgenerate} generates new Universally Unique Identifiers. It can be either time-based or random. \code{UUIDfromName} generates deterministic UUIDs based on namespace UUID and a name (UUID version 3 and 5). \code{UUIDparse} parses one of more UUIDs in string form and converts them to other internal formats. \code{UUIDvalidate} checks the valitiy of UUIDs in string form. } \usage{ UUIDgenerate(use.time = NA, n = 1L, output = c("string", "raw", "uuid")) UUIDfromName(namespace, name, type = c("sha1", "md5"), output = c("string", "raw", "uuid")) UUIDparse(what, output = c("uuid", "string", "raw", "logical")) UUIDvalidate(what) } \arguments{ \item{use.time}{logical, if \code{TRUE} then time-based UUID is generated, if \code{FALSE} then a random UUID is generated, if \code{NA} then random one is generated if a sufficiently reliable source of random numbers can be found, otherwise a time-based UUID is generated.} \item{n}{integer, number of UUIDs to generate.} \item{output}{type of the output. Valid types are: \code{"string"} for a character vector with UUIDs in textual representation (always lowercase), \code{"raw"} for a vector or matrix of raw bytes, \code{"uuid"} for an object of the class \code{\link{UUID}} and \code{"logical"} which only reports failure/success of the parsing, but not the actual values.} \item{namespace}{UUID defining the namespace} \item{name}{character vector of names to use for generating UUIDs. The result will yield as many UUIDs as there are elements in this vector.} \item{type}{string, type of the hash function to use when generating the UUIDs. "sha1" is recommended (version 5 UUID), "md5" is available for compatibility (version 3 UUID).} \item{what}{character vector which will be parsed into UUIDs.} } \value{ \code{UUIDgenerate}, \code{UUIDfromName} and \code{UUIDparse} values depend on the \code{output} argument as follows: \item{\code{"string"}}{character vector with each element UUID in lowercase form, for \code{UUIDparse} strings that cannot be parsed will result in \code{NA} values} \item{\code{"raw"}}{raw vector with the UUIDs stores each as 16 bytes seqeuntially. If the output is more than one UUID then the result is a raw matrix with 16 rows and as many columns as there are input elements.} \item{\code{"uuid"}}{object of the class \code{\link{UUID}} which is a vector of UUIDs in 128-bit internal representation.} \item{\code{"logical"}}{only supported in \code{UUIDparse} and return code \code{TRUE} for valid UUID, \code{FALSE} for invalid input and \code{NA} for \code{NA} input.} \code{UUIDvalidate} is just a shorthand for \code{UUIDparse(what, output="logical")}. } \author{ Simon Urbanek, based on libuuid by Theodore Ts'o. } \note{ The first argument is not \code{n} for historical reasons, beause the first version did only generate a single UUID. } \examples{ UUIDgenerate() UUIDgenerate(TRUE) UUIDgenerate(FALSE) ## see if the randomness is any good length(unique(UUIDgenerate(n=1000))) ## generate a native UUID vector (u <- UUIDgenerate(n=3, output="uuid")) as.character(u) as.raw(u[1]) UUIDgenerate(output="raw") ## UUID for DNS namespace DNS.namespace <- "6ba7b810-9dad-11d1-80b4-00c04fd430c8" ## SHA1 (v5) - default UUIDfromName(DNS.namespace, "r-project.org") ## MD5 (v3) UUIDfromName(DNS.namespace, "r-project.org", type="md5") ## see ?UUID for more examples on UUID objects } \keyword{manip} uuid/man/UUID.Rd0000644000176200001440000000666714550351455013056 0ustar liggesusers\name{UUID} \alias{UUID} \alias{uuid} \alias{as.UUID} \alias{is.UUID} \docType{data} \title{ UUID Data Type } \description{ S3 class \code{"UUID"} represents vector of UUIDs in native form (128-bit). They are typically obtained by calling \code{\link{UUIDgenerate}}, \code{\link{UUIDparse}} or \code{as.UUID}. Methods exist for common operations such as \code{\link{as.character}}, \code{\link{print}}, \code{\link{c}}, subsetting and comparison operators. Note that arithmetic and other operations are not allowed. UUIDs have three possible representations: as character vectors (in the hyphenated 8-4-4-4-12 hexadecimal form), the \code{UUID} class described here and raw vectors. In the latter case the raw vector must be of length 16 or it must be a matrix with 16 rows. Since matrices in R are stored in colum-major format, UUID must be contiguous and thus form the \emph{columns} of the raw matrix, which may be slightly counter-intuitive, but is far morecefficient. \code{as.character} method exists for UUID objects and converts it to a character vector of lower-case UUID string representation. \code{as.raw} method converts UUIDs to raw vectors or matrices as describe above. Similarly, a \code{as.UUID} method for raw vectors performs the inverse transformation. } \usage{ as.UUID(x, ...) is.UUID(x) } \arguments{ \item{x}{object to coerce / check} \item{...}{unused} } \value{ \code{as.UUID} returns an object of the class \code{"UUID"} representing a vector of UUIDs. Any elements that are not valid UUIDs will yield \code{NA} values. \code{is.UUID} returns \code{TRUE} if the object is of the class \code{"UUID"} and \code{FALSE} otherwise. } \details{ Internally, the underlying object uses complex numbers to store 128-bit values with each UUID represented as one complex number. There may be cases where some operations strip the class attribute which will lead to complex values being visible, but their behavior should be regarded as undefined. \code{NA} values in the UUID class are internally stored as a special value a2070000-0000-f07f-a207-00000000f07f which is not a valid UUID (since the version of that UUID is 15 which does not exist). This is an R extension and will be automatically converted to \code{NA} where possible, but the raw format does not support \code{NA}s so it will be visible there. Coercions to/from string and UUIDs handle \code{NA}s correctly and thus this internal representation should not be relied upon by any code and may change in the future. } \note{ Comparisons are much faster between UUID vectors than between UUID vectors and other types, because in the latter case all values are coerced to strings before comparison which is very expensive. However, \code{x == y} does not necessarily yield the same result as \code{as.UUID(x) == as.UUID(y)}. For example, for \code{x} a valid UUID object of length one and \code{y = "foo"} the former will be \code{FALSE} while the latter will be \code{NA} due to coercion not yielding a valid UUID value represented by \code{NA}. } \author{ Simon Urbanek } \examples{ (u <- as.UUID("837bc850-07d9-42f9-9afb-716409bf87b7")) (uv <- c(u, NA, UUIDgenerate(n=3, output="uuid"))) as.character(u) uv == u is.na(uv) identical(as.UUID(as.character(uv)), uv) as.raw(u) ## all forms are can be coerced losslessly identical(as.UUID(as.raw(uv)), uv) identical(as.UUID(as.character(as.UUID(as.raw(uv)))), uv) } \keyword{manip} uuid/DESCRIPTION0000644000176200001440000000110214550775645012742 0ustar liggesusersPackage: uuid Version: 1.2-0 Title: Tools for Generating and Handling of UUIDs Author: Simon Urbanek (R package), Theodore Ts'o (libuuid) Maintainer: Simon Urbanek Depends: R (>= 2.9.0) Description: Tools for generating and handling of UUIDs (Universally Unique Identifiers). License: MIT + file LICENSE URL: https://www.rforge.net/uuid BugReports: https://github.com/s-u/uuid NeedsCompilation: yes Packaged: 2024-01-13 00:03:03 UTC; rforge Repository: CRAN Date/Publication: 2024-01-14 15:20:05 UTC uuid/configure.ac0000644000176200001440000000367414550351455013527 0ustar liggesusers# Process this file with autoconf to produce a configure script. AC_INIT([uuid],[0.1],[Simon.Urbanek@r-project.org]) AC_CONFIG_SRCDIR([src/R.c]) AC_CONFIG_HEADERS([src/config.h]) # find R home and set CC/CFLAGS : ${R_HOME=`R RHOME`} if test -z "${R_HOME}"; then echo "could not determine R_HOME" exit 1 fi RBIN="${R_HOME}/bin/R" CC=`"${RBIN}" CMD config CC`; ## since R 3.6 we can't use CPP but NEWS recommends $CC -E CPP="${CC} -E" CFLAGS=`"${RBIN}" CMD config CFLAGS` CPPFLAGS=`"${RBIN}" CMD config CPPFLAGS` if test -n "${PKG_CPPFLAGS}"; then CPPFLAGS="${CPPFLAGS} ${PKG_CPPFLAGS}" fi AC_PROG_CC LIBS="${PKG_LIBS}" AC_CHECK_HEADERS([grp.h langinfo.h locale.h netinet/in.h stdlib.h sys/file.h \ sys/ioctl.h sys/socket.h sys/sockio.h sys/syscall.h sys/sendfile.h \ sys/time.h sys/un.h unistd.h]) AC_CHECK_HEADERS([net/if.h net/if_dl.h], [], [], [#if HAVE_NETINET_IN_H #include #endif ]) AC_CHECK_FUNCS([ \ dirfd \ err \ errx \ getexecname \ getrandom \ jrand48 \ llseek \ lchown \ mempcpy \ mkostemp \ nanosleep \ sendfile \ srandom \ strnchr \ strndup \ strnlen \ usleep \ warn \ warnx ]) AC_CHECK_FUNCS([flock], [#if HAVE_SYS_FILE_H #include #endif ]) AC_CHECK_MEMBER(struct sockaddr.sa_len, AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),, [#include #include ]) AC_CHECK_HEADERS([dlfcn.h]) AC_SEARCH_LIBS(dlsym, dl, [AC_DEFINE(HAS_DLSYM, 1, [defined if the system supports dlsym])]) ## note the libuuid only uses __thread so that's the only one to test for have_tls=no AC_MSG_CHECKING([for thread local storage (TLS) support]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([],[static __thread int x;])], [have_tls=yes]) AC_MSG_RESULT([$have_tls]) if test x$have_tls = xyes; then AC_DEFINE(HAVE_TLS, 1, [Thread local storage is supported via __thread]) fi AC_CONFIG_FILES([src/Makevars]) AC_OUTPUT uuid/src/0000755000176200001440000000000014550351455012016 5ustar liggesusersuuid/src/unparse.c0000644000176200001440000000456414550351455013650 0ustar liggesusers/* * unparse.c -- convert a UUID to string * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #include #include "c.h" #include "uuidP.h" static char const hexdigits_lower[16] = "0123456789abcdef"; static char const hexdigits_upper[16] = "0123456789ABCDEF"; static void uuid_fmt(const uuid_t uuid, char *buf, char const *restrict fmt) { char *p = buf; int i; for (i = 0; i < 16; i++) { if (i == 4 || i == 6 || i == 8 || i == 10) { *p++ = '-'; } size_t tmp = uuid[i]; *p++ = fmt[tmp >> 4]; *p++ = fmt[tmp & 15]; } *p = '\0'; } void uuid_unparse_lower(const uuid_t uu, char *out) { uuid_fmt(uu, out, hexdigits_lower); } void uuid_unparse_upper(const uuid_t uu, char *out) { uuid_fmt(uu, out, hexdigits_upper); } void uuid_unparse(const uuid_t uu, char *out) { #ifdef UUID_UNPARSE_DEFAULT_UPPER uuid_fmt(uu, out, hexdigits_upper); #else uuid_fmt(uu, out, hexdigits_lower); #endif } uuid/src/uuidP.h0000644000176200001440000000661614550351455013266 0ustar liggesusers/* * uuid.h -- private header file for uuids * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #ifndef _UUID_UUID_PRIVATE_H #define _UUID_UUID_PRIVATE_H #include #include #include "uuid.h" #define LIBUUID_CLOCK_FILE "/var/lib/libuuid/clock.txt" /* * Offset between 15-Oct-1582 and 1-Jan-70 */ #define TIME_OFFSET_HIGH 0x01B21DD2 #define TIME_OFFSET_LOW 0x13814000 /* * Note that RFC4122 defines UUID in more details: * * Field Data Type Octet Note * ------------------------------------------------- * time_low unsigned 32 0-3 The low field of the * bit integer timestamp * * time_mid unsigned 16 4-5 The middle field of the * bit integer timestamp * * time_hi_and_version unsigned 16 6-7 The high field of the * bit integer timestamp multiplexed * with the version number * * clock_seq_hi_and_rese unsigned 8 8 The high field of the * rved bit integer clock sequence * multiplexed with the * variant * * clock_seq_low unsigned 8 9 The low field of the * bit integer clock sequence * * node unsigned 48 10-15 The spatially unique * bit integer node identifier * * We have clock_seq_hi_and_reserved (8bit) and clock_seq_low (8bit) * merged into clock_seq (16bit). */ struct uuid { uint32_t time_low; uint16_t time_mid; uint16_t time_hi_and_version; uint16_t clock_seq; uint8_t node[6]; }; /* * prototypes */ void uuid_pack(const struct uuid *uu, uuid_t ptr); void uuid_unpack(const uuid_t in, struct uuid *uu); #endif /* _UUID_UUID_PRIVATE_H */ uuid/src/c.h0000644000176200001440000003141414550351455012414 0ustar liggesusers/* * Fundamental C definitions. * * No copyright is claimed. This code is in the public domain; do with * it what you wish. */ #ifndef UTIL_LINUX_C_H #define UTIL_LINUX_C_H #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_GRP_H #include #endif #include #ifdef HAVE_ERR_H # include #endif #ifdef HAVE_SYS_SYSMACROS_H # include /* for major, minor */ #endif #ifndef LOGIN_NAME_MAX # define LOGIN_NAME_MAX 256 #endif #ifndef NAME_MAX # define NAME_MAX PATH_MAX #endif /* * __GNUC_PREREQ is deprecated in favour of __has_attribute() and * __has_feature(). The __has macros are supported by clang and gcc>=5. */ #ifndef __GNUC_PREREQ # if defined __GNUC__ && defined __GNUC_MINOR__ # define __GNUC_PREREQ(maj, min) \ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) # else # define __GNUC_PREREQ(maj, min) 0 # endif #endif #ifdef __GNUC__ /* &a[0] degrades to a pointer: a different type from an array */ # define __must_be_array(a) \ UL_BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(__typeof__(a), __typeof__(&a[0]))) # define ignore_result(x) __extension__ ({ \ __typeof__(x) __dummy __attribute__((__unused__)) = (x); (void) __dummy; \ }) #else /* !__GNUC__ */ # define __must_be_array(a) 0 # define __attribute__(_arg_) # define ignore_result(x) ((void) (x)) #endif /* !__GNUC__ */ /* "restrict" keyword fallback */ #if __STDC__ != 1 # define restrict __restrict /* use implementation __ format */ #else # ifndef __STDC_VERSION__ # define restrict __restrict /* use implementation __ format */ # else # if __STDC_VERSION__ < 199901L # define restrict __restrict /* use implementation __ format */ # endif # endif #endif /* * It evaluates to 1 if the attribute/feature is supported by the current * compilation target. Fallback for old compilers. */ #ifndef __has_attribute #define __has_attribute(x) 0 #endif #ifndef __has_feature #define __has_feature(x) 0 #endif /* * Function attributes */ #ifndef __ul_alloc_size # if (__has_attribute(alloc_size) && __has_attribute(warn_unused_result)) || __GNUC_PREREQ (4, 3) # define __ul_alloc_size(s) __attribute__((alloc_size(s), warn_unused_result)) # else # define __ul_alloc_size(s) # endif #endif #ifndef __ul_calloc_size # if (__has_attribute(alloc_size) && __has_attribute(warn_unused_result)) || __GNUC_PREREQ (4, 3) # define __ul_calloc_size(n, s) __attribute__((alloc_size(n, s), warn_unused_result)) # else # define __ul_calloc_size(n, s) # endif #endif #if __has_attribute(returns_nonnull) || __GNUC_PREREQ (4, 9) # define __ul_returns_nonnull __attribute__((returns_nonnull)) #else # define __ul_returns_nonnull #endif /* * Force a compilation error if condition is true, but also produce a * result (of value 0 and type size_t), so the expression can be used * e.g. in a structure initializer (or wherever else comma expressions * aren't permitted). */ #define UL_BUILD_BUG_ON_ZERO(e) __extension__ (sizeof(struct { int:-!!(e); })) #define BUILD_BUG_ON_NULL(e) ((void *)sizeof(struct { int:-!!(e); })) #ifndef ARRAY_SIZE # define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr)) #endif #ifndef PATH_MAX # define PATH_MAX 4096 #endif #ifndef TRUE # define TRUE 1 #endif #ifndef FALSE # define FALSE 0 #endif #ifndef min # define min(x, y) __extension__ ({ \ __typeof__(x) _min1 = (x); \ __typeof__(y) _min2 = (y); \ (void) (&_min1 == &_min2); \ _min1 < _min2 ? _min1 : _min2; }) #endif #ifndef max # define max(x, y) __extension__ ({ \ __typeof__(x) _max1 = (x); \ __typeof__(y) _max2 = (y); \ (void) (&_max1 == &_max2); \ _max1 > _max2 ? _max1 : _max2; }) #endif #ifndef abs_diff # define abs_diff(x, y) __extension__ ({ \ __typeof__(x) _a = (x); \ __typeof__(y) _b = (y); \ (void) (&_a == &_b); \ _a > _b ? _a - _b : _b - _a; }) #endif #ifndef cmp_numbers # define cmp_numbers(x, y) __extension__ ({ \ __typeof__(x) _a = (x); \ __typeof__(y) _b = (y); \ (void) (&_a == &_b); \ _a == _b ? 0 : _a > _b ? 1 : -1; }) #endif #ifndef cmp_timespec # define cmp_timespec(a, b, CMP) \ (((a)->tv_sec == (b)->tv_sec) \ ? ((a)->tv_nsec CMP (b)->tv_nsec) \ : ((a)->tv_sec CMP (b)->tv_sec)) #endif #ifndef cmp_stat_mtime # ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC # define cmp_stat_mtime(_a, _b, CMP) cmp_timespec(&(_a)->st_mtim, &(_b)->st_mtim, CMP) # else # define cmp_stat_mtime(_a, _b, CMP) ((_a)->st_mtime CMP (_b)->st_mtime) # endif #endif #ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif /* * container_of - cast a member of a structure out to the containing structure * @ptr: the pointer to the member. * @type: the type of the container struct this is embedded in. * @member: the name of the member within the struct. */ #ifndef container_of #define container_of(ptr, type, member) __extension__ ({ \ const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) #endif #ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME # ifdef HAVE___PROGNAME extern char *__progname; # define program_invocation_short_name __progname # else # ifdef HAVE_GETEXECNAME # define program_invocation_short_name \ prog_inv_sh_nm_from_file(getexecname(), 0) # else # define program_invocation_short_name \ prog_inv_sh_nm_from_file(__FILE__, 1) # endif static char prog_inv_sh_nm_buf[256]; static inline char * prog_inv_sh_nm_from_file(char *f, char stripext) { char *t; if ((t = strrchr(f, '/')) != NULL) t++; else t = f; strncpy(prog_inv_sh_nm_buf, t, sizeof(prog_inv_sh_nm_buf) - 1); prog_inv_sh_nm_buf[sizeof(prog_inv_sh_nm_buf) - 1] = '\0'; if (stripext && (t = strrchr(prog_inv_sh_nm_buf, '.')) != NULL) *t = '\0'; return prog_inv_sh_nm_buf; } # endif #endif #if 0 /* HAVE_ERR_H fallback unused and causes issues with ISO C so disable */ static inline void __attribute__ ((__format__ (__printf__, 4, 5))) errmsg(char doexit, int excode, char adderr, const char *fmt, ...) { fprintf(stderr, "%s: ", program_invocation_short_name); if (fmt != NULL) { va_list argp; va_start(argp, fmt); vfprintf(stderr, fmt, argp); va_end(argp); if (adderr) fprintf(stderr, ": "); } if (adderr) fprintf(stderr, "%m"); fprintf(stderr, "\n"); if (doexit) exit(excode); } #ifndef HAVE_ERR # define err(E, FMT...) errmsg(1, E, 1, FMT) #endif #ifndef HAVE_ERRX # define errx(E, FMT...) errmsg(1, E, 0, FMT) #endif #ifndef HAVE_WARN # define warn(FMT...) errmsg(0, 0, 1, FMT) #endif #ifndef HAVE_WARNX # define warnx(FMT...) errmsg(0, 0, 0, FMT) #endif #endif /* !HAVE_ERR_H */ /* Don't use inline function to avoid '#include "nls.h"' in c.h */ #define errtryhelp(eval) __extension__ ({ \ fprintf(stderr, _("Try '%s --help' for more information.\n"), \ program_invocation_short_name); \ exit(eval); \ }) /* After failed execvp() */ #define EX_EXEC_FAILED 126 /* Program located, but not usable. */ #define EX_EXEC_ENOENT 127 /* Could not find program to exec. */ #define errexec(name) err(errno == ENOENT ? EX_EXEC_ENOENT : EX_EXEC_FAILED, \ _("failed to execute %s"), name) static inline __attribute__((const)) int is_power_of_2(unsigned long num) { return (num != 0 && ((num & (num - 1)) == 0)); } #ifndef HAVE_LOFF_T typedef int64_t loff_t; #endif #if !defined(HAVE_DIRFD) && (!defined(HAVE_DECL_DIRFD) || HAVE_DECL_DIRFD == 0) && defined(HAVE_DIR_DD_FD) #include #include static inline int dirfd(DIR *d) { return d->dd_fd; } #endif /* * Fallback defines for old versions of glibc */ #include #ifdef O_CLOEXEC #define UL_CLOEXECSTR "e" #else #define UL_CLOEXECSTR "" #endif #ifndef O_CLOEXEC #define O_CLOEXEC 0 #endif #ifdef __FreeBSD_kernel__ #ifndef F_DUPFD_CLOEXEC #define F_DUPFD_CLOEXEC 17 /* Like F_DUPFD, but FD_CLOEXEC is set */ #endif #endif #ifndef AI_ADDRCONFIG #define AI_ADDRCONFIG 0x0020 #endif #ifndef IUTF8 #define IUTF8 0040000 #endif /* * MAXHOSTNAMELEN replacement */ static inline size_t get_hostname_max(void) { #ifndef WIN32 long len = sysconf(_SC_HOST_NAME_MAX); if (0 < len) return len; #endif #ifdef MAXHOSTNAMELEN return MAXHOSTNAMELEN; #elif HOST_NAME_MAX return HOST_NAME_MAX; #endif return 64; } static inline int drop_permissions(void) { #ifdef _WIN32 return 0; #else errno = 0; /* drop GID */ if (setgid(getgid()) < 0) goto fail; /* drop UID */ if (setuid(getuid()) < 0) goto fail; return 0; fail: return errno ? -errno : -1; #endif } /* * The usleep function was marked obsolete in POSIX.1-2001 and was removed * in POSIX.1-2008. It was replaced with nanosleep() that provides more * advantages (like no interaction with signals and other timer functions). */ #include static inline int xusleep(useconds_t usec) { #ifdef HAVE_NANOSLEEP struct timespec waittime = { .tv_sec = usec / 1000000L, .tv_nsec = (usec % 1000000L) * 1000 }; return nanosleep(&waittime, NULL); #elif defined(HAVE_USLEEP) return usleep(usec); #else # error "System with usleep() or nanosleep() required!" #endif } /* * Constant strings for usage() functions. For more info see * Documentation/{howto-usage-function.txt,boilerplate.c} */ #define USAGE_HEADER _("\nUsage:\n") #define USAGE_OPTIONS _("\nOptions:\n") #define USAGE_FUNCTIONS _("\nFunctions:\n") #define USAGE_COMMANDS _("\nCommands:\n") #define USAGE_ARGUMENTS _("\nArguments:\n") #define USAGE_COLUMNS _("\nAvailable output columns:\n") #define USAGE_SEPARATOR "\n" #define USAGE_OPTSTR_HELP _("display this help") #define USAGE_OPTSTR_VERSION _("display version") #define USAGE_HELP_OPTIONS(marg_dsc) \ "%-" #marg_dsc "s%s\n" \ "%-" #marg_dsc "s%s\n" \ , " -h, --help", USAGE_OPTSTR_HELP \ , " -V, --version", USAGE_OPTSTR_VERSION #define USAGE_ARG_SEPARATOR "\n" #define USAGE_ARG_SIZE(_name) \ _(" %s arguments may be followed by the suffixes for\n" \ " GiB, TiB, PiB, EiB, ZiB, and YiB (the \"iB\" is optional)\n"), _name #define USAGE_MAN_TAIL(_man) _("\nFor more details see %s.\n"), _man #define UTIL_LINUX_VERSION _("%s from %s\n"), program_invocation_short_name, PACKAGE_STRING #define print_version(eval) __extension__ ({ \ printf(UTIL_LINUX_VERSION); \ exit(eval); \ }) static inline void print_features(const char **features, const char *prefix) { if (features && *features) { const char **p = features; while (p && *p) { if (prefix && p == features) printf(" (%s ", prefix); else fputs(p == features ? " (" : ", ", stdout); fputs(*p++, stdout); } fputc(')', stdout); } } #define UTIL_LINUX_VERSION_NOBREAK _("%s from %s"), program_invocation_short_name, PACKAGE_STRING #define print_version_with_features(eval, features) __extension__ ({ \ printf(UTIL_LINUX_VERSION_NOBREAK); \ print_features(features, _("features:")); \ fputc('\n', stdout); \ exit(eval); \ }) /* * seek stuff */ #ifndef SEEK_DATA # define SEEK_DATA 3 #endif #ifndef SEEK_HOLE # define SEEK_HOLE 4 #endif /* * Macros to convert #define'itions to strings, for example * #define XYXXY 42 * printf ("%s=%s\n", stringify(XYXXY), stringify_value(XYXXY)); */ #define stringify_value(s) stringify(s) #define stringify(s) #s /* Detect if we're compiled with Address Sanitizer * - gcc (__SANITIZE_ADDRESS__) * - clang (__has_feature(address_sanitizer)) */ #if !defined(HAS_FEATURE_ADDRESS_SANITIZER) # ifdef __SANITIZE_ADDRESS__ # define HAS_FEATURE_ADDRESS_SANITIZER 1 # elif defined(__has_feature) # if __has_feature(address_sanitizer) # define HAS_FEATURE_ADDRESS_SANITIZER 1 # endif # endif # if !defined(HAS_FEATURE_ADDRESS_SANITIZER) # define HAS_FEATURE_ADDRESS_SANITIZER 0 # endif #endif /* * UL_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time * instrumentation shipped with Clang and GCC) to not instrument the * annotated function. Furthermore, it will prevent the compiler from * inlining the function because inlining currently breaks the blacklisting * mechanism of AddressSanitizer. */ #if __has_feature(address_sanitizer) && __has_attribute(no_sanitize_memory) && __has_attribute(no_sanitize_address) # define UL_ASAN_BLACKLIST __attribute__((noinline)) __attribute__((no_sanitize_memory)) __attribute__((no_sanitize_address)) #else # define UL_ASAN_BLACKLIST /* nothing */ #endif /* * Note that sysconf(_SC_GETPW_R_SIZE_MAX) returns *initial* suggested size for * pwd buffer and in some cases it is not large enough. See POSIX and * getpwnam_r man page for more details. */ #define UL_GETPW_BUFSIZ (16 * 1024) /* * Darwin or other BSDs may only have MAP_ANON. To get it on Darwin we must * define _DARWIN_C_SOURCE before including sys/mman.h. We do this in config.h. */ #if !defined MAP_ANONYMOUS && defined MAP_ANON # define MAP_ANONYMOUS (MAP_ANON) #endif #endif /* UTIL_LINUX_C_H */ uuid/src/gen_uuid.c0000644000176200001440000004033314550351455013764 0ustar liggesusers/* * gen_uuid.c --- generate a DCE-compatible uuid * * Copyright (C) 1996, 1997, 1998, 1999 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #ifdef _WIN32 #define _WIN32_WINNT 0x0500 #include #define UUID MYUUID #endif #include #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #include #include #include #include #include #ifdef HAVE_SYS_TIME_H #include #endif #include #ifdef HAVE_SYS_FILE_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_UN_H #include #endif #ifdef HAVE_SYS_SOCKIO_H #include #endif #ifdef HAVE_NET_IF_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NET_IF_DL_H #include #endif #if defined(__linux__) && defined(HAVE_SYS_SYSCALL_H) #include #endif #include "all-io.h" #include "uuidP.h" #include "uuidd.h" #include "randutils.h" #include "strutils.h" #include "c.h" #include "md5.h" #include "sha1.h" #ifdef HAVE_TLS #define THREAD_LOCAL static __thread #else #define THREAD_LOCAL static #endif /* * Get the ethernet hardware address, if we can find it... * * XXX for a windows version, probably should use GetAdaptersInfo: * http://www.codeguru.com/cpp/i-n/network/networkinformation/article.php/c5451 * commenting out get_node_id just to get gen_uuid to compile under windows * is not the right way to go! */ static int get_node_id(unsigned char *node_id) { #ifdef HAVE_NET_IF_H int sd; struct ifreq ifr, *ifrp; struct ifconf ifc; char buf[1024]; int n, i; unsigned char *a = NULL; #ifdef HAVE_NET_IF_DL_H struct sockaddr_dl *sdlp; #endif /* * BSD 4.4 defines the size of an ifreq to be * max(sizeof(ifreq), sizeof(ifreq.ifr_name)+ifreq.ifr_addr.sa_len * However, under earlier systems, sa_len isn't present, so the size is * just sizeof(struct ifreq) */ #ifdef HAVE_SA_LEN #define ifreq_size(i) max(sizeof(struct ifreq),\ sizeof((i).ifr_name)+(i).ifr_addr.sa_len) #else #define ifreq_size(i) sizeof(struct ifreq) #endif /* HAVE_SA_LEN */ sd = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP); if (sd < 0) { return -1; } memset(buf, 0, sizeof(buf)); ifc.ifc_len = sizeof(buf); ifc.ifc_buf = buf; if (ioctl (sd, SIOCGIFCONF, (char *)&ifc) < 0) { close(sd); return -1; } n = ifc.ifc_len; for (i = 0; i < n; i+= ifreq_size(*ifrp) ) { ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i); strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ); #ifdef SIOCGIFHWADDR if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0) continue; a = (unsigned char *) &ifr.ifr_hwaddr.sa_data; #else #ifdef SIOCGENADDR if (ioctl(sd, SIOCGENADDR, &ifr) < 0) continue; a = (unsigned char *) ifr.ifr_enaddr; #else #ifdef HAVE_NET_IF_DL_H sdlp = (struct sockaddr_dl *) &ifrp->ifr_addr; if ((sdlp->sdl_family != AF_LINK) || (sdlp->sdl_alen != 6)) continue; a = (unsigned char *) &sdlp->sdl_data[sdlp->sdl_nlen]; #else /* * XXX we don't have a way of getting the hardware * address */ close(sd); return 0; #endif /* HAVE_NET_IF_DL_H */ #endif /* SIOCGENADDR */ #endif /* SIOCGIFHWADDR */ if (a == NULL || (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5])) continue; if (node_id) { memcpy(node_id, a, 6); close(sd); return 1; } } close(sd); #endif return 0; } /* Assume that the gettimeofday() has microsecond granularity */ #define MAX_ADJUSTMENT 10 /* Reserve a clock_seq value for the 'continuous clock' implementation */ #define CLOCK_SEQ_CONT 0 /* * Get clock from global sequence clock counter. * * Return -1 if the clock counter could not be opened/locked (in this case * pseudorandom value is returned in @ret_clock_seq), otherwise return 0. */ static int get_clock(uint32_t *clock_high, uint32_t *clock_low, uint16_t *ret_clock_seq, int *num) { THREAD_LOCAL int adjustment = 0; THREAD_LOCAL struct timeval last = {0, 0}; THREAD_LOCAL uint16_t clock_seq; struct timeval tv; uint64_t clock_reg; #ifndef _WIN32 mode_t save_umask; int len; THREAD_LOCAL FILE *state_f; THREAD_LOCAL int state_fd = -2; #endif int ret = 0; #ifdef _WIN32 ret = -1; #else if (state_fd == -1) ret = -1; if (state_fd == -2) { save_umask = umask(0); state_fd = open(LIBUUID_CLOCK_FILE, O_RDWR|O_CREAT|O_CLOEXEC, 0660); (void) umask(save_umask); if (state_fd != -1) { state_f = fdopen(state_fd, "r+" UL_CLOEXECSTR); if (!state_f) { close(state_fd); state_fd = -1; ret = -1; } } else ret = -1; } if (state_fd >= 0) { rewind(state_f); #ifdef HAVE_FLOCK while (flock(state_fd, LOCK_EX) < 0) { if ((errno == EAGAIN) || (errno == EINTR)) continue; fclose(state_f); close(state_fd); state_fd = -1; ret = -1; break; } #endif } if (state_fd >= 0) { unsigned int cl; unsigned long tv1, tv2; int a; if (fscanf(state_f, "clock: %04x tv: %lu %lu adj: %d\n", &cl, &tv1, &tv2, &a) == 4) { clock_seq = cl & 0x3FFF; last.tv_sec = tv1; last.tv_usec = tv2; adjustment = a; } // reset in case of reserved CLOCK_SEQ_CONT if (clock_seq == CLOCK_SEQ_CONT) { last.tv_sec = 0; last.tv_usec = 0; } } if ((last.tv_sec == 0) && (last.tv_usec == 0)) { do { ul_random_get_bytes(&clock_seq, sizeof(clock_seq)); clock_seq &= 0x3FFF; } while (clock_seq == CLOCK_SEQ_CONT); gettimeofday(&last, NULL); last.tv_sec--; } #endif try_again: gettimeofday(&tv, NULL); if ((tv.tv_sec < last.tv_sec) || ((tv.tv_sec == last.tv_sec) && (tv.tv_usec < last.tv_usec))) { do { clock_seq = (clock_seq+1) & 0x3FFF; } while (clock_seq == CLOCK_SEQ_CONT); adjustment = 0; last = tv; } else if ((tv.tv_sec == last.tv_sec) && (tv.tv_usec == last.tv_usec)) { if (adjustment >= MAX_ADJUSTMENT) goto try_again; adjustment++; } else { adjustment = 0; last = tv; } clock_reg = tv.tv_usec*10 + adjustment; clock_reg += ((uint64_t) tv.tv_sec)*10000000; clock_reg += (((uint64_t) 0x01B21DD2) << 32) + 0x13814000; if (num && (*num > 1)) { adjustment += *num - 1; last.tv_usec += adjustment / 10; adjustment = adjustment % 10; last.tv_sec += last.tv_usec / 1000000; last.tv_usec = last.tv_usec % 1000000; } #ifndef _WIN32 if (state_fd >= 0) { rewind(state_f); len = fprintf(state_f, "clock: %04x tv: %016ld %08ld adj: %08d\n", clock_seq, (long)last.tv_sec, (long)last.tv_usec, adjustment); fflush(state_f); if (ftruncate(state_fd, len) < 0) { fprintf(state_f, " \n"); fflush(state_f); } rewind(state_f); #ifdef HAVE_FLOCK flock(state_fd, LOCK_UN); #endif } #endif *clock_high = clock_reg >> 32; *clock_low = clock_reg; *ret_clock_seq = clock_seq; return ret; } /* * Get current time in 100ns ticks. */ static uint64_t get_clock_counter(void) { struct timeval tv; uint64_t clock_reg; gettimeofday(&tv, NULL); clock_reg = tv.tv_usec*10; clock_reg += ((uint64_t) tv.tv_sec) * 10000000ULL; return clock_reg; } /* * Get continuous clock value. * * Return -1 if there is no further clock counter available, * otherwise return 0. * * This implementation doesn't deliver clock counters based on * the current time because last_clock_reg is only incremented * by the number of requested UUIDs. * max_clock_offset is used to limit the offset of last_clock_reg. */ static int get_clock_cont(uint32_t *clock_high, uint32_t *clock_low, int num, uint32_t max_clock_offset) { /* 100ns based time offset according to RFC 4122. 4.1.4. */ const uint64_t reg_offset = (((uint64_t) 0x01B21DD2) << 32) + 0x13814000; static uint64_t last_clock_reg = 0; uint64_t clock_reg; if (last_clock_reg == 0) last_clock_reg = get_clock_counter(); clock_reg = get_clock_counter(); if (max_clock_offset) { uint64_t clock_offset = max_clock_offset * 10000000ULL; if (last_clock_reg < (clock_reg - clock_offset)) last_clock_reg = clock_reg - clock_offset; } clock_reg += MAX_ADJUSTMENT; if ((last_clock_reg + num) >= clock_reg) return -1; *clock_high = (last_clock_reg + reg_offset) >> 32; *clock_low = last_clock_reg + reg_offset; last_clock_reg += num; return 0; } #if defined(HAVE_UUIDD) && defined(HAVE_SYS_UN_H) /* * Try using the uuidd daemon to generate the UUID * * Returns 0 on success, non-zero on failure. */ static int get_uuid_via_daemon(int op, uuid_t out, int *num) { char op_buf[64]; int op_len; int s; ssize_t ret; int32_t reply_len = 0, expected = 16; struct sockaddr_un srv_addr; if (sizeof(UUIDD_SOCKET_PATH) > sizeof(srv_addr.sun_path)) return -1; if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) return -1; srv_addr.sun_family = AF_UNIX; xstrncpy(srv_addr.sun_path, UUIDD_SOCKET_PATH, sizeof(srv_addr.sun_path)); if (connect(s, (const struct sockaddr *) &srv_addr, sizeof(struct sockaddr_un)) < 0) goto fail; op_buf[0] = op; op_len = 1; if (op == UUIDD_OP_BULK_TIME_UUID) { memcpy(op_buf+1, num, sizeof(*num)); op_len += sizeof(*num); expected += sizeof(*num); } ret = write(s, op_buf, op_len); if (ret < 1) goto fail; ret = read_all(s, (char *) &reply_len, sizeof(reply_len)); if (ret < 0) goto fail; if (reply_len != expected) goto fail; ret = read_all(s, op_buf, reply_len); if (op == UUIDD_OP_BULK_TIME_UUID) memcpy(op_buf+16, num, sizeof(int)); memcpy(out, op_buf, 16); close(s); return ((ret == expected) ? 0 : -1); fail: close(s); return -1; } #else /* !defined(HAVE_UUIDD) && defined(HAVE_SYS_UN_H) */ static int get_uuid_via_daemon(int op __attribute__((__unused__)), uuid_t out __attribute__((__unused__)), int *num __attribute__((__unused__))) { return -1; } #endif static int __uuid_generate_time_internal(uuid_t out, int *num, uint32_t cont_offset) { static unsigned char node_id[6]; static int has_init = 0; struct uuid uu; uint32_t clock_mid; int ret; if (!has_init) { if (get_node_id(node_id) <= 0) { ul_random_get_bytes(node_id, 6); /* * Set multicast bit, to prevent conflicts * with IEEE 802 addresses obtained from * network cards */ node_id[0] |= 0x01; } has_init = 1; } if (cont_offset) { ret = get_clock_cont(&clock_mid, &uu.time_low, *num, cont_offset); uu.clock_seq = CLOCK_SEQ_CONT; if (ret != 0) /* fallback to previous implpementation */ ret = get_clock(&clock_mid, &uu.time_low, &uu.clock_seq, num); } else { ret = get_clock(&clock_mid, &uu.time_low, &uu.clock_seq, num); } uu.clock_seq |= 0x8000; uu.time_mid = (uint16_t) clock_mid; uu.time_hi_and_version = ((clock_mid >> 16) & 0x0FFF) | 0x1000; memcpy(uu.node, node_id, 6); uuid_pack(&uu, out); return ret; } int __uuid_generate_time(uuid_t out, int *num) { return __uuid_generate_time_internal(out, num, 0); } int __uuid_generate_time_cont(uuid_t out, int *num, uint32_t cont_offset) { return __uuid_generate_time_internal(out, num, cont_offset); } /* * Generate time-based UUID and store it to @out * * Tries to guarantee uniqueness of the generated UUIDs by obtaining them from the uuidd daemon, * or, if uuidd is not usable, by using the global clock state counter (see get_clock()). * If neither of these is possible (e.g. because of insufficient permissions), it generates * the UUID anyway, but returns -1. Otherwise, returns 0. */ static int uuid_generate_time_generic(uuid_t out) { #ifdef HAVE_TLS THREAD_LOCAL int num = 0; THREAD_LOCAL int cache_size = 1; THREAD_LOCAL struct uuid uu; THREAD_LOCAL time_t last_time = 0; time_t now; if (num > 0) { now = time(NULL); if (now > last_time+1) num = 0; } if (num <= 0) { /* * num + OP_BULK provides a local cache in each application. * Start with a small cache size to cover short running applications * and increment the cache size over the runntime. */ if (cache_size < 1000000) cache_size *= 10; num = cache_size; if (get_uuid_via_daemon(UUIDD_OP_BULK_TIME_UUID, out, &num) == 0) { last_time = time(NULL); uuid_unpack(out, &uu); num--; return 0; } num = 0; } if (num > 0) { uu.time_low++; if (uu.time_low == 0) { uu.time_mid++; if (uu.time_mid == 0) uu.time_hi_and_version++; } num--; uuid_pack(&uu, out); return 0; } #else if (get_uuid_via_daemon(UUIDD_OP_TIME_UUID, out, 0) == 0) return 0; #endif return __uuid_generate_time(out, NULL); } /* * Generate time-based UUID and store it to @out. * * Discards return value from uuid_generate_time_generic() */ void uuid_generate_time(uuid_t out) { (void)uuid_generate_time_generic(out); } int uuid_generate_time_safe(uuid_t out) { return uuid_generate_time_generic(out); } int __uuid_generate_random(uuid_t out, int *num) { uuid_t buf; struct uuid uu; int i, n, r = 0; if (!num || !*num) n = 1; else n = *num; for (i = 0; i < n; i++) { if (ul_random_get_bytes(buf, sizeof(buf))) r = -1; uuid_unpack(buf, &uu); uu.clock_seq = (uu.clock_seq & 0x3FFF) | 0x8000; uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x4000; uuid_pack(&uu, out); out += sizeof(uuid_t); } return r; } void uuid_generate_random(uuid_t out) { int num = 1; /* No real reason to use the daemon for random uuid's -- yet */ __uuid_generate_random(out, &num); } /* * This is the generic front-end to __uuid_generate_random and * uuid_generate_time. It uses __uuid_generate_random output * only if high-quality randomness is available. */ void uuid_generate(uuid_t out) { int num = 1; if (__uuid_generate_random(out, &num)) uuid_generate_time(out); } /* * Generate an MD5 hashed (predictable) UUID based on a well-known UUID * providing the namespace and an arbitrary binary string. */ void uuid_generate_md5(uuid_t out, const uuid_t ns, const char *name, size_t len) { UL_MD5_CTX ctx; char hash[UL_MD5LENGTH]; uuid_t buf; struct uuid uu; ul_MD5Init(&ctx); ul_MD5Update(&ctx, ns, sizeof(uuid_t)); ul_MD5Update(&ctx, (const unsigned char *)name, len); ul_MD5Final((unsigned char *)hash, &ctx); assert(sizeof(buf) <= sizeof(hash)); memcpy(buf, hash, sizeof(buf)); uuid_unpack(buf, &uu); uu.clock_seq = (uu.clock_seq & 0x3FFF) | 0x8000; uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x3000; uuid_pack(&uu, out); } /* * Generate a SHA1 hashed (predictable) UUID based on a well-known UUID * providing the namespace and an arbitrary binary string. */ void uuid_generate_sha1(uuid_t out, const uuid_t ns, const char *name, size_t len) { UL_SHA1_CTX ctx; char hash[UL_SHA1LENGTH]; uuid_t buf; struct uuid uu; ul_SHA1Init(&ctx); ul_SHA1Update(&ctx, ns, sizeof(uuid_t)); ul_SHA1Update(&ctx, (const unsigned char *)name, len); ul_SHA1Final((unsigned char *)hash, &ctx); assert(sizeof(buf) <= sizeof(hash)); memcpy(buf, hash, sizeof(buf)); uuid_unpack(buf, &uu); uu.clock_seq = (uu.clock_seq & 0x3FFF) | 0x8000; uu.time_hi_and_version = (uu.time_hi_and_version & 0x0FFF) | 0x5000; uuid_pack(&uu, out); } uuid/src/Ruuid.c0000644000176200001440000000305714550351455013257 0ustar liggesusers#include "Ruuid.h" static int API_uuid_generate(uuid_t uuid, int type) { if (type == GT_DEFAULT) { uuid_generate(uuid); return 0; } if (type == GT_TIME) { uuid_generate_time(uuid); return 0; } if (type == GT_RANDOM) { uuid_generate_random(uuid); return 0; } return -2; } static void API_uuid_unparse(uuid_t u, char *out, int lower) { if (lower) uuid_unparse_lower(u, out); else uuid_unparse_upper(u, out); } static int API_uuid_parse(const char *in_start, const char *in_end, uuid_t uu) { return (in_end) ? uuid_parse_range(in_start, in_end, uu) : uuid_parse(in_start, uu); } #include #include SEXP UUID_gen(SEXP sN, SEXP sOut, SEXP sType, SEXP sNS); /* R.c */ SEXP UUID_parse(SEXP sWhat, SEXP sOut); SEXP UUID_unparse(SEXP sWhat, SEXP sAsUUID); SEXP UUID_is_NA(SEXP sWhat); SEXP UUID_cmp(SEXP sE1, SEXP sE2, SEXP sOp); static const R_CallMethodDef callMethods[] = { {"UUID_gen", (DL_FUNC) &UUID_gen, 4}, {"UUID_parse", (DL_FUNC) &UUID_parse, 2}, {"UUID_unparse", (DL_FUNC) &UUID_unparse, 2}, {"UUID_is_NA", (DL_FUNC) &UUID_is_NA, 1}, {"UUID_cmp", (DL_FUNC) &UUID_cmp, 3}, {NULL, NULL, 0} }; void R_init_uuid(DllInfo *dll) { R_registerRoutines(dll, NULL, callMethods, NULL, NULL); R_useDynamicSymbols(dll, FALSE); R_RegisterCCallable("uuid", "generate", (DL_FUNC) &API_uuid_generate); R_RegisterCCallable("uuid", "unparse", (DL_FUNC) &API_uuid_unparse); R_RegisterCCallable("uuid", "parse", (DL_FUNC) &API_uuid_parse); } uuid/src/randutils.c0000644000176200001440000001320214550351455014165 0ustar liggesusers/* * SPDX-License-Identifier: BSD-3-Clause * * General purpose random utilities. Based on libuuid code. * * This code is free software; you can redistribute it and/or modify it under * the terms of the Modified BSD License. The complete text of the license is * available in the Documentation/licenses/COPYING.BSD-3-Clause file. */ #include #include #include #include #include #include #ifdef HAVE_SYS_SYSCALL_H #include #endif #include "c.h" #include "randutils.h" #include "nls.h" #ifdef HAVE_TLS #define THREAD_LOCAL static __thread #else #define THREAD_LOCAL static #endif #ifdef HAVE_GETRANDOM # include #elif defined (__linux__) # if !defined(SYS_getrandom) && defined(__NR_getrandom) /* usable kernel-headers, but old glibc-headers */ # define SYS_getrandom __NR_getrandom # endif #endif #if !defined(HAVE_GETRANDOM) && defined(SYS_getrandom) /* libc without function, but we have syscall */ #define GRND_NONBLOCK 0x01 #define GRND_RANDOM 0x02 static int getrandom(void *buf, size_t buflen, unsigned int flags) { return (syscall(SYS_getrandom, buf, buflen, flags)); } # define HAVE_GETRANDOM #endif #if defined(__linux__) && defined(__NR_gettid) && defined(HAVE_JRAND48) #define DO_JRAND_MIX THREAD_LOCAL unsigned short ul_jrand_seed[3]; #endif int rand_get_number(int low_n, int high_n) { return rand() % (high_n - low_n + 1) + low_n; } #ifdef _WIN32 static int getuid() { return 1; } #endif static void crank_random(void) { int i; struct timeval tv; unsigned int n_pid, n_uid; gettimeofday(&tv, NULL); n_pid = getpid(); n_uid = getuid(); srand((n_pid << 16) ^ n_uid ^ tv.tv_sec ^ tv.tv_usec); #ifdef DO_JRAND_MIX ul_jrand_seed[0] = getpid() ^ (tv.tv_sec & 0xFFFF); ul_jrand_seed[1] = getppid() ^ (tv.tv_usec & 0xFFFF); ul_jrand_seed[2] = (tv.tv_sec ^ tv.tv_usec) >> 16; #endif /* Crank the random number generator a few times */ gettimeofday(&tv, NULL); for (i = (tv.tv_sec ^ tv.tv_usec) & 0x1F; i > 0; i--) rand(); } int random_get_fd(void) { int fd = -1; #ifndef _WIN32 int i; fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC); if (fd == -1) fd = open("/dev/random", O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (fd >= 0) { i = fcntl(fd, F_GETFD); if (i >= 0) fcntl(fd, F_SETFD, i | FD_CLOEXEC); } #endif crank_random(); return fd; } /* * Generate a stream of random nbytes into buf. * Use /dev/urandom if possible, and if not, * use glibc pseudo-random functions. */ #define UL_RAND_READ_ATTEMPTS 8 #define UL_RAND_READ_DELAY 125000 /* microseconds */ /* * Write @nbytes random bytes into @buf. * * Returns 0 for good quality of random bytes or 1 for weak quality. */ int ul_random_get_bytes(void *buf, size_t nbytes) { unsigned char *cp = (unsigned char *)buf; size_t i, n = nbytes; int lose_counter = 0; #ifdef HAVE_GETRANDOM while (n > 0) { int x; errno = 0; x = getrandom(cp, n, GRND_NONBLOCK); if (x > 0) { /* success */ n -= x; cp += x; lose_counter = 0; errno = 0; } else if (errno == ENOSYS) { /* kernel without getrandom() */ break; } else if (errno == EAGAIN && lose_counter < UL_RAND_READ_ATTEMPTS) { xusleep(UL_RAND_READ_DELAY); /* no entropy, wait and try again */ lose_counter++; } else break; } if (errno == ENOSYS) #endif /* * We've been built against headers that support getrandom, but the * running kernel does not. Fallback to reading from /dev/{u,}random * as before */ { int fd = random_get_fd(); lose_counter = 0; if (fd >= 0) { while (n > 0) { ssize_t x = read(fd, cp, n); if (x <= 0) { if (lose_counter++ > UL_RAND_READ_ATTEMPTS) break; xusleep(UL_RAND_READ_DELAY); continue; } n -= x; cp += x; lose_counter = 0; } close(fd); } } /* * We do this all the time, but this is the only source of * randomness if /dev/random/urandom is out to lunch. */ crank_random(); for (cp = buf, i = 0; i < nbytes; i++) *cp++ ^= (rand() >> 7) & 0xFF; #ifdef DO_JRAND_MIX { unsigned short tmp_seed[3]; memcpy(tmp_seed, ul_jrand_seed, sizeof(tmp_seed)); ul_jrand_seed[2] = ul_jrand_seed[2] ^ syscall(__NR_gettid); for (cp = buf, i = 0; i < nbytes; i++) *cp++ ^= (jrand48(tmp_seed) >> 7) & 0xFF; memcpy(ul_jrand_seed, tmp_seed, sizeof(ul_jrand_seed)-sizeof(unsigned short)); } #endif #ifdef _WIN32 /* this is our R-specific thing: we replace rand() with an implementation using rand_s() which returns crypto-grade RNG so we know it is good (or so M$ tells us ;)) */ n = 0; #endif return n != 0; } /* * Tell source of randomness. */ const char *random_tell_source(void) { #ifdef HAVE_GETRANDOM return _("getrandom() function"); #else size_t i; static const char *random_sources[] = { "/dev/urandom", "/dev/random" }; for (i = 0; i < ARRAY_SIZE(random_sources); i++) { if (!access(random_sources[i], R_OK)) return random_sources[i]; } #endif return _("libc pseudo-random functions"); } #ifdef TEST_PROGRAM_RANDUTILS #include int main(int argc, char *argv[]) { size_t i, n; int64_t *vp, v; char *buf; size_t bufsz; n = argc == 1 ? 16 : atoi(argv[1]); printf("Multiple random calls:\n"); for (i = 0; i < n; i++) { ul_random_get_bytes(&v, sizeof(v)); printf("#%02zu: %25"PRIu64"\n", i, v); } printf("One random call:\n"); bufsz = n * sizeof(*vp); buf = malloc(bufsz); if (!buf) err(EXIT_FAILURE, "failed to allocate buffer"); ul_random_get_bytes(buf, bufsz); for (i = 0; i < n; i++) { vp = (int64_t *) (buf + (i * sizeof(*vp))); printf("#%02zu: %25"PRIu64"\n", i, *vp); } return EXIT_SUCCESS; } #endif /* TEST_PROGRAM_RANDUTILS */ uuid/src/md5.c0000644000176200001440000002030614550351455012650 0ustar liggesusers/* * This code implements the MD5 message-digest algorithm. * The algorithm is due to Ron Rivest. This code was * written by Colin Plumb in 1993, no copyright is claimed. * This code is in the public domain; do with it what you wish. * * Equivalent code is available from RSA Data Security, Inc. * This code has been tested against that, and is equivalent, * except that you don't need to include two pages of legalese * with every copy. * * To compute the message digest of a chunk of bytes, declare an * MD5Context structure, pass it to MD5Init, call MD5Update as * needed on buffers full of bytes, and then call MD5Final, which * will fill a supplied 16-byte array with the digest. */ #include /* for memcpy() */ #include "md5.h" #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ # define byteReverse(buf, len) /* Nothing */ #else static void byteReverse(unsigned char *buf, unsigned longs); #ifndef ASM_MD5 /* * Note: this code is harmless on little-endian machines. */ static void byteReverse(unsigned char *buf, unsigned longs) { uint32_t t; do { t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 | ((unsigned) buf[1] << 8 | buf[0]); *(uint32_t *) buf = t; buf += 4; } while (--longs); } #endif /* !ASM_MD5 */ #endif /* __ORDER_LITTLE_ENDIAN__ */ /* * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious * initialization constants. */ void ul_MD5Init(struct UL_MD5Context *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; ctx->bits[0] = 0; ctx->bits[1] = 0; } /* * Update context to reflect the concatenation of another buffer full * of bytes. */ void ul_MD5Update(struct UL_MD5Context *ctx, unsigned char const *buf, unsigned len) { uint32_t t; /* Update bitcount */ t = ctx->bits[0]; if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1] += len >> 29; t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ /* Handle any leading odd-sized chunks */ if (t) { unsigned char *p = (unsigned char *) ctx->in + t; t = 64 - t; if (len < t) { memcpy(p, buf, len); return; } memcpy(p, buf, t); byteReverse(ctx->in, 16); ul_MD5Transform(ctx->buf, (uint32_t *) ctx->in); buf += t; len -= t; } /* Process data in 64-byte chunks */ while (len >= 64) { memcpy(ctx->in, buf, 64); byteReverse(ctx->in, 16); ul_MD5Transform(ctx->buf, (uint32_t *) ctx->in); buf += 64; len -= 64; } /* Handle any remaining bytes of data. */ memcpy(ctx->in, buf, len); } /* * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ void ul_MD5Final(unsigned char digest[UL_MD5LENGTH], struct UL_MD5Context *ctx) { unsigned count; unsigned char *p; /* Compute number of bytes mod 64 */ count = (ctx->bits[0] >> 3) & 0x3F; /* Set the first char of padding to 0x80. This is safe since there is always at least one byte free */ p = ctx->in + count; *p++ = 0x80; /* Bytes of padding needed to make 64 bytes */ count = 64 - 1 - count; /* Pad out to 56 mod 64 */ if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ memset(p, 0, count); byteReverse(ctx->in, 16); ul_MD5Transform(ctx->buf, (uint32_t *) ctx->in); /* Now fill the next block with 56 bytes */ memset(ctx->in, 0, 56); } else { /* Pad block to 56 bytes */ memset(p, 0, count - 8); } byteReverse(ctx->in, 14); /* Append length in bits and transform. * Use memcpy to avoid aliasing problems. On most systems, * this will be optimized away to the same code. */ memcpy(&ctx->in[14 * sizeof(uint32_t)], &ctx->bits[0], 4); memcpy(&ctx->in[15 * sizeof(uint32_t)], &ctx->bits[1], 4); ul_MD5Transform(ctx->buf, (uint32_t *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memcpy(digest, ctx->buf, UL_MD5LENGTH); memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } #ifndef ASM_MD5 /* The four core functions - F1 is optimized somewhat */ /* #define F1(x, y, z) (x & y | ~x & z) */ #define F1(x, y, z) (z ^ (x & (y ^ z))) #define F2(x, y, z) F1(z, x, y) #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) /* This is the central step in the MD5 algorithm. */ #define MD5STEP(f, w, x, y, z, data, s) \ ( w += f(x, y, z) + data, w = w<>(32-s), w += x ) /* * The core of the MD5 algorithm, this alters an existing MD5 hash to * reflect the addition of 16 longwords of new data. MD5Update blocks * the data and converts bytes into longwords for this routine. */ void ul_MD5Transform(uint32_t buf[4], uint32_t const in[16]) { register uint32_t a, b, c, d; a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); buf[0] += a; buf[1] += b; buf[2] += c; buf[3] += d; } #endif uuid/src/sha1.h0000644000176200001440000000122214550351455013020 0ustar liggesusers#ifndef UTIL_LINUX_SHA1_H #define UTIL_LINUX_SHA1_H /* SHA-1 in C By Steve Reid 100% Public Domain */ #include "stdint.h" #define UL_SHA1LENGTH 20 typedef struct { uint32_t state[5]; uint32_t count[2]; unsigned char buffer[64]; } UL_SHA1_CTX; void ul_SHA1Transform(uint32_t state[5], const unsigned char buffer[64]); void ul_SHA1Init(UL_SHA1_CTX *context); void ul_SHA1Update(UL_SHA1_CTX *context, const unsigned char *data, uint32_t len); void ul_SHA1Final(unsigned char digest[UL_SHA1LENGTH], UL_SHA1_CTX *context); void ul_SHA1(char *hash_out, const char *str, unsigned len); #endif /* UTIL_LINUX_SHA1_H */ uuid/src/clear.c0000644000176200001440000000321414550351455013250 0ustar liggesusers/* * clear.c -- Clear a UUID * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #include "string.h" #include "uuidP.h" void uuid_clear(uuid_t uu) { memset(uu, 0, 16); } uuid/src/Ruuid.h0000644000176200001440000000123214550351455013255 0ustar liggesusers#ifndef R_UUID_H__ #define R_UUID_H__ #include "uuid.h" /* types to use with generate() */ #define GT_DEFAULT 0 #define GT_RANDOM 1 #define GT_TIME 2 /* exported functions: */ typedef int (*RU_generate_t)(uuid_t uuid, int type); typedef int (*RU_parse_t)(const char *in_start, const char *in_end, uuid_t uu); /* in_end can be NULL */ typedef void(*RU_unparse_t)(uuid_t uuid, char *out, int lower); /* sample use: RU_generate_t generate_fn = (RU_generate_t) R_GetCCallable("uuid", "generate"); RU_parse_t parse_fn = (RU_parse_t) R_GetCCallable("uuid", "parse"); RU_unparse_t unparse_fn = (RU_unparse_t) R_GetCCallable("uuid", "unparse"); */ #endif uuid/src/parse.c0000644000176200001440000000536314550351455013303 0ustar liggesusers/* * parse.c --- UUID parsing * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #include #include #include #include #include "c.h" #include "uuidP.h" int uuid_parse_range(const char *in_start, const char *in_end, uuid_t uu); int uuid_parse(const char *in, uuid_t uu) { size_t len = strlen(in); if (len != 36) return -1; return uuid_parse_range(in, in + len, uu); } int uuid_parse_range(const char *in_start, const char *in_end, uuid_t uu) { struct uuid uuid; int i; const char *cp; char buf[3]; if ((in_end - in_start) != 36) return -1; for (i=0, cp = in_start; i < 36; i++,cp++) { if ((i == 8) || (i == 13) || (i == 18) || (i == 23)) { if (*cp == '-') continue; return -1; } if (!isxdigit(*cp)) return -1; } errno = 0; uuid.time_low = strtoul(in_start, NULL, 16); if (!errno) uuid.time_mid = strtoul(in_start+9, NULL, 16); if (!errno) uuid.time_hi_and_version = strtoul(in_start+14, NULL, 16); if (!errno) uuid.clock_seq = strtoul(in_start+19, NULL, 16); if (errno) return -1; cp = in_start+24; buf[2] = 0; for (i=0; i < 6; i++) { buf[0] = *cp++; buf[1] = *cp++; errno = 0; uuid.node[i] = strtoul(buf, NULL, 16); if (errno) return -1; } uuid_pack(&uuid, uu); return 0; } uuid/src/uuidd.h0000644000176200001440000000434014550351455013302 0ustar liggesusers/* * Definitions used by the uuidd daemon * * Copyright (C) 2007 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #ifndef _UUID_UUIDD_H #define _UUID_UUIDD_H #define UUIDD_DIR _PATH_RUNSTATEDIR "/uuidd" #define UUIDD_SOCKET_PATH UUIDD_DIR "/request" #define UUIDD_PIDFILE_PATH UUIDD_DIR "/uuidd.pid" #define UUIDD_PATH "/usr/sbin/uuidd" #define UUIDD_OP_GETPID 0 #define UUIDD_OP_GET_MAXOP 1 #define UUIDD_OP_TIME_UUID 2 #define UUIDD_OP_RANDOM_UUID 3 #define UUIDD_OP_BULK_TIME_UUID 4 #define UUIDD_OP_BULK_RANDOM_UUID 5 #define UUIDD_MAX_OP UUIDD_OP_BULK_RANDOM_UUID extern int __uuid_generate_time(uuid_t out, int *num); extern int __uuid_generate_time_cont(uuid_t out, int *num, uint32_t cont); extern int __uuid_generate_random(uuid_t out, int *num); #endif /* _UUID_UUID_H */ uuid/src/compare.c0000644000176200001440000000416714550351455013620 0ustar liggesusers/* * compare.c --- compare whether or not two UUIDs are the same * * Returns 0 if the two UUIDs are different, and 1 if they are the same. * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #include "uuidP.h" #include #define UUCMP(u1,u2) if (u1 != u2) return((u1 < u2) ? -1 : 1); int uuid_compare(const uuid_t uu1, const uuid_t uu2) { struct uuid uuid1, uuid2; uuid_unpack(uu1, &uuid1); uuid_unpack(uu2, &uuid2); UUCMP(uuid1.time_low, uuid2.time_low); UUCMP(uuid1.time_mid, uuid2.time_mid); UUCMP(uuid1.time_hi_and_version, uuid2.time_hi_and_version); UUCMP(uuid1.clock_seq, uuid2.clock_seq); return memcmp(uuid1.node, uuid2.node, 6); } uuid/src/win32/0000755000176200001440000000000014550351455012760 5ustar liggesusersuuid/src/win32/config.h0000644000176200001440000000550214550351455014400 0ustar liggesusers/* src/config.h. Generated from config.h.in by configure. */ /* src/config.h.in. Generated from configure.ac by autoheader. */ /* -- reflects MinGW + Win32 -- */ /* defined if the system supports dlsym */ /* #undef HAS_DLSYM */ /* Define to 1 if you have the header file. */ /* #undef HAVE_DLFCN_H */ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `flock' function. */ /* #undef HAVE_FLOCK */ /* Define to 1 if you have the `jrand48' function. */ /* #undef HAVE_JRAND48 */ /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_NETINET_IN_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_NET_IF_DL_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_NET_IF_H */ /* Define if struct sockaddr contains sa_len */ /* #undef HAVE_SA_LEN */ /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 #define HAVE_NANOSLEEP 1 #define HAVE_USLEEP 1 /* not defined, so we define it to 0 */ #define O_CLOEXEC 0 /* Define to 1 if you have the header file. */ #define HAVE_SYS_FILE_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_IOCTL_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_SOCKET_H */ /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_SOCKIO_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_SYSCALL_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_UN_H */ /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "Simon.Urbanek@r-project.org" /* Define to the full name of this package. */ #define PACKAGE_NAME "uuid" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "uuid 0.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "uuid" /* Define to the version of this package. */ #define PACKAGE_VERSION "0.1" /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 uuid/src/R.c0000644000176200001440000001643314550351455012372 0ustar liggesusers#include "uuid.h" #include #include #include #define OF_STRING 0 #define OF_RAW 1 #define OF_CPLX 2 #define OF_VALID 3 /* x is expected to be protected, this does allocate; n is the number of uuids */ static void set_raw_dim(SEXP x, size_t n) { /* FIXME: INT won't be enough for n > 2^31 */ SEXP sDim = Rf_allocVector(INTSXP, 2); INTEGER(sDim)[0] = sizeof(uuid_t); INTEGER(sDim)[1] = n; Rf_setAttrib(x, R_DimSymbol, sDim); /* setAttrib does PROTECT */ } SEXP UUID_gen(SEXP sN, SEXP sOut, SEXP sType, SEXP sNS) { uuid_t u; SEXP res; char c[40]; int form = asInteger(sOut); int ver = asInteger(sType); /* use.time=TRUE -> 1, use.time=FALSE -> 4, use.time=NA -> NA */ ptrdiff_t i, n = -1; uuid_t *dst = &u; uuid_t ns; if (ver == 3 || ver == 5) { /* use sN as the name vector and sNS UUID; R code does the necessary coersions */ n = (ptrdiff_t) XLENGTH(sN); if (!(TYPEOF(sNS) == CPLXSXP && Rf_inherits(sNS, "UUID"))) Rf_error("namespace must be a valid UUID object"); memcpy(&ns, (uuid_t*) COMPLEX(sNS), sizeof(uuid_t)); } else { if (TYPEOF(sN) == INTSXP && LENGTH(sN) > 0) n = INTEGER(sN)[0]; if (TYPEOF(sN) == REALSXP && LENGTH(sN) > 0) n = (ptrdiff_t)REAL(sN)[0]; if (n < 0) Rf_error("invalid n, must be a positive integer"); } switch(form) { case OF_STRING: res = PROTECT(allocVector(STRSXP, n)); break; case OF_RAW: res = PROTECT(allocVector(RAWSXP, n * sizeof(uuid_t))); dst = (uuid_t*) RAW(res); break; case OF_CPLX: res = PROTECT(allocVector(CPLXSXP, n)); dst = (uuid_t*) ((void*) COMPLEX(res)); break; default: Rf_error("invalid output format specification"); } for (i = 0; i < n; i++) { switch(ver) { case 1: uuid_generate_time(*dst); break; case 4: uuid_generate_random(*dst); break; case 3: case 5: { const char *name = CHAR(STRING_ELT(sN, i)); if (ver == 3) uuid_generate_md5(*dst, ns, name, strlen(name)); else uuid_generate_sha1(*dst, ns, name, strlen(name)); break; } default: uuid_generate(*dst); } if (form == OF_STRING) { uuid_unparse_lower(u, c); SET_STRING_ELT(res, i, mkChar(c)); } else dst++; } if (form == OF_RAW && n > 1) set_raw_dim(res, n); if (form == OF_CPLX) Rf_setAttrib(res, R_ClassSymbol, Rf_mkString("UUID")); UNPROTECT(1); return res; } static void cplx_set_NA(void* dst) { Rcomplex *c = (Rcomplex*) dst; c->r = NA_REAL; c->i = NA_REAL; } SEXP UUID_parse(SEXP sWhat, SEXP sOut) { uuid_t u; SEXP res; char c[40]; int form = asInteger(sOut); size_t i, n = (size_t) XLENGTH(sWhat); uuid_t *dst = &u; int *lgl = 0; if (TYPEOF(sWhat) != STRSXP) Rf_error("input must be a character vector"); switch(form) { case OF_STRING: res = PROTECT(allocVector(STRSXP, n)); break; case OF_RAW: res = PROTECT(allocVector(RAWSXP, n * sizeof(uuid_t))); dst = (uuid_t*) RAW(res); break; case OF_CPLX: res = PROTECT(allocVector(CPLXSXP, n)); dst = (uuid_t*) ((void*) COMPLEX(res)); break; case OF_VALID: res = PROTECT(allocVector(LGLSXP, n)); lgl = LOGICAL(res); break; default: Rf_error("invalid output format specification"); } for (i = 0; i < n; i++) { SEXP elt = STRING_ELT(sWhat, i); if (elt == NA_STRING) { switch (form) { case OF_STRING: SET_STRING_ELT(res, i, NA_STRING); break; case OF_RAW: case OF_CPLX: cplx_set_NA(*dst); dst++; break; case OF_VALID: lgl[i] = NA_LOGICAL; break; } continue; } int pr = uuid_parse(CHAR(STRING_ELT(sWhat, i)), *dst); switch (form) { case OF_STRING: if (pr) /* FAIL */ SET_STRING_ELT(res, i, NA_STRING); else { uuid_unparse_lower(u, c); SET_STRING_ELT(res, i, mkChar(c)); } break; case OF_VALID: lgl[i] = (pr == 0) ? 1 : 0; break; case OF_CPLX: case OF_RAW: if (pr != 0) cplx_set_NA(*dst); dst++; break; } } if (form == OF_RAW && n > 1) set_raw_dim(res, n); if (form == OF_CPLX) Rf_setAttrib(res, R_ClassSymbol, Rf_mkString("UUID")); UNPROTECT(1); return res; } SEXP UUID_unparse(SEXP sWhat, SEXP sAsUUID) { SEXP res; uuid_t *src = 0, NA_value; char c[40]; size_t n, i; int as_uuid = Rf_asInteger(sAsUUID); cplx_set_NA(NA_value); if (TYPEOF(sWhat) == RAWSXP) { size_t len = XLENGTH(sWhat); SEXP dim = Rf_getAttrib(sWhat, R_DimSymbol); if ((dim != R_NilValue) && (!( ((TYPEOF(dim) == INTSXP) && (LENGTH(dim) >= 1) && INTEGER(dim)[0] == sizeof(uuid_t)) || ((TYPEOF(dim) == REALSXP) && (LENGTH(dim) >= 1) && REAL(dim)[0] == (double) sizeof(uuid_t))))) Rf_error("invalid dimensions, first dimension must be 16"); /* in case there are no dimensions */ if (len % sizeof(uuid_t)) Rf_error("invalid raw vector length, this cannot be UUID"); src = (uuid_t*) RAW(sWhat); n = len / sizeof(uuid_t); } else if (TYPEOF(sWhat) == CPLXSXP && Rf_inherits(sWhat, "UUID")) { src = (uuid_t*) COMPLEX(sWhat); n = XLENGTH(sWhat); } else Rf_error("Unparsing only works for raw vectors and UUID objects"); /* this is not really unparsing, but rather conversion UUID <-> raw ... */ if (as_uuid) { if (as_uuid == 2) { res = PROTECT(Rf_allocVector(RAWSXP, n * sizeof(uuid_t))); memcpy(RAW(res), src, n * sizeof(uuid_t)); if (n > 1) set_raw_dim(res, n); UNPROTECT(1); return res; } else { res = PROTECT(Rf_allocVector(CPLXSXP, n)); memcpy(COMPLEX(res), src, n * sizeof(uuid_t)); Rf_setAttrib(res, R_ClassSymbol, Rf_mkString("UUID")); UNPROTECT(1); return res; } } res = PROTECT(Rf_allocVector(STRSXP, n)); for (i = 0; i < n; i++) { if (src[i][6] == 0xf0 && !memcmp(src[i], NA_value, sizeof(uuid_t))) SET_STRING_ELT(res, i, NA_STRING); else { uuid_unparse_lower(src[i], c); SET_STRING_ELT(res, i, mkChar(c)); } } UNPROTECT(1); return res; } SEXP UUID_is_NA(SEXP sWhat) { uuid_t *src, NA_value; size_t i, n; int *lgl; SEXP res; if (!(TYPEOF(sWhat) == CPLXSXP && Rf_inherits(sWhat, "UUID"))) Rf_error("must be UUID object"); cplx_set_NA(NA_value); n = XLENGTH(sWhat); src = (uuid_t*) COMPLEX(sWhat); res = Rf_allocVector(LGLSXP, n); lgl = LOGICAL(res); for (i = 0; i < n; i++) lgl[i] = memcmp(src[i], NA_value, sizeof(uuid_t)) ? 0 : 1; return res; } SEXP UUID_cmp(SEXP sE1, SEXP sE2, SEXP sOp) { uuid_t *s1, *s2, NA_value; size_t i1 = 0, i2 = 0, i = 0, n1, n2, n; SEXP res; int *lgl; int op = Rf_asInteger(sOp); if (!(TYPEOF(sE1) == CPLXSXP && Rf_inherits(sE1, "UUID") && TYPEOF(sE2) == CPLXSXP && Rf_inherits(sE2, "UUID"))) Rf_error("both operands must be UUID objects"); n1 = XLENGTH(sE1); n2 = XLENGTH(sE2); if (n1 == 0 || n2 == 0) return Rf_allocVector(LGLSXP, 0); cplx_set_NA(NA_value); s1 = (uuid_t*) COMPLEX(sE1); s2 = (uuid_t*) COMPLEX(sE2); n = (n1 > n2) ? n1 : n2; res = Rf_allocVector(LGLSXP, n); lgl = LOGICAL(res); while (i < n) { if ((!memcmp(s1[i1], NA_value, sizeof(uuid_t))) || (!memcmp(s2[i2], NA_value, sizeof(uuid_t)))) lgl[i] = NA_LOGICAL; else lgl[i] = (memcmp(s1[i1], s2[i2], sizeof(uuid_t)) == op) ? 1 : 0; if (++i1 == n1) i1 = 0; if (++i2 == n2) i2 = 0; i++; } return res; } uuid/src/copy.c0000644000176200001440000000335714550351455013144 0ustar liggesusers/* * copy.c --- copy UUIDs * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #include "uuidP.h" void uuid_copy(uuid_t dst, const uuid_t src) { unsigned char *cp1; const unsigned char *cp2; int i; for (i=0, cp1 = dst, cp2 = src; i < 16; i++) *cp1++ = *cp2++; } uuid/src/upstream.patch0000644000176200001440000001241314550351455014700 0ustar liggesusersdiff --git a/src/c.h b/src/c.h index db0c58b..c24f295 100644 --- a/src/c.h +++ b/src/c.h @@ -17,7 +17,9 @@ #include #include #include +#ifdef HAVE_GRP_H #include +#endif #include @@ -244,7 +246,7 @@ prog_inv_sh_nm_from_file(char *f, char stripext) #endif -#ifndef HAVE_ERR_H +#if 0 /* HAVE_ERR_H fallback unused and causes issues with ISO C so disable */ static inline void __attribute__ ((__format__ (__printf__, 4, 5))) errmsg(char doexit, int excode, char adderr, const char *fmt, ...) { @@ -350,10 +352,12 @@ static inline int dirfd(DIR *d) */ static inline size_t get_hostname_max(void) { +#ifndef WIN32 long len = sysconf(_SC_HOST_NAME_MAX); if (0 < len) return len; +#endif #ifdef MAXHOSTNAMELEN return MAXHOSTNAMELEN; @@ -366,6 +370,9 @@ static inline size_t get_hostname_max(void) static inline int drop_permissions(void) { +#ifdef _WIN32 + return 0; +#else errno = 0; /* drop GID */ @@ -379,6 +386,7 @@ static inline int drop_permissions(void) return 0; fail: return errno ? -errno : -1; +#endif } /* diff --git a/src/gen_uuid.c b/src/gen_uuid.c index 76d5371..95c2d82 100644 --- a/src/gen_uuid.c +++ b/src/gen_uuid.c @@ -96,30 +96,6 @@ #define THREAD_LOCAL static #endif -#ifdef _WIN32 -static void gettimeofday (struct timeval *tv, void *dummy) -{ - FILETIME ftime; - uint64_t n; - - GetSystemTimeAsFileTime (&ftime); - n = (((uint64_t) ftime.dwHighDateTime << 32) - + (uint64_t) ftime.dwLowDateTime); - if (n) { - n /= 10; - n -= ((369 * 365 + 89) * (uint64_t) 86400) * 1000000; - } - - tv->tv_sec = n / 1000000; - tv->tv_usec = n % 1000000; -} - -static int getuid (void) -{ - return 1; -} -#endif - /* * Get the ethernet hardware address, if we can find it... * @@ -221,15 +197,20 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low, { THREAD_LOCAL int adjustment = 0; THREAD_LOCAL struct timeval last = {0, 0}; - THREAD_LOCAL int state_fd = -2; - THREAD_LOCAL FILE *state_f; THREAD_LOCAL uint16_t clock_seq; struct timeval tv; uint64_t clock_reg; +#ifndef _WIN32 mode_t save_umask; int len; + THREAD_LOCAL FILE *state_f; + THREAD_LOCAL int state_fd = -2; +#endif int ret = 0; +#ifdef _WIN32 + ret = -1; +#else if (state_fd == -1) ret = -1; @@ -250,6 +231,7 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low, } if (state_fd >= 0) { rewind(state_f); +#ifdef HAVE_FLOCK while (flock(state_fd, LOCK_EX) < 0) { if ((errno == EAGAIN) || (errno == EINTR)) continue; @@ -259,6 +241,7 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low, ret = -1; break; } +#endif } if (state_fd >= 0) { unsigned int cl; @@ -280,6 +263,7 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low, gettimeofday(&last, NULL); last.tv_sec--; } +#endif try_again: gettimeofday(&tv, NULL); @@ -311,6 +295,7 @@ try_again: last.tv_usec = last.tv_usec % 1000000; } +#ifndef _WIN32 if (state_fd >= 0) { rewind(state_f); len = fprintf(state_f, @@ -322,8 +307,11 @@ try_again: fflush(state_f); } rewind(state_f); +#ifdef HAVE_FLOCK flock(state_fd, LOCK_UN); +#endif } +#endif *clock_high = clock_reg >> 32; *clock_low = clock_reg; diff --git a/src/parse.c b/src/parse.c index c3e2281..cf609ec 100644 --- a/src/parse.c +++ b/src/parse.c @@ -40,6 +40,8 @@ #include "c.h" #include "uuidP.h" +int uuid_parse_range(const char *in_start, const char *in_end, uuid_t uu); + int uuid_parse(const char *in, uuid_t uu) { size_t len = strlen(in); diff --git a/src/randutils.c b/src/randutils.c index 2ffe9b4..35c072b 100644 --- a/src/randutils.c +++ b/src/randutils.c @@ -56,6 +56,10 @@ int rand_get_number(int low_n, int high_n) return rand() % (high_n - low_n + 1) + low_n; } +#ifdef _WIN32 +static int getuid() { return 1; } +#endif + static void crank_random(void) { int i; @@ -80,7 +84,9 @@ static void crank_random(void) int random_get_fd(void) { - int i, fd; + int fd = -1; +#ifndef _WIN32 + int i; fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC); if (fd == -1) @@ -90,6 +96,7 @@ int random_get_fd(void) if (i >= 0) fcntl(fd, F_SETFD, i | FD_CLOEXEC); } +#endif crank_random(); return fd; } @@ -183,6 +190,11 @@ int ul_random_get_bytes(void *buf, size_t nbytes) } #endif +#ifdef _WIN32 /* this is our R-specific thing: we replace rand() with an implementation + using rand_s() which returns crypto-grade RNG so we know it is good + (or so M$ tells us ;)) */ + n = 0; +#endif return n != 0; } diff --git a/src/randutils.h b/src/randutils.h index 690bf5e..be10121 100644 --- a/src/randutils.h +++ b/src/randutils.h @@ -1,11 +1,24 @@ #ifndef UTIL_LINUX_RANDUTILS #define UTIL_LINUX_RANDUTILS +/* map dynamic symbols */ +#define srandom(x) uuid_srandom(x) +#define random() uuid_random() + #ifdef HAVE_SRANDOM -#define srand(x) srandom(x) -#define rand() random() +#define srand(x) uuid_srandom(x) +#define rand() uuid_random() +#else +#define srand(x) uuid_srand(x) +#define rand() uuid_rand() #endif +/* from rand.c */ +extern int uuid_rand(void); +extern void uuid_srand(unsigned seed); +extern long uuid_random(void); +extern void uuid_srandom(unsigned seed); + /* rand() based */ extern int rand_get_number(int low_n, int high_n); uuid/src/update-inst.sh0000644000176200001440000000112214550351455014603 0ustar liggesusers#!/bin/bash a=$(dirname $0) if [ -z "$a" ]; then a=.; fi src=`(cd $a && pwd)` if [ -z "$src" ]; then src=`pwd`; fi if [ ! -e $src/uuid.h ]; then echo "ERROR: cannot determine src directory. If in doubt, run from it." >&2 exit 1 fi cd "$src/.." echo "Processing uuid package in `pwd`" if [ ! -e DESCRIPTION ]; then echo "ERROR: invalid package structure, cannot find $src/../DESCRIPTION" >&2 exit 1 fi if [ ! -e inst/include ]; then echo Creating inst/include mkdir -p inst/include fi echo Copying LinkingTo header files cp -p src/*uuid.h inst/include/ echo Done uuid/src/randutils.h0000644000176200001440000000133414550351455014175 0ustar liggesusers#ifndef UTIL_LINUX_RANDUTILS #define UTIL_LINUX_RANDUTILS /* map dynamic symbols */ #define srandom(x) uuid_srandom(x) #define random() uuid_random() #ifdef HAVE_SRANDOM #define srand(x) uuid_srandom(x) #define rand() uuid_random() #else #define srand(x) uuid_srand(x) #define rand() uuid_rand() #endif /* from rand.c */ extern int uuid_rand(void); extern void uuid_srand(unsigned seed); extern long uuid_random(void); extern void uuid_srandom(unsigned seed); /* rand() based */ extern int rand_get_number(int low_n, int high_n); /* /dev/urandom based with fallback to rand() */ extern int random_get_fd(void); extern int ul_random_get_bytes(void *buf, size_t nbytes); extern const char *random_tell_source(void); #endif uuid/src/sha1.c0000644000176200001440000001516514550351455013026 0ustar liggesusers/* * SHA-1 in C by Steve Reid * 100% Public Domain * * Test Vectors (from FIPS PUB 180-1) * 1) "abc": A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D * 2) "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq": 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 * 3) A million repetitions of "a": 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F */ #define UL_SHA1HANDSOFF #include #include #include #include "sha1.h" #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) /* blk0() and blk() perform the initial expand. */ #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ # define blk0(i) block->l[i] #else # define blk0(i) (block->l[i] = (rol(block->l[i],24)&0xFF00FF00) \ |(rol(block->l[i],8)&0x00FF00FF)) #endif #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ ^block->l[(i+2)&15]^block->l[i&15],1)) /* (R0+R1), R2, R3, R4 are the different operations used in SHA1 */ #define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(i)+0x5A827999+rol(v,5);w=rol(w,30); #define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); #define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); #define R3(v,w,x,y,z,i) z+=(((w|x)&y)|(w&x))+blk(i)+0x8F1BBCDC+rol(v,5);w=rol(w,30); #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); /* Hash a single 512-bit block. This is the core of the algorithm. */ void ul_SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) { uint32_t a, b, c, d, e; typedef union { unsigned char c[64]; uint32_t l[16]; } CHAR64LONG16; #ifdef UL_SHA1HANDSOFF CHAR64LONG16 block[1]; /* use array to appear as a pointer */ memcpy(block, buffer, 64); #else /* The following had better never be used because it causes the * pointer-to-const buffer to be cast into a pointer to non-const. * And the result is written through. I threw a "const" in, hoping * this will cause a diagnostic. */ CHAR64LONG16 *block = (const CHAR64LONG16 *)buffer; #endif /* Copy context->state[] to working vars */ a = state[0]; b = state[1]; c = state[2]; d = state[3]; e = state[4]; /* 4 rounds of 20 operations each. Loop unrolled. */ R0(a, b, c, d, e, 0); R0(e, a, b, c, d, 1); R0(d, e, a, b, c, 2); R0(c, d, e, a, b, 3); R0(b, c, d, e, a, 4); R0(a, b, c, d, e, 5); R0(e, a, b, c, d, 6); R0(d, e, a, b, c, 7); R0(c, d, e, a, b, 8); R0(b, c, d, e, a, 9); R0(a, b, c, d, e, 10); R0(e, a, b, c, d, 11); R0(d, e, a, b, c, 12); R0(c, d, e, a, b, 13); R0(b, c, d, e, a, 14); R0(a, b, c, d, e, 15); R1(e, a, b, c, d, 16); R1(d, e, a, b, c, 17); R1(c, d, e, a, b, 18); R1(b, c, d, e, a, 19); R2(a, b, c, d, e, 20); R2(e, a, b, c, d, 21); R2(d, e, a, b, c, 22); R2(c, d, e, a, b, 23); R2(b, c, d, e, a, 24); R2(a, b, c, d, e, 25); R2(e, a, b, c, d, 26); R2(d, e, a, b, c, 27); R2(c, d, e, a, b, 28); R2(b, c, d, e, a, 29); R2(a, b, c, d, e, 30); R2(e, a, b, c, d, 31); R2(d, e, a, b, c, 32); R2(c, d, e, a, b, 33); R2(b, c, d, e, a, 34); R2(a, b, c, d, e, 35); R2(e, a, b, c, d, 36); R2(d, e, a, b, c, 37); R2(c, d, e, a, b, 38); R2(b, c, d, e, a, 39); R3(a, b, c, d, e, 40); R3(e, a, b, c, d, 41); R3(d, e, a, b, c, 42); R3(c, d, e, a, b, 43); R3(b, c, d, e, a, 44); R3(a, b, c, d, e, 45); R3(e, a, b, c, d, 46); R3(d, e, a, b, c, 47); R3(c, d, e, a, b, 48); R3(b, c, d, e, a, 49); R3(a, b, c, d, e, 50); R3(e, a, b, c, d, 51); R3(d, e, a, b, c, 52); R3(c, d, e, a, b, 53); R3(b, c, d, e, a, 54); R3(a, b, c, d, e, 55); R3(e, a, b, c, d, 56); R3(d, e, a, b, c, 57); R3(c, d, e, a, b, 58); R3(b, c, d, e, a, 59); R4(a, b, c, d, e, 60); R4(e, a, b, c, d, 61); R4(d, e, a, b, c, 62); R4(c, d, e, a, b, 63); R4(b, c, d, e, a, 64); R4(a, b, c, d, e, 65); R4(e, a, b, c, d, 66); R4(d, e, a, b, c, 67); R4(c, d, e, a, b, 68); R4(b, c, d, e, a, 69); R4(a, b, c, d, e, 70); R4(e, a, b, c, d, 71); R4(d, e, a, b, c, 72); R4(c, d, e, a, b, 73); R4(b, c, d, e, a, 74); R4(a, b, c, d, e, 75); R4(e, a, b, c, d, 76); R4(d, e, a, b, c, 77); R4(c, d, e, a, b, 78); R4(b, c, d, e, a, 79); /* Add the working vars back into context.state[] */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; state[4] += e; /* Wipe variables */ a = b = c = d = e = 0; #ifdef UL_SHA1HANDSOFF memset(block, '\0', sizeof(block)); #endif } /* SHA1Init - Initialize new context */ void ul_SHA1Init(UL_SHA1_CTX *context) { /* SHA1 initialization constants */ context->state[0] = 0x67452301; context->state[1] = 0xEFCDAB89; context->state[2] = 0x98BADCFE; context->state[3] = 0x10325476; context->state[4] = 0xC3D2E1F0; context->count[0] = context->count[1] = 0; } /* Run your data through this. */ void ul_SHA1Update(UL_SHA1_CTX *context, const unsigned char *data, uint32_t len) { uint32_t i; uint32_t j; j = context->count[0]; if ((context->count[0] += len << 3) < j) context->count[1]++; context->count[1] += (len >> 29); j = (j >> 3) & 63; if ((j + len) > 63) { memcpy(&context->buffer[j], data, (i = 64 - j)); ul_SHA1Transform(context->state, context->buffer); for (; i + 63 < len; i += 64) { ul_SHA1Transform(context->state, &data[i]); } j = 0; } else i = 0; memcpy(&context->buffer[j], &data[i], len - i); } /* Add padding and return the message digest. */ void ul_SHA1Final(unsigned char digest[20], UL_SHA1_CTX *context) { unsigned i; unsigned char finalcount[8]; unsigned char c; #if 0 /* untested "improvement" by DHR */ /* Convert context->count to a sequence of bytes * in finalcount. Second element first, but * big-endian order within element. * But we do it all backwards. */ unsigned char *fcp = &finalcount[8]; for (i = 0; i < 2; i++) { uint32_t t = context->count[i]; int j; for (j = 0; j < 4; t >>= 8, j++) *--fcp = (unsigned char)t} #else for (i = 0; i < 8; i++) { finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] >> ((3 - (i & 3)) * 8)) & 255); /* Endian independent */ } #endif c = 0200; ul_SHA1Update(context, &c, 1); while ((context->count[0] & 504) != 448) { c = 0000; ul_SHA1Update(context, &c, 1); } ul_SHA1Update(context, finalcount, 8); /* Should cause a SHA1Transform() */ for (i = 0; i < 20; i++) { digest[i] = (unsigned char) ((context->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255); } /* Wipe variables */ memset(context, '\0', sizeof(*context)); memset(&finalcount, '\0', sizeof(finalcount)); } void ul_SHA1(char *hash_out, const char *str, unsigned len) { UL_SHA1_CTX ctx; unsigned int ii; ul_SHA1Init(&ctx); for (ii = 0; ii < len; ii += 1) ul_SHA1Update(&ctx, (const unsigned char *)str + ii, 1); ul_SHA1Final((unsigned char *)hash_out, &ctx); hash_out[20] = '\0'; } uuid/src/all-io.h0000644000176200001440000000424514550351455013351 0ustar liggesusers/* * No copyright is claimed. This code is in the public domain; do with * it what you wish. * * Written by Karel Zak * Petr Uzel */ #ifndef UTIL_LINUX_ALL_IO_H #define UTIL_LINUX_ALL_IO_H #include #include #include #include #ifdef HAVE_SYS_SENDFILE_H # include #endif #include "c.h" static inline int write_all(int fd, const void *buf, size_t count) { while (count) { ssize_t tmp; errno = 0; tmp = write(fd, buf, count); if (tmp > 0) { count -= tmp; if (count) buf = (const void *) ((const char *) buf + tmp); } else if (errno != EINTR && errno != EAGAIN) return -1; if (errno == EAGAIN) /* Try later, *sigh* */ xusleep(250000); } return 0; } static inline int fwrite_all(const void *ptr, size_t size, size_t nmemb, FILE *stream) { while (nmemb) { size_t tmp; errno = 0; tmp = fwrite(ptr, size, nmemb, stream); if (tmp > 0) { nmemb -= tmp; if (nmemb) ptr = (const void *) ((const char *) ptr + (tmp * size)); } else if (errno != EINTR && errno != EAGAIN) return -1; if (errno == EAGAIN) /* Try later, *sigh* */ xusleep(250000); } return 0; } static inline ssize_t read_all(int fd, char *buf, size_t count) { ssize_t ret; ssize_t c = 0; int tries = 0; memset(buf, 0, count); while (count > 0) { ret = read(fd, buf, count); if (ret < 0) { if ((errno == EAGAIN || errno == EINTR) && (tries++ < 5)) { xusleep(250000); continue; } return c ? c : -1; } if (ret == 0) return c; tries = 0; count -= ret; buf += ret; c += ret; } return c; } static inline ssize_t sendfile_all(int out, int in, off_t *off, size_t count) { #if defined(HAVE_SENDFILE) && defined(__linux__) ssize_t ret; ssize_t c = 0; int tries = 0; while (count) { ret = sendfile(out, in, off, count); if (ret < 0) { if ((errno == EAGAIN || errno == EINTR) && (tries++ < 5)) { xusleep(250000); continue; } return c ? c : -1; } if (ret == 0) return c; tries = 0; count -= ret; c += ret; } return c; #else errno = ENOSYS; return -1; #endif } #endif /* UTIL_LINUX_ALL_IO_H */ uuid/src/rand.c0000644000176200001440000001066014550351455013111 0ustar liggesusers/* this provides an isolation between system rand()/srand() and the R package (where possible) to avoid API warnings. It started as a small proof of concept, but got quite a bit out of hand due to Win32 not providing dl* POSIX API .. */ #include "config.h" #include #ifdef HAVE_DLFCN_H /* on Liunx this need to be set, otherwise RTLD_DEFAULT is not defined */ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include /* it *should* be defined in dlfcn.h, but if it's not, we take a guess */ #ifndef RTLD_DEFAULT #define RTLD_DEFAULT ((void *) 0) #endif #endif /* there is no dlsym() on Windows, implement it */ #ifdef _WIN32 #include #include #define HAS_DLSYM 1 #define RTLD_DEFAULT NULL typedef void(*fn_t)(void); static BOOL (WINAPI *EnumProcessModulesFn)(HANDLE, HMODULE*, DWORD, LPDWORD); static HMODULE mods_buf[512]; /* we use a static buffer to avoid dynamic allocations */ static HMODULE *mods = mods_buf; static int mods_alloc = sizeof(mods_buf); static fn_t dlsym(void *whatever, const char *name) { FARPROC sym; HMODULE hModule = GetModuleHandle(NULL); /* can we resolve it directly? */ if ((sym = GetProcAddress(hModule, name))) return (fn_t) sym; /* good */ /* nope, so we have to walk loaded DLLs - annoying, for that we need PSAPI */ /* FIXME: if we knew the library with the desired symbols, we could load it directly ... (on Windows 2008 we found all entries in msvcrt.dll - is that reliable?) */ if (!EnumProcessModulesFn) { /* load from psapi.dll */ HMODULE psapi = LoadLibraryA("psapi.dll"); if (psapi) EnumProcessModulesFn = (BOOL (WINAPI*)(HANDLE, HMODULE*, DWORD, LPDWORD)) GetProcAddress(psapi, "EnumProcessModules"); } if (!EnumProcessModulesFn) Rf_error("Cannot find PSAPI.DLL"); { DWORD n, i; if (EnumProcessModulesFn(GetCurrentProcess(), mods, mods_alloc, &n)) { if (n > mods_alloc) { /* we have to allocate more */ if (mods != mods_buf) free(mods); mods_alloc = n + 64; mods = (HMODULE*) malloc(mods_alloc); if (!mods) Rf_error("Unable to allocate memory for DLL modules"); if (!EnumProcessModulesFn(GetCurrentProcess(), mods, mods_alloc, &n)) Rf_error("Cannot load DLL module list"); } n /= sizeof(HMODULE); for (i = 0; i < n; i++) { #ifdef PRINT_DLL_SEARCH static char tb[512]; *tb = 0; GetModuleFileNameA(mods[i], tb, sizeof(tb)); Rprintf("> %s\n", tb); if ((sym = GetProcAddress(mods[i], name))) { Rprintf("^-- %s found here\n", name); return (fn_t) sym; } #else if ((sym = GetProcAddress(mods[i], name))) return (fn_t) sym; #endif } } } return 0; } #endif /* if we can, let's get the symbols dynamically */ #ifdef HAS_DLSYM typedef int(*rand_t)(void); typedef void(*srand_t)(unsigned); typedef long(*random_t)(void); typedef void(*srandom_t)(unsigned); #ifdef _WIN32 typedef errno_t (*rand_s_t)(unsigned int *); static rand_s_t fn_rand_s; #endif static rand_t fn_rand; static srand_t fn_srand; static random_t fn_random; static srandom_t fn_srandom; static void load_rand(void) { if (!(fn_rand = (rand_t) dlsym(RTLD_DEFAULT, "rand")) || #ifdef _WIN32 !(fn_rand_s = (rand_s_t) dlsym(RTLD_DEFAULT, "rand_s")) || #endif #ifdef HAVE_SRANDOM !(fn_random = (random_t) dlsym(RTLD_DEFAULT, "random")) || !(fn_srandom = (srandom_t) dlsym(RTLD_DEFAULT, "srandom")) || #endif !(fn_srand = (srand_t) dlsym(RTLD_DEFAULT, "srand"))) Rf_error("Cannot find entry points for random number generators!"); } int uuid_rand(void) { if (!fn_rand) load_rand(); #ifdef _WIN32 /* on Windows there is no good source and no jrand, and relying on rand() is terribly bad for repeated calls, so we try to use rand_s() which is reportedly tied to crypto API */ if (fn_rand_s) { unsigned int res; if (!fn_rand_s(&res)) return (int) res; } #endif return fn_rand(); } void uuid_srand(unsigned seed) { if (!fn_srand) load_rand(); fn_srand(seed); } long uuid_random(void) { if (!fn_srand) load_rand(); return fn_random(); } void uuid_srandom(unsigned seed) { if (!fn_srand) load_rand(); fn_srandom(seed); } #else /* no way to find symbols, link them directly and deal with the warnings */ #include int uuid_rand(void) { return rand(); } void uuid_srand(unsigned seed) { srand(seed); } long uuid_random(void) { return random(); } void uuid_srandom(unsigned seed) { srandom(seed); } #endif uuid/src/unpack.c0000644000176200001440000000405114550351455013443 0ustar liggesusers/* * Internal routine for unpacking UUID * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #include #include "uuidP.h" void uuid_unpack(const uuid_t in, struct uuid *uu) { const uint8_t *ptr = in; uint32_t tmp; tmp = *ptr++; tmp = (tmp << 8) | *ptr++; tmp = (tmp << 8) | *ptr++; tmp = (tmp << 8) | *ptr++; uu->time_low = tmp; tmp = *ptr++; tmp = (tmp << 8) | *ptr++; uu->time_mid = tmp; tmp = *ptr++; tmp = (tmp << 8) | *ptr++; uu->time_hi_and_version = tmp; tmp = *ptr++; tmp = (tmp << 8) | *ptr++; uu->clock_seq = tmp; memcpy(uu->node, ptr, 6); } uuid/src/pack.c0000644000176200001440000000430414550351455013101 0ustar liggesusers/* * Internal routine for packing UUIDs * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #include #include "uuidP.h" void uuid_pack(const struct uuid *uu, uuid_t ptr) { uint32_t tmp; unsigned char *out = ptr; tmp = uu->time_low; out[3] = (unsigned char) tmp; tmp >>= 8; out[2] = (unsigned char) tmp; tmp >>= 8; out[1] = (unsigned char) tmp; tmp >>= 8; out[0] = (unsigned char) tmp; tmp = uu->time_mid; out[5] = (unsigned char) tmp; tmp >>= 8; out[4] = (unsigned char) tmp; tmp = uu->time_hi_and_version; out[7] = (unsigned char) tmp; tmp >>= 8; out[6] = (unsigned char) tmp; tmp = uu->clock_seq; out[9] = (unsigned char) tmp; tmp >>= 8; out[8] = (unsigned char) tmp; memcpy(out+10, uu->node, 6); } uuid/src/Makevars.win0000644000176200001440000000004714550351455014307 0ustar liggesusersPKG_CPPFLAGS=-include config.h -Iwin32 uuid/src/upstream.sh0000644000176200001440000000162114550351455014212 0ustar liggesusers## update files from upstream (util-linux -> libuuid) if [ ! -e util-linux ]; then git clone --depth=1 https://github.com/karelzak/util-linux.git fi for src in \ util-linux/include/all-io.h \ util-linux/include/c.h \ util-linux/libuuid/src/clear.c \ util-linux/libuuid/src/compare.c \ util-linux/libuuid/src/copy.c \ util-linux/libuuid/src/gen_uuid.c \ util-linux/libuuid/src/isnull.c \ util-linux/lib/md5.c \ util-linux/include/md5.h \ util-linux/include/nls.h \ util-linux/libuuid/src/pack.c \ util-linux/libuuid/src/parse.c \ util-linux/lib/randutils.c \ util-linux/include/randutils.h \ util-linux/lib/sha1.c \ util-linux/include/sha1.h \ util-linux/include/strutils.h \ util-linux/libuuid/src/unpack.c \ util-linux/libuuid/src/unparse.c \ util-linux/libuuid/src/uuid.h \ util-linux/libuuid/src/uuidP.h \ util-linux/libuuid/src/uuidd.h \ ; do cp -p $src .; done (cd .. && patch -p1 < src/upstream.patch ) uuid/src/COPYING0000644000176200001440000000274514550351455013061 0ustar liggesusersThis library is free software; you can redistribute it and/or modify it under the terms of the Modified BSD License: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, and the entire permission notice in its entirety, including the disclaimer of warranties. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. uuid/src/md5.h0000644000176200001440000000113314550351455012652 0ustar liggesusers#ifndef UTIL_LINUX_MD5_H #define UTIL_LINUX_MD5_H #include #define UL_MD5LENGTH 16 struct UL_MD5Context { uint32_t buf[4]; uint32_t bits[2]; unsigned char in[64]; }; void ul_MD5Init(struct UL_MD5Context *ctx); void ul_MD5Update(struct UL_MD5Context *ctx, unsigned char const *buf, unsigned len); void ul_MD5Final(unsigned char digest[UL_MD5LENGTH], struct UL_MD5Context *ctx); void ul_MD5Transform(uint32_t buf[4], uint32_t const in[16]); /* * This is needed to make RSAREF happy on some MS-DOS compilers. */ typedef struct UL_MD5Context UL_MD5_CTX; #endif /* !UTIL_LINUX_MD5_H */ uuid/src/strutils.h0000644000176200001440000002324714550351455014070 0ustar liggesusers#ifndef UTIL_LINUX_STRUTILS #define UTIL_LINUX_STRUTILS #include #include #include #include #include #include #include #include #include "c.h" /* initialize a custom exit code for all *_or_err functions */ extern void strutils_set_exitcode(int exit_code); extern int parse_size(const char *str, uintmax_t *res, int *power); extern int strtosize(const char *str, uintmax_t *res); extern uintmax_t strtosize_or_err(const char *str, const char *errmesg); extern int ul_strtos64(const char *str, int64_t *num, int base); extern int ul_strtou64(const char *str, uint64_t *num, int base); extern int ul_strtos32(const char *str, int32_t *num, int base); extern int ul_strtou32(const char *str, uint32_t *num, int base); extern int64_t str2num_or_err(const char *str, int base, const char *errmesg, int64_t low, int64_t up); extern uint64_t str2unum_or_err(const char *str, int base, const char *errmesg, uint64_t up); #define strtos64_or_err(_s, _e) str2num_or_err(_s, 10, _e, 0, 0) #define strtou64_or_err(_s, _e) str2unum_or_err(_s, 10, _e, 0) #define strtox64_or_err(_s, _e) str2unum_or_err(_s, 16, _e, 0) #define strtos32_or_err(_s, _e) (int32_t) str2num_or_err(_s, 10, _e, INT32_MIN, INT32_MAX) #define strtou32_or_err(_s, _e) (uint32_t) str2unum_or_err(_s, 10, _e, UINT32_MAX) #define strtox32_or_err(_s, _e) (uint32_t) str2unum_or_err(_s, 16, _e, UINT32_MAX) #define strtos16_or_err(_s, _e) (int16_t) str2num_or_err(_s, 10, _e, INT16_MIN, INT16_MAX) #define strtou16_or_err(_s, _e) (uint16_t) str2unum_or_err(_s, 10, _e, UINT16_MAX) #define strtox16_or_err(_s, _e) (uint16_t) str2unum_or_err(_s, 16, _e, UINT16_MAX) extern double strtod_or_err(const char *str, const char *errmesg); extern long double strtold_or_err(const char *str, const char *errmesg); #define strtol_or_err(_s, _e) (long) str2num_or_err(_s, 10, _e, LONG_MIN, LONG_MAX) #define strtoul_or_err(_s, _e) (unsigned long) str2unum_or_err(_s, 10, _e, ULONG_MAX) extern void strtotimeval_or_err(const char *str, struct timeval *tv, const char *errmesg); extern time_t strtotime_or_err(const char *str, const char *errmesg); extern int isdigit_strend(const char *str, const char **end); #define isdigit_string(_s) isdigit_strend(_s, NULL) extern int isxdigit_strend(const char *str, const char **end); #define isxdigit_string(_s) isxdigit_strend(_s, NULL) extern int parse_switch(const char *arg, const char *errmesg, ...); #ifndef HAVE_MEMPCPY extern void *mempcpy(void *restrict dest, const void *restrict src, size_t n); #endif #ifndef HAVE_STRNLEN extern size_t strnlen(const char *s, size_t maxlen); #endif #ifndef HAVE_STRNDUP extern char *strndup(const char *s, size_t n); #endif #ifndef HAVE_STRNCHR extern char *strnchr(const char *s, size_t maxlen, int c); #endif /* caller guarantees n > 0 */ static inline void xstrncpy(char *dest, const char *src, size_t n) { size_t len = src ? strlen(src) : 0; if (!len) return; len = min(len, n - 1); memcpy(dest, src, len); dest[len] = 0; } /* This is like strncpy(), but based on memcpy(), so compilers and static * analyzers do not complain when sizeof(destination) is the same as 'n' and * result is not terminated by zero. * * Use this function to copy string to logs with fixed sizes (wtmp/utmp. ...) * where string terminator is optional. */ static inline void * __attribute__((nonnull (1))) str2memcpy(void *dest, const char *src, size_t n) { size_t bytes = strlen(src) + 1; if (bytes > n) bytes = n; memcpy(dest, src, bytes); return dest; } static inline char * __attribute__((nonnull (1))) mem2strcpy(char *dest, const void *src, size_t n, size_t nmax) { if (n + 1 > nmax) n = nmax - 1; memset(dest, '\0', nmax); memcpy(dest, src, n); return dest; } /* Reallocate @str according to @newstr and copy @newstr to @str; returns new @str. * The @str is not modified if reallocation failed (like classic realloc()). */ static inline char * __attribute__((warn_unused_result)) strrealloc(char *str, const char *newstr) { size_t nsz, osz; if (!str) return newstr ? strdup(newstr) : NULL; if (!newstr) return NULL; osz = strlen(str); nsz = strlen(newstr); if (nsz > osz) str = realloc(str, nsz + 1); if (str) memcpy(str, newstr, nsz + 1); return str; } /* Copy string @str to struct @stru to member addressed by @offset */ static inline int strdup_to_offset(void *stru, size_t offset, const char *str) { char **o; char *p = NULL; if (!stru) return -EINVAL; o = (char **) ((char *) stru + offset); if (str) { p = strdup(str); if (!p) return -ENOMEM; } free(*o); *o = p; return 0; } /* Copy string __str to struct member _m of the struct _s */ #define strdup_to_struct_member(_s, _m, _str) \ strdup_to_offset((void *) _s, offsetof(__typeof__(*(_s)), _m), _str) /* Copy string addressed by @offset between two structs */ static inline int strdup_between_offsets(void *stru_dst, void *stru_src, size_t offset) { char **src; char **dst; char *p = NULL; if (!stru_src || !stru_dst) return -EINVAL; src = (char **) ((char *) stru_src + offset); dst = (char **) ((char *) stru_dst + offset); if (*src) { p = strdup(*src); if (!p) return -ENOMEM; } free(*dst); *dst = p; return 0; } /* Copy string addressed by struct member between two instances of the same * struct type */ #define strdup_between_structs(_dst, _src, _m) \ strdup_between_offsets((void *)_dst, (void *)_src, offsetof(__typeof__(*(_src)), _m)) extern char *xstrmode(mode_t mode, char *str); /* Options for size_to_human_string() */ enum { SIZE_SUFFIX_1LETTER = 0, SIZE_SUFFIX_3LETTER = (1 << 0), SIZE_SUFFIX_SPACE = (1 << 1), SIZE_DECIMAL_2DIGITS = (1 << 2) }; extern char *size_to_human_string(int options, uint64_t bytes); extern int string_to_idarray(const char *list, int ary[], size_t arysz, int (name2id)(const char *, size_t)); extern int string_add_to_idarray(const char *list, int ary[], size_t arysz, size_t *ary_pos, int (name2id)(const char *, size_t)); extern int string_to_bitarray(const char *list, char *ary, int (*name2bit)(const char *, size_t), size_t allow_range); extern int string_to_bitmask(const char *list, unsigned long *mask, long (*name2flag)(const char *, size_t)); extern int parse_range(const char *str, int *lower, int *upper, int def); extern int streq_paths(const char *a, const char *b); /* * Match string beginning. */ static inline const char *startswith(const char *s, const char *prefix) { size_t sz = prefix ? strlen(prefix) : 0; if (s && sz && strncmp(s, prefix, sz) == 0) return s + sz; return NULL; } /* * Case insensitive match string beginning. */ static inline const char *startswith_no_case(const char *s, const char *prefix) { size_t sz = prefix ? strlen(prefix) : 0; if (s && sz && strncasecmp(s, prefix, sz) == 0) return s + sz; return NULL; } /* * Match string ending. */ static inline const char *endswith(const char *s, const char *postfix) { size_t sl = s ? strlen(s) : 0; size_t pl = postfix ? strlen(postfix) : 0; if (pl == 0) return s + sl; if (sl < pl) return NULL; if (memcmp(s + sl - pl, postfix, pl) != 0) return NULL; return s + sl - pl; } /* * Skip leading white space. */ static inline const char *skip_space(const char *p) { while (isspace(*p)) ++p; return p; } static inline const char *skip_blank(const char *p) { while (isblank(*p)) ++p; return p; } /* Removes whitespace from the right-hand side of a string (trailing * whitespace). * * Returns size of the new string (without \0). */ static inline size_t rtrim_whitespace(unsigned char *str) { size_t i; if (!str) return 0; i = strlen((char *) str); while (i) { i--; if (!isspace(str[i])) { i++; break; } } str[i] = '\0'; return i; } /* Removes whitespace from the left-hand side of a string. * * Returns size of the new string (without \0). */ static inline size_t ltrim_whitespace(unsigned char *str) { size_t len; unsigned char *p; if (!str) return 0; for (p = str; *p && isspace(*p); p++); len = strlen((char *) p); if (p > str) memmove(str, p, len + 1); return len; } /* Removes left-hand, right-hand and repeating whitespaces. */ static inline size_t __normalize_whitespace( const unsigned char *src, size_t sz, unsigned char *dst, size_t len) { size_t i, x = 0; int nsp = 0, intext = 0; if (!sz) goto done; for (i = 0, x = 0; i < sz && x < len - 1; ) { if (isspace(src[i])) nsp++; else nsp = 0, intext = 1; if (nsp > 1 || (nsp && !intext)) i++; else dst[x++] = src[i++]; } if (nsp && x > 0) /* tailing space */ x--; done: dst[x] = '\0'; return x; } static inline size_t normalize_whitespace(unsigned char *str) { size_t sz = strlen((char *) str); return __normalize_whitespace(str, sz, str, sz + 1); } static inline void strrep(char *s, int find, int replace) { while (s && *s && (s = strchr(s, find)) != NULL) *s++ = replace; } static inline void strrem(char *s, int rem) { char *p; if (!s) return; for (p = s; *s; s++) { if (*s != rem) *p++ = *s; } *p = '\0'; } extern char *strnconcat(const char *s, const char *suffix, size_t b); extern char *strconcat(const char *s, const char *suffix); extern char *strfconcat(const char *s, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int strappend(char **a, const char *b); extern const char *split(const char **state, size_t *l, const char *separator, int quoted); extern char *ul_strchr_escaped(const char *s, int c); extern int skip_fline(FILE *fp); extern int ul_stralnumcmp(const char *p1, const char *p2); extern int ul_optstr_next(char **optstr, char **name, size_t *namesz, char **value, size_t *valsz); #endif uuid/src/isnull.c0000644000176200001440000000341014550351455013466 0ustar liggesusers/* * isnull.c --- Check whether or not the UUID is null * * Copyright (C) 1996, 1997 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #include "uuidP.h" #include /* Returns 1 if the uuid is the NULL uuid */ int uuid_is_null(const uuid_t uu) { const uuid_t nil = { 0 }; return !memcmp(uu, nil, sizeof(nil)); } uuid/src/config.h.in0000644000176200001440000001053314550351455014043 0ustar liggesusers/* src/config.h.in. Generated from configure.ac by autoheader. */ /* defined if the system supports dlsym */ #undef HAS_DLSYM /* Define to 1 if you have the `dirfd' function. */ #undef HAVE_DIRFD /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `err' function. */ #undef HAVE_ERR /* Define to 1 if you have the `errx' function. */ #undef HAVE_ERRX /* Define to 1 if you have the `flock' function. */ #undef HAVE_FLOCK /* Define to 1 if you have the `getexecname' function. */ #undef HAVE_GETEXECNAME /* Define to 1 if you have the `getrandom' function. */ #undef HAVE_GETRANDOM /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `jrand48' function. */ #undef HAVE_JRAND48 /* Define to 1 if you have the header file. */ #undef HAVE_LANGINFO_H /* Define to 1 if you have the `lchown' function. */ #undef HAVE_LCHOWN /* Define to 1 if you have the `llseek' function. */ #undef HAVE_LLSEEK /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the `mempcpy' function. */ #undef HAVE_MEMPCPY /* Define to 1 if you have the `mkostemp' function. */ #undef HAVE_MKOSTEMP /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_DL_H /* Define to 1 if you have the header file. */ #undef HAVE_NET_IF_H /* Define if struct sockaddr contains sa_len */ #undef HAVE_SA_LEN /* Define to 1 if you have the `sendfile' function. */ #undef HAVE_SENDFILE /* Define to 1 if you have the `srandom' function. */ #undef HAVE_SRANDOM /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strnchr' function. */ #undef HAVE_STRNCHR /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strnlen' function. */ #undef HAVE_STRNLEN /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SENDFILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSCALL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Thread local storage is supported via __thread */ #undef HAVE_TLS /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `usleep' function. */ #undef HAVE_USLEEP /* Define to 1 if you have the `warn' function. */ #undef HAVE_WARN /* Define to 1 if you have the `warnx' function. */ #undef HAVE_WARNX /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if all of the C90 standard headers exist (not just the ones required in a freestanding environment). This macro is provided for backward compatibility; new code need not use it. */ #undef STDC_HEADERS uuid/src/uuid.h0000644000176200001440000000771114550351455013143 0ustar liggesusers/* * Public include file for the UUID library * * Copyright (C) 1996, 1997, 1998 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #ifndef _UL_LIBUUID_UUID_H #define _UL_LIBUUID_UUID_H #include #ifndef _WIN32 #include #endif #include typedef unsigned char uuid_t[16]; /* UUID Variant definitions */ #define UUID_VARIANT_NCS 0 #define UUID_VARIANT_DCE 1 #define UUID_VARIANT_MICROSOFT 2 #define UUID_VARIANT_OTHER 3 #define UUID_VARIANT_SHIFT 5 #define UUID_VARIANT_MASK 0x7 /* UUID Type definitions */ #define UUID_TYPE_DCE_NIL 0 #define UUID_TYPE_DCE_TIME 1 #define UUID_TYPE_DCE_SECURITY 2 #define UUID_TYPE_DCE_MD5 3 #define UUID_TYPE_DCE_RANDOM 4 #define UUID_TYPE_DCE_SHA1 5 #define UUID_TYPE_SHIFT 4 #define UUID_TYPE_MASK 0xf #define UUID_STR_LEN 37 /* Allow UUID constants to be defined */ #ifdef __GNUC__ #define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \ static const uuid_t name __attribute__ ((unused)) = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15} #else #define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \ static const uuid_t name = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15} #endif #ifdef __cplusplus extern "C" { #endif /* clear.c */ extern void uuid_clear(uuid_t uu); /* compare.c */ extern int uuid_compare(const uuid_t uu1, const uuid_t uu2); /* copy.c */ extern void uuid_copy(uuid_t dst, const uuid_t src); /* gen_uuid.c */ extern void uuid_generate(uuid_t out); extern void uuid_generate_random(uuid_t out); extern void uuid_generate_time(uuid_t out); extern int uuid_generate_time_safe(uuid_t out); extern void uuid_generate_md5(uuid_t out, const uuid_t ns, const char *name, size_t len); extern void uuid_generate_sha1(uuid_t out, const uuid_t ns, const char *name, size_t len); /* isnull.c */ extern int uuid_is_null(const uuid_t uu); /* parse.c */ extern int uuid_parse(const char *in, uuid_t uu); extern int uuid_parse_range(const char *in_start, const char *in_end, uuid_t uu); /* unparse.c */ extern void uuid_unparse(const uuid_t uu, char *out); extern void uuid_unparse_lower(const uuid_t uu, char *out); extern void uuid_unparse_upper(const uuid_t uu, char *out); /* uuid_time.c */ extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv); extern int uuid_type(const uuid_t uu); extern int uuid_variant(const uuid_t uu); /* predefined.c */ extern const uuid_t *uuid_get_template(const char *alias); #ifdef __cplusplus } #endif #endif /* _UL_LIBUUID_UUID_H */ uuid/src/nls.h0000644000176200001440000000533614550351455012772 0ustar liggesusers#ifndef UTIL_LINUX_NLS_H #define UTIL_LINUX_NLS_H #ifndef LOCALEDIR #define LOCALEDIR "/usr/share/locale" #endif #ifdef HAVE_LOCALE_H # include #else # undef setlocale # define setlocale(Category, Locale) /* empty */ struct lconv { char *decimal_point; }; # undef localeconv # define localeconv() NULL #endif #ifdef ENABLE_NLS # include /* * For NLS support in the public shared libraries we have to specify text * domain name to be independent on the main program. For this purpose define * UL_TEXTDOMAIN_EXPLICIT before you include nls.h to your shared library code. */ # ifdef UL_TEXTDOMAIN_EXPLICIT # define _(Text) dgettext (UL_TEXTDOMAIN_EXPLICIT, Text) # else # define _(Text) gettext (Text) # endif # ifdef gettext_noop # define N_(String) gettext_noop (String) # else # define N_(String) (String) # endif # define P_(Singular, Plural, n) ngettext (Singular, Plural, n) #else # undef bindtextdomain # define bindtextdomain(Domain, Directory) /* empty */ # undef textdomain # define textdomain(Domain) /* empty */ # define _(Text) (Text) # define N_(Text) (Text) # define P_(Singular, Plural, n) ((n) == 1 ? (Singular) : (Plural)) #endif /* ENABLE_NLS */ #ifdef HAVE_LANGINFO_H # include #else typedef int nl_item; extern char *langinfo_fallback(nl_item item); # define nl_langinfo langinfo_fallback enum { CODESET = 1, RADIXCHAR, THOUSEP, D_T_FMT, D_FMT, T_FMT, T_FMT_AMPM, AM_STR, PM_STR, DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7, ABDAY_1, ABDAY_2, ABDAY_3, ABDAY_4, ABDAY_5, ABDAY_6, ABDAY_7, MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, MON_7, MON_8, MON_9, MON_10, MON_11, MON_12, ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12, ERA_D_FMT, ERA_D_T_FMT, ERA_T_FMT, ALT_DIGITS, CRNCYSTR, YESEXPR, NOEXPR }; #endif /* !HAVE_LANGINFO_H */ #ifndef HAVE_LANGINFO_ALTMON # define ALTMON_1 MON_1 # define ALTMON_2 MON_2 # define ALTMON_3 MON_3 # define ALTMON_4 MON_4 # define ALTMON_5 MON_5 # define ALTMON_6 MON_6 # define ALTMON_7 MON_7 # define ALTMON_8 MON_8 # define ALTMON_9 MON_9 # define ALTMON_10 MON_10 # define ALTMON_11 MON_11 # define ALTMON_12 MON_12 #endif /* !HAVE_LANGINFO_ALTMON */ #ifndef HAVE_LANGINFO_NL_ABALTMON # define _NL_ABALTMON_1 ABMON_1 # define _NL_ABALTMON_2 ABMON_2 # define _NL_ABALTMON_3 ABMON_3 # define _NL_ABALTMON_4 ABMON_4 # define _NL_ABALTMON_5 ABMON_5 # define _NL_ABALTMON_6 ABMON_6 # define _NL_ABALTMON_7 ABMON_7 # define _NL_ABALTMON_8 ABMON_8 # define _NL_ABALTMON_9 ABMON_9 # define _NL_ABALTMON_10 ABMON_10 # define _NL_ABALTMON_11 ABMON_11 # define _NL_ABALTMON_12 ABMON_12 #endif /* !HAVE_LANGINFO_NL_ABALTMON */ #endif /* UTIL_LINUX_NLS_H */ uuid/src/Makevars.in0000644000176200001440000000007214550351455014116 0ustar liggesusersPKG_CPPFLAGS=-include config.h @CPPFLAGS@ PKG_LIBS=@LIBS@ uuid/NEWS0000644000176200001440000000366014550351455011733 0ustar liggesusers NEWS for uuid --------------- 1.2-0 2024-01-13 o add UUIDfromName() which allows generation of version 3 and 5 UUIDs based on a namespace UUID and a string. 1.1-1 2022-12-02 o clean up strict prototype warnings o update to upstream util-linux version 25b98ae 1.1-0 2022-04-19 o added UUIDparse() and UUIDvalidate() functions o added an internal representation of UUIDs as class "UUID" which represents a vector of 128-bit elements interpreted as UUIDs. This also allows seamless conversion between textual representation, raw vectors and UUID objects. 1.0-5 2022-04-19 o update to upstream util-linux version e928e8ed6 o add LinkingTo includes in the source tree. This fixes issues on Windows where the headers were not copied since configure is not run on Windows. The headers can be updated using src/update-inst.sh script in the source tree. 1.0-4 2022-03-15 o Windows: use dynamic buffer when querying DLLs to avoid "Too many DLLs" error. 1.0-3 2021-11-01 o guard flock() with HAVE_FLOCK for platforms that don't have it 1.0-2 2021-10-25 o silence benign sendfile warning from upstream 1.0-1 2021-10-20 o update to latest upstream libuuid sources (util-linux c4a543ff, libuuid e6743239) o Add LinkingTo: API allowing other packages to use UUID generation from C code 0.1-4 2020-02-26 o add `n' parameter to UUIDgenerate() to generate multiple UUIDs at once (#2) o use crypto-safe RNG on Windows to avoid UUIDs that are identical. That makes the default behavior equivalent to `use.time=FALSE' on Windows. (#8) 0.1-3 2020-02-25 o don't use deprecated `R CMD config CPP` o isolate rand()/srand() to avoid warnings 0.1-2 2015-07-27 o update License entry to conform to CRAN rules o don't break on systems without flock() (thanks to Brian Ripley) 0.1-1 2013-09-03 o initial CRAN release 0.1-0 2013-02-24 o initial version based on libuuid uuid/R/0000755000176200001440000000000014550351455011430 5ustar liggesusersuuid/R/uuid.R0000644000176200001440000000622014550351455012521 0ustar liggesusersUUIDgenerate <- function(use.time = NA, n = 1L, output = c("string", "raw", "uuid")) .Call(UUID_gen, n, switch(match.arg(output), string = 0L, raw = 1L, uuid = 2L), if (isTRUE(use.time)) 1L else if (isTRUE(!use.time)) 4L else NA_integer_, NULL) UUIDfromName <- function(namespace, name, type = c("sha1", "md5"), output = c("string", "raw", "uuid")) { ns <- as.UUID(namespace) if (length(ns) != 1 || any(is.na(ns))) stop("namespace must be a single, valid UUID") .Call(UUID_gen, name, switch(match.arg(output), string = 0L, raw = 1L, uuid = 2L), switch(match.arg(type), sha1 = 5L, md5 = 3L), ns) } UUIDparse <- function(what, output = c("uuid", "string", "raw", "logical")) .Call(UUID_parse, what, switch(match.arg(output), string = 0L, raw = 1L, uuid = 2L, logical = 3L)) UUIDvalidate <- function(what) UUIDparse(what, output="logical") UUID2string <- function(what) .Call(UUID_unparse, what, 0L) as.character.UUID <- function(x, ...) .Call(UUID_unparse, x, 0L) as.UUID <- function(x, ...) UseMethod("as.UUID") as.UUID.UUID <- function(x, ...) x as.UUID.raw <- function(x, ...) .Call(UUID_unparse, x, 1L) as.UUID.default <- function(x, ...) UUIDparse(as.character(x), output="uuid") as.raw.UUID <- function(x) .Call(UUID_unparse, x, 2L) rep.UUID <- function(x, ...) { x <- rep(unclass(x), ...) class(x) <- "UUID" x } c.UUID <- function(...) { l <- lapply(list(...), function(x) if (inherits(x, "UUID")) unclass(x) else x) x <- do.call(base::c, l) if (is.complex(x)) class(x) <- "UUID" x } unique.UUID <- function (x, incomparables = FALSE, ...) { x <- unique(unclass(x), incomparables=incomparables, ...) class(x) <- "UUID" x } print.UUID <- function(x, ...) { if (length(x) == 1L) cat("UUID: ", as.character.UUID(x), "\n", sep='') else { cat("UUID vector:\n") print(as.character.UUID(x), ...) } invisible(x) } `[.UUID` <- function(x, i, ...) { x <- unclass(x)[i, ...] class(x) <- "UUID" x } `[<-.UUID` <- function(x, i, ..., value) { x <- unclass(x) x[i, ...] <- as.UUID(value) class(x) <- "UUID" x } `[[.UUID` <- function(x, i, ...) { x <- unclass(x)[[i, ...]] class(x) <- "UUID" x } `[[<-.UUID` <- function(x, i, ..., value) { x <- unclass(x) x[[i, ...]] <- as.UUID(value) class(x) <- "UUID" x } Ops.UUID <- function(e1, e2) stop(.Generic, " operator is not supported on UUIDs") Math.UUID <- function(x, ...) stop(.Generic, " is not supported on UUIDs") Complex.UUID <- function(z) stop(.Generic, " is not supported on UUIDs") Summary.UUID <- function(..., na.rm = FALSE) stop(.Generic, " is not supported on UUIDs") is.UUID <- function(x) inherits(x, "UUID") `==.UUID` <- function(e1, e2) { if (inherits(e1, "UUID") && inherits(e2, "UUID")) .Call(UUID_cmp, e1, e2, 0L) else as.character(e1) == as.character(e2) } `!=.UUID` <- function(e1, e2) !`==.UUID`(e1, e2) ## We cannot use native is.na, because we only reserve (NA,NA), yet R will flag ## (x,NA) or (NA, x) in the complex case is.na.UUID <- function(x) .Call(UUID_is_NA, x) uuid/MD50000644000176200001440000000416414550775645011557 0ustar liggesusersdcc23889e2766536265d54f39fd50c8d *DESCRIPTION 576b91ce6112d68a9ab4a1f8749be113 *LICENSE dc1921b9de1f5191625950df82109a4c *NAMESPACE c76ab96cb202d31551100a08a308b6ba *NEWS 56096fa85f21706c8b120e778666c1c4 *R/uuid.R 45284af519fe5e0b551bfba2a4a24bcb *configure 4e9190ec023f28193dac3b48ca9dd222 *configure.ac cfb66084ea2bfc7648ab47ed1018e8a4 *inst/COPYING c915738d7218d998de13df8ed944d3a9 *inst/include/Ruuid.h 6c10334648d747bfb44c755aa3fa5fee *inst/include/uuid.h 3e8693b14c84565d289360d4407bd0f6 *man/UUID.Rd 81cd97704581a4d1a3bd52ea3b35ea5e *man/UUIDgenerate.Rd cfb66084ea2bfc7648ab47ed1018e8a4 *src/COPYING ca91f1dfb203b02dc81ca6d51b56c139 *src/Makevars.in b3ff1631d01db56025f62342dd6d4e69 *src/Makevars.win 6d0e867d46afa6a799a986c199b72fd0 *src/R.c 9f6e0a1f05f2234b20928f34a7b59803 *src/Ruuid.c c915738d7218d998de13df8ed944d3a9 *src/Ruuid.h 876d9c10796b223ef05a4f644c38e9b8 *src/all-io.h 399fd7e5c8b3cf8e7046860ca5aa421c *src/c.h bb35a49ecaad3cc9ba9198648e6865c8 *src/clear.c d2b39a0b3d72632db235a9c6d36ef344 *src/compare.c e7b87a05317d2ec33c78dbc875d76d13 *src/config.h.in d0026e30bb2f3feb7ac1db9827dd4820 *src/copy.c 45eb5cfc19441fc165dd88b7c08b00c4 *src/gen_uuid.c 1e0dc4ba0c89a12c3fbc227a7d2ec494 *src/isnull.c f71e683a3de84a397c4f07faddc98dd7 *src/md5.c 7cae8b31d8f74363a7e5f56019ece580 *src/md5.h c9c7412577eb3d80dac2dd69ee1a8e09 *src/nls.h b671656493c2119636a4e981e9aad857 *src/pack.c 6c794e4d3f51943914705106778c768a *src/parse.c a61474be69808afb391fff9d1e6194ca *src/rand.c 3e98c0fb65ac83c30b436549790e693d *src/randutils.c ac51d6448a0a43a9bdc483833f7390c0 *src/randutils.h b00041f5c29be55f5ff4ea1836283995 *src/sha1.c 26205c77c0836ef3dc5705beb656c5b3 *src/sha1.h 9f7b6575d4e65ef5ce1322c91b10d782 *src/strutils.h bededb71c0c869f06c3275a79781ed17 *src/unpack.c 0102c47a0969737d1df699137754bba7 *src/unparse.c cc9a643a4bde3b48d7adebc53e03f951 *src/update-inst.sh 455eb7b79d47493b4ad5a240ca745a64 *src/upstream.patch 3e265b497369387a5c13d9501151f106 *src/upstream.sh 6c10334648d747bfb44c755aa3fa5fee *src/uuid.h dbe690f0255a328950489b0f882908aa *src/uuidP.h a0870acd335b7b930580c746509019f6 *src/uuidd.h 72163a1d920be8a54c360b4473770975 *src/win32/config.h uuid/inst/0000755000176200001440000000000014550351455012204 5ustar liggesusersuuid/inst/include/0000755000176200001440000000000014550351455013627 5ustar liggesusersuuid/inst/include/Ruuid.h0000644000176200001440000000123214550351455015066 0ustar liggesusers#ifndef R_UUID_H__ #define R_UUID_H__ #include "uuid.h" /* types to use with generate() */ #define GT_DEFAULT 0 #define GT_RANDOM 1 #define GT_TIME 2 /* exported functions: */ typedef int (*RU_generate_t)(uuid_t uuid, int type); typedef int (*RU_parse_t)(const char *in_start, const char *in_end, uuid_t uu); /* in_end can be NULL */ typedef void(*RU_unparse_t)(uuid_t uuid, char *out, int lower); /* sample use: RU_generate_t generate_fn = (RU_generate_t) R_GetCCallable("uuid", "generate"); RU_parse_t parse_fn = (RU_parse_t) R_GetCCallable("uuid", "parse"); RU_unparse_t unparse_fn = (RU_unparse_t) R_GetCCallable("uuid", "unparse"); */ #endif uuid/inst/include/uuid.h0000644000176200001440000000771114550351455014754 0ustar liggesusers/* * Public include file for the UUID library * * Copyright (C) 1996, 1997, 1998 Theodore Ts'o. * * %Begin-Header% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, and the entire permission notice in its entirety, * including the disclaimer of warranties. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote * products derived from this software without specific prior * written permission. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. * %End-Header% */ #ifndef _UL_LIBUUID_UUID_H #define _UL_LIBUUID_UUID_H #include #ifndef _WIN32 #include #endif #include typedef unsigned char uuid_t[16]; /* UUID Variant definitions */ #define UUID_VARIANT_NCS 0 #define UUID_VARIANT_DCE 1 #define UUID_VARIANT_MICROSOFT 2 #define UUID_VARIANT_OTHER 3 #define UUID_VARIANT_SHIFT 5 #define UUID_VARIANT_MASK 0x7 /* UUID Type definitions */ #define UUID_TYPE_DCE_NIL 0 #define UUID_TYPE_DCE_TIME 1 #define UUID_TYPE_DCE_SECURITY 2 #define UUID_TYPE_DCE_MD5 3 #define UUID_TYPE_DCE_RANDOM 4 #define UUID_TYPE_DCE_SHA1 5 #define UUID_TYPE_SHIFT 4 #define UUID_TYPE_MASK 0xf #define UUID_STR_LEN 37 /* Allow UUID constants to be defined */ #ifdef __GNUC__ #define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \ static const uuid_t name __attribute__ ((unused)) = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15} #else #define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \ static const uuid_t name = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15} #endif #ifdef __cplusplus extern "C" { #endif /* clear.c */ extern void uuid_clear(uuid_t uu); /* compare.c */ extern int uuid_compare(const uuid_t uu1, const uuid_t uu2); /* copy.c */ extern void uuid_copy(uuid_t dst, const uuid_t src); /* gen_uuid.c */ extern void uuid_generate(uuid_t out); extern void uuid_generate_random(uuid_t out); extern void uuid_generate_time(uuid_t out); extern int uuid_generate_time_safe(uuid_t out); extern void uuid_generate_md5(uuid_t out, const uuid_t ns, const char *name, size_t len); extern void uuid_generate_sha1(uuid_t out, const uuid_t ns, const char *name, size_t len); /* isnull.c */ extern int uuid_is_null(const uuid_t uu); /* parse.c */ extern int uuid_parse(const char *in, uuid_t uu); extern int uuid_parse_range(const char *in_start, const char *in_end, uuid_t uu); /* unparse.c */ extern void uuid_unparse(const uuid_t uu, char *out); extern void uuid_unparse_lower(const uuid_t uu, char *out); extern void uuid_unparse_upper(const uuid_t uu, char *out); /* uuid_time.c */ extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv); extern int uuid_type(const uuid_t uu); extern int uuid_variant(const uuid_t uu); /* predefined.c */ extern const uuid_t *uuid_get_template(const char *alias); #ifdef __cplusplus } #endif #endif /* _UL_LIBUUID_UUID_H */ uuid/inst/COPYING0000644000176200001440000000274514550351455013247 0ustar liggesusersThis library is free software; you can redistribute it and/or modify it under the terms of the Modified BSD License: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, and the entire permission notice in its entirety, including the disclaimer of warranties. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. uuid/configure0000755000176200001440000042663014550351467013154 0ustar liggesusers#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for uuid 0.1. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: Simon.Urbanek@r-project.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='uuid' PACKAGE_TARNAME='uuid' PACKAGE_VERSION='0.1' PACKAGE_STRING='uuid 0.1' PACKAGE_BUGREPORT='Simon.Urbanek@r-project.org' PACKAGE_URL='' ac_unique_file="src/R.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #ifdef HAVE_STRING_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_c_list= ac_subst_vars='LTLIBOBJS LIBOBJS OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures uuid 0.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/uuid] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of uuid 0.1:";; esac cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF uuid configure 0.1 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. */ #include #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main (void) { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" else $as_nop eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including # INCLUDES, setting cache variable VAR accordingly. ac_fn_c_check_member () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int main (void) { static $2 ac_aggr; if (sizeof ac_aggr.$3) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" else $as_nop eval "$4=no" fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by uuid $as_me 0.1, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers src/config.h" # find R home and set CC/CFLAGS : ${R_HOME=`R RHOME`} if test -z "${R_HOME}"; then echo "could not determine R_HOME" exit 1 fi RBIN="${R_HOME}/bin/R" CC=`"${RBIN}" CMD config CC`; ## since R 3.6 we can't use CPP but NEWS recommends $CC -E CPP="${CC} -E" CFLAGS=`"${RBIN}" CMD config CFLAGS` CPPFLAGS=`"${RBIN}" CMD config CPPFLAGS` if test -n "${PKG_CPPFLAGS}"; then CPPFLAGS="${CPPFLAGS} ${PKG_CPPFLAGS}" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu LIBS="${PKG_LIBS}" ac_header= ac_cache= for ac_item in $ac_header_c_list do if test $ac_cache; then ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then printf "%s\n" "#define $ac_item 1" >> confdefs.h fi ac_header= ac_cache= elif test $ac_header; then ac_cache=$ac_item else ac_header=$ac_item fi done if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes then : printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "grp.h" "ac_cv_header_grp_h" "$ac_includes_default" if test "x$ac_cv_header_grp_h" = xyes then : printf "%s\n" "#define HAVE_GRP_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "langinfo.h" "ac_cv_header_langinfo_h" "$ac_includes_default" if test "x$ac_cv_header_langinfo_h" = xyes then : printf "%s\n" "#define HAVE_LANGINFO_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "locale.h" "ac_cv_header_locale_h" "$ac_includes_default" if test "x$ac_cv_header_locale_h" = xyes then : printf "%s\n" "#define HAVE_LOCALE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default" if test "x$ac_cv_header_netinet_in_h" = xyes then : printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes then : printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/file.h" "ac_cv_header_sys_file_h" "$ac_includes_default" if test "x$ac_cv_header_sys_file_h" = xyes then : printf "%s\n" "#define HAVE_SYS_FILE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes then : printf "%s\n" "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "$ac_includes_default" if test "x$ac_cv_header_sys_socket_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sockio_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SOCKIO_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/syscall.h" "ac_cv_header_sys_syscall_h" "$ac_includes_default" if test "x$ac_cv_header_sys_syscall_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SYSCALL_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/sendfile.h" "ac_cv_header_sys_sendfile_h" "$ac_includes_default" if test "x$ac_cv_header_sys_sendfile_h" = xyes then : printf "%s\n" "#define HAVE_SYS_SENDFILE_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes then : printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "sys/un.h" "ac_cv_header_sys_un_h" "$ac_includes_default" if test "x$ac_cv_header_sys_un_h" = xyes then : printf "%s\n" "#define HAVE_SYS_UN_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes then : printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "net/if.h" "ac_cv_header_net_if_h" "#if HAVE_NETINET_IN_H #include #endif " if test "x$ac_cv_header_net_if_h" = xyes then : printf "%s\n" "#define HAVE_NET_IF_H 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "net/if_dl.h" "ac_cv_header_net_if_dl_h" "#if HAVE_NETINET_IN_H #include #endif " if test "x$ac_cv_header_net_if_dl_h" = xyes then : printf "%s\n" "#define HAVE_NET_IF_DL_H 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd" if test "x$ac_cv_func_dirfd" = xyes then : printf "%s\n" "#define HAVE_DIRFD 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "err" "ac_cv_func_err" if test "x$ac_cv_func_err" = xyes then : printf "%s\n" "#define HAVE_ERR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "errx" "ac_cv_func_errx" if test "x$ac_cv_func_errx" = xyes then : printf "%s\n" "#define HAVE_ERRX 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getexecname" "ac_cv_func_getexecname" if test "x$ac_cv_func_getexecname" = xyes then : printf "%s\n" "#define HAVE_GETEXECNAME 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "getrandom" "ac_cv_func_getrandom" if test "x$ac_cv_func_getrandom" = xyes then : printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "jrand48" "ac_cv_func_jrand48" if test "x$ac_cv_func_jrand48" = xyes then : printf "%s\n" "#define HAVE_JRAND48 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "llseek" "ac_cv_func_llseek" if test "x$ac_cv_func_llseek" = xyes then : printf "%s\n" "#define HAVE_LLSEEK 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "lchown" "ac_cv_func_lchown" if test "x$ac_cv_func_lchown" = xyes then : printf "%s\n" "#define HAVE_LCHOWN 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy" if test "x$ac_cv_func_mempcpy" = xyes then : printf "%s\n" "#define HAVE_MEMPCPY 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "mkostemp" "ac_cv_func_mkostemp" if test "x$ac_cv_func_mkostemp" = xyes then : printf "%s\n" "#define HAVE_MKOSTEMP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" if test "x$ac_cv_func_nanosleep" = xyes then : printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "sendfile" "ac_cv_func_sendfile" if test "x$ac_cv_func_sendfile" = xyes then : printf "%s\n" "#define HAVE_SENDFILE 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "srandom" "ac_cv_func_srandom" if test "x$ac_cv_func_srandom" = xyes then : printf "%s\n" "#define HAVE_SRANDOM 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strnchr" "ac_cv_func_strnchr" if test "x$ac_cv_func_strnchr" = xyes then : printf "%s\n" "#define HAVE_STRNCHR 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup" if test "x$ac_cv_func_strndup" = xyes then : printf "%s\n" "#define HAVE_STRNDUP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen" if test "x$ac_cv_func_strnlen" = xyes then : printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "usleep" "ac_cv_func_usleep" if test "x$ac_cv_func_usleep" = xyes then : printf "%s\n" "#define HAVE_USLEEP 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "warn" "ac_cv_func_warn" if test "x$ac_cv_func_warn" = xyes then : printf "%s\n" "#define HAVE_WARN 1" >>confdefs.h fi ac_fn_c_check_func "$LINENO" "warnx" "ac_cv_func_warnx" if test "x$ac_cv_func_warnx" = xyes then : printf "%s\n" "#define HAVE_WARNX 1" >>confdefs.h fi for ac_func in flock do : ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock" if test "x$ac_cv_func_flock" = xyes then : printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h #if HAVE_SYS_FILE_H #include #endif fi done ac_fn_c_check_member "$LINENO" "struct sockaddr" "sa_len" "ac_cv_member_struct_sockaddr_sa_len" "#include #include " if test "x$ac_cv_member_struct_sockaddr_sa_len" = xyes then : printf "%s\n" "#define HAVE_SA_LEN 1" >>confdefs.h fi ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes then : printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing dlsym" >&5 printf %s "checking for library containing dlsym... " >&6; } if test ${ac_cv_search_dlsym+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char dlsym (); int main (void) { return dlsym (); ; return 0; } _ACEOF for ac_lib in '' dl do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_dlsym=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_dlsym+y} then : break fi done if test ${ac_cv_search_dlsym+y} then : else $as_nop ac_cv_search_dlsym=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlsym" >&5 printf "%s\n" "$ac_cv_search_dlsym" >&6; } ac_res=$ac_cv_search_dlsym if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" printf "%s\n" "#define HAS_DLSYM 1" >>confdefs.h fi ## note the libuuid only uses __thread so that's the only one to test for have_tls=no { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thread local storage (TLS) support" >&5 printf %s "checking for thread local storage (TLS) support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { static __thread int x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : have_tls=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_tls" >&5 printf "%s\n" "$have_tls" >&6; } if test x$have_tls = xyes; then printf "%s\n" "#define HAVE_TLS 1" >>confdefs.h fi ac_config_files="$ac_config_files src/Makevars" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by uuid $as_me 0.1, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ uuid config.status 0.1 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "src/Makevars") CONFIG_FILES="$CONFIG_FILES src/Makevars" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi