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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
|
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(libsylph/account.c)
PACKAGE=libsylph
dnl version number
MAJOR_VERSION=1
MINOR_VERSION=1
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=
BUILD_REVISION=0
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
AC_CANONICAL_SYSTEM
dnl
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
dnl AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
dnl AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(BUILD_REVISION)
dnl libtool versioning
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
LT_CURRENT=2
LT_REVISION=0
LT_AGE=1
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
dnl Specify a header configuration file
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
dnl Checks for programs.
dnl AC_ARG_PROGRAM
AC_PROG_CC
AC_ISC_POSIX
AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_CPP
dnl AC_PROG_RANLIB
AM_PROG_LEX
AC_PROG_YACC
AM_PROG_LIBTOOL
AC_CHECK_PROG(WINDRES, windres, windres)
AM_CONDITIONAL(HAVE_WINDRES, test x"$WINDRES" != x)
SYLPHEED_ACLOCAL_INCLUDE(ac)
native_win32=no
case "$target" in
*-darwin*)
CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
;;
*-*-mingw*)
native_win32=yes
CFLAGS="$CFLAGS -mms-bitfields -mwindows"
LIBS="$LIBS -lws2_32"
;;
esac
AM_CONDITIONAL(OS_WIN32, [test "$native_win32" = "yes"])
dnl Checks for libraries.
AM_PATH_GLIB_2_0(2.4.0,, AC_MSG_ERROR(Test for GLib failed. See the 'INSTALL' for help.))
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
dnl checks for iconv
AM_ICONV
AC_CHECK_FUNCS(bind_textdomain_codeset)
dnl for gettext
ALL_LINGUAS="bg cs da de el es et fr gl hr hu it ja ko lt nl pl pt_BR ro ru sk sl sr sv tr uk vi zh_CN zh_TW"
GETTEXT_PACKAGE=libsylph
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define text domain.])
AM_GLIB_GNU_GETTEXT
dnl AM_GNU_GETTEXT
dnl AC_CHECK_FUNC(gettext, AC_CHECK_LIB(intl, gettext))
if test "x$DATADIRNAME" != "x"; then
localedir='${prefix}/${DATADIRNAME}/locale'
else
localedir='${datadir}/locale'
fi
AC_ARG_WITH(localedir,
[ --with-localedir=DIR Locale directory],
[localedir="$withval"])
AC_SUBST(localedir)
dnl Check for OpenSSL
AC_ARG_ENABLE(ssl,
[ --disable-ssl Disable SSL support using OpenSSL],
[ac_cv_enable_ssl=$enableval], [ac_cv_enable_ssl=yes])
AC_MSG_CHECKING([whether to use OpenSSL])
if test $ac_cv_enable_ssl = yes; then
AC_MSG_RESULT(yes)
dnl First check with pkg-config
PKG_CHECK_MODULES(OPENSSL, openssl, [:], [:])
if test "x$OPENSSL_LIBS" != "x"; then
CFLAGS="$CFLAGS $OPENSSL_CFLAGS"
LIBS="$LIBS $OPENSSL_LIBS"
AC_MSG_CHECKING([if openssl is available])
AC_MSG_RESULT(yes)
AC_DEFINE(USE_SSL, 1, Define if you use OpenSSL to support SSL.)
else
dnl If pkg-config fails, run compile/link test.
AC_MSG_CHECKING([if openssl is available])
ac_save_LIBS="$LIBS"
if test "$native_win32" = yes; then
LIBS="$LIBS -lssl32 -leay32"
else
LIBS="$LIBS -lssl -lcrypto"
fi
AC_TRY_LINK([
#include <openssl/opensslv.h>
], [ return OPENSSL_VERSION_NUMBER; ],
[ AC_MSG_RESULT(yes)
AC_DEFINE(USE_SSL, 1, Define if you use OpenSSL to support SSL.) ],
[ AC_MSG_RESULT(no)
LIBS="$ac_save_LIBS"
ac_cv_enable_ssl=no ])
fi
else
AC_MSG_RESULT(no)
fi
dnl Check for Oniguruma support in message filtering
AC_ARG_ENABLE(oniguruma,
[ --enable-oniguruma Use Oniguruma instead of system's regex [[default=no]]],
[ac_cv_enable_oniguruma=$enableval], [ac_cv_enable_oniguruma=no])
AC_MSG_CHECKING([whether to use Oniguruma])
if test "$ac_cv_enable_oniguruma" = yes; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING([whether Oniguruma is available])
if `pkg-config --exists oniguruma`; then
AC_MSG_RESULT(yes)
CFLAGS="$CFLAGS `pkg-config --cflags oniguruma`"
LIBS="$LIBS `pkg-config --libs oniguruma`"
AC_DEFINE(USE_ONIGURUMA, 1, Define if you want to use Oniguruma.)
else
AC_MSG_RESULT(no)
ac_cv_enable_oniguruma=no
fi
else
AC_MSG_RESULT(no)
fi
dnl for GThread support (currently disabled)
dnl AC_ARG_ENABLE(threads,
dnl [ --enable-threads Enable multithread support [[default=no]]],
dnl [use_threads=$enableval], [use_threads=no])
AC_MSG_CHECKING([whether to use threads])
if test x"$use_threads" = xyes ; then
AC_MSG_RESULT(yes)
if test ! -z `$PKG_CONFIG --help 2>&1 |grep 'gthread-2.0'` ; then
CFLAGS="$CFLAGS `$PKG_CONFIG --cflags gthread-2.0`"
LIBS="$LIBS `$PKG_CONFIG --libs gthread-2.0`"
AC_DEFINE(USE_THREADS, 1, Whether to use multithread or not)
else
AC_MSG_ERROR([LibSylph requires GThread from GLib to use threading.])
fi
else
AC_MSG_RESULT(no)
fi
dnl check for IPv6 option
AC_ARG_ENABLE(ipv6,
[ --disable-ipv6 Disable IPv6 support],
[ac_cv_enable_ipv6=$enableval], [ac_cv_enable_ipv6=yes])
dnl automated checks for IPv6 support.
AC_MSG_CHECKING([whether to use IPv6])
if test x"$ac_cv_enable_ipv6" = xyes; then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING([for IPv6 support])
if test "$native_win32" = yes; then
AC_CACHE_VAL(ac_cv_ipv6,[
AC_TRY_COMPILE([#define INET6
#include <sys/types.h>
#include <winsock2.h>
#include <ws2tcpip.h>],
[int x = IPPROTO_IPV6; struct in6_addr a;],
ac_cv_ipv6=yes, ac_cv_ipv6=no)
])
else
AC_CACHE_VAL(ac_cv_ipv6,[
AC_TRY_COMPILE([#define INET6
#include <sys/types.h>
#include <netinet/in.h>],
[int x = IPPROTO_IPV6; struct in6_addr a;],
ac_cv_ipv6=yes, ac_cv_ipv6=no)
])
fi
AC_MSG_RESULT($ac_cv_ipv6)
if test $ac_cv_ipv6 = yes; then
AC_DEFINE(INET6, 1, Define if you want IPv6 support.)
else
AC_MSG_WARN(*** IPv6 will not be supported ***)
ac_cv_enable_ipv6=no
fi
else
AC_MSG_RESULT(no)
fi
dnl Check for d_type member in struct dirent
AC_MSG_CHECKING([whether struct dirent has d_type member])
AC_CACHE_VAL(ac_cv_dirent_d_type,[
AC_TRY_COMPILE([#include <dirent.h>],
[struct dirent d; d.d_type = DT_REG;],
ac_cv_dirent_d_type=yes, ac_cv_dirent_d_type=no)
])
AC_MSG_RESULT($ac_cv_dirent_d_type)
if test $ac_cv_dirent_d_type = yes; then
AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
Define if `struct dirent' has `d_type' member.)
fi
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/file.h unistd.h paths.h \
sys/param.h sys/utsname.h sys/select.h \
netdb.h regex.h sys/mman.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_SIZEOF(unsigned short, 2)
AC_CHECK_SIZEOF(unsigned int, 4)
AC_CHECK_SIZEOF(unsigned long, 4)
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(gethostname mkdir mktime socket strstr strchr \
uname flock lockf inet_aton inet_addr \
fchmod truncate getuid regcomp mlock)
AC_OUTPUT([
Makefile
ac/Makefile
doc/Makefile
libsylph/Makefile
po/Makefile.in
])
dnl Output the configuration summary
echo ""
echo "$PACKAGE $VERSION"
echo ""
echo "OpenSSL : $ac_cv_enable_ssl"
echo "iconv : $am_cv_func_iconv"
echo "IPv6 : $ac_cv_enable_ipv6"
echo "Oniguruma : $ac_cv_enable_oniguruma"
echo ""
echo "The binary will be installed in $prefix/lib"
echo ""
echo "Configure finished, type 'make' to build."
|