forked from litespeedtech/openlitespeed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
194 lines (161 loc) · 6.7 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
m4_include(ax_check_zlib.m4)
m4_include(ax_check_openssl.m4)
m4_include(ax_path_lib_pcre.m4)
m4_include(ax_lib_expat.m4)
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([openlitespeed],[1.2.8],[[email protected]],[openlitespeed],[http://www.litespeedtech.com/])
AM_INIT_AUTOMAKE([1.2.8 foreign no-define ])
AM_CONFIG_HEADER(src/config.h:src/config.h.in)
dnl NOW change the default installation directory!
AC_PREFIX_DEFAULT('/usr/local/lsws')
# General "with" options
# ----------------------------------------------------------------------------
dnl Checks for programs.
AC_PROG_MAKE_SET
AC_PROG_INSTALL
# Checks for programs.
AC_PROG_AWK
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# Checks for header files.
AC_CHECK_HEADER([pthread.h],
[AC_CHECK_LIB([pthread],[pthread_join],[
AC_DEFINE([HAVE_LIBPTHREAD],[],[Define if pthread (-lpthread)])
AC_DEFINE([HAVE_PTHREAD_H],[],[Define if <pthread.h>])
LIBS="-lpthread $LIBS"
])])
AC_CHECK_HEADERS(arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stddef.h stdlib.h string.h strings.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h unistd.h)
AC_HEADER_ASSERT
## ##Set option --with-user
AC_ARG_WITH([user],
AS_HELP_STRING([--with-user],[Set user name to run openlitespeed [default: nobody]]),
[OPENLSWS_USER="$withval"], [OPENLSWS_USER=nobody])
AC_SUBST([OPENLSWS_USER])
## ##Set option --with-group
AC_ARG_WITH([group],
AS_HELP_STRING([--with-group],[Set group of the user [default: nobody]]),
[OPENLSWS_GROUP="$withval"], [OPENLSWS_GROUP=nobody])
AC_SUBST([OPENLSWS_GROUP])
## ##Set option --with-admin
AC_ARG_WITH([admin],
AS_HELP_STRING([--with-admin],[Set administrator user name [default: admin]]),
[OPENLSWS_ADMIN="$withval"], [OPENLSWS_ADMIN=admin])
AC_SUBST([OPENLSWS_ADMIN])
## ##Set option --with-password
AC_ARG_WITH([password],
AS_HELP_STRING([--with-password],[Set password of administrator [default: 123456]]),
[OPENLSWS_PASSWORD="$withval"], [OPENLSWS_PASSWORD=123456])
AC_SUBST([OPENLSWS_PASSWORD])
## ##Set option --with-email
AC_ARG_WITH([email],
AS_HELP_STRING([--with-email],[Set email of administrator [default: root@localhost]]),
[OPENLSWS_EMAIL="$withval"], [OPENLSWS_EMAIL=root@localhost])
AC_SUBST([OPENLSWS_EMAIL])
AC_ARG_ENABLE([adminssl],
[AC_HELP_STRING([--enable-adminssl=@<:@yes/no@:>@],
[Enable HTTPS for admin console (modify adminssl.conf before installation) @<:@default=yes@:>@])],
[OPENLSWS_ADMINSSL="$enableval"], [OPENLSWS_ADMINSSL=yes])
AC_SUBST([OPENLSWS_ADMINSSL])
AC_ARG_ENABLE([spdy],
[AC_HELP_STRING([--enable-spdy],
[Enable SPDY over HTTPS (Spdy is disabled by default)])],
[ AC_DEFINE([LS_ENABLE_SPDY], [1], [Define if need spdy feature])
echo "SPDY enabled!!!" ], [])
AC_ARG_ENABLE([debug],
[AC_HELP_STRING([--enable-debug],
[Enable debugging symbols (Debug is disabled by default)])],
[OPENLSWS_DEBUG="$enableval"
if test "$OPENLSWS_DEBUG" = "yes" ; then
CFLAGS="-g3 -O0"
CXXFLAGS="-g3 -O0"
else
CFLAGS="-g -O3"
CXXFLAGS="-g -O3"
fi
echo "OPENLSWS_DEBUG='$OPENLSWS_DEBUG'"
], [])
AC_ARG_ENABLE([profiling],
[AC_HELP_STRING([--enable-profiling],
[Enable cpu profiling (profiling is disabled by default)])],
[OPENLSWS_PROF="$enableval"
if test "$OPENLSWS_PROF" = "yes" ; then
CFLAGS="$CFLAGS -pg"
CXXFLAGS="$CXXFLAGS -pg"
fi
echo "OPENLSWS_PROF='$OPENLSWS_PROF'"
], [])
CFLAGS="$CFLAGS -fstack-protector `getconf LFS_CFLAGS`"
CXXFLAGS="$CXXFLAGS -fstack-protector `getconf LFS_CFLAGS`"
echo "Final CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS'"
AC_ARG_ENABLE([rpath],
[AC_HELP_STRING([--disable-rpath],
[Disable rpath (It is 'no' by default)])],
[OPENLSWS_DISABLE_RPATH=yes
echo "OPENLSWS_DISABLE_RPATH=yes"], [OPENLSWS_DISABLE_RPATH=no])
AC_SUBST([OPENLSWS_DISABLE_RPATH])
AC_ARG_WITH([libdir],
AS_HELP_STRING([--with-libdir],[Set system lib directory. It is lib or lib64 and will be automatically checked by default]),
[OPENLSWS_LIBDIR="$withval"], [
OSTYPE=`uname -m`
OSNAME=`uname -s`
if test "$OSNAME" != Linux ; then
OPENLSWS_LIBDIR=lib
else
if test "$OSTYPE" != x86_64 ; then
OPENLSWS_LIBDIR=lib
else
OPENLSWS_LIBDIR=lib64
fi
fi
])
echo "Default system lib directory = $OPENLSWS_LIBDIR"
AC_SUBST([OPENLSWS_LIBDIR])
AX_CHECK_ZLIB(, AC_MSG_ERROR(Can not find zlib. You must install it before continuing.))
AX_CHECK_OPENSSL(, AC_MSG_ERROR(Can not find openssl. You must install it before continuing.))
AX_PATH_LIB_PCRE(, AC_MSG_ERROR(Can not find pcre. You must install it before continuing.))
AX_LIB_EXPAT(0.5)
AC_CHECK_LIB([GeoIP], [GeoIP_id_by_addr])
AC_CHECK_LIB(crypt,crypt,LIBS="-lcrypt $LIBS")
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_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_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_CHECK_TYPES(ptrdiff_t)
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_FSEEKO
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_CHECK_FUNCS(bzero dup2 ftruncate getcwd gethostbyaddr gethostbyname gettimeofday inet_ntoa localtime_r memchr memmove memset mkdir munmap select socket strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strspn strstr strtol)
AC_CONFIG_FILES(Makefile
src/Makefile
src/edio/Makefile
src/extensions/Makefile
src/http/Makefile
src/spdy/Makefile
src/log4cxx/Makefile
src/main/Makefile
src/socket/Makefile
src/sslpp/Makefile
src/ssi/Makefile
src/util/Makefile)
AC_OUTPUT