summaryrefslogtreecommitdiff
path: root/configure.ac
blob: 93dc7f4dfe359c50f8e108094ebefa678292f58e (plain)
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.66])
AC_INIT(libwebsockets, 0.3, andy@warmcat.com)
AC_CONFIG_SRCDIR([test-server/test-server.c])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([-Wall -Werror foreign])
LT_INIT(shared)

#AX_PTHREAD

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CONFIG_MACRO_DIR([m4])


#
#
#
AC_ARG_ENABLE(openssl,
 [  --enable-openssl  Enables https support and needs openssl libs],
 [ openssl=yes
 ])

if test "x$openssl" = "xyes" ; then
AC_CHECK_LIB([ssl], [SSL_library_init])
CFLAGS="$CFLAGS -DLWS_OPENSSL_SUPPORT"
fi

#
#
#
AC_ARG_ENABLE(nofork,
 [  --enable-nofork  Disables fork-related options],
 [ nofork=yes
 ])

if test "x$nofork" = "xyes" ; then
CFLAGS="$CFLAGS -DLWS_NO_FORK"
else
AC_FUNC_FORK
fi

#
#
#
AC_ARG_ENABLE(libcrypto,
 [  --enable-libcrypto  Use libcrypto MD5 and SHA1 implementations],
 [ libcrypto=yes
 ])

if test "x$libcrypto" = "xyes" ; then
CFLAGS="$CFLAGS -DLWS_LIBCRYPTO"
LDFLAGS="$LDFLAGS -lcrypto"
fi
AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)


#
#
#
AC_ARG_ENABLE(x-google-mux,
 [  --enable-x-google-mux  Build experimental x-google-mux],
 [ x_google_mux=yes
 ])
if test "x$x_google_mux" = "xyes" ; then
CFLAGS="$CFLAGS -DLWS_EXT_GOOGLE_MUX"
fi
AM_CONDITIONAL(EXT_GOOGLE_MUX, test x$x_google_mux = xyes)

#                                                                               
#                                                                               
#                                                                               
AC_ARG_ENABLE(mingw,                                                          
 [  --enable-mingw  Using mingw compilers, disables ping test build],            
 [ mingw=yes
   noping=yes
 ])                                                                             
                                                                                
if test "x$mingw" = "xyes" ; then                                             
CFLAGS="$CFLAGS -DLWS_MINGW_SUPPORT"                                          
fi
AM_CONDITIONAL(MINGW, test x$mingw = xyes)

#
#
#
AC_ARG_WITH([client-cert-dir],
[AS_HELP_STRING([--with-client-cert-dir],[directory containing client certs, defaults to /etc/pki/tls/certs/])],
[clientcertdir=$withval],
[clientcertdir=/etc/pki/tls/certs/]
)
AC_SUBST([clientcertdir])

AC_SUBST([CFLAGS])


#
#
#
AC_ARG_ENABLE(noping,
 [  --enable-noping  Do not build ping test app, which has some unixy stuff in sources],
 [ noping=yes
 ])

AM_CONDITIONAL(NOPING, test x$noping = xyes)



# Checks for header files.
AC_CHECK_HEADERS([zlib.h fcntl.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# Checks for library functions.

AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([bzero memset socket strerror])

AC_CONFIG_FILES([Makefile
                 lib/Makefile
                 test-server/Makefile])

AC_OUTPUT