source: libcaca/branches/0.5/configure.ac @ 3577

Last change on this file since 3577 was 282, checked in by Sam Hocevar, 16 years ago
  • configure.ac NEWS debian/changelog: + New 0.5 release.
  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1# $Id: configure.ac 282 2003-12-25 21:36:52Z 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.5)
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) (EXPERIMENTAL)])
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_HEADERS(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 to activate the conio.h backend driver)
41fi
42
43if test "${enable_slang}" = "yes"; then
44  AC_CHECK_HEADERS(slang.h,:,AC_MSG_ERROR([cannot find slang headers]))
45  AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library]))
46  AC_DEFINE(USE_SLANG, 1, Define to activate the slang backend driver)
47  CPPFLAGS="${CPPFLAGS} -DOPTIMISE_SLANG_PALETTE=1"
48  CACA_LIBS="${CACA_LIBS} -lslang"
49fi
50
51if test "${enable_x11}" = "yes"; then
52  AC_PATH_X
53  AC_CHECK_LIB(X11, XOpenDisplay,
54   [ac_cv_my_have_x11=yes
55    if test -n "${x_includes}"; then X_CFLAGS="-I${x_includes}"; fi
56    if test -n "${x_libraries}"; then X_LIBS="-lX11 -L${x_libraries}"; fi],
57   [ac_cv_my_have_x11=no],
58   [[-lXt -L${x_libraries}]])
59  if test "${ac_cv_my_have_x11}" != "yes"; then
60    AC_MSG_ERROR([cannot find X11 development files])
61  fi
62  AC_DEFINE(USE_X11, 1, Define to activate the X11 backend driver)
63  CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
64  CACA_LIBS="${CACA_LIBS} ${X_LIBS}"
65fi
66
67if test "${enable_ncurses}" != "no"; then
68  AC_CHECK_HEADERS(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers]))
69  AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library]))
70  AC_DEFINE(USE_NCURSES, 1, Define to activate the ncurses backend driver)
71  CACA_LIBS="${CACA_LIBS} -lncurses"
72fi
73
74AC_SUBST(CACA_LIBS)
75
76# Optimizations
77CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
78# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
79CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
80
81# Build the PIC library?
82case "${target_os}" in
83  *mingw32* | *cygwin* | *djgpp*)
84    NEED_PIC=false
85    ;;
86  *)
87    NEED_PIC=:
88    ;;
89esac
90AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
91
92# Build cacaview?
93save_CPPFLAGS="${CPPFLAGS}"
94AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
95if test "${IMLIB2_CONFIG}" != "no"; then
96  CPPFLAGS="${CPPFLAGS} `imlib2-config --cflags` -DX_DISPLAY_MISSING=1"
97fi
98AC_CHECK_HEADERS(Imlib2.h, USE_IMLIB2=:, USE_IMLIB2=false)
99CPPFLAGS="${save_CPPFLAGS}"
100AM_CONDITIONAL(USE_IMLIB2, ${USE_IMLIB2})
101
102# Build documentation?
103AC_PATH_PROG(DOXYGEN, doxygen, no)
104AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
105
106# Build LaTeX documentation?
107AC_PATH_PROG(LATEX, latex, no)
108AC_MSG_CHECKING(for a4wide.sty)
109if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
110  AC_MSG_RESULT(yes)
111else
112  LATEX=no
113  AC_MSG_RESULT(no)
114fi
115AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
116
117AC_CONFIG_FILES([
118  Makefile
119  src/Makefile
120  examples/Makefile
121  doc/Makefile
122  doc/doxygen.cfg
123  autotools/Makefile
124  debian/Makefile
125])
126AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
127AC_OUTPUT
128
Note: See TracBrowser for help on using the repository browser.