[1209] | 1 | # $Id: configure.ac 98 2006-09-22 16:27:37Z sam $ |
---|
| 2 | |
---|
| 3 | AC_INIT(cacamoo, 0.0) |
---|
| 4 | |
---|
| 5 | AC_PREREQ(2.50) |
---|
| 6 | AC_CONFIG_SRCDIR(src/main.c) |
---|
[2441] | 7 | AC_CONFIG_AUX_DIR(.auto) |
---|
[1209] | 8 | AC_CANONICAL_SYSTEM |
---|
| 9 | |
---|
| 10 | AM_INIT_AUTOMAKE(cacamoo, 0.0) |
---|
| 11 | AM_CONFIG_HEADER(config.h) |
---|
| 12 | |
---|
| 13 | AM_PROG_CC_C_O |
---|
| 14 | AC_PROG_CPP |
---|
| 15 | |
---|
| 16 | dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right |
---|
| 17 | dnl now otherwise it might be set in an obscure if statement. Same thing for |
---|
| 18 | dnl PKG_PROG_PKG_CONFIG which needs to be called first. |
---|
| 19 | AC_EGREP_CPP(yes, foo) |
---|
| 20 | PKG_PROG_PKG_CONFIG() |
---|
| 21 | |
---|
| 22 | dnl Don't let pkg-config fuck our cross-compilation environment |
---|
| 23 | m4_pattern_allow([^PKG_CONFIG_LIBDIR$]) |
---|
| 24 | if test "$build" != "$host" -a "${PKG_CONFIG_LIBDIR}" = ""; then |
---|
| 25 | export PKG_CONFIG_LIBDIR=/dev/null |
---|
| 26 | fi |
---|
| 27 | |
---|
[1244] | 28 | AC_CHECK_HEADERS(getopt.h) |
---|
| 29 | |
---|
| 30 | AC_CHECK_FUNCS(getopt_long, |
---|
| 31 | [AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.)], |
---|
| 32 | [AC_CHECK_LIB(gnugetopt, getopt_long, |
---|
| 33 | [AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the `getopt_long' function.) |
---|
| 34 | GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])]) |
---|
| 35 | AC_SUBST(GETOPT_LIBS) |
---|
| 36 | |
---|
[1209] | 37 | CACA="no" |
---|
[1448] | 38 | PKG_CHECK_MODULES(CUCUL, cucul, |
---|
[1209] | 39 | [CACA="yes"], |
---|
| 40 | [AC_MSG_RESULT(no) |
---|
| 41 | AC_MSG_ERROR([you need libcucul version 0.99 or later])]) |
---|
| 42 | |
---|
| 43 | # Optimizations |
---|
| 44 | CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" |
---|
| 45 | # Code qui fait des warnings == code de porc == deux baffes dans ta gueule |
---|
| 46 | CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" |
---|
| 47 | |
---|
| 48 | AC_OUTPUT([ |
---|
| 49 | Makefile |
---|
| 50 | src/Makefile |
---|
| 51 | data/Makefile |
---|
| 52 | ]) |
---|
| 53 | |
---|