dnl Process this file with autoconf to produce a configure script dnl Initialization AC_PREREQ(2.50) AC_INIT(rpc2, 2.5) AC_CONFIG_SRCDIR(rpc2-src/rpc2.private.h) AM_INIT_AUTOMAKE AC_CONFIG_HEADERS(config.h) dnl For library version updates, follow these steps in order. dnl - when any library source has changed, increment first dnl - when interfaces were added/removed changed, increment second and set dnl first to 0 dnl - if any interfaces were added, increment third dnl - if any interfaces were removed, set third to 0 CODA_LIBRARY_VERSION(3, 8, 4) CONFIG_DATE=`date +"%a, %d %b %Y %T %z"` AC_SUBST(CONFIG_DATE, "$CONFIG_DATE", [Date when configure was last run]) CODA_OPTION_LWP dnl Checks for programs. AC_PROG_CC CODA_PROG_NATIVECC AC_PROG_CPP AC_CHECK_PROG(AR, ar, ar) export AR AM_PROG_LEX AC_PROG_YACC AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_CHECK_PROG(CP, cp, cp) AC_CHECK_PROG(PERL, perl, perl) dnl pkg-config stuff PKG_PROG_PKG_CONFIG([0.18.0]) AC_ARG_WITH(lua, [ --with-lua embed Lua interpreter], [ PKG_CHECK_EXISTS([lua5.1], [ PKG_CHECK_MODULES([LUA], [lua5.1]) ], [ PKG_CHECK_MODULES([LUA], [lua]) ]) AC_DEFINE(USE_LUA, 1, [Define this when linking against Lua]) include_lua=true ], [ include_lua=false ]) AM_CONDITIONAL(LUA, test x$include_lua = xtrue) dnl Checks for libraries. CODA_FIND_LIB(lwp, [#include ], [LWP_Init(0,0,0)]) CODA_CHECK_LIBTERMCAP CODA_CHECK_READLINE AC_SEARCH_LIBS(bind, socket) AC_SEARCH_LIBS(inet_ntoa, nsl) AC_SEARCH_LIBS(gethostbyname, resolv) dnl For playing with the _pt version... if test ${with_LWP_PT}p = nop ; then AC_CHECK_LIB(lwp, LWP_Init, [LIBLWP="-llwp"], [AC_MSG_ERROR("Could not locate liblwp")]) else AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"]) AC_CHECK_LIB(lwp_pt, LWP_Init, [LIBLWP="-llwp_pt"], [AC_MSG_ERROR("Failed to locate liblwp_pt")], [${LIBPTHREAD}]) CPPFLAGS="-D_REENTRANT ${CPPFLAGS}" fi AC_SUBST(LIBLWP) AC_SUBST(LIBPTHREAD) dnl Checks for header files. AC_CHECK_HEADERS(sys/stream.h arpa/inet.h netdb.h) dnl Checks for types. AC_CHECK_TYPES([struct sockaddr_storage, struct sockaddr_in6, socklen_t],,, [#include #include #include ]) dnl Checks for compiler characteristics. CODA_CC_FEATURE_TEST(Wall) dnl Checks for library functions. AC_CHECK_FUNCS(ffs iopen getaddrinfo gai_strerror getipnodebyname) AC_CHECK_FUNCS(inet_aton inet_ntoa inet_pton inet_ntop) AC_FUNC_SELECT_ARGTYPES dnl Checks for system services. AC_C_BIGENDIAN() if test ${with_LWP_PT}p != nop ; then AC_MSG_WARN(["Building against pthreaded lwp libraries, *experimental*"]) fi dnl Generate output files AC_CONFIG_FILES(Makefile pkgs/Makefile pkgs/pkg-bsd.sh pkgs/rpc2.spec debian/Makefile debian/changelog include/Makefile include/rpc2/Makefile secure/Makefile rpc2-src/Makefile rp2gen/Makefile scripts/Makefile) AC_OUTPUT