root/todo/tags/0.1.20/configure.in

Revision 340, 2.5 kB (checked in by athomas, 2 years ago)

Dev Todo:

  • Fixes #25
  • Fix for compilation under G++ 4.1
Line 
1 AC_INIT(src/main.cc)
2 AM_INIT_AUTOMAKE(devtodo,0.1.20)
3
4 # We don't want the util source to be made into a shared lib as it's
5 # only used locally
6 AC_DISABLE_SHARED
7
8 AM_PROG_LIBTOOL
9 AC_PROG_CXX
10 AC_PROG_INSTALL
11 AC_PROG_LN_S
12
13 AC_LANG_CPLUSPLUS
14
15 # Extra options
16 AC_ARG_ENABLE(debug,
17         [  --enable-debug          enable debugging CXXFLAGS (-Wall -g) [off]],
18         [case "${enableval}" in
19                 yes) debug=true; CXXFLAGS="-Wall -g" ;;
20                 no) debug=false ;;
21                 *) AC_MSG_ERROR(--enable-debug expects either yes or no) ;;
22         esac], [debug=false])
23 AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
24
25 # Don't use termcap to obtain window size
26 AC_ARG_WITH(termcap, [  --without-termcap       don't use termcap to obtain terminal width])
27 if test "${with_termcap}_" = _ -o "${with_termcap}_" = yes; then
28         AC_DEFINE(USETERMCAP)
29 fi
30
31 # Check for various headers and functions - although I'm not doing anything
32 # with them yet
33 AC_CHECK_HEADERS(regex.h string utility iterator stdexcept list map vector \
34         typeinfo ctype.h stack iostream fstream ctime)
35 AC_CHECK_FUNCS(regcomp ctime time unlink isatty strncmp)
36
37 dnl The autoconf test for strftime is broken now (due to gcc 3.3 bug?):
38 dnl Gcc 3.3 testprog = ``extern "C" char strftime;'', build with g++ test.cc
39 dnl breaks with:
40 dnl   test.cc:1: error: nonnull argument with out-of-range operand number
41 dnl   (arg 1, operand 3)
42
43
44 AC_MSG_CHECKING(for strftime)
45
46 AC_COMPILE_IFELSE(
47 [AC_LANG_PROGRAM([#include <time.h>],
48 [[
49 char * s;
50 time_t t = time(NULL);
51 size_t x = strftime(s, 5, "%a", localtime(&t));
52 ]]
53 )],
54 [
55         AC_DEFINE(HAVE_STRFTIME, 1, [Define to 1 if you have the 'strftime' func
56 tion.])
57         AC_MSG_RESULT(yes)
58 ],
59 [AC_MSG_RESULT(no)])
60
61 # Check for readline - modified heavily from librep
62 # check for terminal library
63 # this is a very cool solution from octave's configure.in
64 unset tcap
65 for termlib in ncurses curses termcap terminfo termlib; do
66   AC_CHECK_LIB(${termlib}, tputs, [tcap="$tcap -l$termlib"])
67   case "$tcap" in
68     *-l${termlib}*)
69       break
70     ;;
71   esac
72 done
73
74 AC_CHECK_LIB(readline, readline,[READLINE_LIBS="-lreadline $tcap"], , $tcap)
75
76 if test -z "$READLINE_LIBS"; then
77         AC_MSG_ERROR([Can't find readline libraries])
78 fi
79 AC_SUBST(READLINE_LIBS)
80
81 SYSCONFDIR="`eval echo $sysconfdir`"
82 AC_DEFINE_UNQUOTED(SYSCONFDIR, "$SYSCONFDIR")
83 AC_SUBST(SYSCONFDIR)
84
85 AC_CHECK_PROG(HAVE_CRASH_CONFIG, crash-config, yes)
86 AC_SUBST(HAVE_CRASH_CONFIG)
87
88 AM_CONFIG_HEADER(config.h)
89 AC_OUTPUT(Makefile src/Makefile util/Makefile doc/Makefile doc/devtodo.1 makepackages.sh devtodo.spec devtodo.list)
90
91 chmod +x makepackages.sh
Note: See TracBrowser for help on using the browser.