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
RevLine 
[71]1# $Id: configure.ac 222 2003-11-26 21:02:31Z sam $
[17]2
[207]3AC_INIT(src/caca.c)
[17]4
5AC_PREREQ(2.50)
[39]6AC_CONFIG_AUX_DIR(autotools)
[17]7AC_CANONICAL_SYSTEM
8
[207]9AM_INIT_AUTOMAKE(libcaca, 0.1)
[17]10AM_CONFIG_HEADER(config.h)
11
12AM_PROG_CC_C_O
13AC_PROG_CPP
[77]14AC_PROG_RANLIB
[17]15
[157]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
[51]20AC_ARG_ENABLE(slang,
21  [  --enable-slang          slang graphics support (default enabled)])
[17]22AC_ARG_ENABLE(ncurses,
[51]23  [  --enable-ncurses        ncurses graphics support (default disabled)])
[155]24AC_ARG_ENABLE(conio,
25  [  --enable-conio          DOS conio.h graphics support (default disabled)])
[17]26
[222]27AC_CHECK_HEADERS(inttypes.h)
28
[65]29USE_SLANG=false
30USE_NCURSES=false
[155]31USE_CONIO=false
32if test "${enable_conio}" = "yes"; then
33  AC_CHECK_HEADER(conio.h,:,AC_MSG_ERROR([cannot find conio.h header]))
[157]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)])
[155]40  AC_DEFINE(USE_CONIO, 1, Define if the backend driver is conio.h)
41  USE_CONIO=:
42elif test "${enable_ncurses}" = "yes"; then
[17]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]))
[111]45  AC_DEFINE(USE_NCURSES, 1, Define if the backend driver is ncurses)
[65]46  USE_NCURSES=:
[111]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=:
[207]52else
53  AC_MSG_ERROR([could not find any terminal graphics interface])
[17]54fi
55
[65]56AM_CONDITIONAL(USE_SLANG, ${USE_SLANG})
57AM_CONDITIONAL(USE_NCURSES, ${USE_NCURSES})
[17]58
[125]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
[187]62CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
[125]63
[202]64# Build the PIC library?
65case "${target_os}" in
[207]66  *mingw32* | *cygwin* | *djgpp*)
[202]67    NEED_PIC=false
68    ;;
69  *)
70    NEED_PIC=:
71    ;;
72esac
73AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
74
[217]75# Build cacaview?
76AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
77AM_CONDITIONAL(IMLIB2_CONFIG, test "${IMLIB2_CONFIG}" != "no")
78
[207]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
[17]92AC_OUTPUT([
93  Makefile
[190]94  src/Makefile
95  examples/Makefile
[207]96  doc/Makefile
[39]97  autotools/Makefile
[17]98  debian/Makefile
[202]99  caca-config
100],[
101  chmod 0755 caca-config
[17]102])
103
Note: See TracBrowser for help on using the repository browser.