source: libcaca/trunk/configure.ac @ 265

Last change on this file since 265 was 265, checked in by Sam Hocevar, 16 years ago
  • src/graphics.c src/caca.c src/io.c: + Support for simultaneously compiled-in drivers. + Honour the CACA_DRIVER environment variable.
  • configure.ac: + Drivers are no longer mutually exclusive.
  • Property svn:keywords set to Id
File size: 3.7 KB
RevLine 
[71]1# $Id: configure.ac 265 2003-12-22 15:26:12Z 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
[250]9AM_INIT_AUTOMAKE(libcaca, 0.3)
[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
[231]20AC_ARG_ENABLE(ncurses,
21  [  --enable-ncurses        ncurses graphics support (default enabled)])
[51]22AC_ARG_ENABLE(slang,
[231]23  [  --enable-slang          slang graphics support (default disabled)])
[155]24AC_ARG_ENABLE(conio,
25  [  --enable-conio          DOS conio.h graphics support (default disabled)])
[251]26AC_ARG_ENABLE(x11,
[253]27  [  --enable-x11            X11 support (default disabled) (EXPERIMENTAL)])
[17]28
[238]29AC_CHECK_HEADERS(inttypes.h endian.h)
[250]30AC_CHECK_FUNCS(vsnprintf getenv putenv strcasecmp)
[222]31
[155]32if test "${enable_conio}" = "yes"; then
[253]33  AC_CHECK_HEADERS(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)])
[265]40  AC_DEFINE(USE_CONIO, 1, Define to activate the conio.h backend driver)
41fi
42
43if test "${enable_slang}" = "yes"; then
[253]44  AC_CHECK_HEADERS(slang.h,:,AC_MSG_ERROR([cannot find slang headers]))
[231]45  AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library]))
[265]46  AC_DEFINE(USE_SLANG, 1, Define to activate the slang backend driver)
[244]47  CACA_LIBS="${CACA_LIBS} -lslang"
[265]48fi
49
50if test "${enable_x11}" = "yes"; then
[251]51  AC_PATH_X
52  AC_CHECK_LIB(X11, XOpenDisplay,
53   [ac_cv_my_have_x11=yes
54    X_CFLAGS="-I${x_includes}"
55    X_LIBS="-lX11 -L${x_libraries}"],
56   [ac_cv_my_have_x11=no],
57   [[-lXt -L${x_libraries}]])
58  if test "${ac_cv_my_have_x11}" != "yes"; then
59    AC_MSG_ERROR([cannot find X11 development files])
60  fi
[265]61  AC_DEFINE(USE_X11, 1, Define to activate the X11 backend driver)
[251]62  CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
63  CACA_LIBS="${CACA_LIBS} ${X_LIBS}"
[265]64fi
65
66if test "${enable_ncurses}" != "no"; then
[253]67  AC_CHECK_HEADERS(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers]))
[17]68  AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library]))
[265]69  AC_DEFINE(USE_NCURSES, 1, Define to activate the ncurses backend driver)
[244]70  CACA_LIBS="${CACA_LIBS} -lncurses"
[17]71fi
72
[244]73AC_SUBST(CACA_LIBS)
[17]74
[125]75# Optimizations
76CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
77# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
[187]78CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
[125]79
[202]80# Build the PIC library?
81case "${target_os}" in
[207]82  *mingw32* | *cygwin* | *djgpp*)
[202]83    NEED_PIC=false
84    ;;
85  *)
86    NEED_PIC=:
87    ;;
88esac
89AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
90
[217]91# Build cacaview?
[224]92save_CPPFLAGS="${CPPFLAGS}"
[217]93AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
[224]94if test "${IMLIB2_CONFIG}" != "no"; then
95  CPPFLAGS="${CPPFLAGS} `imlib2-config --cflags` -DX_DISPLAY_MISSING=1"
96fi
[253]97AC_CHECK_HEADERS(Imlib2.h, USE_IMLIB2=:, USE_IMLIB2=false)
[224]98CPPFLAGS="${save_CPPFLAGS}"
99AM_CONDITIONAL(USE_IMLIB2, ${USE_IMLIB2})
[217]100
[207]101# Build documentation?
102AC_PATH_PROG(DOXYGEN, doxygen, no)
103AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
104AC_PATH_PROG(LATEX, latex, no)
105AC_MSG_CHECKING(for a4wide.sty)
106if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
107  AC_MSG_RESULT(yes)
108else
109  LATEX=no
110  AC_MSG_RESULT(no)
111fi
112AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
113
[245]114AC_CONFIG_FILES([
[17]115  Makefile
[190]116  src/Makefile
117  examples/Makefile
[207]118  doc/Makefile
[39]119  autotools/Makefile
[17]120  debian/Makefile
121])
[245]122AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
123AC_OUTPUT
[17]124
Note: See TracBrowser for help on using the repository browser.