source: libcaca/trunk/configure.ac @ 245

Last change on this file since 245 was 245, checked in by Sam Hocevar, 16 years ago
  • configure.ac: + Set the executable bit of caca-config when regenerating that file.
  • caca-config.in: + No longer use USE_SLANG_TRUE and USE_NCURSES_TRUE since we now

have @CACA_LIBS@.

  • Property svn:keywords set to Id
File size: 3.1 KB
Line 
1# $Id: configure.ac 245 2003-12-11 15:54:53Z 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.2)
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(ncurses,
21  [  --enable-ncurses        ncurses graphics support (default enabled)])
22AC_ARG_ENABLE(slang,
23  [  --enable-slang          slang graphics support (default disabled)])
24AC_ARG_ENABLE(conio,
25  [  --enable-conio          DOS conio.h graphics support (default disabled)])
26
27AC_CHECK_HEADERS(inttypes.h endian.h)
28AC_CHECK_FUNCS(vsnprintf getenv putenv)
29
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)
39elif test "${enable_slang}" = "yes"; then
40  AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers]))
41  AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library]))
42  AC_DEFINE(USE_SLANG, 1, Define if the backend driver is slang)
43  CACA_LIBS="${CACA_LIBS} -lslang"
44elif test "${enable_ncurses}" != "no"; then
45  AC_CHECK_HEADER(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers]))
46  AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library]))
47  AC_DEFINE(USE_NCURSES, 1, Define if the backend driver is ncurses)
48  CACA_LIBS="${CACA_LIBS} -lncurses"
49else
50  AC_MSG_ERROR([could not find any terminal graphics interface])
51fi
52
53AC_SUBST(CACA_LIBS)
54
55# Optimizations
56CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
57# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
58CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
59
60# Build the PIC library?
61case "${target_os}" in
62  *mingw32* | *cygwin* | *djgpp*)
63    NEED_PIC=false
64    ;;
65  *)
66    NEED_PIC=:
67    ;;
68esac
69AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
70
71# Build cacaview?
72save_CPPFLAGS="${CPPFLAGS}"
73AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
74if test "${IMLIB2_CONFIG}" != "no"; then
75  CPPFLAGS="${CPPFLAGS} `imlib2-config --cflags` -DX_DISPLAY_MISSING=1"
76fi
77AC_CHECK_HEADER(Imlib2.h, USE_IMLIB2=:, USE_IMLIB2=false)
78CPPFLAGS="${save_CPPFLAGS}"
79AM_CONDITIONAL(USE_IMLIB2, ${USE_IMLIB2})
80
81# Build documentation?
82AC_PATH_PROG(DOXYGEN, doxygen, no)
83AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
84AC_PATH_PROG(LATEX, latex, no)
85AC_MSG_CHECKING(for a4wide.sty)
86if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
87  AC_MSG_RESULT(yes)
88else
89  LATEX=no
90  AC_MSG_RESULT(no)
91fi
92AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
93
94AC_CONFIG_FILES([
95  Makefile
96  src/Makefile
97  examples/Makefile
98  doc/Makefile
99  autotools/Makefile
100  debian/Makefile
101])
102AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
103AC_OUTPUT
104
Note: See TracBrowser for help on using the repository browser.