# Process this file with autoconf to produce a configure script. AC_INIT PACKAGENAME=cxx MAJOR=0 MINOR=95 SUPPORT=0 # AM_INIT_AUTOMAKE(@PACKAGENAME@, @address@hidden@MINOR@) # project settings AC_LANG(C++) # set flags CPPFLAGS="${CPPFLAGS} -D_XOPEN_SOURCE_EXTENDED" # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET #AC_PROG_AWK AC_PROG_LIBTOOL AM_PROG_LEX # Checks for libraries. AC_SEARCH_LIBS(socket, socket) AC_SEARCH_LIBS(gethostbyname_r, nsl) AC_SEARCH_LIBS(sched_get_priority_max, rt) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADER(FlexLexer.h, , [AC_MSG_ERROR([header FlexLexer.h not found *** you need to install flex or to specify a path to a FlexLexer.h, *** i.e. export CPPFLAGS=-I/opt/local/share/include *** or setenv CPPFLAGS -I/opt/local/share/include])]) AC_CHECK_HEADERS([arpa/inet.h errno.h fcntl.h netdb.h netinet/in.h nl_types.h \ stdlib.h string.h strings.h sys/ioctl.h sys/socket.h \ syslog.h unistd.h sys/time.h pthread.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_PID_T AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM # Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_FUNC_MALLOC AC_FUNC_STRFTIME AC_CHECK_FUNCS([getcwd gethostbyaddr gethostbyname gethostname gettimeofday \ inet_ntoa localtime_r putenv select socket strerror]) # Options and Dependencies AC_TRY_COMPILE([#define _REENTRANT #include], [qpthr::QpInit::QpInit init()], [have_threads="yes"], [have_threads="no"]) AC_CHECK_PROG(have_gencat, gencat, yes, no) AC_CHECK_PROG(have_m4, m4, yes, no) AC_CHECK_PROG(have_flex, flex, yes, no) AC_CHECK_PROG(have_sed, sed, yes, no) AC_CHECK_PROG(have_doxygen, doxygen, yes, no) AC_CHECK_PROG(have_dia, dia, yes, no) AC_CHECK_PROG(have_convert, convert, yes, no) AC_CHECK_PROG(have_dot, dot, yes, no) # Arguments AM_MAINTAINER_MODE AC_ARG_ENABLE(threads, [ --disable-threads disable multithread support], [have_threads="$enableval"]) if [[ "$have_threads" = "yes" ]]; then CPPFLAGS="${CPPFLAGS} -D_REENTRANT" LDFLAGS="${LDFLAGS} -lqpthr" DOXYMACROS="_REENTRANT" AC_SEARCH_LIBS(pthread_create, pthread) fi AC_ARG_ENABLE(dot, [ --disable-dot disable dot graphic tools for documentation], [have_dot="$enableval"]) test "$enableval" = "yes" && HAVE_DOT="YES" || HAVE_DOT="NO"; # export variables AC_SUBST(DOXYMACROS) AC_SUBST(HAVE_DOT) AC_SUBST(MAJOR) AC_SUBST(MINOR) AC_SUBST(SUPPORT) AC_SUBST(PACKAGENAME) # create output AC_CONFIG_FILES([makefile src/makefile test/makefile doxyfile]) AC_OUTPUT # warnings and infos if test "$have_gencat" = "no"; then AC_MSG_WARN([Missing program gencat! - you cannot run the tests with command make check - needed for creating your own message catalogs in traceing]); fi if test "$have_m4" = "no"; then AC_MSG_WARN([Missing program m4! - you cannot rebuild after command make distclean - there are precompiled derieved files in the distribution]); fi if test "$have_flex" = "no"; then AC_MSG_WARN([Missing program flex! - you cannot rebuild after command make distclean - there are precompiled derieved files in the distribution]); fi if test "$have_sed" = "no"; then AC_MSG_WARN([Missing program sed! - you cannot rebuild after command make distclean - there are precompiled derieved files in the distribution]); fi if test "$have_doxygen" = "no"; then AC_MSG_WARN([Missing program doxygen! - you cannot rebuild the documentation with make doc - there are precompiled derieved files in the distribution]); fi if test "$have_dia" = "no"; then AC_MSG_WARN([Missing program dia! - you cannot rebuild the documentation with make doc - there are precompiled derieved files in the distribution]); fi if test "$have_convert" = "no"; then AC_MSG_WARN([Missing program convert! - you cannot rebuild the documentation with make doc - there are precompiled derieved files in the distribution]); fi if test "$have_dot" = "no"; then AC_MSG_WARN([Missing program dot! - when you rebild documentation with make doc, there are no generated images - there are precompiled derieved files in the distribution]); fi if test "$have_threads" = "no"; then AC_MSG_WARN([Thread support has been disabled! - please note that some features, such as utl::Timer won't be supported - please note that the libraries won't be thread safe - to enable thread support you need QpThread library, at lease 1.3.1 - QpThread is required with namespaces enabled - please set CXXFLAGS and LDFLAGS environment variables so, that the library can be found (details see INSTALL and README) e.g.: CXXFLAGS=-I/home/qp/include LDFLAGS=-L/home/qp/lib ./configure]); fi AC_MSG_NOTICE([Results from optional features: - thread support: $have_threads - dot grafic tools: $have_dot (for building documentation) For details, please see the file README])