]> git.draconx.ca Git - cdecl99.git/blob - configure.ac
Fix testcase compilation with --disable-shared.
[cdecl99.git] / configure.ac
1 dnl Copyright © 2011-2013, 2020-2021 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], [1a], [nbowler@draconx.ca])
9 AC_CONFIG_HEADERS([config.h])
10
11 AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects dist-xz])
12 AM_SILENT_RULES([yes])
13 DX_AUTOMAKE_COMPAT
14
15 AC_PROG_CC_C99
16 AM_PROG_CC_C_O
17 gl_EARLY
18
19 LT_INIT
20 gl_INIT
21
22 AC_CACHE_CHECK([if readline supports add_history], [dx_cv_rl_add_history], [dnl
23 dx_cv_rl_add_history=no
24 dx_save_libs=$LIBS
25 LIBS="$LIBS $LIBREADLINE"
26 AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
27 #include <stdio.h>
28 #if HAVE_READLINE_HISTORY_H
29 #  include <readline/history.h>
30 #endif
31 ], [dnl
32 (*add_history)("");
33 ])], [dx_cv_rl_add_history=yes], [dx_cv_rl_add_history=no])
34 LIBS=$dx_save_libs
35 ])
36
37 AS_IF([test x"$dx_cv_rl_add_history" = x"yes"],
38         [AC_DEFINE([HAVE_RL_ADD_HISTORY], [1],
39                 [Define to 1 if readline supports add_history.])])
40
41 m4_include([lib/gnulib.mk])
42 DX_GLSYM_PREFIX([cdecl__])
43
44 dnl We provide our own makefile rules for gettext.  Disable tracing of
45 dnl AM_GNU_GETTEXT to prevent autoreconf from running autopoint, and to
46 dnl prevent automake from growing gratuitous error conditions.
47 m4_traceoff([AM_GNU_GETTEXT])
48 AM_GNU_GETTEXT([external])
49 DX_LINGUAS
50
51 DX_PROG_FLEX([], [have_flex=yes], [have_flex=no])
52 AM_CONDITIONAL([HAVE_FLEX], [test x"$have_flex" = x"yes"])
53
54 DX_PROG_BISON([], [have_bison=yes], [have_bison=no])
55 AM_CONDITIONAL([HAVE_BISON], [test x"$have_bison" = x"yes"])
56
57 DX_BISON_COMPAT
58 BISON_I18N
59
60 BISON_COMPAT=
61 AS_IF([test x"$dx_cv_bison_api_header_include" = x"yes"],
62   [BISON_COMPAT="'--define=api.header.include={\"\$(*F).h\"}'"])
63 AS_IF([test x"$dx_cv_bison_warn_no_deprecated" = x"yes"],
64   [AS_VAR_APPEND([BISON_COMPAT], ["${BISON_COMPAT:+ }-Wno-deprecated"])])
65 AC_SUBST([BISON_COMPAT])
66
67 AH_TOP([#include <conf_pre.h>])
68 AH_BOTTOM([#include <conf_post.h>])
69
70 AC_ARG_WITH([gsl],
71         [AS_HELP_STRING([--with-gsl],
72                 [specify whether to build test programs requiring the GNU Scientific Library. [default=auto]]
73         )], [with_gsl=$withval], [with_gsl=auto])
74
75 AS_CASE([$with_gsl],
76         [no], [have_gsl=no],
77         [yes], [DX_CHECK_GSL([1.0], [have_gsl=yes])],
78         [DX_CHECK_GSL([1.0], [have_gsl=yes], [have_gsl=no])])
79 AM_CONDITIONAL([HAVE_GSL], [test x"$have_gsl" = x"yes"])
80
81 AC_CONFIG_TESTDIR([.], [test:.])
82 DX_PROG_AUTOTEST
83 AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
84
85 AC_CONFIG_FILES([
86         Makefile
87 ])
88 AC_OUTPUT