2011-03-13 07:40:15 +00:00
|
|
|
dnl AC_PREREQ([2.67])
|
2009-12-14 01:44:50 +00:00
|
|
|
|
2012-02-24 09:09:45 +00:00
|
|
|
dnl Make sure you change the version information
|
|
|
|
dnl in include/qse/conf_*.h whenever you change the version
|
|
|
|
dnl here. Those files don't depend on autoconf, thus requiring
|
|
|
|
dnl manual change.
|
2012-12-28 08:39:41 +00:00
|
|
|
AC_INIT([qse],[0.6.0],[Chung, Hyung-Hwan (hyunghwan.chung@gmail.com)],[],[http://code.abiyo.net/@qse])
|
2012-02-24 09:09:45 +00:00
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
AC_CONFIG_HEADER([include/qse/config.h])
|
2011-01-22 02:04:22 +00:00
|
|
|
AC_CONFIG_AUX_DIR([ac])
|
2011-02-11 07:48:51 +00:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2008-07-19 20:59:08 +00:00
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl use CC and CPP for compilation tests with .c test programs.
|
2008-07-19 20:59:08 +00:00
|
|
|
AC_LANG(C)
|
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl initialize automake
|
2008-06-13 07:48:44 +00:00
|
|
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2013-02-09 13:31:31 +00:00
|
|
|
dnl enable silent rules if automake supports them.
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
|
|
|
|
dnl m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl determine a C compiler to use
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_PROG_CC
|
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl determine a C++ compiler to use
|
2008-07-19 08:56:50 +00:00
|
|
|
AC_PROG_CXX
|
2008-10-31 03:59:11 +00:00
|
|
|
|
2014-05-28 16:51:32 +00:00
|
|
|
dnl check if the C++ compiler exists in PATH
|
2008-07-20 01:29:52 +00:00
|
|
|
AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
|
|
|
|
|
2014-05-28 16:51:32 +00:00
|
|
|
dnl check if the C++ compiler supports namespace
|
|
|
|
AX_CXX_NAMESPACE_STD
|
|
|
|
|
2011-01-23 03:52:20 +00:00
|
|
|
dnl determine some key programs
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_EGREP
|
|
|
|
AC_PROG_LN_S
|
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl check other tools
|
2008-06-27 00:44:41 +00:00
|
|
|
AC_CHECK_TOOL(RM, rm)
|
2011-01-23 03:52:20 +00:00
|
|
|
AC_CHECK_TOOL(RMDIR, rmdir)
|
|
|
|
AC_CHECK_TOOL(TRUE, true)
|
2011-02-22 03:11:21 +00:00
|
|
|
AC_CHECK_TOOL(ECHO, echo)
|
2007-12-14 08:15:05 +00:00
|
|
|
|
2009-06-06 06:34:15 +00:00
|
|
|
dnl avoid "'/bin/rm: cannot remove `libtoolT': No such file or directory"
|
|
|
|
RM="$RM -f"
|
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl initialize libtool
|
2011-03-13 07:40:15 +00:00
|
|
|
LT_INIT
|
2008-12-27 02:52:47 +00:00
|
|
|
AC_SUBST(LIBTOOL_DEPS)
|
|
|
|
|
2012-10-23 17:08:56 +00:00
|
|
|
dnl 'recursive' type seems to have problems in setting LT_CONFIG_H
|
|
|
|
dnl so i use the classic 'subproject' type here
|
|
|
|
LT_CONFIG_LTDL_DIR([libltdl])
|
2013-02-22 08:56:34 +00:00
|
|
|
|
|
|
|
save_CFLAGS="$CFLAGS"
|
|
|
|
save_LDFLAGS="$LDFLAGS"
|
|
|
|
save_LIBS="$LIBS"
|
2012-10-23 17:08:56 +00:00
|
|
|
LTDL_INIT
|
2013-02-22 08:56:34 +00:00
|
|
|
LDFLAGS="$save_LDFLAGS"
|
|
|
|
CFLAGS="$save_CFLAGS"
|
|
|
|
LIBS="$save_LIBS"
|
2012-10-23 17:08:56 +00:00
|
|
|
|
2012-11-01 15:03:02 +00:00
|
|
|
dnl The lt_dladvise_init symbol was added with libtool-2.2
|
|
|
|
if test "x$with_included_ltdl" != "xyes"; then
|
|
|
|
save_CFLAGS="$CFLAGS"
|
|
|
|
save_LDFLAGS="$LDFLAGS"
|
2013-02-22 08:56:34 +00:00
|
|
|
save_LIBS="$LIBS"
|
2012-11-01 15:03:02 +00:00
|
|
|
CFLAGS="$CFLAGS $LTDLINCL"
|
|
|
|
LDFLAGS="$LDFLAGS $LIBLTDL"
|
|
|
|
AC_CHECK_LIB([ltdl], [lt_dladvise_init], [],
|
2012-11-05 09:49:54 +00:00
|
|
|
[AC_MSG_ERROR([installed libltdl is too old. install a newer libltdl or specify --with-included-ltdl])])
|
2012-11-01 15:03:02 +00:00
|
|
|
LDFLAGS="$save_LDFLAGS"
|
|
|
|
CFLAGS="$save_CFLAGS"
|
2013-02-22 08:56:34 +00:00
|
|
|
LIBS="$save_LIBS"
|
2012-11-01 15:03:02 +00:00
|
|
|
fi
|
|
|
|
|
2011-02-26 09:26:16 +00:00
|
|
|
dnl overrides the default CFLAGS setting
|
|
|
|
if test "$ac_test_CFLAGS" != "set"
|
|
|
|
then
|
|
|
|
if test "$GCC" = "yes"
|
|
|
|
then
|
|
|
|
CFLAGS="$CFLAGS -Wall"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$ac_test_CXXFLAGS" != "set"
|
|
|
|
then
|
|
|
|
if test "$GCC" = "yes"
|
|
|
|
then
|
|
|
|
CXXFLAGS="$CXXFLAGS -Wall"
|
|
|
|
fi
|
|
|
|
fi
|
2007-12-14 08:15:05 +00:00
|
|
|
|
2009-06-19 06:08:06 +00:00
|
|
|
dnl indicate the existence of config.h
|
|
|
|
CFLAGS="$CFLAGS -DQSE_HAVE_CONFIG_H"
|
|
|
|
CXXFLAGS="$CXXFLAGS -DQSE_HAVE_CONFIG_H"
|
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl make visible the 64-bit interface to the file system
|
2009-06-19 06:08:06 +00:00
|
|
|
CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
|
|
|
|
CXXFLAGS="$CXXFLAGS -D_LARGEFILE64_SOURCE"
|
2008-11-27 03:05:00 +00:00
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl define the WIN32 conditional if necessary
|
2008-12-27 02:52:47 +00:00
|
|
|
case "$host" in
|
|
|
|
*-*-mingw*|*-*-cygwin*)
|
|
|
|
#CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0400"
|
|
|
|
platform_win32=yes
|
2013-11-03 16:01:39 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
platform_win32=no
|
|
|
|
;;
|
2008-12-27 02:52:47 +00:00
|
|
|
esac
|
|
|
|
AM_CONDITIONAL(WIN32, test "${platform_win32}" = "yes" )
|
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl check the math library (check if -lm is needed)
|
2011-03-13 07:40:15 +00:00
|
|
|
LT_LIB_M
|
2008-07-20 01:29:52 +00:00
|
|
|
AC_SUBST(LIBM, $LIBM)
|
2008-06-22 08:08:38 +00:00
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl check header files.
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_HEADER_STDC
|
2012-09-11 16:19:52 +00:00
|
|
|
AC_CHECK_HEADERS([stddef.h wchar.h wctype.h errno.h signal.h fcntl.h dirent.h])
|
2012-10-11 13:39:52 +00:00
|
|
|
AC_CHECK_HEADERS([time.h sys/time.h utime.h spawn.h execinfo.h ucontext.h])
|
2013-01-02 03:00:20 +00:00
|
|
|
AC_CHECK_HEADERS([sys/resource.h sys/wait.h sys/syscall.h sys/ioctl.h])
|
|
|
|
AC_CHECK_HEADERS([sys/sendfile.h sys/epoll.h sys/event.h])
|
2014-08-25 16:18:17 +00:00
|
|
|
AC_CHECK_HEADERS([sys/sysctl.h sys/socket.h sys/sockio.h ifaddrs.h linux/netfilter_ipv4.h netinet/sctp.h])
|
2012-11-18 15:19:51 +00:00
|
|
|
AC_CHECK_HEADERS([net/if.h net/if_dl.h], [], [], [
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>])
|
2012-11-22 13:36:46 +00:00
|
|
|
AC_CHECK_HEADERS([sys/stropts.h sys/macstat.h linux/ethtool.h linux/sockios.h])
|
2013-11-03 16:01:39 +00:00
|
|
|
AC_CHECK_HEADERS([quadmath.h crt_externs.h sys/prctl.h uci.h])
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl check data types
|
2008-07-22 08:11:04 +00:00
|
|
|
AC_CHECK_TYPE([wchar_t],
|
2014-08-25 16:18:17 +00:00
|
|
|
[ AC_DEFINE([HAVE_WCHAR_T_IN_STDDEF_H],
|
|
|
|
[],[wchar_t is available in stddef.h]) ],
|
2008-07-22 08:11:04 +00:00
|
|
|
[],
|
|
|
|
[#include <stddef.h>])
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-10-14 09:04:24 +00:00
|
|
|
dnl check functions
|
2008-10-15 04:08:31 +00:00
|
|
|
AC_CHECK_FUNCS([uselocale])
|
|
|
|
AC_CHECK_FUNCS([mbrlen mbrtowc wcrtomb])
|
2008-10-18 05:43:20 +00:00
|
|
|
AC_CHECK_FUNCS([mbsnrtowcs mbsrtowcs wcsnrtombs wcsrtombs])
|
2011-08-22 23:26:26 +00:00
|
|
|
AC_CHECK_FUNCS([wctype iswctype wctrans towctrans])
|
|
|
|
AC_CHECK_FUNCS([isblank iswblank])
|
2014-09-25 15:27:08 +00:00
|
|
|
AC_CHECK_FUNCS([lseek64 stat64 fstat64 lstat64 ftruncate64 readdir64 dirfd])
|
2008-12-30 04:49:25 +00:00
|
|
|
AC_CHECK_FUNCS([timegm timelocal])
|
2009-06-09 07:09:01 +00:00
|
|
|
AC_CHECK_FUNCS([utime utimes])
|
2013-04-13 05:22:41 +00:00
|
|
|
AC_CHECK_FUNCS([sysconf prctl fdopendir setrlimit getrlimit])
|
2009-06-23 22:53:22 +00:00
|
|
|
AC_CHECK_FUNCS([backtrace backtrace_symbols])
|
2012-11-11 16:07:34 +00:00
|
|
|
AC_CHECK_FUNCS([fork vfork posix_spawn gettid nanosleep select])
|
2012-10-11 13:39:52 +00:00
|
|
|
AC_CHECK_FUNCS([makecontext swapcontext getcontext setcontext])
|
2013-02-22 05:01:33 +00:00
|
|
|
AC_CHECK_FUNCS([_vsnprintf _vsnwprintf])
|
2008-10-14 09:04:24 +00:00
|
|
|
|
2008-12-17 03:42:48 +00:00
|
|
|
OLDLIBS="$LIBS"
|
|
|
|
LIBS="$LIBM $LIBS"
|
2014-06-30 02:30:49 +00:00
|
|
|
AC_CHECK_FUNCS([powl fmodl sinl cosl tanl sinhl coshl tanhl asinl acosl atanl atan2l logl log10l expl sqrtl ceill floorl roundl])
|
|
|
|
AC_CHECK_FUNCS([pow fmod sin cos tan sinh cosh tanh asin acos atan atan2 log log10 exp sqrt ceil floor round])
|
|
|
|
AC_CHECK_FUNCS([powf fmodf sinf cosf tanf sinhf coshf tanhf asinf acosf atanf atan2f logf log10f expf sqrtf ceilf floorf roundf])
|
2008-12-17 03:42:48 +00:00
|
|
|
LIBS="$OLDLIBS"
|
|
|
|
|
2012-01-13 14:56:41 +00:00
|
|
|
dnl OLDLIBS="$LIBS"
|
|
|
|
dnl AC_SEARCH_LIBS([connect], [socket])
|
|
|
|
dnl LIBS="$OLDLIBS"
|
|
|
|
dnl if test "$ac_cv_search_connect" != "none required" -a "$ac_cv_search_connect" != "no"
|
|
|
|
dnl then
|
|
|
|
dnl SOCKET_LIBS="$SOCKET_LIBS -lsocket"
|
|
|
|
dnl fi
|
|
|
|
dnl AC_SUBST(SOCKET_LIBS)
|
|
|
|
AC_CHECK_FUNCS([connect gethostbyname])
|
|
|
|
if test "$ac_cv_func_gethostbyname" = "no"
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB([nsl], [gethostbyname], [
|
|
|
|
SOCKET_LIBS="$SOCKET_LIBS -lnsl"
|
|
|
|
AC_DEFINE(HAVE_GETHOSTBYNAME, 1)
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
if test "$ac_cv_func_connect" = "no"
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB([socket], [connect], [
|
|
|
|
SOCKET_LIBS="$SOCKET_LIBS -lsocket"
|
|
|
|
AC_DEFINE(HAVE_CONNECT, 1)
|
|
|
|
])
|
|
|
|
fi
|
2012-04-30 09:46:58 +00:00
|
|
|
if test "${platform_win32}" = "yes"
|
|
|
|
then
|
|
|
|
SOCKET_LIBS="$SOCKET_LIBS -lws2_32"
|
|
|
|
fi
|
2012-01-13 14:56:41 +00:00
|
|
|
AC_SUBST(SOCKET_LIBS)
|
|
|
|
|
2012-11-16 16:46:49 +00:00
|
|
|
OLDLIBS="$LIBS"
|
|
|
|
LIBS="$SOCKET_LIBS $LIBS"
|
|
|
|
AC_CHECK_FUNCS([if_nametoindex if_indextoname getifaddrs])
|
|
|
|
LIBS="$OLDLIBS"
|
|
|
|
|
2012-01-13 14:56:41 +00:00
|
|
|
dnl check if sendfile and its variants exist in the standard c library
|
|
|
|
dnl it inspects the existence of each missing function in the sendfile library.
|
|
|
|
AC_CHECK_FUNCS([sendfile sendfile64 sendfilev sendfilev64])
|
|
|
|
if test "$ac_cv_func_sendfile" = "no"
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB([sendfile], [sendfile], [
|
|
|
|
SENDFILE_LIBS="-lsendfile"
|
2012-09-05 22:37:55 +00:00
|
|
|
dnl only for consistency with AC_CHECK_FUNCS
|
2012-01-13 14:56:41 +00:00
|
|
|
AC_DEFINE(HAVE_SENDFILE, 1)
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
if test "$ac_cv_func_sendfile64" = "no"
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB([sendfile], [sendfile64], [
|
|
|
|
SENDFILE_LIBS="-lsendfile"
|
2012-09-05 22:37:55 +00:00
|
|
|
dnl only for consistency with AC_CHECK_FUNCS
|
2012-01-13 14:56:41 +00:00
|
|
|
AC_DEFINE(HAVE_SENDFILE64, 1)
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
if test "$ac_cv_func_sendfilev" = "no"
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB([sendfile], [sendfilev], [
|
|
|
|
SENDFILE_LIBS="-lsendfile"
|
2012-09-05 22:37:55 +00:00
|
|
|
dnl only for consistency with AC_CHECK_FUNCS
|
2012-01-13 14:56:41 +00:00
|
|
|
AC_DEFINE(HAVE_SENDFILEV, 1)
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
if test "$ac_cv_func_sendfilev64" = "no"
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB([sendfile], [sendfilev64], [
|
|
|
|
SENDFILE_LIBS="-lsendfile"
|
2012-09-05 22:37:55 +00:00
|
|
|
dnl only for consistency with AC_CHECK_FUNCS
|
2012-01-13 14:56:41 +00:00
|
|
|
AC_DEFINE(HAVE_SENDFILEV64, 1)
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
AC_SUBST(SENDFILE_LIBS)
|
|
|
|
|
2012-04-27 14:33:14 +00:00
|
|
|
AC_CHECK_FUNCS([epoll_create epoll_create1])
|
|
|
|
if test "$ac_cv_func_epoll_create" = "yes"
|
|
|
|
then
|
2012-09-05 13:46:11 +00:00
|
|
|
AC_DEFINE(HAVE_EPOLL, 1, [epoll support])
|
2012-04-27 14:33:14 +00:00
|
|
|
fi
|
|
|
|
|
2013-01-02 03:00:20 +00:00
|
|
|
AC_CHECK_FUNCS([kqueue kqueue1 kevent])
|
|
|
|
|
2012-02-19 14:38:22 +00:00
|
|
|
dnl check is the import library for unicows.dll exists
|
|
|
|
dnl this check doesn't look for a particular symbol
|
|
|
|
dnl but for the symbol 'main' since i want to check
|
|
|
|
dnl the existence of the libaray.
|
|
|
|
AC_CHECK_LIB([unicows], [main], [UNICOWS_LIBS="-lunicows"])
|
|
|
|
AC_SUBST(UNICOWS_LIBS)
|
|
|
|
|
2013-02-26 18:31:38 +00:00
|
|
|
AC_ARG_ENABLE([ssl], [AS_HELP_STRING([--enable-ssl],[build the library in the ssl mode (default. yes)])],
|
|
|
|
enable_ssl_is=$enableval,enable_ssl_is=yes)
|
|
|
|
if test "$enable_ssl_is" = "yes"
|
2012-09-05 13:46:11 +00:00
|
|
|
then
|
2013-02-26 18:31:38 +00:00
|
|
|
dnl check for an SSL library
|
|
|
|
AC_CHECK_FUNCS([SSL_library_init])
|
|
|
|
if test "$ac_cv_func_SSL_library_init" = "yes"
|
|
|
|
then
|
2012-09-05 13:46:11 +00:00
|
|
|
AC_DEFINE(HAVE_SSL, 1, [ssl support])
|
2013-02-26 18:31:38 +00:00
|
|
|
else
|
|
|
|
AC_CHECK_LIB([ssl], [SSL_library_init], [
|
|
|
|
SSL_LIBS="-lssl"
|
|
|
|
AC_DEFINE(HAVE_SSL, 1, [ssl support])
|
|
|
|
|
|
|
|
dnl additional check
|
|
|
|
AC_CHECK_LIB([crypto], [ERR_get_error], [
|
|
|
|
SSL_LIBS="${SSL_LIBS} -lcrypto"
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl only for consistency with AC_CHECK_FUNCS
|
|
|
|
AC_DEFINE(HAVE_SSL_LIBRARY_INIT, 1)
|
2013-01-17 14:13:48 +00:00
|
|
|
])
|
2013-02-26 18:31:38 +00:00
|
|
|
fi
|
2012-09-05 13:46:11 +00:00
|
|
|
fi
|
2012-09-05 10:40:58 +00:00
|
|
|
AC_SUBST(SSL_LIBS)
|
|
|
|
|
2012-10-23 17:08:56 +00:00
|
|
|
dnl MPI (optional)
|
2012-08-10 16:05:55 +00:00
|
|
|
LX_FIND_MPI(C)
|
|
|
|
AM_CONDITIONAL(HAVE_C_MPI, test "${have_C_mpi}" = "yes" )
|
|
|
|
dnl AM_CONDITIONAL(HAVE_CXX_MPI, test "${have_CXX_mpi}" = "yes" )
|
|
|
|
|
2012-10-23 17:08:56 +00:00
|
|
|
dnl libuci (optional)
|
|
|
|
AC_CHECK_LIB([uci], [uci_alloc_context], [UCI_LIBS="-luci"])
|
|
|
|
AC_SUBST(UCI_LIBS)
|
|
|
|
AM_CONDITIONAL(HAVE_LIBUCI, test "${ac_cv_lib_uci_uci_alloc_context}" = "yes" -a "${ac_cv_header_uci_h}" = "yes")
|
|
|
|
|
2011-10-19 22:29:28 +00:00
|
|
|
AC_STRUCT_DIRENT_D_TYPE
|
2014-09-25 15:27:08 +00:00
|
|
|
AC_CHECK_MEMBERS([DIR.d_fd, DIR.dd_fd],,,[[#include <dirent.h>]])
|
2011-10-28 01:05:19 +00:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_birthtime])
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec])
|
2012-11-11 16:07:34 +00:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec])
|
2011-10-28 01:05:19 +00:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec])
|
2012-11-11 16:07:34 +00:00
|
|
|
AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec])
|
2011-10-19 22:29:28 +00:00
|
|
|
|
2013-09-13 06:42:07 +00:00
|
|
|
|
2012-11-18 15:19:51 +00:00
|
|
|
AC_CHECK_MEMBERS([struct ifreq.ifr_ifindex, struct ifreq.ifr_mtu], [], [],
|
2012-11-16 16:46:49 +00:00
|
|
|
[#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#ifdef HAVE_NET_IF_H
|
|
|
|
#include <net/if.h>
|
|
|
|
#endif])
|
2012-11-18 15:19:51 +00:00
|
|
|
|
|
|
|
AC_CHECK_TYPES([struct lifconf, struct lifreq, struct if_laddrreq], [], [],
|
2012-11-16 16:46:49 +00:00
|
|
|
[#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#ifdef HAVE_NET_IF_H
|
|
|
|
#include <net/if.h>
|
|
|
|
#endif])
|
|
|
|
|
2013-09-13 06:42:07 +00:00
|
|
|
AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id], [], [],
|
|
|
|
[#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>])
|
|
|
|
|
2013-11-05 14:16:45 +00:00
|
|
|
AC_MSG_CHECKING([for va_copy])
|
2013-11-04 02:33:52 +00:00
|
|
|
AC_TRY_LINK(
|
|
|
|
[#include <stdarg.h>],
|
|
|
|
[
|
|
|
|
va_list x, y;
|
|
|
|
va_copy(x,y);
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([HAVE_VA_COPY], [1], [va_copy is available])
|
|
|
|
],
|
|
|
|
[AC_MSG_RESULT(no)]
|
|
|
|
)
|
|
|
|
|
2013-11-05 14:16:45 +00:00
|
|
|
AC_MSG_CHECKING([for __va_copy])
|
2013-11-04 02:33:52 +00:00
|
|
|
AC_TRY_LINK(
|
|
|
|
[#include <stdarg.h>],
|
|
|
|
[
|
|
|
|
va_list x, y;
|
|
|
|
__va_copy(x,y);
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE([HAVE___VA_COPY], [1], [__va_copy is available])
|
|
|
|
],
|
|
|
|
[AC_MSG_RESULT(no)]
|
|
|
|
)
|
|
|
|
|
2008-12-31 00:08:03 +00:00
|
|
|
dnl check the size of primitive data types
|
2011-10-03 01:25:23 +00:00
|
|
|
AC_CHECK_SIZEOF(char,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(short,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(int,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(long,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(long long,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int8,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int16,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int32,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int64,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int128,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int8_t,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int16_t,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int32_t,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int64_t,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(__int128_t,,[[]])
|
2008-07-21 21:49:09 +00:00
|
|
|
dnl AC_CHECK_SIZEOF doesn't work without white-space between void and *
|
2011-10-03 01:25:23 +00:00
|
|
|
AC_CHECK_SIZEOF(void *,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(float,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(double,,[[]])
|
|
|
|
AC_CHECK_SIZEOF(long double,,[[]])
|
2011-11-22 05:03:31 +00:00
|
|
|
AC_CHECK_SIZEOF(__float128,,[[]])
|
2011-10-03 01:25:23 +00:00
|
|
|
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_CHECK_SIZEOF(wchar_t)
|
2009-06-19 06:08:06 +00:00
|
|
|
AC_CHECK_SIZEOF(off_t)
|
|
|
|
AC_CHECK_SIZEOF(off64_t)
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2011-10-03 01:25:23 +00:00
|
|
|
AC_CHECK_SIZEOF(mbstate_t,,[#include <wchar.h>])
|
2011-08-22 23:26:26 +00:00
|
|
|
AX_CHECK_NUMVALOF(MB_LEN_MAX,[32],[#include <limits.h>])
|
|
|
|
|
2012-11-16 16:46:49 +00:00
|
|
|
if test "${platform_win32}" == "yes"
|
|
|
|
then
|
2014-08-25 16:18:17 +00:00
|
|
|
AC_CHECK_SIZEOF(struct sockaddr_in,,[
|
|
|
|
#include <winsock2.h>
|
|
|
|
#include <ws2tcpip.h>])
|
|
|
|
AC_CHECK_SIZEOF(struct sockaddr_in6,,[
|
|
|
|
#include <winsock2.h>
|
|
|
|
#include <ws2tcpip.h>])
|
|
|
|
AC_CHECK_SIZEOF(socklen_t,, [
|
|
|
|
#include <winsock2.h>
|
|
|
|
#include <ws2tcpip.h>])
|
|
|
|
|
|
|
|
if test ${ac_cv_sizeof_socklen_t} -gt 0
|
|
|
|
then
|
|
|
|
AX_CHECK_SIGN([socklen_t],
|
|
|
|
[ AC_DEFINE(QSE_SOCKLEN_T_IS_SIGNED, 1, [Define if socklen_t is signed]) ],
|
|
|
|
[ AS_ECHO_N("") ],
|
|
|
|
[#include <winsock2.h>
|
|
|
|
#include <ws2tcpip.h>])
|
|
|
|
fi
|
2012-11-16 16:46:49 +00:00
|
|
|
else
|
2014-08-25 16:18:17 +00:00
|
|
|
AC_CHECK_SIZEOF(struct sockaddr_in,,[
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>])
|
|
|
|
AC_CHECK_SIZEOF(struct sockaddr_in6,,[
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>])
|
|
|
|
AC_CHECK_SIZEOF(socklen_t,, [
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h>])
|
|
|
|
|
|
|
|
if test ${ac_cv_sizeof_socklen_t} -gt 0
|
|
|
|
then
|
|
|
|
AX_CHECK_SIGN([socklen_t],
|
|
|
|
[ AC_DEFINE(QSE_SOCKLEN_T_IS_SIGNED, 1, [Define if socklen_t is signed]) ],
|
|
|
|
[ AS_ECHO_N("") ],
|
|
|
|
[#include <sys/socket.h>])
|
|
|
|
fi
|
2012-11-16 16:46:49 +00:00
|
|
|
fi
|
|
|
|
|
2014-08-25 16:18:17 +00:00
|
|
|
|
2012-11-16 16:46:49 +00:00
|
|
|
dnl gcc 3.4.3 on opensolaris x86 gave this warning without -msse or
|
|
|
|
dnl something similar.
|
|
|
|
dnl SSE vector argument without SSE enabled changes the ABI
|
|
|
|
dnl it also ended with an internal compiler error while compiling
|
|
|
|
dnl some expressions like 'v % base' where v is of the __int128_t type.
|
|
|
|
dnl so i've added this check to determine if the compiler has
|
|
|
|
dnl proper support for __int128_t.
|
|
|
|
dnl
|
|
|
|
dnl Changing ac_cv_sizeof___int128_t here doesn't corret SIZEOF___INT128_T
|
|
|
|
dnl since it's already generated. It only affects QSE_SIZEOF___INT128_T below.
|
|
|
|
if test ${ac_cv_sizeof___int128_t} -gt 0
|
|
|
|
then
|
2013-01-17 14:13:48 +00:00
|
|
|
AC_MSG_CHECKING([__int128_t with %])
|
2012-11-16 16:46:49 +00:00
|
|
|
AC_COMPILE_IFELSE(
|
2013-01-17 14:13:48 +00:00
|
|
|
[AC_LANG_PROGRAM([], [
|
|
|
|
volatile __int128_t x, base;
|
|
|
|
x = (__int128_t)&base;
|
|
|
|
base = (__int128_t)&x;
|
|
|
|
x = x % base;
|
|
|
|
return (int)x;
|
|
|
|
])],
|
|
|
|
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
ac_cv_sizeof___int128_t=0
|
|
|
|
]
|
2012-11-16 16:46:49 +00:00
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2013-11-14 14:07:16 +00:00
|
|
|
dnl Some compilers doesn't seem to have full support for __float128
|
|
|
|
dnl even if the type is available.
|
|
|
|
if test ${ac_cv_sizeof___float128} -gt 0
|
|
|
|
then
|
|
|
|
AC_MSG_CHECKING([__float128 with linking])
|
|
|
|
AC_TRY_LINK(
|
|
|
|
[#include <stdio.h>],
|
|
|
|
[
|
|
|
|
__float128 x, y, z;
|
|
|
|
z = x * y + x;
|
|
|
|
printf ("%p", (char*)(int)z);
|
|
|
|
],
|
|
|
|
[AC_MSG_RESULT(yes)],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
ac_cv_sizeof___float128=0
|
|
|
|
]
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2014-07-24 16:22:06 +00:00
|
|
|
dnl Quadmath functions may not be in the default c library.
|
|
|
|
dnl Find a library containing them. Disable the float128 type
|
|
|
|
dnl if they are not available.
|
2013-11-26 13:47:58 +00:00
|
|
|
if test ${ac_cv_sizeof___float128} -gt 0
|
|
|
|
then
|
|
|
|
AC_CHECK_FUNCS([quadmath_snprintf])
|
|
|
|
if test "$ac_cv_func_quadmath_snprintf" = "no"
|
|
|
|
then
|
|
|
|
OLDLIBS="$LIBS"
|
|
|
|
LIBS="$LIBM $LIBS"
|
|
|
|
AC_CHECK_FUNCS([quadmath_snprintf])
|
|
|
|
LIBS="$OLDLIBS"
|
|
|
|
|
|
|
|
if test "$ac_cv_func_quadmath_snprintf" = "no"
|
|
|
|
then
|
2014-07-24 16:22:06 +00:00
|
|
|
dnl quadmath_snprintf not avalable in the
|
|
|
|
dnl standard math lib.
|
|
|
|
|
2013-11-26 13:47:58 +00:00
|
|
|
AC_CHECK_LIB([quadmath], [quadmath_snprintf], [
|
|
|
|
QUADMATH_LIBS="-lquadmath"
|
|
|
|
LIBM="$LIBM -lquadmath"
|
|
|
|
AC_DEFINE(HAVE_QUADMATH_SNPRINTF, 1)
|
|
|
|
])
|
2014-07-24 16:22:06 +00:00
|
|
|
|
|
|
|
if test "$ac_cv_lib_quadmath_quadmath_snprintf" = "no"
|
|
|
|
then
|
|
|
|
dnl quadmath_snprintf not avalable in the
|
|
|
|
dnl quadmath lib.
|
|
|
|
|
|
|
|
ac_cv_sizeof___float128=0
|
|
|
|
fi
|
|
|
|
|
2013-11-26 13:47:58 +00:00
|
|
|
else
|
|
|
|
QUADMATH_LIBS="$LIBM"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2014-07-24 16:22:06 +00:00
|
|
|
if test ${ac_cv_sizeof___float128} -gt 0
|
|
|
|
then
|
|
|
|
OLDLIBS="$LIBS"
|
|
|
|
LIBS="$LIBM $LIBS"
|
|
|
|
AC_CHECK_FUNCS([powq fmodq sinq cosq tanq sinhq coshq tanhq asinq acosq atanq atan2q logq log10q expq sqrtq ceilq floorq roundq])
|
|
|
|
AC_CHECK_FUNCS([strtoflt128])
|
|
|
|
LIBS="$OLDLIBS"
|
|
|
|
fi
|
2013-11-26 13:47:58 +00:00
|
|
|
fi
|
|
|
|
AC_SUBST(QUADMATH_LIBS)
|
|
|
|
|
2014-08-25 16:18:17 +00:00
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_CHAR, ${ac_cv_sizeof_char}, [sizeof(char)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_SHORT, ${ac_cv_sizeof_short}, [sizeof(short)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_INT, ${ac_cv_sizeof_int}, [sizeof(int)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_LONG, ${ac_cv_sizeof_long}, [sizeof(long)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_LONG_LONG, ${ac_cv_sizeof_long_long}, [sizeof(long long)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT8, ${ac_cv_sizeof___int8}, [sizeof(__int8)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT16, ${ac_cv_sizeof___int16}, [sizeof(__int16)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT32, ${ac_cv_sizeof___int32}, [sizeof(__int32)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT64, ${ac_cv_sizeof___int64}, [sizeof(__int64)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT128, ${ac_cv_sizeof___int128}, [sizeof(__int128)])
|
2011-02-05 09:39:15 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF___INT128_T, ${ac_cv_sizeof___int128_t}, [sizeof(__int128_t)])
|
2008-12-21 21:35:07 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_VOID_P, ${ac_cv_sizeof_void_p}, [sizeof(void*)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_FLOAT, ${ac_cv_sizeof_float}, [sizeof(float)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_DOUBLE, ${ac_cv_sizeof_double}, [sizeof(double)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_LONG_DOUBLE, ${ac_cv_sizeof_long_double}, [sizeof(long double)])
|
2011-11-22 05:03:31 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF___FLOAT128, ${ac_cv_sizeof___float128}, [sizeof(__float128)])
|
|
|
|
|
2008-12-21 21:35:07 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_WCHAR_T, ${ac_cv_sizeof_wchar_t}, [sizeof(wchar_t)])
|
2009-06-19 06:08:06 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_OFF_T, ${ac_cv_sizeof_off_t}, [sizeof(off_t)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_OFF64_T, ${ac_cv_sizeof_off64_t}, [sizeof(off64_t)])
|
2011-11-22 05:03:31 +00:00
|
|
|
|
2011-08-22 23:26:26 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_MBSTATE_T, ${ac_cv_sizeof_mbstate_t}, [sizeof(mbstate_t)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_MBLEN_MAX, ${ax_cv_numvalof_MB_LEN_MAX}, [MB_LEN_MAX])
|
2008-12-21 21:35:07 +00:00
|
|
|
|
2012-11-16 16:46:49 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_STRUCT_SOCKADDR_IN, ${ac_cv_sizeof_struct_sockaddr_in}, [sizeof(struct sockaddr_in)])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_STRUCT_SOCKADDR_IN6, ${ac_cv_sizeof_struct_sockaddr_in6}, [sizeof(struct sockaddr_in6)])
|
2014-08-25 16:18:17 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_SIZEOF_SOCKLEN_T, ${ac_cv_sizeof_socklen_t}, [sizeof(socklen_t)])
|
|
|
|
|
2012-11-16 16:46:49 +00:00
|
|
|
|
2012-08-22 02:53:15 +00:00
|
|
|
qse_package_version_major="`echo ${PACKAGE_VERSION} | cut -d. -f1`"
|
|
|
|
qse_package_version_minor="`echo ${PACKAGE_VERSION} | cut -d. -f2`"
|
|
|
|
qse_package_version_patch="`echo ${PACKAGE_VERSION} | cut -d. -f3`"
|
|
|
|
AC_SUBST(PACKAGE_VERSION_MAJOR, ${qse_package_version_major})
|
|
|
|
AC_SUBST(PACKAGE_VERSION_MINOR, ${qse_package_version_minor})
|
|
|
|
AC_SUBST(PACKAGE_VERSION_PATCH, ${qse_package_version_patch})
|
|
|
|
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION, "${PACKAGE_VERSION}", [Package version])
|
|
|
|
dnl AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_MAJOR, $(echo ${VERSION} | cut -d. -f1), [Major version number])
|
|
|
|
dnl AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_MINOR, $(echo ${VERSION} | cut -d. -f2), [Minor version number])
|
|
|
|
dnl AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_PATCH, $(echo ${VERSION} | cut -d. -f3), [Patch level])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_MAJOR, ${qse_package_version_major}, [Major version number])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_MINOR, ${qse_package_version_minor}, [Minor version number])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_PACKAGE_VERSION_PATCH, ${qse_package_version_patch}, [Patch level])
|
2011-01-23 04:32:11 +00:00
|
|
|
|
2011-08-22 23:26:26 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_PACKAGE_AUTHOR,"${PACKAGE_BUGREPORT}", [Author])
|
2011-01-23 04:32:11 +00:00
|
|
|
AC_DEFINE_UNQUOTED(QSE_PACKAGE_NAME,"${PACKAGE_NAME}", [package name])
|
|
|
|
AC_DEFINE_UNQUOTED(QSE_PACKAGE_URL, "${PACKAGE_URL}", [Project URL])
|
2008-06-23 01:32:26 +00:00
|
|
|
|
2008-07-22 08:11:04 +00:00
|
|
|
AC_C_BIGENDIAN(
|
2008-12-21 21:35:07 +00:00
|
|
|
[AC_DEFINE([QSE_ENDIAN_BIG],[],[Big Endian])],
|
|
|
|
[AC_DEFINE([QSE_ENDIAN_LITTLE],[],[Little Endian])],
|
|
|
|
[AC_DEFINE([QSE_ENDIAN_UNKNOWN],[],[Unknown Endian])])
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2008-12-10 00:52:03 +00:00
|
|
|
dnl define extra options
|
2013-01-12 16:46:12 +00:00
|
|
|
AC_ARG_ENABLE([wchar], [AS_HELP_STRING([--enable-wchar],[Use the wide character type as the default charater type when enabled (default. yes)])],
|
2007-05-02 01:07:00 +00:00
|
|
|
enable_wchar_is=$enableval,enable_wchar_is=yes)
|
2008-07-21 21:49:09 +00:00
|
|
|
test "${ac_cv_sizeof_wchar_t}" = "0" && enable_wchar_is=no
|
2008-11-27 03:05:00 +00:00
|
|
|
if test "${enable_wchar_is}" = "yes"
|
2007-05-02 01:07:00 +00:00
|
|
|
then
|
2013-01-12 16:46:12 +00:00
|
|
|
AC_DEFINE([QSE_CHAR_IS_WCHAR],[],[The default character type is the wide character type])
|
2009-06-03 08:13:50 +00:00
|
|
|
AC_SUBST(CHAR_MODE, "QSE_CHAR_IS_WCHAR")
|
2007-05-02 01:07:00 +00:00
|
|
|
else
|
2013-01-12 16:46:12 +00:00
|
|
|
AC_DEFINE([QSE_CHAR_IS_MCHAR],[],[The default character type is the multi-byte character type])
|
2009-06-03 08:13:50 +00:00
|
|
|
AC_SUBST(CHAR_MODE, "QSE_CHAR_IS_MCHAR")
|
2007-05-02 01:07:00 +00:00
|
|
|
fi
|
2012-12-06 13:02:46 +00:00
|
|
|
AM_CONDITIONAL(WCHAR, test "${enable_wchar_is}" = "yes")
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([bundled-unicode], [AS_HELP_STRING([--enable-bundled-unicode],[use thn bundled unicode routines (default. no)])],
|
|
|
|
enable_bundled_unicode_is=$enableval,enable_bundled_unicode_is=yes)
|
|
|
|
if test "${ac_cv_header_wctype_h}" = "no" -o "${ac_cv_func_wctrans}" = "no" -o "${ac_cv_func_wctype}" = "no"
|
|
|
|
then
|
2013-02-01 14:30:25 +00:00
|
|
|
dnl force bundled-unicode to yes if some wchar functions are not available
|
2012-12-06 13:02:46 +00:00
|
|
|
enable_bundled_unicode_is=yes
|
|
|
|
fi
|
2013-02-01 14:30:25 +00:00
|
|
|
if test "${enable_bundled_unicode_is}" = "yes"
|
|
|
|
then
|
|
|
|
AC_DEFINE([QSE_ENABLE_BUNDLED_UNICODE],[],[use the bundled unicode routines])
|
|
|
|
fi
|
2012-12-06 13:02:46 +00:00
|
|
|
AM_CONDITIONAL(ENABLE_BUNDLED_UNICODE, test "${enable_bundled_unicode_is}" = "yes")
|
2007-05-02 01:07:00 +00:00
|
|
|
|
2012-12-18 08:12:15 +00:00
|
|
|
AC_ARG_ENABLE([xcmgrs], [AS_HELP_STRING([--enable-xcmgrs],[include more built-in cmgrs like cp949 and cp950 when enabled (default. yes)])],
|
|
|
|
enable_xcmgrs_is=$enableval,enable_xcmgrs_is=yes)
|
|
|
|
if test "${enable_xcmgrs_is}" = "yes"
|
2012-09-05 22:37:55 +00:00
|
|
|
then
|
2012-12-18 08:12:15 +00:00
|
|
|
AC_DEFINE([QSE_ENABLE_XCMGRS],[],[include more built-in cmgrs like cp949 and cp950])
|
2012-09-05 22:37:55 +00:00
|
|
|
fi
|
2012-12-18 08:12:15 +00:00
|
|
|
AM_CONDITIONAL(ENABLE_XCMGRS, test "${enable_xcmgrs_is}" = "yes" )
|
2012-09-05 22:37:55 +00:00
|
|
|
|
2011-03-13 07:40:15 +00:00
|
|
|
AC_ARG_ENABLE([syscall], [AS_HELP_STRING([--enable-syscall],[use the syscall() function to call system calls (default. no)])],
|
2009-08-29 06:47:09 +00:00
|
|
|
enable_syscall_is=$enableval,enable_syscall_is=no)
|
2008-11-27 03:05:00 +00:00
|
|
|
if test "${enable_syscall_is}" = "yes"
|
|
|
|
then
|
2009-01-24 00:36:34 +00:00
|
|
|
AC_DEFINE([QSE_USE_SYSCALL],[],[use the syscall() function to invoke a system call])
|
2008-11-27 03:05:00 +00:00
|
|
|
fi
|
|
|
|
|
2011-03-13 07:40:15 +00:00
|
|
|
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],[build the library in the debug mode (default. no)])],
|
2007-05-02 01:07:00 +00:00
|
|
|
enable_debug_is=$enableval,enable_debug_is=no)
|
|
|
|
if test "$enable_debug_is" = "yes"
|
|
|
|
then
|
2012-10-15 09:36:39 +00:00
|
|
|
[CFLAGS="$CFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG -U_FORTIFY_SOURCE"]
|
|
|
|
[CXXFLAGS="$CXXFLAGS -g -D_DEBUG -UNDEBUG -DQSE_BUILD_DEBUG -U_FORTIFY_SOURCE"]
|
2008-07-20 01:29:52 +00:00
|
|
|
AC_SUBST(BUILD_MODE, "debug")
|
2007-05-02 01:07:00 +00:00
|
|
|
else
|
2012-10-15 09:36:39 +00:00
|
|
|
[CFLAGS="$CFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE -U_FORTIFY_SOURCE"]
|
|
|
|
[CXXFLAGS="$CXXFLAGS -DNDEBUG -U_DEBUG -DQSE_BUILD_RELEASE -U_FORTIFY_SOURCE"]
|
2008-07-20 01:29:52 +00:00
|
|
|
AC_SUBST(BUILD_MODE, "release")
|
2007-05-02 01:07:00 +00:00
|
|
|
fi
|
|
|
|
|
2014-05-28 16:51:32 +00:00
|
|
|
AC_ARG_ENABLE([cxx],
|
|
|
|
[AS_HELP_STRING([--enable-cxx],[build the library for C++ if a C++ compiler is available (default. yes)])],
|
|
|
|
enable_cxx_is=$enableval,
|
|
|
|
enable_cxx_is=yes
|
|
|
|
)
|
|
|
|
|
|
|
|
dnl disable c++ if no c++ compiler was found
|
2014-06-08 14:11:12 +00:00
|
|
|
test "${HAVE_CXX}" = "yes" || enable_cxx_is="no"
|
2014-05-28 16:51:32 +00:00
|
|
|
dnl disable c++ if the compiler is too old.
|
2014-06-08 14:11:12 +00:00
|
|
|
test "${ax_cv_cxx_have_std_namespace}" = "yes" || enable_cxx_is="no"
|
2014-05-28 16:51:32 +00:00
|
|
|
|
2008-07-20 01:29:52 +00:00
|
|
|
AM_CONDITIONAL(ENABLE_CXX, test "${enable_cxx_is}" = "yes" )
|
|
|
|
|
2013-03-13 15:51:44 +00:00
|
|
|
AX_PTHREAD()
|
|
|
|
AC_ARG_ENABLE([reentrant], [AS_HELP_STRING([--enable-reentrant],[add thread options (default. no)])],
|
|
|
|
enable_reentrant_is=$enableval,enable_reentrant_is=no)
|
2007-05-02 01:07:00 +00:00
|
|
|
if test "$enable_reentrant_is" = "yes"
|
|
|
|
then
|
2011-08-14 01:05:45 +00:00
|
|
|
[CFLAGS="$CFLAGS $PTHREAD_CFLAGS"]
|
|
|
|
[CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"]
|
2007-05-02 01:07:00 +00:00
|
|
|
fi
|
|
|
|
|
2013-11-05 14:16:45 +00:00
|
|
|
AC_ARG_ENABLE([awk-intmax],
|
|
|
|
[AS_HELP_STRING([--enable-awk-intmax],[use qse_intmax_t for integers in AWK (default. no)])],
|
|
|
|
enable_awk_intmax_is=$enableval,
|
|
|
|
enable_awk_intmax_is=no
|
|
|
|
)
|
|
|
|
if test "${enable_awk_intmax_is}" = "yes"
|
|
|
|
then
|
|
|
|
AC_DEFINE([QSE_USE_AWK_INTMAX],[],[use qse_intmax_t for integers in AWK])
|
|
|
|
fi
|
|
|
|
|
2013-11-05 02:53:01 +00:00
|
|
|
AC_ARG_ENABLE([awk-fltmax],
|
|
|
|
[AS_HELP_STRING([--enable-awk-fltmax],[use qse_fltmax_t for floating-point numbers in AWK (default. no)])],
|
|
|
|
enable_awk_fltmax_is=$enableval,
|
|
|
|
enable_awk_fltmax_is=no
|
|
|
|
)
|
|
|
|
if test "${enable_awk_fltmax_is}" = "yes"
|
|
|
|
then
|
|
|
|
AC_DEFINE([QSE_USE_AWK_FLTMAX],[],[use qse_fltmax_t for floating-point numbers in AWK])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([sed-tracer],
|
|
|
|
[AS_HELP_STRING([--enable-sed-tracer],[enable qse_sed_setexectracer() (default. yes)])],
|
|
|
|
enable_sed_tracer_is=$enableval,
|
|
|
|
enable_sed_tracer_is=yes
|
|
|
|
)
|
|
|
|
if test "${enable_sed_tracer_is}" = "yes"
|
2011-10-07 23:09:48 +00:00
|
|
|
then
|
2013-11-05 02:53:01 +00:00
|
|
|
AC_DEFINE([QSE_ENABLE_SED_TRACER],[],[enable qse_sed_setexectracer()])
|
2011-10-07 23:09:48 +00:00
|
|
|
fi
|
|
|
|
|
2013-02-01 14:30:25 +00:00
|
|
|
if test "${enable_shared}" = "no" -a "${enable_static}" = "yes"
|
|
|
|
then
|
|
|
|
AC_DEFINE([QSE_ENABLE_STATIC_MODULE],[],[link modules statically into the main library])
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(ENABLE_STATIC_MODULE, test "${enable_shared}" = "no" -a "${enable_static}" = "yes")
|
|
|
|
|
2009-06-02 20:16:27 +00:00
|
|
|
AC_SUBST(QSE_SIZEOF_WCHAR_T, $ac_cv_sizeof_wchar_t)
|
|
|
|
AC_SUBST(QSE_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
|
|
|
|
AC_SUBST(QSE_SIZEOF_LONG, $ac_cv_sizeof_long)
|
|
|
|
AC_SUBST(QSE_SIZEOF_INT, $ac_cv_sizeof_int)
|
|
|
|
AC_SUBST(QSE_SIZEOF_SHORT, $ac_cv_sizeof_short)
|
|
|
|
AC_SUBST(QSE_SIZEOF_CHAR, $ac_cv_sizeof_char)
|
|
|
|
AC_SUBST(QSE_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
|
|
|
|
AC_SUBST(QSE_SIZEOF_FLOAT, $ac_cv_sizeof_float)
|
|
|
|
AC_SUBST(QSE_SIZEOF_DOUBLE, $ac_cv_sizeof_double)
|
|
|
|
AC_SUBST(QSE_SIZEOF_LONG_DOUBLE, $ac_cv_sizeof_long_double)
|
2013-01-12 16:46:12 +00:00
|
|
|
AC_SUBST(QSE_SIZEOF_OFF_T, $ac_cv_sizeof_off_t)
|
|
|
|
AC_SUBST(QSE_SIZEOF_OFF64_T, $ac_cv_sizeof_off64_t)
|
2009-06-02 20:16:27 +00:00
|
|
|
|
2009-12-14 01:44:50 +00:00
|
|
|
AC_SUBST(QSE_PROJECT_AUTHOR, "${PACKAGE_BUGREPORT}")
|
|
|
|
AC_SUBST(QSE_PROJECT_URL, "${PACKAGE_URL}")
|
|
|
|
|
2008-06-15 02:15:37 +00:00
|
|
|
AC_CONFIG_FILES([
|
2008-12-25 08:16:17 +00:00
|
|
|
Makefile
|
2009-12-14 01:44:50 +00:00
|
|
|
README
|
2008-12-25 08:16:17 +00:00
|
|
|
include/Makefile
|
|
|
|
include/qse/Makefile
|
|
|
|
include/qse/cmn/Makefile
|
|
|
|
include/qse/awk/Makefile
|
2009-12-23 06:56:01 +00:00
|
|
|
include/qse/sed/Makefile
|
2013-02-05 15:04:15 +00:00
|
|
|
include/qse/xli/Makefile
|
2013-02-18 13:45:50 +00:00
|
|
|
include/qse/http/Makefile
|
2008-12-25 08:16:17 +00:00
|
|
|
lib/Makefile
|
|
|
|
lib/cmn/Makefile
|
|
|
|
lib/awk/Makefile
|
2009-12-23 06:56:01 +00:00
|
|
|
lib/sed/Makefile
|
2013-02-05 15:04:15 +00:00
|
|
|
lib/xli/Makefile
|
2013-02-18 13:45:50 +00:00
|
|
|
lib/http/Makefile
|
2008-12-25 08:16:17 +00:00
|
|
|
cmd/Makefile
|
|
|
|
cmd/awk/Makefile
|
2010-08-25 21:28:40 +00:00
|
|
|
cmd/sed/Makefile
|
2013-02-06 14:31:32 +00:00
|
|
|
cmd/xli/Makefile
|
2013-02-18 13:45:50 +00:00
|
|
|
cmd/http/Makefile
|
2009-06-25 02:29:33 +00:00
|
|
|
samples/Makefile
|
|
|
|
samples/cmn/Makefile
|
|
|
|
samples/awk/Makefile
|
2009-12-23 06:56:01 +00:00
|
|
|
samples/sed/Makefile
|
2013-02-18 13:45:50 +00:00
|
|
|
samples/http/Makefile
|
2009-07-02 19:26:57 +00:00
|
|
|
regress/Makefile
|
|
|
|
regress/awk/Makefile
|
2011-08-15 03:07:31 +00:00
|
|
|
regress/awk/regress.sh
|
2009-12-23 06:56:01 +00:00
|
|
|
regress/sed/Makefile
|
2011-08-15 03:07:31 +00:00
|
|
|
regress/sed/regress.sh
|
2009-05-29 00:34:58 +00:00
|
|
|
doc/Makefile
|
|
|
|
doc/Doxyfile
|
2012-02-24 09:09:45 +00:00
|
|
|
tools/Makefile
|
2008-12-30 04:49:25 +00:00
|
|
|
])
|
2007-05-02 01:07:00 +00:00
|
|
|
AC_OUTPUT
|
2008-07-19 08:42:02 +00:00
|
|
|
|
|
|
|
[
|
|
|
|
echo
|
|
|
|
echo "-[SUMMARY]---------------------------------------------------------------"
|
|
|
|
echo "Configured for ${host}"
|
2008-07-20 01:29:52 +00:00
|
|
|
echo " Build mode : ${BUILD_MODE}"
|
2008-12-27 02:52:47 +00:00
|
|
|
echo " Source directory: ${srcdir}"
|
2008-07-19 08:42:02 +00:00
|
|
|
echo " Installation directory: ${prefix}"
|
|
|
|
echo " C compiler: ${CC} ${CFLAGS}"
|
|
|
|
echo " C++ compiler: ${CXX} ${CXXFLAGS}"
|
2008-07-20 01:29:52 +00:00
|
|
|
echo " C++ support: ${enable_cxx_is}"
|
2008-07-21 07:03:27 +00:00
|
|
|
echo " Wide character: ${enable_wchar_is}"
|
2008-07-20 01:29:52 +00:00
|
|
|
echo " Math library: ${LIBM}"
|
2011-08-14 01:05:45 +00:00
|
|
|
echo " Pthread library: ${PTHREAD_LIBS}"
|
|
|
|
echo " Socket library: ${SOCKET_LIBS}"
|
2012-01-10 15:05:40 +00:00
|
|
|
echo " Sendfile library: ${SENDFILE_LIBS}"
|
2012-09-05 10:40:58 +00:00
|
|
|
echo " SSL library: ${SSL_LIBS}"
|
2008-07-19 08:42:02 +00:00
|
|
|
echo "-------------------------------------------------------------------------"
|
|
|
|
]
|