-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
61 lines (53 loc) · 1.84 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Process this file with autoconf to produce a configure script.
AC_INIT(uuid, 0.9, [email protected])
AC_CONFIG_SRCDIR([src/R.c])
AC_CONFIG_HEADER([src/config.h])
AC_CONFIG_HEADER([src/uuid.h])
AC_CONFIG_HEADER([src/uuid_types.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([netinet/in.h stdlib.h sys/file.h \
sys/ioctl.h sys/socket.h sys/sockio.h sys/syscall.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 <netinet/in.h>
#endif
])
AC_CHECK_FUNCS([jrand48])
AC_CHECK_FUNCS([flock],
[#if HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
])
AC_CHECK_MEMBER(struct sockaddr.sa_len,
AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
[#include <sys/types.h>
#include <sys/socket.h>])
AC_CHECK_HEADERS([dlfcn.h])
AC_SEARCH_LIBS(dlsym, dl, [AC_DEFINE(HAS_DLSYM, 1, [defined if the system supports dlsym])])
## NOTE: the current util-linux which has taken over libuuid also uses
## check for HAVE_TLS (thread local storage).
## However, the AX_CHECK_TLS test in util-linux/m4/tls.m4 is taken from
## GCC under GPLv2 and we don't want it to infect our license, so we
## don't check for it. In the current code the only difference when
## HAVE_TLS is defined is that it adds __thread to static declarations.
## Given that R uses libuuid only on the main thread this should have
## no real impact.
AC_CONFIG_FILES([src/Makevars])
AC_OUTPUT