source: git/libpolys/configure.ac @ 4e2bce

fieker-DuValspielwiese
Last change on this file since 4e2bce was 4e2bce, checked in by Hans Schoenemann <hannes@…>, 4 years ago
Revert "fix: trac #861: add NTL-check for libpolys (but not libsingular) users" This reverts commit c9d5fdafb3afc14f72a1eef9295af06a871274fb.
  • Property mode set to 100644
File size: 5.1 KB
Line 
1AC_INIT([libpolys], [4.1.2])
2
3AC_CONFIG_MACRO_DIR([../m4])
4AC_CONFIG_AUX_DIR([../build-aux])
5AC_CONFIG_SRCDIR([reporter/reporter.h])
6AC_CONFIG_HEADER([_config.h])
7
8AM_MAINTAINER_MODE([enable])
9
10AM_INIT_AUTOMAKE([-Wall foreign subdir-objects]) # -Wno-extra-portability -Werror silent-rules
11m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
12m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
13
14dnl Check if build env is sane
15AM_SANITY_CHECK
16
17# Add pre'prefixed config
18AX_PREFIX_CONFIG_H([libpolysconfig.h],[],[_config.h])
19
20# - Check for CC and CXX but be careful about CFLAGS.
21SING_RESET_FLAGS()
22SING_CHECK_SET_ARGS()
23
24AC_PROG_CC
25AC_PROG_CXX
26AM_PROG_CC_C_O
27AC_PROG_LN_S
28AC_PROG_INSTALL
29
30# Turn off shared libraries during beta-testing, since they
31# make the build process take too long.
32LT_INIT([win32-dll])
33# ([shared])
34# LT_INIT([win32-dll])(dlopen disable-static) # doesn't work on PowerPC!
35
36SING_WIN_FLAGS
37
38# Checks for libraries.
39# This test for -lpthread etc has to come before AX_PTHREAD,
40# because libtool tends to ignore -pthread in linking shared C++-libs
41# see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
42# (happens with ubuntu 14.04)
43AC_SEARCH_LIBS(sem_wait,[rt pthreads pthread],[],[
44  AC_MSG_ERROR([sem_wait not found in rt,pthreads,pthread])
45])
46
47# Check whether --with-gmp was given.
48if test "${with_gmp+set}" = set; then :
49  if test "$with_gmp" = yes ; then
50        GMP_HOME_PATH="${DEFAULT_CHECKING_PATH}"
51   elif test "$with_gmp" != no ; then
52        GMP_HOME_PATH="$with_gmp ${DEFAULT_CHECKING_PATH}"
53    fi
54else
55  GMP_HOME_PATH="${DEFAULT_CHECKING_PATH}"
56fi
57
58BACKUP_CFLAGS=${CFLAGS}
59BACKUP_LIBS=${LIBS}
60
61for GMP_HOME in ${GMP_HOME_PATH}
62do
63  if test "x$GMP_HOME" != "x/usr"; then
64    if test -e ${GMP_HOME}/include/gmp.h; then
65      GMP_CPPFLAGS="-I${GMP_HOME}/include"
66      GMP_LIBS="-L${GMP_HOME}/lib -Wl,-rpath -Wl,${GMP_HOME}/lib -lgmp"
67    fi
68  fi
69done
70CFLAGS="${BACKUP_CFLAGS} ${GMP_CPPFLAGS}"
71LIBS="${BACKUP_LIBS} ${GMP_LIBS}"
72AC_SUBST(GMP_CPPFLAGS)
73AC_SUBST(GMP_LIBS)
74
75dnl ntl check in factory
76LB_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)]))
77
78SING_CHECK_JULIA
79
80# Checks for library functions.
81AC_FUNC_ERROR_AT_LINE
82AC_CHECK_FUNCS([memmove memset pow sqrt strchr setenv putenv])
83AC_FUNC_VPRINTF
84AC_CHECK_FUNC([vsnprintf], [AC_DEFINE([HAVE_VSNPRINTF], [1], [Define if vsnprintf exists.])])
85
86# Checks for header files.
87AC_HEADER_STDC
88AC_STDC_HEADERS
89AC_CHECK_HEADERS([stdlib.h string.h unistd.h pwd.h sys/param.h limits.h float.h execinfo.h])
90
91# If the compiler supports GCC C++ ABI name demangling (has header
92#   cxxabi.h and abi::__cxa_demangle() function), define
93#   HAVE_GCC_ABI_DEMANGLE
94AX_CXX_GCC_ABI_DEMANGLE
95
96# Checks for typedefs, structures, and compiler characteristics.
97AC_C_CONST
98AC_C_INLINE
99AC_HEADER_STDBOOL
100AC_TYPE_SIZE_T
101
102# SING_CHECK_PIPE
103
104# check for cpu properties
105AC_CHECK_SIZEOF(long,4)
106SING_CHECK_CPU
107
108#check for host:
109AC_CANONICAL_HOST
110
111case $host_os in
112  *cygwin* ) AX_APPEND_LINK_FLAGS([-Wl,-Bdynamic]);;
113esac
114
115dnl INCLUDES=""
116dnl dnl OS specific flags and options (does work without the following:)
117dnl case "$host" in
118dnl     *-*-freebsd*)
119dnl         LIBS="$LIBS -L/usr/local/lib -lc"
120dnl     CFLAGS="$CFLAGS -I/usr/local/include"
121dnl     INCLUDES="$INCLUDES -I/usr/local/include"
122dnl     ;;
123dnl esac
124dnl AC_SUBST(INCLUDES)
125
126SING_CHECK_OMALLOC()
127
128ENABLE_RESOURCES="yes"
129
130AC_ARG_VAR( [RESOURCES_INCLUDES], [INCLUDES for libsingular_resources] )
131AC_ARG_VAR( [RESOURCES_LIBS], [LIBS for libsingular_resources] )
132
133AC_MSG_CHECKING(whether libsingular_resources should be used)
134
135if test "x$ENABLE_RESOURCES" = xyes;
136then
137  AC_MSG_RESULT(yes)
138
139  AC_MSG_CHECKING([  RESOURCES_INCLUDES?..])
140  AC_MSG_RESULT(${RESOURCES_INCLUDES:-unset})
141
142  AC_MSG_CHECKING([  RESOURCES_LIBS?..])
143  AC_MSG_RESULT(${RESOURCES_LIBS:-unset})
144
145  PKG_REQUIRE="$PKG_REQUIRE singular_resources"
146  AC_SUBST(PKG_REQUIRE)
147else
148  AC_MSG_RESULT(no)
149fi
150
151AM_CONDITIONAL([ENABLE_RESOURCES],[test "x$ENABLE_RESOURCES" = xyes])
152
153SING_CHECK_FACTORY()
154
155SING_CHECK_P_PROCS
156SING_CHECK_ARITH_RINGS
157SING_CHECK_PLURAL
158
159# AC_SUBST(PREFIX)
160# AC_DEFINE_UNQUOTED(INSTALL_PREFIX,"$PREFIX",Prefix)
161
162AC_DEFINE([SINGULAR],[1],[SINGULAR])
163AC_DEFINE([DISABLE_GMP_CPP],[1],[DISABLE_GMP_CPP])
164AC_DEFINE([NOSTREAMIO],[1],[DISABLE_GMP_CPP])
165
166# AX_PYTHON_DEFAULT()
167# AX_PYTHON_WITH_VERSION([2.4])
168
169AC_DEFINE_UNQUOTED([NTL_CPPFLAGS],"$NTL_CPPFLAGS",[NTL_CPPFLAGS])
170AC_DEFINE_UNQUOTED([NTL_LIBS],"$NTL_LIBS",[NTL_LIBS])
171
172AC_DEFINE_UNQUOTED([GMP_CPPFLAGS],"$GMP_CPPFLAGS",[GMP_CPPFLAGS])
173AC_DEFINE_UNQUOTED([GMP_LIBS],"$GMP_LIBS",[GMP_LIBS])
174
175# AC_DEFINE_UNQUOTED([FLINT_CFLAGS],"$FLINT_CFLAGS",[FLINT_CFLAGS])
176# AC_DEFINE_UNQUOTED([FLINT_LIBS],"$FLINT_LIBS",[FLINT_LIBS])
177
178## AC_DEFINE([HAVE_POLYEXTENSIONS], [1], [Enable the algebraic & transcendental extensions])
179
180AC_CONFIG_FILES([Makefile])
181AC_CONFIG_FILES([misc/Makefile])
182AC_CONFIG_FILES([reporter/Makefile])
183AC_CONFIG_FILES([coeffs/Makefile])
184AC_CONFIG_FILES([polys/Makefile])
185AC_CONFIG_FILES([tests/Makefile])
186AC_CONFIG_FILES([libpolys-config libpolys.pc])
187AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.