# Process this file with autoconf to produce a configure script. # Copyright (C) 2004, 2005 Jack Lloyd # Todd MacDermid AC_INIT([cutlass],[0.2.0],[cutlass@synacklabs.net]) AM_INIT_AUTOMAKE(cutlass, 0.2.0) AC_PREREQ(2.59) if test "$prefix" = "NONE"; then prefix="/usr/local" fi # check programs AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB AC_PROG_LN_S CFLAGS="$CFLAGS -Wall" CXXFLAGS="$CXXFLAGS -Wall" # check libs LIB_CONFIG([botan_config], [botan-config], [Botan], [CXXFLAGS], [LIBS]) dnl AC_PATH_PROG(PKG_CONFIG,pkg-config,no) AC_SEARCH_LIBS(snd_pcm_open, asound, , ,) #AC_CHECK_LIB(asound, snd_pcm_open,, # [AC_MSG_ERROR([ALSA library needed that can snd_pcm_open.])]) AC_CHECK_LIB(asound, snd_pcm_open) AC_CHECK_LIB(speex, speex_encoder_init) AC_CHECK_HEADERS([sys/soundcard.h]) AC_CHECK_HEADERS([speex/speex.h]) AC_CHECK_HEADERS([speex.h]) # Default to building GTK+ frontend, if possible build_gtkcutlass=yes AC_ARG_WITH(gtk, [ --without-gtk disable GTK+ GUI], [ case "${with_gtk}" in "yes") build_gtkcutlass=yes ;; "no") build_gtkcutlass=no ;; esac] ) UI_SUBDIRS= if test $build_gtkcutlass = yes then PKG_CHECK_MODULES(GTKCUTLASS,glib-2.0 gtk+-2.0 >= 2.2 libglade-2.0,gtkcutlass="gtk-cutlass/Makefile",[],[build_gtkcutlass=no]) if test $build_gtkcutlass = yes; then AC_SUBST(GTKCUTLASS_CFLAGS) AC_SUBST(GTKCUTLASS_LIBS) UI_SUBDIRS=gtk-cutlass fi fi AC_SUBST(UI_SUBDIRS) # FIXME: Solaris needs extra libs I think AC_SEARCH_LIBS(socket, socket, , , -lsocket) AC_SEARCH_LIBS(gethostbyname, nsl, , , -lnsl) AC_SEARCH_LIBS(nanosleep, rt, , , -lrt) #AC_CHECK_LIB(socket, socket) #AC_CHECK_LIB(netdb, gethostbyname) # check headers AC_CHECK_HEADERS(inttypes.h) AC_LANG_PUSH(C++) #AC_CHECK_HEADER(botan/botan.h, [], # [AC_MSG_ERROR(["Unable to find Botan's headers"])], [ ]) AC_LANG_POP(C++) # check types AC_CHECK_TYPES(socklen_t) # check structs # check compiler characteristics # check library functions/services AC_CHECK_FUNCS(inet_ntop) # We absolutely 100% must have these functions. Probably this will change once # we do the Windows port, but one thing at a time (anyway, probably won't build # the Windows port with autoconf anyway). REQUIRE_FUNC(socket) REQUIRE_FUNC(connect) REQUIRE_FUNC(shutdown) REQUIRE_FUNC(bind) REQUIRE_FUNC(select) REQUIRE_FUNC(send) REQUIRE_FUNC(recv) REQUIRE_FUNC(recvfrom) #REQUIRE_FUNC(gethostbyname) CHECK_PTHREADS() # check system services privdatadir='${datadir}'/cutlass/ AC_SUBST(privdatadir) # do output AC_CONFIG_FILES([Makefile libcutlass/Makefile libcutlass/include/Makefile libcutlass/include/cutlass/Makefile text-cutlass/Makefile docs/Makefile test/Makefile]) if test $build_gtkcutlass = yes then AC_CONFIG_FILES([gtk-cutlass/Makefile]) gladedir="$privdatadir/glade/" AC_SUBST(gladedir) fi AC_OUTPUT