source: libcaca/branches/0.1/configure.ac @ 2900

Last change on this file since 2900 was 207, checked in by Sam Hocevar, 20 years ago
  • AUTHORS NEWS: + Added these mandatory files.
  • doc/: + Wrote a Doxygen configuration file. + Added a manpage for caca-config(1), borrowed from sdl-config.
  • configure.ac: + Use new style AC_INIT. + Error out if no library was found. + Added *djgpp* to the list of non-PIC platforms. + Added checks for doxygen and latex.
  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1# $Id: configure.ac 207 2003-11-22 12:53:55Z 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 documentation?
74AC_PATH_PROG(DOXYGEN, doxygen, no)
75AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
76AC_PATH_PROG(LATEX, latex, no)
77AC_MSG_CHECKING(for a4wide.sty)
78if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
79  AC_MSG_RESULT(yes)
80else
81  LATEX=no
82  AC_MSG_RESULT(no)
83fi
84AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
85
86AC_OUTPUT([
87  Makefile
88  src/Makefile
89  examples/Makefile
90  doc/Makefile
91  autotools/Makefile
92  debian/Makefile
93  caca-config
94],[
95  chmod 0755 caca-config
96])
97
Note: See TracBrowser for help on using the repository browser.