source: libcaca/trunk/configure.ac @ 222

Last change on this file since 222 was 222, checked in by Sam Hocevar, 17 years ago
  • configure.ac: Added a missing check for <inttypes.h>.
  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1# $Id: configure.ac 222 2003-11-26 21:02:31Z sam $
2
3AC_INIT(src/caca.c)
4
5AC_PREREQ(2.50)
6AC_CONFIG_AUX_DIR(autotools)
7AC_CANONICAL_SYSTEM
8
9AM_INIT_AUTOMAKE(libcaca, 0.1)
10AM_CONFIG_HEADER(config.h)
11
12AM_PROG_CC_C_O
13AC_PROG_CPP
14AC_PROG_RANLIB
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.
18AC_EGREP_CPP(foo,foo)
19
20AC_ARG_ENABLE(slang,
21  [  --enable-slang          slang graphics support (default enabled)])
22AC_ARG_ENABLE(ncurses,
23  [  --enable-ncurses        ncurses graphics support (default disabled)])
24AC_ARG_ENABLE(conio,
25  [  --enable-conio          DOS conio.h graphics support (default disabled)])
26
27AC_CHECK_HEADERS(inttypes.h)
28
29USE_SLANG=false
30USE_NCURSES=false
31USE_CONIO=false
32if test "${enable_conio}" = "yes"; then
33  AC_CHECK_HEADER(conio.h,:,AC_MSG_ERROR([cannot find conio.h header]))
34  AC_MSG_CHECKING(for ScreenUpdate in pc.h)
35  AC_EGREP_HEADER(ScreenUpdate,pc.h,[
36    AC_MSG_RESULT(yes)
37    AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
38              Define if <pc.h> defines ScreenUpdate.)],[
39    AC_MSG_RESULT(no)])
40  AC_DEFINE(USE_CONIO, 1, Define if the backend driver is conio.h)
41  USE_CONIO=:
42elif test "${enable_ncurses}" = "yes"; then
43  AC_CHECK_HEADER(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers]))
44  AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library]))
45  AC_DEFINE(USE_NCURSES, 1, Define if the backend driver is ncurses)
46  USE_NCURSES=:
47elif test "${enable_slang}" != "no"; then
48  AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers]))
49  AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library]))
50  AC_DEFINE(USE_SLANG, 1, Define if the backend driver is slang)
51  USE_SLANG=:
52else
53  AC_MSG_ERROR([could not find any terminal graphics interface])
54fi
55
56AM_CONDITIONAL(USE_SLANG, ${USE_SLANG})
57AM_CONDITIONAL(USE_NCURSES, ${USE_NCURSES})
58
59# Optimizations
60CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
61# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
62CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
63
64# Build the PIC library?
65case "${target_os}" in
66  *mingw32* | *cygwin* | *djgpp*)
67    NEED_PIC=false
68    ;;
69  *)
70    NEED_PIC=:
71    ;;
72esac
73AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
74
75# Build cacaview?
76AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
77AM_CONDITIONAL(IMLIB2_CONFIG, test "${IMLIB2_CONFIG}" != "no")
78
79# Build documentation?
80AC_PATH_PROG(DOXYGEN, doxygen, no)
81AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
82AC_PATH_PROG(LATEX, latex, no)
83AC_MSG_CHECKING(for a4wide.sty)
84if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
85  AC_MSG_RESULT(yes)
86else
87  LATEX=no
88  AC_MSG_RESULT(no)
89fi
90AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
91
92AC_OUTPUT([
93  Makefile
94  src/Makefile
95  examples/Makefile
96  doc/Makefile
97  autotools/Makefile
98  debian/Makefile
99  caca-config
100],[
101  chmod 0755 caca-config
102])
103
Note: See TracBrowser for help on using the repository browser.