source: libcaca/trunk/configure.ac @ 251

Last change on this file since 251 was 251, checked in by Sam Hocevar, 17 years ago
  • src/graphics.c src/io.c: + Beginning of an X11 driver. Currently we merely open the window and

check keyboard events.

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