source: toilet/trunk/configure.ac @ 4681

Last change on this file since 4681 was 4681, checked in by Sam Hocevar, 10 years ago

Remove the build dependency on the getopt implementation and use libcaca
instead.

  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1
2AC_INIT(toilet, 0.2)
3
4AC_PREREQ(2.50)
5AC_CONFIG_SRCDIR(src/main.c)
6AC_CONFIG_AUX_DIR(.auto)
7AC_CANONICAL_SYSTEM
8
9AM_INIT_AUTOMAKE(toilet, 0.2)
10AM_CONFIG_HEADER(config.h)
11
12AM_PROG_CC_C_O
13AC_PROG_CPP
14
15dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
16dnl now otherwise it might be set in an obscure if statement. Same thing for
17dnl PKG_PROG_PKG_CONFIG which needs to be called first.
18AC_EGREP_CPP(yes, foo)
19PKG_PROG_PKG_CONFIG()
20
21dnl Don't let pkg-config fuck our cross-compilation environment
22m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
23if test "$build" != "$host" -a "${PKG_CONFIG_LIBDIR}" = ""; then
24  export PKG_CONFIG_LIBDIR=/dev/null
25fi
26
27AC_CHECK_HEADERS(sys/ioctl.h)
28
29AC_CACHE_CHECK([for TIOCGWINSZ],
30  [ac_cv_have_tiocgwinsz],
31  [AC_TRY_COMPILE(
32    [#include <sys/ioctl.h>],
33    [struct winsize ws;
34     ioctl(1, TIOCGWINSZ, &ws);],
35    ac_cv_have_tiocgwinsz=yes,
36    ac_cv_have_tiocgwinsz=no)])
37if test "${ac_cv_have_tiocgwinsz}" = "yes"; then
38  AC_DEFINE(HAVE_TIOCGWINSZ, 1, [Define if you have TIOCGWINSZ])
39fi
40
41CUCUL="no"
42PKG_CHECK_MODULES(CACA, caca >= 0.99.beta18,
43 [CUCUL="yes"],
44 [AC_MSG_RESULT(no)
45  AC_MSG_ERROR([you need libcaca version 0.99.beta18 or later])])
46
47AC_MSG_CHECKING([for release date])
48tmp="${stamp%-*}"
49ac_build_date="${stamp##*-} ${tmp#*-} ${stamp%%-*}"
50AC_MSG_RESULT([$ac_build_date])
51AC_DEFINE_UNQUOTED(DATE, "$ac_build_date", [Define the version date])
52
53# Optimizations
54CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
55# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
56CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
57
58AC_OUTPUT([
59  Makefile
60  src/Makefile
61  tools/Makefile
62  fonts/Makefile
63  doc/Makefile
64  test/Makefile
65])
66
Note: See TracBrowser for help on using the repository browser.