source: libcaca/trunk/configure.ac @ 224

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