source: toilet/trunk/configure.ac @ 1326

Last change on this file since 1326 was 1326, checked in by Sam Hocevar, 17 years ago
  • Allow setting the font directory using --datadir / --datarootdir.
File size: 2.5 KB
Line 
1# $Id: configure.ac 98 2006-09-22 16:27:37Z sam $
2
3AC_INIT(toilet, 0.0)
4
5AC_PREREQ(2.50)
6AC_CONFIG_SRCDIR(src/main.c)
7AC_CONFIG_AUX_DIR(autotools)
8AC_CANONICAL_SYSTEM
9
10AM_INIT_AUTOMAKE(toilet, 0.0)
11AM_CONFIG_HEADER(config.h)
12
13AM_PROG_CC_C_O
14AC_PROG_CPP
15
16dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right
17dnl now otherwise it might be set in an obscure if statement. Same thing for
18dnl PKG_PROG_PKG_CONFIG which needs to be called first.
19AC_EGREP_CPP(yes, foo)
20PKG_PROG_PKG_CONFIG()
21
22dnl Don't let pkg-config fuck our cross-compilation environment
23m4_pattern_allow([^PKG_CONFIG_LIBDIR$])
24if test "$build" != "$host" -a "${PKG_CONFIG_LIBDIR}" = ""; then
25  export PKG_CONFIG_LIBDIR=/dev/null
26fi
27
28AC_CHECK_HEADERS(getopt.h sys/ioctl.h zlib.h)
29
30AC_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"])])
35AC_SUBST(GETOPT_LIBS)
36
37AC_CHECK_LIB(z, gzopen,
38 [ZLIB_LIBS="${ZLIB_LIBS} -lz"])
39AC_SUBST(ZLIB_LIBS)
40
41AC_CACHE_CHECK([for TIOCGWINSZ],
42  [ac_cv_have_tiocgwinsz],
43  [AC_TRY_COMPILE(
44    [#include <sys/ioctl.h>],
45    [struct winsize ws;
46     ioctl(1, TIOCGWINSZ, &ws);],
47    ac_cv_have_tiocgwinsz=yes,
48    ac_cv_have_tiocgwinsz=no)])
49if test "${ac_cv_have_tiocgwinsz}" = "yes"; then
50  AC_DEFINE(HAVE_TIOCGWINSZ, 1, [Define if you have TIOCGWINSZ])
51fi
52
53CUCUL="no"
54PKG_CHECK_MODULES(cucul, cucul >= 0.99.beta9,
55 [CUCUL="yes"],
56 [AC_MSG_RESULT(no)
57  AC_MSG_ERROR([you need libcucul version 0.99.beta9 or later])])
58
59AC_MSG_CHECKING([for release date])
60stamp="$(sed -ne 's/# \$Id: .*\(....-..-..\).*/\1/p;q' configure.ac)"
61 if date +"%e %B %Y" -d "$stamp" >/dev/null 2>&1; then
62   ac_build_date="$(LANG=C date +"%e %B %Y" -d "$stamp" | sed 's/^ //')"
63 else
64   ac_build_date="${stamp##*-} ${${stamp%-*}#*-} ${stamp%%-*}"
65 fi
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  doc/toilet.1
81])
82
Note: See TracBrowser for help on using the repository browser.