# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. m4_define([MAJOR_VERSION], 2) m4_define([MINOR_VERSION], 1) m4_define([MICRO_VERSION], 0) AC_PREREQ(2.59) AC_INIT([faux], [MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION], [serj.kalichev at gmail dot com]) AC_CONFIG_AUX_DIR(aux_scripts) AC_CONFIG_MACRO_DIR([m4]) # Values for SONAME. See -version-info for details. AC_SUBST(SONAME_CURRENT, 2) AC_SUBST(SONAME_REVISION, 0) AC_SUBST(SONAME_AGE, 0) # Check for system extensions (_POSIX_THREAD_SEMANTICS for Solaris) AC_USE_SYSTEM_EXTENSIONS # Checks for programs. AC_PROG_CC AC_LIBTOOL_WIN32_DLL AC_PROG_LIBTOOL AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE(subdir-objects) AM_PROG_CC_C_O # Dir for libc replacements AC_CONFIG_LIBOBJ_DIR([libc]) # needed to handle 64-bit architecture AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(size_t) ######################################### # See if linker supports version scripts ######################################### # Check if LD supports linker scripts, # and define automake conditional HAVE_LD_VERSION_SCRIPT if so. AC_ARG_ENABLE([ld-version-script], AS_HELP_STRING([--enable-ld-version-script], [enable linker version script (default is enabled when possible)]), [have_ld_version_script=$enableval], []) if test -z "$have_ld_version_script"; then AC_MSG_CHECKING([if LD -Wl,--version-script works]) save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" cat > conftest.map <], [char* cs = nl_langinfo(CODESET); return !cs;], [am_cv_langinfo_codeset=yes], [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE([HAVE_LANGINFO_CODESET], [1], [Define if you have and nl_langinfo(CODESET).]) fi ]) AM_LANGINFO_CODESET ################################ # Check for pwd.h and grp.h ################################ AC_CHECK_HEADERS(pwd.h, [], AC_MSG_WARN([pwd.h not found: the pwd operations is not supported])) AC_CHECK_HEADERS(grp.h, [], AC_MSG_WARN([grp.h not found: the grp operations is not supported])) ################################ # Check for dlopen() ################################ AC_CHECK_HEADERS(dlfcn.h, [ AC_SEARCH_LIBS([dlopen], [dl dld], [], [ AC_MSG_ERROR([unable to find the dlopen() function]) ]) ],[ AC_MSG_ERROR([dlfcn.h not found: the dl operations is not supported]) ]) ################################ # Check for pthread ################################ # library's net_io.c needs pthread_sigmask() AX_PTHREAD ################################ # Check for signalfd() ################################ AC_CHECK_FUNCS(signalfd, [], AC_MSG_WARN([signalfd() not found: more complex mechanism will be used])) ################################ # Check for ppoll() ################################ AC_CHECK_FUNCS(ppoll, [], AC_MSG_WARN([ppoll() not found: more complex mechanism will be used])) AC_CONFIG_FILES([Makefile]) AC_OUTPUT