source: toilet/trunk/configure.ac @ 4353

Last change on this file since 4353 was 4350, checked in by Sam Hocevar, 11 years ago

Get rid of $Id$ keywords.

  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1
2AC_INIT(toilet, 0.1)
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.1)
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(getopt.h sys/ioctl.h zlib.h)
28
29ac_cv_have_getopt_long="no"
30AC_CHECK_FUNCS(getopt_long,
31 [ac_cv_have_getopt_long="yes"],
32 [AC_CHECK_LIB(gnugetopt, getopt_long,
33   [ac_cv_have_getopt_long="yes"
34    GETOPT_LIBS="${GETOPT_LIBS} -lgnugetopt"])])
35if test "$ac_cv_have_getopt_long" != "no"; then
36  AC_DEFINE(HAVE_GETOPT_LONG, 1, Define to 1 if you have the ‘getopt_long’ function.)
37fi
38AM_CONDITIONAL(NEED_GETOPT_LONG, test "$ac_cv_have_getopt_long" = "no")
39AC_SUBST(GETOPT_LIBS)
40
41AC_CHECK_LIB(z, gzopen,
42 [ZLIB_LIBS="${ZLIB_LIBS} -lz"])
43AC_SUBST(ZLIB_LIBS)
44
45AC_CACHE_CHECK([for TIOCGWINSZ],
46  [ac_cv_have_tiocgwinsz],
47  [AC_TRY_COMPILE(
48    [#include <sys/ioctl.h>],
49    [struct winsize ws;
50     ioctl(1, TIOCGWINSZ, &ws);],
51    ac_cv_have_tiocgwinsz=yes,
52    ac_cv_have_tiocgwinsz=no)])
53if test "${ac_cv_have_tiocgwinsz}" = "yes"; then
54  AC_DEFINE(HAVE_TIOCGWINSZ, 1, [Define if you have TIOCGWINSZ])
55fi
56
57CUCUL="no"
58PKG_CHECK_MODULES(CACA, caca >= 0.99.beta17,
59 [CUCUL="yes"],
60 [AC_MSG_RESULT(no)
61  AC_MSG_ERROR([you need libcaca version 0.99.beta17 or later])])
62
63AC_MSG_CHECKING([for release date])
64tmp="${stamp%-*}"
65ac_build_date="${stamp##*-} ${tmp#*-} ${stamp%%-*}"
66AC_MSG_RESULT([$ac_build_date])
67AC_DEFINE_UNQUOTED(DATE, "$ac_build_date", [Define the version date])
68
69# Optimizations
70CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
71# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
72CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
73
74AC_OUTPUT([
75  Makefile
76  src/Makefile
77  tools/Makefile
78  fonts/Makefile
79  doc/Makefile
80  test/Makefile
81])
82
Note: See TracBrowser for help on using the repository browser.