source: libcaca/trunk/configure.ac @ 217

Last change on this file since 217 was 217, checked in by Sam Hocevar, 16 years ago
  • configure.ac examples/Makefile.am: + Added a check for imlib2-config. + Build cacaview conditionally.
  • examples/demo.c: + Removed all gdkpixbuf code.
  • examples/view.c: + Default to ordered dithering. + Make sure the arrows always work even if delta is too small.
  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1# $Id: configure.ac 217 2003-11-24 19:56:04Z 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
27USE_SLANG=false
28USE_NCURSES=false
29USE_CONIO=false
30if test "${enable_conio}" = "yes"; then
31  AC_CHECK_HEADER(conio.h,:,AC_MSG_ERROR([cannot find conio.h header]))
32  AC_MSG_CHECKING(for ScreenUpdate in pc.h)
33  AC_EGREP_HEADER(ScreenUpdate,pc.h,[
34    AC_MSG_RESULT(yes)
35    AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
36              Define if <pc.h> defines ScreenUpdate.)],[
37    AC_MSG_RESULT(no)])
38  AC_DEFINE(USE_CONIO, 1, Define if the backend driver is conio.h)
39  USE_CONIO=:
40elif test "${enable_ncurses}" = "yes"; then
41  AC_CHECK_HEADER(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers]))
42  AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library]))
43  AC_DEFINE(USE_NCURSES, 1, Define if the backend driver is ncurses)
44  USE_NCURSES=:
45elif test "${enable_slang}" != "no"; then
46  AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers]))
47  AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library]))
48  AC_DEFINE(USE_SLANG, 1, Define if the backend driver is slang)
49  USE_SLANG=:
50else
51  AC_MSG_ERROR([could not find any terminal graphics interface])
52fi
53
54AM_CONDITIONAL(USE_SLANG, ${USE_SLANG})
55AM_CONDITIONAL(USE_NCURSES, ${USE_NCURSES})
56
57# Optimizations
58CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
59# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
60CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
61
62# Build the PIC library?
63case "${target_os}" in
64  *mingw32* | *cygwin* | *djgpp*)
65    NEED_PIC=false
66    ;;
67  *)
68    NEED_PIC=:
69    ;;
70esac
71AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
72
73# Build cacaview?
74AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
75AM_CONDITIONAL(IMLIB2_CONFIG, test "${IMLIB2_CONFIG}" != "no")
76
77# Build documentation?
78AC_PATH_PROG(DOXYGEN, doxygen, no)
79AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
80AC_PATH_PROG(LATEX, latex, no)
81AC_MSG_CHECKING(for a4wide.sty)
82if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
83  AC_MSG_RESULT(yes)
84else
85  LATEX=no
86  AC_MSG_RESULT(no)
87fi
88AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
89
90AC_OUTPUT([
91  Makefile
92  src/Makefile
93  examples/Makefile
94  doc/Makefile
95  autotools/Makefile
96  debian/Makefile
97  caca-config
98],[
99  chmod 0755 caca-config
100])
101
Note: See TracBrowser for help on using the repository browser.