source: libcaca/trunk/configure.ac @ 324

Last change on this file since 324 was 324, checked in by Sam Hocevar, 16 years ago
  • test/event.c: + Small event lister, similar to X11's xev.
  • src/graphics.c: + If possible, disable autorepeat in the X11 driver.
  • src/io.c: + Implemented CACA_EVENT_MOUSE_RELEASE in all drivers. + Button number support in CACA_EVENT_MOUSE_{PRESS,RELEASE}.
  • Property svn:keywords set to Id
File size: 5.2 KB
RevLine 
[71]1# $Id: configure.ac 324 2004-01-07 17:19:36Z 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
[310]9AM_INIT_AUTOMAKE(libcaca, 0.6)
[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
[284]20AC_ARG_ENABLE(slang,
[285]21  [  --enable-slang          slang graphics support (autodetected)])
[231]22AC_ARG_ENABLE(ncurses,
[285]23  [  --enable-ncurses        ncurses graphics support (autodetected)])
[155]24AC_ARG_ENABLE(conio,
25  [  --enable-conio          DOS conio.h graphics support (default disabled)])
[251]26AC_ARG_ENABLE(x11,
[285]27  [  --enable-x11            X11 support (autodetected)])
[17]28
[238]29AC_CHECK_HEADERS(inttypes.h endian.h)
[250]30AC_CHECK_FUNCS(vsnprintf getenv putenv strcasecmp)
[222]31
[284]32CACA_DRIVERS=""
33
[285]34if test "${enable_conio}" != "no"; then
35  AC_CHECK_HEADERS(conio.h,
36   [ac_cv_my_have_conio="yes"
37    AC_MSG_CHECKING(for ScreenUpdate in pc.h)
38    AC_EGREP_HEADER(ScreenUpdate,pc.h,
39     [AC_MSG_RESULT(yes)
40      AC_DEFINE(SCREENUPDATE_IN_PC_H, 1,
41                Define if <pc.h> defines ScreenUpdate.)],
42     [AC_MSG_RESULT(no)])
43    AC_DEFINE(USE_CONIO, 1, Define to activate the conio.h backend driver)
44    CACA_DRIVERS="${CACA_DRIVERS} conio"],
45   [ac_cv_my_have_conio="no"])
46  if test "${ac_cv_my_have_conio}" = "no" -a "${enable_conio}" = "yes"; then
47    AC_MSG_ERROR([cannot find conio.h])
48  fi
[265]49fi
50
[284]51if test "${enable_slang}" != "no"; then
[309]52  AC_CHECK_HEADERS(slang.h slang/slang.h,
53   ac_cv_my_have_slang="no"
[284]54   [AC_CHECK_LIB(slang, SLkp_init,
55     [ac_cv_my_have_slang="yes"
56      AC_DEFINE(USE_SLANG, 1, Define to activate the slang backend driver)
57      CPPFLAGS="${CPPFLAGS} -DOPTIMISE_SLANG_PALETTE=1"
58      CACA_LIBS="${CACA_LIBS} -lslang"
[309]59      CACA_DRIVERS="${CACA_DRIVERS} slang"])])
[284]60  if test "${ac_cv_my_have_slang}" = "no" -a "${enable_slang}" = "yes"; then
61    AC_MSG_ERROR([cannot find slang development files])
62  fi
[265]63fi
64
[284]65if test "${enable_x11}" != "no"; then
[251]66  AC_PATH_X
67  AC_CHECK_LIB(X11, XOpenDisplay,
[284]68   [ac_cv_my_have_x11="yes"
[277]69    if test -n "${x_includes}"; then X_CFLAGS="-I${x_includes}"; fi
[284]70    if test -n "${x_libraries}"; then X_LIBS="-lX11 -L${x_libraries}"; fi
71    AC_DEFINE(USE_X11, 1, Define to activate the X11 backend driver)
72    CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
73    CACA_LIBS="${CACA_LIBS} ${X_LIBS}"
74    CACA_DRIVERS="${CACA_DRIVERS} x11"],
75   [ac_cv_my_have_x11="no"],
[251]76   [[-lXt -L${x_libraries}]])
[324]77  AC_CHECK_HEADERS(X11/XKBlib.h)
[284]78  if test "${ac_cv_my_have_x11}" != "yes" -a "${enable_x11}" = "yes"; then
[251]79    AC_MSG_ERROR([cannot find X11 development files])
80  fi
[265]81fi
82
83if test "${enable_ncurses}" != "no"; then
[284]84  AC_CHECK_HEADERS(ncurses.h,
85   [AC_CHECK_LIB(ncurses, initscr,
86     [ac_cv_my_have_ncurses="yes"
87      AC_DEFINE(USE_NCURSES, 1, Define to activate the ncurses backend driver)
88      CACA_LIBS="${CACA_LIBS} -lncurses"
89      CACA_DRIVERS="${CACA_DRIVERS} ncurses"],
90     [ac_cv_my_have_ncurses="no"])],
91   [ac_cv_my_have_ncurses="no"])
92  if test "${ac_cv_my_have_ncurses}" = "no" -a "${enable_ncurses}" = "yes"; then
93    AC_MSG_ERROR([cannot find ncurses development files])
94  fi
[17]95fi
96
[284]97AC_MSG_CHECKING(valid output drivers)
98if test -z "${CACA_DRIVERS}"; then
99  AC_MSG_RESULT(no)
100  AC_MSG_ERROR([no output drivers were selected!])
101else
102  AC_MSG_RESULT([${CACA_DRIVERS}])
103fi
104
[244]105AC_SUBST(CACA_LIBS)
[17]106
[125]107# Optimizations
108CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer"
109# Code qui fait des warnings == code de porc == deux baffes dans ta gueule
[187]110CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare"
[125]111
[202]112# Build the PIC library?
113case "${target_os}" in
[207]114  *mingw32* | *cygwin* | *djgpp*)
[202]115    NEED_PIC=false
116    ;;
117  *)
118    NEED_PIC=:
119    ;;
120esac
121AM_CONDITIONAL(NEED_PIC, ${NEED_PIC})
122
[288]123# Use Imlib2?
124ac_cv_my_have_imlib2="no"
125AC_ARG_ENABLE(imlib2,
126  [  --enable-imlib2         Imlib2 graphics support (default enabled)])
[224]127save_CPPFLAGS="${CPPFLAGS}"
[288]128if test "${enable_imlib2}" != "no"; then
129  AC_PATH_PROG(IMLIB2_CONFIG, imlib2-config, no)
130  if test "${IMLIB2_CONFIG}" != "no"; then
131    CPPFLAGS="${CPPFLAGS} `imlib2-config --cflags` -DX_DISPLAY_MISSING=1"
132  fi
133  AC_CHECK_HEADERS(Imlib2.h,
134    ac_cv_my_have_imlib2="yes",
135   [ac_cv_my_have_imlib2="no"
136    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'.]])])
137  CPPFLAGS="${save_CPPFLAGS}"
[224]138fi
[288]139AM_CONDITIONAL(USE_IMLIB2, test "${ac_cv_my_have_imlib2}" = "yes")
[217]140
[207]141# Build documentation?
142AC_PATH_PROG(DOXYGEN, doxygen, no)
143AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no")
[270]144
145# Build LaTeX documentation?
[207]146AC_PATH_PROG(LATEX, latex, no)
[313]147AC_PATH_PROG(DVIPS, dvips, no)
148if test "${DVIPS}" = "no"; then
149  LATEX="no"
150fi
[207]151AC_MSG_CHECKING(for a4wide.sty)
152if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then
153  AC_MSG_RESULT(yes)
154else
[313]155  LATEX="no"
[207]156  AC_MSG_RESULT(no)
157fi
158AM_CONDITIONAL(LATEX, test "${LATEX}" != "no")
159
[245]160AC_CONFIG_FILES([
[17]161  Makefile
[190]162  src/Makefile
163  examples/Makefile
[292]164  test/Makefile
[207]165  doc/Makefile
[268]166  doc/doxygen.cfg
[39]167  autotools/Makefile
[17]168  debian/Makefile
169])
[245]170AC_CONFIG_FILES([caca-config], [chmod 0755 caca-config])
171AC_OUTPUT
[17]172
Note: See TracBrowser for help on using the repository browser.