# $Id: configure.ac 98 2006-09-22 16:27:37Z sam $ AC_INIT(neercs, 0.0) AC_PREREQ(2.50) AC_CONFIG_SRCDIR(src/main.c) AC_CONFIG_AUX_DIR(.auto) AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(neercs, 0.0) AM_CONFIG_HEADER(config.h) AM_PROG_CC_C_O AC_PROG_CPP dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right dnl now otherwise it might be set in an obscure if statement. Same thing for dnl PKG_PROG_PKG_CONFIG which needs to be called first. AC_EGREP_CPP(yes, foo) PKG_PROG_PKG_CONFIG() dnl Don't let pkg-config fuck our cross-compilation environment m4_pattern_allow([^PKG_CONFIG_LIBDIR$]) if test "$build" != "$host" -a "${PKG_CONFIG_LIBDIR}" = ""; then export PKG_CONFIG_LIBDIR=/dev/null fi dnl conditional builds AC_ARG_ENABLE(debug, [ --enable-debug build debug versions of neercs (default no)]) CACA="no" PKG_CHECK_MODULES(CACA, caca >= 0.99.beta15, [CACA="yes"], [AC_MSG_RESULT(no) AC_MSG_ERROR([you need libcaca version 0.99.beta15 or later])]) AC_CHECK_HEADERS(stdio.h pty.h sys/ioctl.h sys/ptrace.h sys/stat.h sys/syscall.h sys/user.h sys/wait.h linux/kdev_t.h linux/major.h security/pam_appl.h security/pam_misc.h) AC_CHECK_LIB(pam, pam_authenticate, [PAM_LIBS="${PAM_LIBS} -lpam" AC_DEFINE(USE_LOCK, 1, [Locking the PTY is supported])]) AC_SUBST(PAM_LIBS) AC_CHECK_LIB(caca, caca_clear_dirty_rect_list, [AC_DEFINE(HAVE_CACA_DIRTY_RECTANGLES, 1, [libcaca has dirty rectangles])]) AC_CHECK_LIB(caca, caca_fill_triangle_textured, [AC_DEFINE(HAVE_CACA_TRIANGLE_TEXTURING, 1, [libcaca has trifiller])]) AC_CHECK_LIB(util, forkpty, UTIL_LIBS="${UTIL_LIBS} -lutil") AC_SUBST(UTIL_LIBS) AC_MSG_CHECKING(for pty grab support) case $target in i?86-*-linux-*|amd64-*-linux-*|x86_64-*-linux-*) AC_DEFINE(USE_GRAB, 1, [Grabbing processes is supported]) grab=yes ;; *) grab=no ;; esac AC_MSG_RESULT($grab) if test "${enable_debug}" = "yes"; then AC_DEFINE(DEBUG, 1, Define to 1 to activate debug) fi AC_DEFINE(_GNU_SOURCE, 1, [Use GNU extentions]) # Optimizations CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" # Code qui fait des warnings == code de porc == deux baffes dans ta gueule CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" AC_OUTPUT([ Makefile doc/Makefile src/Makefile data/Makefile ])