source: git/libpolys/configure.ac @ 4470c0e

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