# $Id: configure.in,v 1.7 2002/09/14 15:54:06 stefan Exp $ AC_INIT AC_PREREQ(2.53) AC_CANONICAL_HOST AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(jfk,0.1.1) AM_CONFIG_HEADER(config.h) AC_PROG_CC AM_PROG_CC_STDC AC_PROG_CXX AC_PROG_LN_S AC_PROG_RANLIB build_client=1 AC_IPV6 # Win32 needs -lwsock32 AC_MSG_CHECKING([for wsock32]) svLIBS=$LIBS LIBS="$LIBS -lwsock32" AC_TRY_LINK([ #include ],[ socket(0, 0, 0); ],[AC_MSG_RESULT(yes)], [LIBS=$svLIBS AC_MSG_RESULT(no)]) # SDL Checks -------------------------------------------- SDL_VERSION=1.2.4 AM_PATH_SDL($SDL_VERSION,,build_client=0) svCXXFLAGS=$CXXFLAGS svLIBS=$LIBS CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" AC_CHECK_LIB(SDL_image, main,,build_client=0) LIBS=$svLIBS CXXFLAGS=$svCXXFLAGS AM_CONDITIONAL(BUILD_CLIENT, test $build_client = 1) if test $build_client = 0; then AC_MSG_WARN([SDL and/or SDL_image not found, only jfkserver will be built]) fi if test $build_client = 1; then AC_DEFINE([JFK_OUTPUT_BUILD_SDL],,[define if SDL output should be built]) fi AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h arpa/nameser.h fcntl.h netdb.h netinet/in.h \ netinet/tcp.h poll.h resolv.h stdint.h sys/param.h sys/select.h \ sys/socket.h sys/syctl.h sys/time.h sys/types.h unistd.h]) AC_CHECK_TYPE(ssize_t, int) TYPE_SOCKLEN_T AC_STRUCT_SA_LEN AC_CXX_NAMESPACES if test $ac_cv_cxx_namespaces = "no"; then AC_MSG_ERROR([jfk needs a C++ compiler that supports namespaces!]) fi AC_CXX_HAVE_SSTREAM if test $ac_cv_cxx_have_sstream = "no"; then AC_MSG_ERROR([jfk needs a C++ compiler that supports stringstreams!]) fi AC_CXX_HAVE_STD_COMPARE AC_CHECK_FUNCS([gettimeofday gethostbyname2 fcntl nanosleep poll select \ setsockopt]) AC_REPLACE_FUNCS([getaddrinfo inet_ntop inet_pton]) AC_ARG_ENABLE(debug,[ --enable-debug Enable development build], enable_debug=yes, enable_debug=no) if test $enable_debug = yes; then CXXFLAGS="$CXXFLAGS -DDEBUG" fi # Unfortunately, autoconf lacks a --docdir option. This is a workaround: AC_ARG_WITH(docdir, [ --with-docdir=DIR Where to put the documentation], [ if test "x$withval" = xyes || test "x$withval" = xno; then docdir='${prefix}/share/doc/jfk' else docdir="$withval" fi ], [ docdir='${prefix}/share/doc/jfk' ]) AC_SUBST(docdir) CXXFLAGS="$CXXFLAGS -W -Wall" CFLAGS="$CFLAGS -W -Wall" # Output Files AC_OUTPUT([ Makefile art/Makefile art/bar/Makefile art/font/Makefile art/ground/Makefile art/splash/Makefile art/object/Makefile art/object/bullet/Makefile art/object/explosion/Makefile art/object/item/Makefile art/object/obstacle/Makefile art/object/person/Makefile art/object/weapon/Makefile doc/Makefile levels/Makefile macros/Makefile src/Makefile src/lib/Makefile src/server/Makefile src/client/Makefile ],[ echo timestamp > stamp-h ])