2012-01-17 16:53:12 +01:00
|
|
|
dnl Spdylay - SPDY Library
|
|
|
|
|
|
|
|
dnl Copyright (c) 2012 Tatsuhiro Tsujikawa
|
|
|
|
|
|
|
|
dnl Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
dnl a copy of this software and associated documentation files (the
|
|
|
|
dnl "Software"), to deal in the Software without restriction, including
|
|
|
|
dnl without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
dnl distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
dnl permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
dnl the following conditions:
|
|
|
|
|
|
|
|
dnl The above copyright notice and this permission notice shall be
|
|
|
|
dnl included in all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
dnl NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
dnl LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
dnl OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
dnl WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
AC_PREREQ(2.61)
|
2013-01-12 13:30:38 +01:00
|
|
|
AC_INIT([spdylay], [0.3.7], [t-tujikawa@users.sourceforge.net])
|
2012-03-21 16:51:36 +01:00
|
|
|
LT_PREREQ([2.2.6])
|
|
|
|
LT_INIT()
|
2012-01-17 16:53:12 +01:00
|
|
|
dnl See versioning rule:
|
|
|
|
dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
2013-01-12 13:30:38 +01:00
|
|
|
AC_SUBST(LT_CURRENT, 5)
|
2012-10-01 15:46:26 +02:00
|
|
|
AC_SUBST(LT_REVISION, 0)
|
2013-01-12 13:30:38 +01:00
|
|
|
AC_SUBST(LT_AGE, 0)
|
2012-01-17 16:53:12 +01:00
|
|
|
|
2012-03-23 15:49:07 +01:00
|
|
|
AC_CANONICAL_BUILD
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE()
|
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
|
2012-06-11 16:08:18 +02:00
|
|
|
dnl Checks for command-line options
|
|
|
|
AC_ARG_ENABLE([maintainer-mode],
|
|
|
|
[AS_HELP_STRING([--enable-maintainer-mode],
|
|
|
|
[Turn on compile time warnings])],
|
2012-09-22 08:44:42 +02:00
|
|
|
[maintainer_mode=$enableval], [maintainer_mode=no])
|
2012-06-11 16:08:18 +02:00
|
|
|
|
2012-09-10 14:51:08 +02:00
|
|
|
AC_ARG_ENABLE([src],
|
|
|
|
[AS_HELP_STRING([--enable-src],
|
|
|
|
[Build installable SPDY client/server programs in src])],
|
2012-09-22 08:44:42 +02:00
|
|
|
[request_src=$enableval], [request_src=yes])
|
2012-09-10 14:51:08 +02:00
|
|
|
|
2012-08-23 19:15:57 +02:00
|
|
|
AC_ARG_ENABLE([examples],
|
|
|
|
[AS_HELP_STRING([--enable-examples],
|
|
|
|
[Build example programs])],
|
2012-09-22 08:44:42 +02:00
|
|
|
[request_examples=$enableval], [request_examples=yes])
|
2012-08-23 19:15:57 +02:00
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
dnl Checks for programs
|
|
|
|
AC_PROG_CC
|
2012-01-31 20:10:09 +01:00
|
|
|
AC_PROG_CXX
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_LN_S
|
|
|
|
AC_PROG_MAKE_SET
|
2012-01-24 14:02:24 +01:00
|
|
|
PKG_PROG_PKG_CONFIG([0.20])
|
2012-01-17 16:53:12 +01:00
|
|
|
|
2012-02-14 15:54:23 +01:00
|
|
|
AC_COMPILE_STDCXX_11
|
|
|
|
AM_CONDITIONAL([HAVE_STDCXX_11],
|
|
|
|
[ test "x$ac_cv_cxx_compile_cxx11_cxx" = "xyes" ])
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
# Checks for libraries.
|
2012-02-08 15:11:06 +01:00
|
|
|
|
2012-07-27 15:11:13 +02:00
|
|
|
# Search for dlsym function, which is used in tests. Linux needs -ldl,
|
|
|
|
# but netbsd does not need it.
|
|
|
|
AC_SEARCH_LIBS([dlsym], [dl])
|
|
|
|
|
2012-02-08 15:11:06 +01:00
|
|
|
# zlib
|
2012-01-24 14:02:24 +01:00
|
|
|
PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3])
|
2012-03-01 15:39:55 +01:00
|
|
|
LIBS="$ZLIB_LIBS $LIBS"
|
|
|
|
CFLAGS="$CFLAGS $ZLIB_CFLAGS"
|
2012-01-24 14:02:24 +01:00
|
|
|
|
2012-02-08 15:11:06 +01:00
|
|
|
# cunit
|
|
|
|
PKG_CHECK_MODULES([CUNIT], [cunit >= 2.1], [have_cunit=yes], [have_cunit=no])
|
|
|
|
# If pkg-config does not find cunit, check it using AC_CHECK_LIB. We
|
|
|
|
# do this because Debian (Ubuntu) lacks pkg-config file for cunit.
|
|
|
|
if test "x${have_cunit}" = "xno"; then
|
|
|
|
AC_MSG_WARN([${CUNIT_PKG_ERRORS}])
|
|
|
|
AC_CHECK_LIB([cunit], [CU_initialize_registry],
|
|
|
|
[have_cunit=yes], [have_cunit=no])
|
|
|
|
if test "x${have_cunit}" = "xyes"; then
|
|
|
|
CUNIT_LIBS="-lcunit"
|
|
|
|
CUNIT_CFLAGS=""
|
|
|
|
AC_SUBST([CUNIT_LIBS])
|
|
|
|
AC_SUBST([CUNIT_CFLAGS])
|
|
|
|
fi
|
|
|
|
fi
|
2012-02-09 14:11:30 +01:00
|
|
|
if test "x${have_cunit}" = "xyes"; then
|
2012-02-14 13:26:52 +01:00
|
|
|
# cunit in Mac OS X requires ncurses. Note that in Mac OS X, test
|
|
|
|
# program can be built without -lncurses, but it emits runtime
|
|
|
|
# error.
|
|
|
|
case "${build}" in
|
|
|
|
*-apple-darwin*)
|
|
|
|
CUNIT_LIBS="$CUNIT_LIBS -lncurses"
|
|
|
|
AC_SUBST([CUNIT_LIBS])
|
|
|
|
;;
|
|
|
|
esac
|
2012-02-09 14:11:30 +01:00
|
|
|
fi
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
|
|
|
|
|
2012-02-08 15:11:06 +01:00
|
|
|
# openssl (for examples)
|
2012-03-28 19:13:33 +02:00
|
|
|
PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.1],
|
|
|
|
[have_openssl=yes], [have_openssl=no])
|
|
|
|
if test "x${have_openssl}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($OPENSSL_PKG_ERRORS)
|
|
|
|
AC_MSG_NOTICE([The example programs will not be built.])
|
|
|
|
fi
|
|
|
|
|
2012-06-04 16:48:31 +02:00
|
|
|
# libevent_openssl
|
2012-06-06 18:36:49 +02:00
|
|
|
# 2.0.8 is required because we use evconnlistener_set_error_cb()
|
|
|
|
PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.0.8],
|
2012-06-04 16:48:31 +02:00
|
|
|
[have_libevent_openssl=yes], [have_libevent_openssl=no])
|
|
|
|
if test "x${have_libevent_openssl}" = "xno"; then
|
|
|
|
AC_MSG_NOTICE($LIBEVENT_OPENSSL_PKG_ERRORS)
|
|
|
|
AC_MSG_NOTICE([Shrpx example program will not be built.])
|
|
|
|
fi
|
2012-06-06 18:36:49 +02:00
|
|
|
AM_CONDITIONAL([HAVE_LIBEVENT_OPENSSL],
|
|
|
|
[ test "x${have_libevent_openssl}" = "xyes" ])
|
2012-06-04 16:48:31 +02:00
|
|
|
|
2012-05-19 10:05:12 +02:00
|
|
|
# libxml2 (for examples/spdycat)
|
2012-05-27 16:52:08 +02:00
|
|
|
AM_PATH_XML2(2.7.7, [have_libxml2=yes], [have_libxml2=no])
|
2012-05-19 10:05:12 +02:00
|
|
|
if test "x${have_libxml2}" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have `libxml2` library.])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_LIBXML2], [ test "x${have_libxml2}" = "xyes" ])
|
|
|
|
|
2012-09-10 14:51:08 +02:00
|
|
|
# The src programs depend on OpenSSL
|
|
|
|
enable_src=no
|
|
|
|
if test "x${request_src}" = "xyes" &&
|
|
|
|
test "x${have_openssl}" = "xyes"; then
|
|
|
|
enable_src=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ENABLE_SRC], [ test "x${enable_src}" = "xyes" ])
|
|
|
|
|
2012-03-28 19:13:33 +02:00
|
|
|
# The example programs depend on OpenSSL
|
2012-08-23 19:15:57 +02:00
|
|
|
enable_examples=no
|
|
|
|
if test "x${request_examples}" = "xyes" &&
|
|
|
|
test "x${have_openssl}" = "xyes"; then
|
|
|
|
enable_examples=yes
|
|
|
|
fi
|
|
|
|
|
2012-03-28 19:13:33 +02:00
|
|
|
AM_CONDITIONAL([ENABLE_EXAMPLES], [ test "x${enable_examples}" = "xyes" ])
|
2012-02-08 15:11:06 +01:00
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
# Checks for header files.
|
|
|
|
AC_CHECK_HEADERS([ \
|
|
|
|
arpa/inet.h \
|
2012-03-23 15:49:07 +01:00
|
|
|
netinet/in.h \
|
2012-07-31 19:06:27 +02:00
|
|
|
pwd.h \
|
2012-01-17 16:53:12 +01:00
|
|
|
stddef.h \
|
|
|
|
stdint.h \
|
|
|
|
stdlib.h \
|
|
|
|
string.h \
|
2012-01-27 15:05:29 +01:00
|
|
|
time.h \
|
2012-01-17 16:53:12 +01:00
|
|
|
unistd.h \
|
|
|
|
])
|
|
|
|
|
2012-08-23 19:15:57 +02:00
|
|
|
# For ntohl, ntohs in Windows
|
|
|
|
AC_CHECK_HEADERS([winsock2.h])
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_SSIZE_T
|
|
|
|
AC_TYPE_UINT8_T
|
|
|
|
AC_TYPE_UINT16_T
|
|
|
|
AC_TYPE_UINT32_T
|
|
|
|
AC_TYPE_UINT64_T
|
|
|
|
AC_CHECK_TYPES([ptrdiff_t])
|
|
|
|
AC_C_BIGENDIAN
|
2013-01-10 16:17:43 +01:00
|
|
|
AC_SYS_LARGEFILE
|
2012-01-17 16:53:12 +01:00
|
|
|
|
|
|
|
# Checks for library functions.
|
2012-03-23 15:49:07 +01:00
|
|
|
if test "x$cross_compiling" != "xyes"; then
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
fi
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CHECK_FUNCS([ \
|
2012-07-31 19:06:27 +02:00
|
|
|
getpwnam \
|
2012-01-17 16:53:12 +01:00
|
|
|
memmove \
|
|
|
|
memset \
|
|
|
|
])
|
|
|
|
|
2012-02-09 18:06:46 +01:00
|
|
|
AX_HAVE_EPOLL([have_epoll=yes], [have_epoll=no])
|
|
|
|
if test "x${have_epoll}" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_EPOLL], [1], [Define to 1 if you have the `epoll`.])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL([HAVE_EPOLL], [ test "x${have_epoll}" = "xyes" ])
|
|
|
|
|
|
|
|
AC_CHECK_FUNCS([kqueue], [have_kqueue=yes])
|
|
|
|
AM_CONDITIONAL([HAVE_KQUEUE], [test "x${have_kqueue}" = "xyes"])
|
|
|
|
|
2012-08-22 14:27:56 +02:00
|
|
|
AC_LANG_PUSH(C++)
|
2012-07-27 15:11:13 +02:00
|
|
|
AC_MSG_CHECKING([whether struct kevent.udata is intptr_t])
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/event.h>
|
|
|
|
#include <sys/time.h>
|
|
|
|
]],
|
|
|
|
[[
|
|
|
|
struct kevent event;
|
2012-08-21 14:11:53 +02:00
|
|
|
event.udata = (intptr_t)(&event);
|
2012-07-27 15:11:13 +02:00
|
|
|
]])],
|
|
|
|
[kevent_udata_intptr_t=yes], [kevent_udata_intptr_t=no])
|
|
|
|
AC_MSG_RESULT([$kevent_udata_intptr_t])
|
|
|
|
if test "x$kevent_udata_intptr_t" = "xyes"; then
|
|
|
|
AC_DEFINE([KEVENT_UDATA_INTPTR_T], [1],
|
|
|
|
[Define to 1 if struct kevent.udata is intptr_t])
|
|
|
|
fi
|
2012-08-22 14:27:56 +02:00
|
|
|
AC_LANG_POP()
|
2012-07-27 15:11:13 +02:00
|
|
|
|
2012-08-23 19:15:57 +02:00
|
|
|
dnl Windows library for winsock2
|
|
|
|
case "${host}" in
|
|
|
|
*mingw*)
|
|
|
|
LIBS="$LIBS -lws2_32"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2012-06-11 16:08:18 +02:00
|
|
|
if test "x$maintainer_mode" != "xno"; then
|
|
|
|
CFLAGS="$CFLAGS -Wall -Wextra -Werror"
|
|
|
|
CFLAGS="$CFLAGS -Wmissing-prototypes -Wstrict-prototypes"
|
|
|
|
CFLAGS="$CFLAGS -Wmissing-declarations -Wpointer-arith"
|
|
|
|
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
|
|
|
|
CFLAGS="$CFLAGS -Wformat-security"
|
|
|
|
CFLAGS="$CFLAGS -Wwrite-strings -Wshadow -Winline -Wnested-externs"
|
|
|
|
CFLAGS="$CFLAGS -Wfloat-equal -Wundef -Wendif-labels -Wempty-body"
|
|
|
|
CFLAGS="$CFLAGS -Wcast-align -Wclobbered -Wvla"
|
|
|
|
CFLAGS="$CFLAGS -Wno-unused-parameter"
|
|
|
|
fi
|
|
|
|
|
2012-01-17 16:53:12 +01:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
Makefile
|
|
|
|
lib/Makefile
|
|
|
|
lib/libspdylay.pc
|
|
|
|
lib/includes/Makefile
|
|
|
|
lib/includes/spdylay/spdylayver.h
|
|
|
|
tests/Makefile
|
2012-04-25 15:27:50 +02:00
|
|
|
tests/testdata/Makefile
|
2012-09-10 14:39:51 +02:00
|
|
|
src/Makefile
|
2012-01-31 20:10:09 +01:00
|
|
|
examples/Makefile
|
2012-03-13 16:32:52 +01:00
|
|
|
doc/Makefile
|
|
|
|
doc/conf.py
|
2012-08-28 15:07:43 +02:00
|
|
|
python/Makefile
|
2012-01-17 16:53:12 +01:00
|
|
|
])
|
|
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
AC_MSG_NOTICE([summary of build options:
|
|
|
|
|
2012-05-27 16:52:48 +02:00
|
|
|
Version: ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
|
2012-01-17 16:53:12 +01:00
|
|
|
Host type: ${host}
|
|
|
|
Install prefix: ${prefix}
|
|
|
|
C compiler: ${CC}
|
2012-05-27 16:52:08 +02:00
|
|
|
CFLAGS: ${CFLAGS}
|
|
|
|
LDFLAGS: ${LDFLAGS}
|
|
|
|
LIBS: ${LIBS}
|
|
|
|
CPPFLAGS: ${CPPFLAGS}
|
|
|
|
C preprocessor: ${CPP}
|
|
|
|
C++ compiler: ${CXX}
|
|
|
|
CXXFLAGS: ${CXXFLAGS}
|
|
|
|
CXXCPP: ${CXXCPP}
|
2012-01-17 16:53:12 +01:00
|
|
|
Library types: Shared=${enable_shared}, Static=${enable_static}
|
|
|
|
CUnit: ${have_cunit}
|
2012-03-28 19:13:33 +02:00
|
|
|
OpenSSL: ${have_openssl}
|
2012-05-27 16:52:08 +02:00
|
|
|
Libxml2: ${have_libxml2}
|
2012-06-06 18:36:49 +02:00
|
|
|
Libevent(SSL): ${have_libevent_openssl}
|
2012-09-10 14:51:08 +02:00
|
|
|
Src: ${enable_src}
|
2012-03-28 19:13:33 +02:00
|
|
|
Examples: ${enable_examples}
|
2012-01-17 16:53:12 +01:00
|
|
|
])
|