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 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
|
dnl # emacs edit mode for this file is -*- sh -*-
dnl #
dnl # configure.in - process this file with `autoconf' to generate
dnl # a `configure' script.
dnl #
dnl # See the `INSTALL' file for information on how the `configure'
dnl # script works.
dnl #
#
# - initialisation.
#
AC_INIT([factory], [4.1.1])
AC_CONFIG_SRCDIR(canonicalform.cc)
AC_CONFIG_MACRO_DIR([../m4])
AC_CONFIG_AUX_DIR([../build-aux])
AC_CONFIG_HEADER([_config.h])
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_MAINTAINER_MODE([enable])
# Add pre'prefixed config
AX_PREFIX_CONFIG_H([config.h],[],[_config.h])
#
# - check for CC and CXX but be careful about CFLAGS.
#
SING_RESET_FLAGS()
SING_CHECK_SET_ARGS()
#AC_PROG_CC
#AC_PROG_CXX
#
# - check for some other programs.
#
AC_PROG_CPP
AC_PROG_CXXCPP
AC_PROG_LN_S
AC_PROG_INSTALL
## AC_DISABLE_STATIC
AC_PROG_YACC
LT_INIT([win32-dll])
AC_PROG_MAKE_SET
AC_CHECK_PROG(AR, ar, ar, where-is-your-ar)
AC_CHECK_PROG(M4, m4, m4, where-is-your-m4)
AC_CHECK_PROG(BISON, bison, bison, where-is-your-bison)
AC_CHECK_SIZEOF(long,4)
AC_C_CONST
AC_C_INLINE
SING_WIN_FLAGS
#
# - check withs and enables.
#
AC_ARG_ENABLE(
cf-inline,
[AS_HELP_STRING([--disable-cf-inline],[build Factory with \"configurable inline methods\" disabled.])],
[enable_cf_inline=$enableval],
[enable_cf_inline=yes])
AC_ARG_ENABLE(
assertions,
[AS_HELP_STRING([--disable-assertions],[build Factory with no assertions])],
,
enable_assertions=yes)
AC_ARG_ENABLE(
timing,
[AS_HELP_STRING([--enable-timing],[build Factory so it will print timing information])],
,
enable_timing=no)
AC_ARG_ENABLE(
debugoutput,
[AS_HELP_STRING([--enable-debugoutput],[build Factory so it will print debugging information])],
,
enable_debugoutput=no)
AC_ARG_ENABLE(
streamio,
[AS_HELP_STRING([--enable-streamio],[build Factory with stream IO])],
,
[enable_streamio=no])
AH_TEMPLATE([NOSTREAMIO], [define to build factory without stream IO])
AC_ARG_WITH(
Singular,
[AS_HELP_STRING([--without-Singular],[(obsolete) build NOT for the use with CAS Singular.])],
,
[with_Singular=yes])
AC_SUBST(DEB_HOST_MULTIARCH)
PKG_REQUIRE="$PKG_REQUIRE"
AC_SUBST(PKG_REQUIRE)
SING_CHECK_OMALLOC()
AH_TEMPLATE([SINGULAR], [define if linked to Singular])
AH_TEMPLATE([DISABLE_GMP_CPP],[DISABLE_GMP_CPP])
# Singular
if test "x$with_Singular" = xyes; then
AC_DEFINE([SINGULAR],[1])
AC_DEFINE([DISABLE_GMP_CPP],[1])
# AC_DEFINE([NOSTREAMIO],[1])
fi
# || test "x$with_Singular" = xyes
# Use no streamio (C++) if SINGULAR or explicitely disabled
if test "x$enable_streamio" = xno; then
AC_DEFINE([NOSTREAMIO],[1])
fi
AM_CONDITIONAL(
[WITH_PARSER_FOR_CANONICAL_FORM],
[test "x$enable_streamio" = xyes])
AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libsingular_resources] )
AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libsingular_resources] )
AC_MSG_CHECKING(whether libsingular_resources should be used)
if test "x$with_Singular" = xyes;
then
AC_MSG_RESULT(yes)
AC_MSG_CHECKING([ RESOURCES_INCLUDES?..])
AC_MSG_RESULT(${RESOURCES_INCLUDES:-unset})
AC_MSG_CHECKING([ RESOURCES_LIBS?..])
AC_MSG_RESULT(${RESOURCES_LIBS:-unset})
PKG_REQUIRE="$PKG_REQUIRE singular-resources"
AC_SUBST(PKG_REQUIRE)
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL([ENABLE_RESOURCES],[test "x$with_Singular" = xyes])
DX_INIT_DOXYGEN($PACKAGE_NAME, doxygen.cfg, $srcdir/docu)
# do not use `MKINSTALLDIRS' and `MAKEHEADER' since there may be
# name clashes with other peoples configure scripts via
# `config.cache'. Furthermore, we do not use cache at all to
# avoid some nasty problems with our own development environment.
#unset ac_cv_path_FACTORY_MKINSTALLDIRS
#unset ac_cv_path_FACTORY_MAKEHEADER
#save_path="$PATH"
#PATH="$PATH:$srcdir/bin"
#AC_PATH_PROG(FACTORY_MKINSTALLDIRS, mkinstalldirs, -mkdir)
#PATH="$srcdir/bin:$save_path"
#AC_PATH_PROG(FACTORY_MAKEHEADER, makeheader)
#PATH="$save_path"
#
# - expand paths.
#
#AC_MSG_CHECKING(and generating explicit install paths)
## generate Makefile
#save_prefix="$prefix"
#save_exec_prefix="$exec_prefix"
#test "x$prefix" = xNONE && prefix=$ac_default_prefix
#test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
#for dir in prefix exec_prefix bindir sbindir libexecdir \
# datadir sysconfdir sharedstatedir localstatedir libdir \
# includedir oldincludedir infodir mandir; do
# eval "dir_value=\$$dir"
# cat >> ./conftest.mk << EXPLPATHEOT
#$dir=$dir_value
#explicit_$dir:
# @ echo \$($dir)
# @ if echo \$($dir) | grep '^/'; \\
# then echo \$($dir) > ./conftest.dir; \\
# else echo \`pwd\`/\$($dir) > ./conftest.dir; fi
#EXPLPATHEOT
#done
#prefix="$save_prefix"
#exec_prefix="$save_exec_prefix"
# generate the explicit paths
#make >&5 2>&1 -f ./conftest.mk explicit_datadir
#explicit_datadir=`cat ./conftest.dir`
#make >&5 2>&1 -f ./conftest.mk explicit_libdir
#explicit_libdir=`cat ./conftest.dir`
#make >&5 2>&1 -f ./conftest.mk explicit_includedir
#explicit_includedir=`cat ./conftest.dir`
# clean up
#rm -f ./conftest.mk ./conftest.dir
#AC_MSG_RESULT(done)
#
# - check for libraries.
#
AC_CHECK_LIB(m, atof, , [ AC_MSG_ERROR(libm.a not found) ])
LB_CHECK_GMP(3.1.1,,AC_MSG_ERROR([Unable to find GMP on your machine: please use --with-gmp=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
#NTL 9.6.4 requires -lpthread/-pthread
AC_SEARCH_LIBS(sem_wait,[rt pthreads pthread],[],[
AC_MSG_ERROR([sem_wait not found in rt,pthreads,pthread])
])
LB_CHECK_NTL(5.0,,AC_MSG_WARN([Unable to find NTL (which is strongly recommended) on your machine: please use --with-ntl=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
LB_CHECK_FLINT(2.4,,AC_MSG_WARN([Unable to find FLINT (which is strongly recommended) on your machine: please use --with-flint=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
# arithmetic shift
#AC_MSG_CHECKING(whether your compiler does arithmetic shifts)
#AC_CACHE_VAL(ac_cv_shift,
# [ LDFLAGS="-L$explicit_libdir $LDFLAGS"
# AC_TRY_RUN(
# [ int main() { if (-2 >> 1 == -1) return(0); else return(1); } ],
# ac_cv_shift=yes, ac_cv_shift=no, ac_cv_shift=yes) ])
#if test "x$ac_cv_shift" = xyes; then
# AC_MSG_RESULT(yes)
#else
# AC_MSG_RESULT(no)
#fi
#
# - check for header files.
#
AC_LANG_CPLUSPLUS
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS(stdio.h stdlib.h string.h time.h math.h, ,
[ AC_MSG_ERROR(C header files not found) ])
AC_CHECK_HEADERS(cstdio)
if test "x$enable_streamio" != xno; then
AC_CHECK_HEADERS(iostream.h strstream.h fstream.h iostream string fstream)
AC_CHECK_HEADERS(ctype.h, , [ AC_MSG_ERROR(standard C header files not found) ])
# since the FTE will compile only with stream IO enabled we will not
# check for the necessary header files if stream IO is disabled
AC_CHECK_HEADERS(stdarg.h signal.h errno.h unistd.h, ,
[ AC_MSG_WARN(C/C++ header files not found.
You will not be able to build the Factory Test Environment
(though Factory itself should compile)) ])
fi
if test "x$enable_timing" != xno; then
AC_CHECK_HEADERS(sys/param.h sys/times.h, ,
[ AC_MSG_ERROR(\`sys/times.h' or \`sys/param.h' not found. Try
\`configure --disable-timing') ])
fi
# font-lock-trick: '
#
# - check for compiler characteristics.
#
# use C to check compiler characteristics instead of C++. On
# nextstep, checking with C++ may fail.
# AC_LANG_C
# cross-compiling ?!
#AC_C_CROSS
#if test "x$cross_compiling" = xyes; then
# AC_MSG_WARN([you better specify a cache file to get the values for
# cross-compiling right (e.g., call \`configure
# --cache-file=yourTarget.cache'). In particular, you
# should make sure that your target machine supports
# arithmetic shift.])
#fi
# font-lock-trick: '
#
# - paths.
#
# note that Singular has its own mechanism to search the tables,
# hence we do not need to mind it here
#gftabledir='${datadir}/factory/gftables'
#explicit_gftabledir="$explicit_datadir/gftables"
# for installation of the templates
#templatedir='${includedir}/templates'
#
# - set defines and variables according to our tests.
#
## CFLAGS
#if test "x$GCC" = xyes && test "x$cflags_expl_set" = xno; then
# CFLAGS=""
#fi
# CXXFLAGS
#if test "x$GXX" = xyes && test "x$cxxflags_expl_set" = xno; then
# CXXFLAGS=""
#
#AC_LANG_SAVE
#AC_LANG_CPLUSPLUS
# check whether CXX accepts -fno-rtti
#AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
#tmp_flags=${CXXFLAGS}
#CXXFLAGS="${CXXFLAGS}"
#AC_CACHE_VAL(ac_cv_cxx_have_rtti,
#AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
#)
#AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
#CXXFLAGS=$tmp_flags
#if test "${ac_cv_cxx_have_rtti}" = yes; then
#CXXFLAGS="$CXXFLAGS"
#fi
#AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
#tmp_flags=${CXXFLAGS}
#CXXFLAGS="${CXXFLAGS} -fno-exceptions"
#AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
#AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
#)
#AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
#CXXFLAGS=$tmp_flags
#if test "${ac_cv_cxx_have_exceptions}" = yes; then
#CXXFLAGS="$CXXFLAGS -fno-exceptions"
#fi
#AC_LANG_RESTORE
#
#fi
# ARFLAGS
#test "${ARFLAGS+set}" = set || ARFLAGS=cr
# M4FLAGS
#test "${M4FLAGS+set}" = set || M4FLAGS=
# arithmetic shift
#if test "x$ac_cv_shift" = xyes; then
# AC_DEFINE([HAS_ARITHMETIC_SHIFT],[1],[HAS_ARITHMETIC_SHIFT])
#fi
AH_TEMPLATE([CF_USE_INLINE], [define to use "configurable inline methods" (see cf_inline.cc)])
# "configurable inline methods"
if test "x$enable_cf_inline" != xno; then
AC_DEFINE([CF_USE_INLINE],[1])
fi
AH_TEMPLATE([NOASSERT], [define if you do not want to activate assertions])
# assertions
if test "x$enable_assertions" = xno; then
AC_DEFINE([NOASSERT],[1])
fi
AH_TEMPLATE([TIMING], [define if you want to activate the timing stuff])
# timing
if test "x$enable_timing" != xno; then
AC_DEFINE([TIMING],[1])
fi
# debugoutput
AH_TEMPLATE([DEBUGOUTPUT], [define if you want to have debugging output])
if test "x$enable_debugoutput" != xno; then
AC_DEFINE([DEBUGOUTPUT],[1])
fi
#
# - complete and substitute variables, defines.
#
#AC_SUBST(gftabledir)
#AC_SUBST(templatedir)
# AC_SUBST(libfactory)
#AC_SUBST(ARFLAGS)
#AC_SUBST(M4FLAGS)
AC_SUBST(MAKEHEADERFLAGS)
#AC_SUBST(factorysrc)
#AC_SUBST(factoryincl)
#AC_SUBST(alltargets)
#AC_SUBST(installtargets)
#AC_SUBST(uninstalltargets)
factory_version="4.1.0"
factory_configuration="'$ac_configure_args' in `pwd`"
AC_SUBST(factory_version)
AH_TEMPLATE([FACTORYVERSION], [factory version])
AC_DEFINE_UNQUOTED([FACTORYVERSION], "$factory_version")
AH_TEMPLATE([FACTORYCONFIGURATION], [factory configuration])
AC_DEFINE_UNQUOTED([FACTORYCONFIGURATION], "$factory_configuration")
#AH_TEMPLATE([GFTABLEDIR], [where the gftables live])
#AC_DEFINE_UNQUOTED([GFTABLEDIR], "$explicit_gftabledir")
AC_CONFIG_FILES([Makefile include/factory/Makefile singular-factory.pc:factory.pc.in]) # ftest/GNUmakefile
AC_OUTPUT
|