-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfigure.ac
75 lines (65 loc) · 1.95 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_INIT([sans], [0.1.0], [https://github.com/XiaoxiaoPu/sans/issues], [sans], [https://github.com/XiaoxiaoPu/sans])
AC_CONFIG_SRCDIR([sans])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
# Checks for programs.
AC_PROG_CC_C99
AC_PROG_INSTALL
LT_INIT
# Custom options
AC_ARG_ENABLE(
[static],
[AS_HELP_STRING([--enable-static], [build with static linking])],
[LDFLAGS="$LDFLAGS -static"])
AM_CONDITIONAL(STATIC, test x"$static" = x"true")
AC_ARG_ENABLE(
[debug],
[AS_HELP_STRING([--enable-debug], [build with additional debugging code])],
[CFLAGS="$CFLAGS -g -DDEBUG -O0"])
AM_CONDITIONAL(DEBUG, test x"$debug" = x"true")
AC_ARG_ENABLE(
[coverage],
[AS_HELP_STRING([--enable-coverage], [enable coverage analysis])],
[CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"])
# Add library for MinGW
case $host in
*-mingw*)
mingw=yes
LIBS="$LIBS -lws2_32"
LDFLAGS="$LDFLAGS -static"
;;
*)
;;
esac
# Checks for libraries.
# Checks for header files.
AC_HEADER_ASSERT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h grp.h netdb.h netinet/in.h pwd.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
case $host in
*-mingw*)
AC_CHECK_HEADERS([windows.h winsock2.h ws2tcpip.h], [], [AC_MSG_ERROR([Missing MinGW headers])], [])
;;
*)
;;
esac
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_CHECK_FUNCS([bzero gettimeofday memset setegid seteuid sigaction select socket strchr strdup strerror strrchr strtol])
AC_CONFIG_FILES([Makefile
src/Makefile])
AC_OUTPUT