1 | # $Id: configure.ac 207 2003-11-22 12:53:55Z sam $ |
---|
2 | |
---|
3 | AC_INIT(src/caca.c) |
---|
4 | |
---|
5 | AC_PREREQ(2.50) |
---|
6 | AC_CONFIG_AUX_DIR(autotools) |
---|
7 | AC_CANONICAL_SYSTEM |
---|
8 | |
---|
9 | AM_INIT_AUTOMAKE(libcaca, 0.1) |
---|
10 | AM_CONFIG_HEADER(config.h) |
---|
11 | |
---|
12 | AM_PROG_CC_C_O |
---|
13 | AC_PROG_CPP |
---|
14 | AC_PROG_RANLIB |
---|
15 | |
---|
16 | dnl AC_PROG_EGREP only exists in autoconf 2.54+, so we use AC_EGREP_CPP right |
---|
17 | dnl now otherwise it might be set in an obscure if statement. |
---|
18 | AC_EGREP_CPP(foo,foo) |
---|
19 | |
---|
20 | AC_ARG_ENABLE(slang, |
---|
21 | [ --enable-slang slang graphics support (default enabled)]) |
---|
22 | AC_ARG_ENABLE(ncurses, |
---|
23 | [ --enable-ncurses ncurses graphics support (default disabled)]) |
---|
24 | AC_ARG_ENABLE(conio, |
---|
25 | [ --enable-conio DOS conio.h graphics support (default disabled)]) |
---|
26 | |
---|
27 | USE_SLANG=false |
---|
28 | USE_NCURSES=false |
---|
29 | USE_CONIO=false |
---|
30 | if test "${enable_conio}" = "yes"; then |
---|
31 | AC_CHECK_HEADER(conio.h,:,AC_MSG_ERROR([cannot find conio.h header])) |
---|
32 | AC_MSG_CHECKING(for ScreenUpdate in pc.h) |
---|
33 | AC_EGREP_HEADER(ScreenUpdate,pc.h,[ |
---|
34 | AC_MSG_RESULT(yes) |
---|
35 | AC_DEFINE(SCREENUPDATE_IN_PC_H, 1, |
---|
36 | Define if <pc.h> defines ScreenUpdate.)],[ |
---|
37 | AC_MSG_RESULT(no)]) |
---|
38 | AC_DEFINE(USE_CONIO, 1, Define if the backend driver is conio.h) |
---|
39 | USE_CONIO=: |
---|
40 | elif test "${enable_ncurses}" = "yes"; then |
---|
41 | AC_CHECK_HEADER(ncurses.h,:,AC_MSG_ERROR([cannot find ncurses headers])) |
---|
42 | AC_CHECK_LIB(ncurses,initscr,:,AC_MSG_ERROR([cannot find ncurses library])) |
---|
43 | AC_DEFINE(USE_NCURSES, 1, Define if the backend driver is ncurses) |
---|
44 | USE_NCURSES=: |
---|
45 | elif test "${enable_slang}" != "no"; then |
---|
46 | AC_CHECK_HEADER(slang.h,:,AC_MSG_ERROR([cannot find slang headers])) |
---|
47 | AC_CHECK_LIB(slang,SLkp_init,:,AC_MSG_ERROR([cannot find slang library])) |
---|
48 | AC_DEFINE(USE_SLANG, 1, Define if the backend driver is slang) |
---|
49 | USE_SLANG=: |
---|
50 | else |
---|
51 | AC_MSG_ERROR([could not find any terminal graphics interface]) |
---|
52 | fi |
---|
53 | |
---|
54 | AM_CONDITIONAL(USE_SLANG, ${USE_SLANG}) |
---|
55 | AM_CONDITIONAL(USE_NCURSES, ${USE_NCURSES}) |
---|
56 | |
---|
57 | # Optimizations |
---|
58 | CFLAGS="${CFLAGS} -g -O2 -fno-strength-reduce -fomit-frame-pointer" |
---|
59 | # Code qui fait des warnings == code de porc == deux baffes dans ta gueule |
---|
60 | CFLAGS="${CFLAGS} -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wstrict-prototypes -Wshadow -Waggregate-return -Wmissing-prototypes -Wnested-externs -Wsign-compare" |
---|
61 | |
---|
62 | # Build the PIC library? |
---|
63 | case "${target_os}" in |
---|
64 | *mingw32* | *cygwin* | *djgpp*) |
---|
65 | NEED_PIC=false |
---|
66 | ;; |
---|
67 | *) |
---|
68 | NEED_PIC=: |
---|
69 | ;; |
---|
70 | esac |
---|
71 | AM_CONDITIONAL(NEED_PIC, ${NEED_PIC}) |
---|
72 | |
---|
73 | # Build documentation? |
---|
74 | AC_PATH_PROG(DOXYGEN, doxygen, no) |
---|
75 | AM_CONDITIONAL(DOXYGEN, test "${DOXYGEN}" != "no") |
---|
76 | AC_PATH_PROG(LATEX, latex, no) |
---|
77 | AC_MSG_CHECKING(for a4wide.sty) |
---|
78 | if test -f /usr/share/texmf/tex/latex/misc/a4wide.sty; then |
---|
79 | AC_MSG_RESULT(yes) |
---|
80 | else |
---|
81 | LATEX=no |
---|
82 | AC_MSG_RESULT(no) |
---|
83 | fi |
---|
84 | AM_CONDITIONAL(LATEX, test "${LATEX}" != "no") |
---|
85 | |
---|
86 | AC_OUTPUT([ |
---|
87 | Makefile |
---|
88 | src/Makefile |
---|
89 | examples/Makefile |
---|
90 | doc/Makefile |
---|
91 | autotools/Makefile |
---|
92 | debian/Makefile |
---|
93 | caca-config |
---|
94 | ],[ |
---|
95 | chmod 0755 caca-config |
---|
96 | ]) |
---|
97 | |
---|