]> git.draconx.ca Git - dxcommon.git/blob - configure.ac
DX_AUTOMAKE_COMPAT: Fix compile with newer Automake.
[dxcommon.git] / configure.ac
1 dnl Copyright © 2015, 2019-2023 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([dxcommon], [0], [nbowler@draconx.ca])
9 AC_CONFIG_SRCDIR([m4/base.m4])
10
11 DX_INIT([.])
12
13 AM_INIT_AUTOMAKE([-Wall -Wno-portability foreign subdir-objects])
14 AM_SILENT_RULES([yes])
15 DX_AUTOMAKE_COMPAT
16
17 # To ensure automake --add-missing copies config.guess/config.sub
18 AC_CANONICAL_HOST
19
20 AC_PROG_CC
21 AC_PROG_RANLIB
22 AC_PROG_AWK
23
24 AC_USE_SYSTEM_EXTENSIONS
25 AC_C_INLINE
26
27 AC_SUBST([STUB_INCLUDES], [@&t@])
28
29 AC_CHECK_FUNCS_ONCE([wcwidth])
30 AM_CONDITIONAL([HAVE_WCWIDTH], [test x"$ac_cv_func_wcwidth" = x"yes"])
31
32 AC_CONFIG_TESTDIR([.])
33 DX_PROG_AUTOTEST
34 AM_CONDITIONAL([HAVE_AUTOTEST], [test x"$dx_cv_autotest_works" = x"yes"])
35
36 AC_CACHE_CHECK([for struct option in <getopt.h>], [dx_cv_have_struct_option],
37   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <getopt.h>],
38 [[struct option opt = { "aaaa", 2, (void *)0, 'a' };
39 return opt.name[opt.flag ? opt.val : opt.has_arg];]])],
40   [dx_cv_have_struct_option=yes], [dx_cv_have_struct_option=no])])
41 AS_IF([test x"$dx_cv_have_struct_option" != x"yes"],
42   [AS_VAR_APPEND([STUB_INCLUDES], ['-I${top_srcdir}/t/getopt'])])
43
44 AM_CONDITIONAL([HAVE_STRUCT_OPTION],
45   [test x"$dx_cv_have_struct_option" = x"yes"])
46
47 AC_ARG_VAR([PERL], [command to execute perl programs])
48 AC_CHECK_PROGS([PERL], [perl], [false])
49
50 AC_CONFIG_FILES([Makefile atlocal])
51 AC_OUTPUT