allow building just the library not the testapps
[profile/ivi/libwebsockets.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.61])
5 AC_INIT(libwebsockets, 1.0, andy@warmcat.com)
6 AC_CONFIG_SRCDIR([test-server/test-server.c])
7 AC_CONFIG_HEADERS([config.h])
8
9 AM_INIT_AUTOMAKE([-Wall -Werror foreign])
10 AM_PROG_AR
11 LT_INIT(shared)
12
13 #AX_PTHREAD
14
15 # Checks for programs.
16 AM_PROG_CC_C_O
17 AC_PROG_INSTALL
18 AC_PROG_MAKE_SET
19 AC_CONFIG_MACRO_DIR([m4])
20
21 #
22 #
23 #
24 AC_ARG_ENABLE(openssl,
25  [  --enable-openssl  Enables https support and needs openssl libs],
26  [ openssl=yes
27  ])
28
29 if test "x$openssl" = "xyes" ; then
30 AC_CHECK_LIB([ssl], [SSL_library_init])
31 CFLAGS="$CFLAGS -DLWS_OPENSSL_SUPPORT"
32 fi
33
34 #
35 #
36 #
37 AC_ARG_ENABLE(nofork,
38  [  --enable-nofork  Disables fork-related options],
39  [ nofork=yes
40  ])
41
42 if test "x$nofork" = "xyes" ; then
43 CFLAGS="$CFLAGS -DLWS_NO_FORK"
44 else
45 AC_FUNC_FORK
46 fi
47
48 #
49 #
50 #
51 AC_ARG_ENABLE(libcrypto,
52  [  --enable-libcrypto  Use libcrypto MD5 and SHA1 implementations],
53  [ libcrypto=yes
54  ])
55
56 if test "x$libcrypto" = "xyes" ; then
57 CFLAGS="$CFLAGS -DLWS_LIBCRYPTO"
58 LDFLAGS="$LDFLAGS -lcrypto"
59 fi
60 AM_CONDITIONAL(LIBCRYPTO, test x$libcrypto = xyes)
61
62
63 #
64 #
65 #
66 AC_ARG_ENABLE(x-google-mux,
67  [  --enable-x-google-mux  Build experimental x-google-mux],
68  [ x_google_mux=yes
69  ])
70 if test "x$x_google_mux" = "xyes" ; then
71 CFLAGS="$CFLAGS -DLWS_EXT_GOOGLE_MUX"
72 fi
73 AM_CONDITIONAL(EXT_GOOGLE_MUX, test x$x_google_mux = xyes)
74
75
76 #
77 #
78 AC_ARG_WITH(testapps,
79  [  --without-testapps  dont build the libwebsocket-test- apps],
80  [ no_testapps=yes
81  ])
82
83 AM_CONDITIONAL(NO_TESTAPPS, test x$no_testapps = xyes)
84
85
86 #                                                                               
87 #                                                                               
88 AC_ARG_ENABLE(mingw,                                                          
89  [  --enable-mingw  Using mingw compilers, disables ping test build],            
90  [ mingw=yes
91    noping=yes
92  ])                                                                             
93                                                                                 
94 if test "x$mingw" = "xyes" ; then                                             
95 CFLAGS="$CFLAGS -DLWS_MINGW_SUPPORT"                                          
96 fi
97 AM_CONDITIONAL(MINGW, test x$mingw = xyes)
98
99 #
100 #
101 #
102 AC_ARG_WITH([client-cert-dir],
103 [AS_HELP_STRING([--with-client-cert-dir],[directory containing client certs, defaults to /etc/pki/tls/certs/])],
104 [clientcertdir=$withval],
105 [clientcertdir=/etc/pki/tls/certs/]
106 )
107 AC_SUBST([clientcertdir])
108
109 AC_SUBST([CFLAGS])
110
111
112 #
113 #
114 #
115 AC_ARG_ENABLE(noping,
116  [  --enable-noping  Do not build ping test app, which has some unixy stuff in sources],
117  [ noping=yes
118  ])
119
120 AM_CONDITIONAL(NOPING, test x$noping = xyes)
121
122 #
123 #
124 #
125 AC_ARG_ENABLE(debug,
126  [  --disable-debug  Stops debug-related code from even being compiled in, useful for best speed],
127  [ disable_debug=yes
128  ])
129
130 if test "x$disable_debug" != "xyes" ; then
131 CFLAGS="$CFLAGS -D_DEBUG"
132 fi
133 AM_CONDITIONAL(DISABLE_DEBUG, test x$disable_debug = xyes)
134
135
136 #
137 #
138 #
139 AC_ARG_ENABLE(builtin-getifaddrs,
140  [  --enable-builtin-getifaddrs  Use BSD getifaddrs implementation from libwebsockets... default is your libc provides it],
141  [ builtin_getifaddrs=yes
142  ])
143 if test "x$builtin-getifaddrs" = "xyes" ; then
144 CFLAGS="$CFLAGS -DLWS_BUILTIN_GETIFADDRS"
145 fi
146 AM_CONDITIONAL(USE_BUILTIN_GETIFADDRS, test x$builtin_getifaddrs = xyes)
147
148
149
150 # Checks for header files.
151 AC_CHECK_HEADERS([zlib.h fcntl.h netinet/in.h stdlib.h string.h sys/socket.h unistd.h sys/prctl.h])
152
153 # Checks for typedefs, structures, and compiler characteristics.
154 AC_TYPE_SIZE_T
155
156 # Checks for library functions.
157
158 AC_FUNC_MALLOC
159 AC_FUNC_REALLOC
160 AC_CHECK_FUNCS([bzero memset socket strerror])
161
162 AC_CONFIG_FILES([Makefile
163                  lib/Makefile
164                  test-server/Makefile])
165
166 AC_OUTPUT([
167 libwebsockets.pc
168 ])