-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
89 lines (78 loc) · 2.33 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
AC_PREREQ([2.68])
AC_INIT([libmuv], [0.1.0], [shsfre09@gmail.com])
AC_CONFIG_SRCDIR([src/core.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
# Checks for programs.
AC_PROG_CC
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
# Checks for libraries.
# AC_PROG_RANLIB
AC_PROG_LIBTOOL
# LT_INIT
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [main])
# FIXME: Replace `main' with a function in `-lpthread':
AC_CHECK_LIB([pthread], [main])
# FIXME: Replace `main' with a function in `-lrt':
AC_CHECK_LIB([rt], [main])
# FIXME: Replace `main' with a function in `-lws2_32':
AC_CHECK_LIB([ws2_32], [main])
# FIXME: Replace `main' with a function in `-lpsapi':
AC_CHECK_LIB([psapi], [main])
# FIXME: Replace `main' with a function in `-liphlpapi':
AC_CHECK_LIB([iphlpapi], [main])
AC_CANONICAL_HOST
case $host_os in
darwin* )
CFLAGS="$CFLAGS -framework CoreServices"
;;
linux*)
;;
*BSD*)
;;
mingw*)
CFLAGS="$CFLAGS -DWINVER=0x0501"
;;
*)
;;
esac
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h locale.h mach/mach.h malloc.h netdb.h netinet/in.h paths.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h termios.h unistd.h utime.h utmp.h wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_FORK
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([bzero clock_gettime dup2 fdatasync floor ftruncate getcwd gethrtime getpagesize gettimeofday memmove memset mkdir pathconf putenv realpath rmdir select socket strchr strdup strndup strrchr strstr sysinfo utime utmpname])
# Defines options
PWD=`pwd`
AC_ARG_WITH([libuv],
[AC_HELP_STRING([--with-libuv], [build with external libuv])],
[UVDIR=${withval}],
[UVDIR=${PWD}/deps/libuv])
AC_SUBST(UVDIR)
AC_CONFIG_FILES([Makefile
src/Makefile
sample/Makefile])
AC_OUTPUT