source: libcaca/trunk/configure.ac @ 331

Last change on this file since 331 was 331, checked in by Sam Hocevar, 16 years ago
  • test/event.c: + Do not refresh after each event, but only when there is no event

pending.

+ If the pressed key is a printable character, display it.

  • src/time.c: + Moved _caca_getticks() to this file.
  • src/caca.c: + Set the escape delay to a very low value in the ncurses driver,

because I don't want escape sequences to be entered manually.

  • src/io.c: + Autorepeat emulation in the ncurses and slang drivers: do not

immediately send the key release event.

  • configure.ac: + Check for usleep. + Improvements in the win32 platform detection.
  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
1# $Id: configure.ac 331 2004-01-09 09:51: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.7)
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(slang,
21  [  --enable-slang          slang graphics support (autodetected)])
22AC_ARG_ENABLE(ncurses,
23  [  --enable-ncurses        ncurses graphics support (autodetected)])
24AC_ARG_ENABLE(win32,
25  [  --enable-win32          Windows console support (autodetected)])
26AC_ARG_ENABLE(conio,
27  [  --enable-conio          DOS conio.h graphics support (autodetected)])
28AC_ARG_ENABLE(x11,
29  [  --enable-x11            X11 support (autodetected)])
30
31AC_CHECK_HEADERS(inttypes.h endian.h)
32AC_CHECK_FUNCS(vsnprintf getenv putenv strcasecmp usleep Sleep)
33
34CACA_DRIVERS=""
35
36if test "${enable_conio}" != "no"; then
37  ac_cv_my_have_conio="no"
38  AC_CHECK_HEADERS(conio.h,
39   [AC_MSG_CHECKING(for ScreenUpdate in pc.h)
40    AC_EGREP_HEADER(ScreenUpdate, pc.h,
41     [ac_cv_my_have_conio="yes"
42      AC_MSG_RESULT(yes)
43      AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
44                Define if <pc.h> defines ScreenUpdate.)
45      AC_DEFINE(USE_CONIO, 1, Define to activate the conio.h backend driver)
46      CACA_DRIVERS="${CACA_DRIVERS} conio"],
47     [AC_MSG_RESULT(no)])])
48  if test "${ac_cv_my_have_conio}" = "no" -a "${enable_conio}" = "yes"; then
49    AC_MSG_ERROR([cannot find conio.h])
50  fi
51fi
52
53if test "${enable_win32}" != "no"; then
54  ac_cv_my_have_win32="no"
55  AC_CHECK_HEADERS(windows.h,
56   [AC_MSG_CHECKING(for AllocConsole in windows.h)
57    AC_EGREP_HEADER(AllocConsole, windows.h,
58     [ac_cv_my_have_win32="yes"
59      AC_MSG_RESULT(yes)
60      AC_DEFINE(ALLOCCONSOLE_IN_WINDOWS_H, 1,
61                Define if <windows.h> defines AllocConsole.)
62      AC_DEFINE(USE_WIN32, 1, Define to activate the win32 backend driver)
63      CACA_DRIVERS="${CACA_DRIVERS} win32"],
64     [AC_MSG_RESULT(no)])])
65  if test "${ac_cv_my_have_win32}" = "no" -a "${enable_win32}" = "yes"; then
66    AC_MSG_ERROR([cannot find win32 console development files])
67  fi
68fi
69
70if test "${enable_slang}" != "no"; then
71  ac_cv_my_have_slang="no"
72  AC_CHECK_HEADERS(slang.h slang/slang.h,
73   [AC_CHECK_LIB(slang, SLkp_init,
74     [ac_cv_my_have_slang="yes"
75      AC_DEFINE(USE_SLANG, 1, Define to activate the slang backend driver)
76      CPPFLAGS="${CPPFLAGS} -DOPTIMISE_SLANG_PALETTE=1"
77      CACA_LIBS="${CACA_LIBS} -lslang"
78      CACA_DRIVERS="${CACA_DRIVERS} slang"])])
79  if test "${ac_cv_my_have_slang}" = "no" -a "${enable_slang}" = "yes"; then
80    AC_MSG_ERROR([cannot find slang development files])
81  fi
82fi
83
84if test "${enable_x11}" != "no"; then
85  AC_PATH_X
86  AC_CHECK_LIB(X11, XOpenDisplay,
87   [ac_cv_my_have_x11="yes"
88    if test -n "${x_includes}"; then X_CFLAGS="-I${x_includes}"; fi
89    if test -n "${x_libraries}"; then X_LIBS="-lX11 -L${x_libraries}"; fi
90    AC_DEFINE(USE_X11, 1, Define to activate the X11 backend driver)
91    CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
92    CACA_LIBS="${CACA_LIBS} ${X_LIBS}"
93    CACA_DRIVERS="${CACA_DRIVERS} x11"],
94   [ac_cv_my_have_x11="no"],
95   [[-lXt -L${x_libraries}]])
96  AC_CHECK_HEADERS(X11/XKBlib.h)
97  if test "${ac_cv_my_have_x11}" != "yes" -a "${enable_x11}" = "yes"; then
98    AC_MSG_ERROR([cannot find X11 development files])
99  fi
100fi
101
102if test "${enable_ncurses}" != "no"; then
103  ac_cv_my_have_ncurses="no"
104  AC_CHECK_HEADERS(ncurses.h,
105   [AC_CHECK_LIB(ncurses, initscr,
106     [ac_cv_my_have_ncurses="yes"
107      AC_DEFINE(USE_NCURSES, 1, Define to activate the ncurses backend driver)
108      CACA_LIBS="${CACA_LIBS} -lncurses"
109      CACA_DRIVERS="${CACA_DRIVERS} ncurses"])])
110  if test "${ac_cv_my_have_ncurses}" = "no" -a "${enable_ncurses}" = "yes"; then
111    AC_MSG_ERROR([cannot find ncurses development files])
112  fi
113fi
114
115AC_MSG_CHECKING(valid output drivers)
116if test -z "${CACA_DRIVERS}"; then
117  AC_MSG_RESULT(no)
118  AC_MSG_ERROR([no output drivers were selected!])
119else
120  AC_MSG_RESULT([${CACA_DRIVERS}])
121fi
122
123AC_SUBST(CACA_LIBS)
124
125# Optimizations
126CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
127# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
128CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
129
130# Build the PIC library?
131case "${target_os}" in
132  *mingw32* | *cygwin* | *djgpp*)
133    NEED_PIC=false
134    ;;
135  *)
136    NEED_PIC=:
137    ;;
138esac
139AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
140
141# Use Imlib2?
142ac_cv_my_have_imlib2="no"
143AC_ARG_ENABLE(imlib2,
144  [  --enable-imlib2         Imlib2 graphics support (default enabled)])
145save_CPPFLAGS="${CPPFLAGS}"
146if test "${enable_imlib2}" != "no"; then
147  AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
148  if test "${IMLIB2_CONFIG}" != "no"; then
149    CPPFLAGS="${CPPFLAGS} `imlib2-config --cflags` -DX_DISPLAY_MISSING=1"
150  fi
151  AC_CHECK_HEADERS(Imlib2.h,
152    ac_cv_my_have_imlib2="yes",
153   [ac_cv_my_have_imlib2="no"
154    AC_MSG_ERROR([[cannot find Imlib2 development files. Without Imlib2, cacaview will only open BMP files; if this is really what you want, re-run configure with '--disable-imlib2'.]])])
155  CPPFLAGS="${save_CPPFLAGS}"
156fi
157AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
158
159# Build documentation?
160AC_PATH_PROG(DOXYGEN, doxygen, no)
161AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
162
163# Build LaTeX documentation?
164AC_PATH_PROG(LATEX, latex, no)
165AC_PATH_PROG(DVIPS, dvips, no)
166if test "${DVIPS}" = "no"; then
167  LATEX="no"
168fi
169AC_MSG_CHECKING(for a4wide.sty)
170if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
171  AC_MSG_RESULT(yes)
172else
173  LATEX="no"
174  AC_MSG_RESULT(no)
175fi
176AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
177
178AC_CONFIG_FILES([
179  Makefile
180  src/Makefile
181  examples/Makefile
182  test/Makefile
183  doc/Makefile
184  doc/doxygen.cfg
185  autotools/Makefile
186  debian/Makefile
187])
188AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
189AC_OUTPUT
190
Note: See TracBrowser for help on using the repository browser.