1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
|
dnl configure.ac for GNU poke
dnl
dnl Please process this file with autoconf to get a 'configure'
dnl script.
dnl Copyright (C) 2019, 2020, 2021, 2022 Jose E. Marchesi
dnl This program is free software: you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation, either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_INIT([GNU poke], [2.4], [poke-devel@gnu.org], [poke],
[http://www.jemarch.net/poke.html])
AC_CONFIG_AUX_DIR([build-aux])
dnl In order to have a custom INSTALL file, we need Automake option 'foreign'.
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADERS(poke/config.h)
AC_CONFIG_MACRO_DIRS([m4])
# Include the Autoconf macros from Jitter.
m4_include([m4/jitter.m4])
dnl Autobuild
dnl AB_INIT
AC_DEFINE([PACKAGE_BUGZILLA],["https://sourceware.org/bugzilla/describecomponents.cgi?product=poke"],[URL for entering bugs in the project's bugzilla])
AC_PROG_CC
gl_EARLY
libpoke_EARLY
gui_EARLY
LT_INIT
AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_ARG_VAR([LEX], [The flex implementation to use.])
if test -n "$LEX"; then
AC_MSG_CHECKING([for flex])
AC_MSG_RESULT([$LEX])
else
AC_PATH_PROG([LEX], [flex], [:])
fi
gl_PROG_BISON([POKE_BISON],[3.6])
dnl System
AC_CANONICAL_HOST
canonical=$host
dnl The proc IOD is currently Linux-specific, since it relies on the
dnl availability of the /proc file-system.
case "${host_os}" in
linux*)
have_proc=yes ;;
*)
have_proc=no ;;
esac
if test "x$have_proc" = "xyes"; then
AC_DEFINE([HAVE_PROC], 1,
[Defined if the host system features a proc directory.])
fi
AM_CONDITIONAL([HAVE_PROC], [test "x$have_proc" = "xyes"])
gl_INIT
libpoke_INIT
gui_INIT
# Try to find a libtextstyle with hyperlinks support.
gl_LIBTEXTSTYLE_OPTIONAL([0.20.5])
# GNU help2man creates man pages from --help output; in many cases, this
# is sufficient, and obviates the need to maintain man pages separately.
# However, this means invoking executables, which we generally cannot do
# when cross-compiling, so we test to avoid that (the variable
# "cross_compiling" is set by AC_PROG_CC).
if test $cross_compiling = no; then
AM_MISSING_PROG(HELP2MAN, help2man)
else
HELP2MAN=:
fi
dnl The following Automake conditional is used in some Makefile.am files
dnl in order to avoid actions that wouln't work while cross compiling.
AM_CONDITIONAL([NATIVE_BUILD], [test "x$cross_compiling" = "xno"])
dnl recfix is part of the GNU recutils suite, and is used in cfg.mk to
dnl implement a syntax-check for etc/poke.rec. If recfix is not
dnl present we set RECFIX to : so the rule wont fail.
AC_CHECK_PROGS([RECFIX],[recfix],[:])
dnl i18n with gettext
AM_GNU_GETTEXT_VERSION([0.19.8])
AM_GNU_GETTEXT([external])
dnl RAS requires a version of awk that supports gensub(). However,
dnl since we are including the RAS-generated .pkc files in the
dnl tarball, this should not be a hard dependency here: people
dnl building poke from released tarballs are not required to have any
dnl particular version of awk installed. We therefore set RAS_AWK
dnl here, using the value ':' for when no suitable awk is found. Then
dnl in the `.pkc : .pks' rule in Makefile.am an error message is
dnl emitted in case no proper AWK is present.
AX_CHECK_AWK_GENSUB([RAS_AWK=$AWK], [RAS_AWK=:])
AC_SUBST([RAS_AWK])
dnl The Boehm-Weiser garbage collector
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES(BDW_GC,[bdw-gc],[have_gc=yes],[have_gc=no])
dnl The JSON-C library for the machine-interface
AC_ARG_ENABLE([mi],
AS_HELP_STRING([--enable-mi],
[Enable the poke Machine-Interface (default is YES)]),
[mi_enabled=$enableval], [mi_enabled=yes])
if test "x$mi_enabled" = "xyes"; then
PKG_CHECK_MODULES(JSON_C,[json-c],[],[mi_enabled=no])
fi
AM_CONDITIONAL([POKE_MI], [test "x$mi_enabled" = "xyes"])
if test "x$mi_enabled" = "xyes"; then
AC_DEFINE([POKE_MI], 1,
[Defined if building poke with the machine-interface enabled])
fi
dnl Jitter
JITTER_JITTER_SUBPACKAGE([jitter])
dnl Profiling in the PVM
AC_ARG_ENABLE([pvm-profiling],
AS_HELP_STRING([--enable-pvm-profiling],
[Enable profiling in the PVM (default is NO)]),
[profiling_enabled=$enableval], [profiling_enabled=no])
if test "x$profiling_enabled" = "xyes"; then
AC_DEFINE([PVM_PROFILE_COUNT], [1], [use count-based profiling in the PVM])
AC_DEFINE([PVM_PROFILE_SAMPLE], [1], [use sample-based profiling in the PVM])
fi
dnl libnbd for nbd:// io spaces (optional). Testing it also requires
dnl nbdkit
AC_ARG_ENABLE([libnbd],
AS_HELP_STRING([--enable-libnbd],
[Enable building with NBD support (default is YES)]),
[libnbd_enabled=$enableval], [libnbd_enabled=yes])
if test "x$libnbd_enabled" = "xyes"; then
PKG_CHECK_MODULES([LIBNBD], [libnbd], [
AC_SUBST([LIBNBD_CFLAGS])
AC_SUBST([LIBNBD_LIBS])
AC_DEFINE([HAVE_LIBNBD], [1], [libnbd found at compile time])
AC_PATH_PROGS([NBDKIT], [nbdkit], [no], [$PATH:/usr/local/sbin:/usr/sbin])
], [libnbd_enabled=no NBDKIT=no])
else
NBDKIT=no
fi
AM_CONDITIONAL([NBD], [test "x$libnbd_enabled" = "xyes"])
dnl Used in Makefile.am. See the note there.
WITH_JITTER=$with_jitter
AC_SUBST([WITH_JITTER])
dnl We need to determine the endianness of the host system. The
dnl following macro is also supposed to work when cross-compiling.
AC_C_BIGENDIAN
dnl The following M4 macro from gnulib sets HOST_CPU_C_ABI_32BIT to
dnl 'yes' if the C language ABI is a 32-bit one, to 'no' if it is
dnl 64-bit, or to 'unknown'.
dnl
dnl We set POKE_HOST_32BIT accordingly, and warn if the 32bitness of
dnl the host cannot be determined.
gl_HOST_CPU_C_ABI_32BIT
case "$HOST_CPU_C_ABI_32BIT" in
yes)
AC_DEFINE([POKE_HOST_32BIT],[1],[whether the host C ABI is 32-bit]);;
unknown)
AC_MSG_WARN([unable to determine whether the host C ABI is 32-bit]);;
*) ;;
esac
dnl Use libtextstyle if available. Otherwise, use the dummy header
dnl file provided by gnulib's libtextstyle-optional module.
gl_LIBTEXTSTYLE_OPTIONAL
AX_LIBTEXTSTYLE_HYPERLINK
if test $HAVE_LIBTEXTSTYLE = yes; then
AC_CHECK_LIB([textstyle], [term_styled_ostream_get_destination], [
AC_DEFINE([HAVE_TEXTSTYLE_ACCESSORS_SUPPORT], 1,
[Defined if libtextstyle has support for terminal hyperlinks])
])
fi
dnl The hyperlinks server is optional. It is enabled by default if
dnl there is a libtextstyle with hyperlinks support available.
AC_ARG_ENABLE([hserver],
AS_HELP_STRING([--enable-hserver],
[Enable the terminal hyperlinks server (default is YES)]),
[hserver_enabled=$enableval], [hserver_enabled=$has_hyper_support])
if test "x$has_hyper_support" = "xno"; then
hserver_enabled=no
fi
AM_CONDITIONAL([HSERVER], [test "x$hserver_enabled" = "xyes"])
if test "x$hserver_enabled" = "xyes"; then
AC_DEFINE([HAVE_HSERVER], 1,
[Defined if the hyperlinks server is available])
fi
dnl The GUI is optional, and depends on the availability of Tcl and
dnl Tk.
AC_ARG_ENABLE([gui],
AS_HELP_STRING([--enable-gui],
[Enable the GUI (default is NO)]),
[gui_enabled=$enableval], [gui_enabled=no])
if test "x$gui_enabled" = "xyes"; then
POKE_TCLTK
gui_enabled=$has_tcltk
fi
AM_CONDITIONAL([GUI], [test "x$gui_enabled" = "xyes"])
dnl The test framework is optional.
AC_CHECK_HEADERS([dejagnu.h])
AM_CONDITIONAL([HAVE_DEJAGNU], [test "$ac_cv_header_dejagnu_h" = yes])
dnl editor syntax definitions
AC_ARG_WITH([vimdir],
[AS_HELP_STRING([--with-vimdir],
[override the default vim directory])],
[ vimdir="$withval"
AC_MSG_CHECKING([where vim files should go])
AC_MSG_RESULT([$vimdir])],
[ vimdir='${datadir}/vim/vimfiles' ]
)
AC_SUBST([vimdir])
AM_PATH_LISPDIR
dnl Generate output files
AC_CONFIG_FILES(Makefile
gl/Makefile
gl-libpoke/Makefile
gl-gui/Makefile
libpoke/Makefile
poke/Makefile
gui/Makefile
utils/Makefile
pickles/Makefile
maps/Makefile
doc/Makefile
man/Makefile
po/Makefile.in
etc/Makefile
etc/vim/Makefile
testsuite/Makefile
testsuite/poke.libpoke/Makefile
testsuite/poke.mi-json/Makefile)
AC_CONFIG_FILES([run],
[chmod +x,-w run])
dnl pkg-config description
AX_CREATE_PKGCONFIG_INFO('libpoke/poke.pc', , , 'libpoke')
AC_OUTPUT
dnl Report warnings
if test "x$HAVE_LIBTEXTSTYLE" = "xno"; then
AC_MSG_WARN([libtextstyle was not found in the system. Poke's output won't be styled.])
fi
if test "x$hserver_enabled" = "xno"; then
AC_MSG_WARN([building poke without terminal hyperlinks server support.
Install a hyperlinks-capable libtextstyle and use --enable-hserver to activate it.])
fi
if test "x$libnbd_enabled" != "xyes"; then
AC_MSG_WARN([building poke without NBD io space support.
Install libnbd to use it.])
fi
if test "x$mi_enabled" = "xno"; then
AC_MSG_WARN([building poke without the machine interface support.
Install libjson-c and use --enable-mi to activate it.])
fi
if test "x$gui_enabled" = "xno"; then
AC_MSG_WARN([building poke without GUI support.
Install tcl-dev and tk-dev and use --enable-gui to activate it.])
fi
dnl Report errors
if test "x$have_gc" = "xno"; then
AC_MSG_ERROR([can't find the Boehm GC library. Please install it.])
fi
if test "x$gl_cv_lib_readline" = "xno"; then
AC_MSG_ERROR([can't find an usable libreadline. Please install one.])
fi
dnl End of configure.ac
|