]> git.draconx.ca Git - cdecl99.git/blob - configure.ac
Add basic readline history support.
[cdecl99.git] / configure.ac
1 dnl Copyright © 2011-2012 Nick Bowler
2 dnl
3 dnl License WTFPL2: Do What The Fuck You Want To Public License, version 2.
4 dnl This is free software: you are free to do what the fuck you want to.
5 dnl There is NO WARRANTY, to the extent permitted by law.
6
7 AC_PREREQ([2.68])
8 AC_INIT([cdecl99], [0.1], [nbowler@draconx.ca])
9 AC_CONFIG_HEADER([config.h])
10
11 AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
12 AM_SILENT_RULES([yes])
13
14 AC_PROG_CC_C99
15 AM_PROG_CC_C_O
16 gl_EARLY
17
18 LT_INIT
19 gl_INIT
20
21 AC_CACHE_CHECK([if readline supports add_history], [dx_cv_rl_add_history], [dnl
22 dx_cv_rl_add_history=no
23 dx_save_libs=$LIBS
24 LIBS="$LIBS $LIBREADLINE"
25 AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
26 #include <stdio.h>
27 #if HAVE_READLINE_HISTORY_H
28 #  include <readline/history.h>
29 #endif
30 ], [dnl
31 (*add_history)("");
32 ])], [dx_cv_rl_add_history=yes], [dx_cv_rl_add_history=no])
33 LIBS=$dx_save_libs
34 ])
35
36 AS_IF([test x"$dx_cv_rl_add_history" = x"yes"],
37         [AC_DEFINE([HAVE_RL_ADD_HISTORY], [1],
38                 [Define to 1 if readline supports add_history.])])
39
40 m4_include([lib/gnulib.mk])
41 DX_GLSYM_PREFIX([cdecl__])
42
43 dnl We provide our own makefile rules for gettext.  Disable tracing of
44 dnl AM_GNU_GETTEXT to prevent autoreconf from running autopoint, and to
45 dnl prevent automake from growing gratuitous error conditions.
46 m4_traceoff([AM_GNU_GETTEXT])
47 AM_GNU_GETTEXT([external])
48 DX_LINGUAS
49
50 AC_ARG_VAR([FLEX], [Command to invoke flex.  Defaults to flex.])
51 AC_ARG_VAR([FLEXFLAGS], [Additional options to pass to flex.])
52 AC_CHECK_PROGS([FLEX], [flex], [flex])
53
54 AC_ARG_VAR([BISON], [Command to invoke GNU Bison.  Defaults to bison.])
55 AC_ARG_VAR([BISONFLAGS], [Additional options to pass to Bison.])
56 AC_CHECK_PROGS([BISON], [bison], [bison])
57 BISON_I18N
58
59 GLOBAL_SYMBOL_PIPE=$lt_cv_sys_global_symbol_pipe
60 AC_SUBST([GLOBAL_SYMBOL_PIPE])
61
62 AH_TOP([#include <conf_pre.h>])
63 AH_BOTTOM([#include <conf_post.h>])
64
65 AC_ARG_WITH([gsl],
66         [AS_HELP_STRING([--with-gsl],
67                 [specify whether to build test programs requiring the GNU Scientific Library. [default=auto]]
68         )], [with_gsl=$withval], [with_gsl=auto])
69
70 AS_CASE([$with_gsl],
71         [no], [have_gsl=no],
72         [yes], [DX_CHECK_GSL([1.0], [have_gsl=yes])],
73         [DX_CHECK_GSL([1.0], [have_gsl=yes], [have_gsl=no])])
74 AM_CONDITIONAL([HAVE_GSL], [test x"$have_gsl" = x"yes"])
75
76 AC_CONFIG_FILES([
77         Makefile
78 ])
79 AC_OUTPUT