forked from allinurl/gwsocket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
67 lines (55 loc) · 1.99 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT([gwsocket], [0.3], [[email protected]], [], [http://gwsocket.io])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/gwsocket.c])
AC_CONFIG_HEADERS([src/config.h])
# Use empty CFLAGS by default so autoconf does not add
# CFLAGS="-O2 -g"
: ${CFLAGS=""}
# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
# DEBUG
AC_ARG_ENABLE(debug, [ --enable-debug Create a debug build. Default is disabled],
[debug="$enableval"], debug=no)
if test "$debug" = "yes"; then
AC_DEFINE([_DEBUG], 1, [Debug option])
fi
AM_CONDITIONAL([DEBUG], [test "x$debug" = "xyes"])
# Handle rdynamic only on systems using GNU ld
AC_CANONICAL_HOST
AC_MSG_CHECKING([whether to build with rdynamic for GNU ld])
with_rdyanimc=yes
case "$host_os" in
*darwin*|*cygwin*|*aix*|*mingw*) with_rdyanimc=no
;;
esac
AC_MSG_RESULT([$with_rdyanimc])
AM_CONDITIONAL([WITH_RDYNAMIC], [test "x$with_rdyanimc" = "xyes"])
# Checks for libraries.
AC_ARG_WITH([openssl],AC_HELP_STRING([--with-openssl], [build with OpenSSL support]),
[openssl="$withval"],[openssl="no"])
# Build with OpenSSL
if test "$openssl" = 'yes'; then
AC_CHECK_LIB([ssl], [SSL_library_init],,[AC_MSG_ERROR([ssl library missing])])
AC_CHECK_LIB([crypto], [CRYPTO_num_locks],,[AC_MSG_ERROR([crypto library missing])])
fi
# For Makefile.am
#AM_CONDITIONAL(HAVE_OPENSSL, test "$openssl" = "yes")
# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([gettimeofday memmove memset mkfifo select socket strcasecmp strchr strerror strpbrk strstr])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT