Debian Codegraph @

src/configure.ac

raw
1 dnl autoconf configuration for gperf/src
2
3 dnl Copyright (C) 1998-2025 Free Software Foundation, Inc.
4 dnl Written by Douglas C. Schmidt <[email protected]>
5 dnl and Bruno Haible <[email protected]>.
6 dnl
7 dnl This file is part of GNU GPERF.
8 dnl
9 dnl This program is free software: you can redistribute it and/or modify
10 dnl it under the terms of the GNU General Public License as published by
11 dnl the Free Software Foundation; either version 3 of the License, or
12 dnl (at your option) any later version.
13 dnl
14 dnl This program is distributed in the hope that it will be useful,
15 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
16 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 dnl GNU General Public License for more details.
18 dnl
19 dnl You should have received a copy of the GNU General Public License
20 dnl along with this program. If not, see <https://www.gnu.org/licenses/>.
21
22 AC_PREREQ([2.64])
23 AC_INIT
24 AC_CONFIG_SRCDIR([main.cc])
25 AC_CONFIG_AUX_DIR([../build-aux])
26 AC_CONFIG_HEADERS([config.h])
27 AC_PROG_MAKE_SET
28 dnl
29 dnl checks for programs
30 dnl
31 AC_PROG_CC
32 dnl sets variable CC
33 AC_PROG_CPP
34 dnl sets variable CPP
35 AC_PROG_CXX
36 dnl sets variable CXX
37 AC_PROG_CXXCPP
38 dnl sets variable CXXCPP
39 AC_PROG_INSTALL
40 dnl sets variables INSTALL, INSTALL_DATA, INSTALL_PROGRAM
41 dnl
42 dnl checks for compiler characteristics
43 dnl
44 AC_CACHE_CHECK([for stack-allocated variable-size arrays],
45 [gp_cv_cxx_dynamic_array],
46 [AC_LANG_PUSH([C++])
47 AC_COMPILE_IFELSE(
48 [AC_LANG_PROGRAM([[int func (int n) { int dynamic_array[n]; }]], [[]])],
49 [gp_cv_cxx_dynamic_array=yes], [gp_cv_cxx_dynamic_array=no])
50 AC_LANG_POP([C++])
51 ])
52 if test $gp_cv_cxx_dynamic_array = yes; then
53 AC_DEFINE([HAVE_DYNAMIC_ARRAY], [1],
54 [Define if the C++ compiler supports stack-allocated variable-size arrays.])
55 fi
56 dnl
57 dnl checks for functions and declarations
58 dnl
59 dnl
60 dnl checks for libraries
61 dnl
62 AC_CHECK_LIB([m], [rand], [GPERF_LIBM="-lm"], [GPERF_LIBM=""])
63 AC_SUBST([GPERF_LIBM])
64 dnl
65 dnl Include lib/config.h through src/config.h.
66 dnl
67 AH_BOTTOM([
68 #undef/**/PACKAGE_NAME
69 #undef/**/PACKAGE_STRING
70 #undef/**/PACKAGE_TARNAME
71 #undef/**/PACKAGE_VERSION
72 #include "../lib/config.h"
73 ])
74 dnl
75 dnl That's it.
76 dnl
77 AC_CONFIG_FILES([Makefile])
78 AC_OUTPUT