]> git.draconx.ca Git - cdecl99.git/blob - configure.ac
Include glthread headers late.
[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], [1.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_ARG_WITH([readline],
16   [AS_HELP_STRING([--with-readline],
17     [use GNU readline for line-editing functionality (default: auto)])],
18   [], [with_readline=auto])
19 AS_CASE([$with_readline],
20   [no], [gl_cv_lib_readline=no],
21   [yes|auto], [:],
22   [*], [AC_MSG_ERROR([invalid option --with-readline=$with_readline])])
23
24 AC_PROG_CC_C99
25 AM_PROG_CC_C_O
26 gl_EARLY
27
28 LT_INIT
29 gl_INIT
30
31 AS_IF([test x"$gl_cv_lib_readline" = x"no"],
32   [AS_IF([test x"$with_readline" = x"yes"],
33     [AC_MSG_FAILURE([--with-readline requested but readline was not found])],
34     [dx_cv_rl_add_history=no])])
35 AC_CACHE_CHECK([if readline supports add_history], [dx_cv_rl_add_history], [dnl
36 dx_cv_rl_add_history=no
37 dx_save_libs=$LIBS
38 LIBS="$LIBS $LIBREADLINE"
39 AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
40 #include <stdio.h>
41 #if HAVE_READLINE_HISTORY_H
42 #  include <readline/history.h>
43 #endif
44 ], [dnl
45 (*add_history)("");
46 ])], [dx_cv_rl_add_history=yes], [dx_cv_rl_add_history=no])
47 LIBS=$dx_save_libs
48 ])
49
50 AS_IF([test x"$dx_cv_rl_add_history" = x"yes"],
51   [AC_DEFINE([HAVE_RL_ADD_HISTORY], [1],
52     [Define to 1 if readline supports add_history.])])
53
54 m4_include([lib/gnulib.mk])
55 DX_GLSYM_PREFIX([cdecl__])
56
57 dnl We provide our own makefile rules for gettext.  Disable tracing of
58 dnl AM_GNU_GETTEXT to prevent autoreconf from running autopoint, and to
59 dnl prevent automake from growing gratuitous error conditions.
60 m4_traceoff([AM_GNU_GETTEXT])
61 AM_GNU_GETTEXT([external])
62 DX_LINGUAS
63
64 DX_PROG_FLEX([], [have_flex=yes], [have_flex=no])
65 AM_CONDITIONAL([HAVE_FLEX], [test x"$have_flex" = x"yes"])
66
67 DX_PROG_BISON([], [have_bison=yes], [have_bison=no])
68 AM_CONDITIONAL([HAVE_BISON], [test x"$have_bison" = x"yes"])
69
70 DX_BISON_COMPAT
71 BISON_I18N
72
73 BISON_COMPAT=
74 AS_IF([test x"$dx_cv_bison_api_header_include" = x"yes"],
75   [BISON_COMPAT="'--define=api.header.include={\"\$(*F).h\"}'"])
76 AS_IF([test x"$dx_cv_bison_warn_no_deprecated" = x"yes"],
77   [AS_VAR_APPEND([BISON_COMPAT], ["${BISON_COMPAT:+ }-Wno-deprecated"])])
78 AC_SUBST([BISON_COMPAT])
79
80 AH_TOP([#include <conf_pre.h>])
81 AH_BOTTOM([#include <conf_post.h>])
82
83 AC_ARG_WITH([gsl],
84         [AS_HELP_STRING([--with-gsl],
85                 [specify whether to build test programs requiring the GNU Scientific Library. [default=auto]]
86         )], [with_gsl=$withval], [with_gsl=auto])
87
88 AS_CASE([$with_gsl],
89         [no], [have_gsl=no],
90         [yes], [DX_CHECK_GSL([1.0], [have_gsl=yes])],
91         [DX_CHECK_GSL([1.0], [have_gsl=yes], [have_gsl=no])])
92 AM_CONDITIONAL([HAVE_GSL], [test x"$have_gsl" = x"yes"])
93
94 AC_CONFIG_TESTDIR([.], [test:.])
95 DX_PROG_AUTOTEST
96 AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
97
98 AC_CONFIG_FILES([
99         Makefile
100 ])
101 AC_OUTPUT