AC_INIT(shoes/shoes.h) SHOES_MAJOR_VERSION=1 SHOES_MINOR_VERSION=0 SHOES_MICRO_VERSION=0 SHOES_VERSION="$SHOES_MAJOR_VERSION.$SHOES_MINOR_VERSION.$SHOES_MICRO_VERSION" AC_SUBST(SHOES_MAJOR_VERSION) AC_SUBST(SHOES_MINOR_VERSION) AC_SUBST(SHOES_MICRO_VERSION) AC_SUBST(SHOES_VERSION) LT_CURRENT=`expr 10 '*' $SHOES_MAJOR_VERSION + $SHOES_MINOR_VERSION` LT_REVISION=$SHOES_MICRO_VERSION # For 1.0.0 comment the first line and uncomment the second #LT_AGE=0 LT_AGE=$SHOES_MINOR_VERSION LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE` AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) AC_SUBST(LT_CURRENT_MINUS_AGE) AM_INIT_AUTOMAKE(libshoes, $SHOES_VERSION) AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_LIBTOOL_WIN32_DLL AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_PROG_LN_S AC_PATH_PROG(PKG_CONFIG, pkg-config, no) DEPS_CFLAGS= DEPS_EXTRA_CFLAGS= DEPS_LIBS= DEPS_PKGS= # check if asio is available AC_LANG_PUSH(C++) AC_CHECK_HEADERS([asio.hpp], [], [ AC_MSG_ERROR([asio is required for libshoes, see http://tenermerx.com/Asio/]) ]) AC_LANG_POP AC_MSG_CHECKING([for native Win32]) case "$host" in *-*-mingw*) native_win32=yes DEPS_LIBS="$DEPS_LIBS -lws2_32" LIBSHOES_WIN32_RESOURCE=libshoes-win32res.lo ;; *) native_win32=no LIBSHOES_WIN32_RESOURCE= ;; esac AC_MSG_RESULT([$native_win32]) AM_CONDITIONAL(OS_WIN32, test "$native_win32" == yes) AC_SUBST(LIBSHOES_WIN32_RESOURCE) # check if asio is available AC_LANG_PUSH(C++) AC_CHECK_HEADERS([asio.hpp], [], [ AC_MSG_ERROR([asio is required for libshoes, see http://tenermerx.com/Asio/]) ]) AC_LANG_POP if test x"$native_win32" = xyes; then # Assume Windows XP target for asio DEPS_CFLAGS="$DEPS_CFLAGS -D_WIN32_WINNT=0x0501" AC_CHECK_TOOL(WINDRES, windres) else # asio requires linking against pthread on non-win32 platforms DEPS_LIBS+="-lpthread"; fi AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [enable debugging support])], [ case "${enableval}" in yes) debug=true ; DEBUG_CXXFLAGS="-DDEBUG -O0 -g" ;; no) debug=false ; DEBUG_CXXFLAGS="-DNDEBUG" ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac ],[ debug=false DEBUG_CXXFLAGS="-DNDEBUG" ]) SHOES_CXXFLAGS="$DEPS_CFLAGS $DEBUG_CXXFLAGS" SHOES_LIBS="$DEPS_LIBS" AC_SUBST(SHOES_CXXFLAGS) AC_SUBST(SHOES_LIBS) AC_OUTPUT([ build/Makefile build/win32/Makefile shoes/Makefile shoes/libshoes.rc test/Makefile Makefile libshoes-1.0.pc ]) echo " Configuration Debugging support: ${debug}" if test x"$native_win32" = xyes; then echo " Building for Windows platform: Assuming Windows XP target " else echo " Building for unix platform " fi