source: git/libfac/configure.in @ 40b63ea

spielwiese
Last change on this file since 40b63ea was 40b63ea, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: 3-1 git-svn-id: file:///usr/local/Singular/svn/trunk@11019 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 4.0 KB
Line 
1dnl
2dnl Process this file with autoconf to produce a configure script.
3dnl
4
5dnl
6dnl Initialisation
7dnl
8AC_INIT(factor.h)
9
10dnl
11dnl Set up variables for Makefile.in
12dnl
13dnl Change libfac variables here:
14AC_SUBST(libfac_name)
15libfac_name="\"Factorization and characteristic sets library\""
16AC_SUBST(libfac_version)
17libfac_version="3.1.0"
18AC_SUBST(libfac_date)
19libfac_date="\"Aug 2008\""
20AC_SUBST(libfac_author)
21libfac_author="\"M. Messollen\""
22
23AC_SUBST(libfac)
24libfac="libfac"
25AC_SUBST(libfac_g)
26libfac_g="libfac-g"
27AC_SUBST(libsingfac)
28libsingfac="libsingfac"
29AC_SUBST(libsingfac_g)
30libsingfac_g="libsingfac-g"
31AC_SUBST(factorH)
32factorH="factor.h"
33AC_SUBST(targetname)
34
35dnl
36dnl Parse options
37dnl
38
39AC_ARG_WITH(
40  debug,
41  [  --with-debug    build with debugging options turned on])
42
43AC_ARG_WITH(
44  Singular,
45  [  --with-Singular build for use with Singular])
46
47if test "$with_Singular" = yes; then
48  AC_DEFINE(SINGULAR)
49  AC_DEFINE(NOSTREAMIO)
50  if test "$with_debug" = yes; then
51     targetname="libsingfac-g"
52  else
53     targetname="libsingfac"
54  fi
55else
56  if test "$with_debug" = yes; then
57     targetname="libfac-g"
58  else
59     targetname="libfac"
60  fi
61fi
62
63AC_ARG_WITH(
64  Singularerror,
65  [  --with-Singularerror use error reporting from Singular])
66
67if test "$with_Singularerror" = yes; then
68  AC_DEFINE(SINGULAR_ERROR)
69fi
70
71AC_ARG_WITH(
72  NOSTREAMIO,
73  [  --with-NOSTREAMIO : do not require iostream include nor library])
74
75if test "$with_NOSTREAMIO" = yes; then
76  AC_DEFINE(NOSTREAMIO)
77fi
78
79dnl
80dnl add to -I and -L, if necessary
81dnl
82if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \
83  test "${ac_default_prefix}" != "/usr/local" || \
84  test "${includedir}" != '${prefix}/include'; then
85  CPPFLAGS="-I${includedir} ${CPPFLAGS}"
86fi
87CPPFLAGS="-I./factor ${CPPFLAGS}"
88
89if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \
90  test "${ac_default_prefix}" != "/usr/local" || \
91  test "${libdir}" != '${prefix}/lib'; then
92  LDFLAGS="-L${libdir} ${LDFLAGS}"
93fi
94LDFLAGS="-L. ${LDFLAGS}"
95
96if test "${CXXFLAGS+set}" != set; then
97  ac_cxxflags_set=no
98  if test "$with_debug" = yes; then
99    CXXFLAGS="-g"
100  else
101    CXXFLAGS="-O"
102    AC_DEFINE(NDEBUG)
103  fi
104fi
105
106dnl
107dnl Checks for programs.
108dnl
109AC_LANG_CPLUSPLUS
110AC_PROG_CXX
111AC_REQUIRE_CPP
112AC_PROG_MAKE_SET
113AC_PROG_RANLIB
114AC_CHECK_PROG(AR,ar,ar)
115if test -z "$AR"; then
116  AC_MSG_ERROR(Need ar)
117fi
118
119dnl
120dnl programs for installation
121dnl
122dnl ac_save_path=${PATH}
123dnl PATH="$PATH:.."
124dnl AC_PROG_INSTALL
125dnl AC_PATH_PROG(MKINSTALLDIRS, mkinstalldirs, -mkdir -p)
126dnl PATH="$ac_save_path"
127
128dnl
129dnl Checks for header files.
130dnl
131AC_CHECK_HEADER(factory.h,,AC_MSG_WARN(factory.h not found! Install factory before building libfac!))
132
133dnl
134dnl Checks for libraries.
135dnl
136
137dnl
138dnl Checks for typedefs, structures, and compiler characteristics.
139dnl
140
141dnl
142dnl Last, but not least, customize CFLAGS
143dnl
144if test x${GXX} = xyes; then
145
146  if test "$ac_cxxflags_set" = no; then
147    if test "$with_debug" = yes; then
148       CXXFLAGS="-O -g"
149    else
150       CXXFLAGS="-O3 "
151    fi
152# check whether CXX accepts -fno-rtti
153AC_LANG_SAVE
154AC_LANG_CPLUSPLUS
155AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
156tmp_flags=${CXXFLAGS}
157CXXFLAGS="${CXXFLAGS} -fno-rtti"
158AC_CACHE_VAL(ac_cv_cxx_have_rtti,
159AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
160)
161AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
162CXXFLAGS=$tmp_flags
163if test "${ac_cv_cxx_have_rtti}" = yes; then
164CXXFLAGS="$CXXFLAGS -fno-rtti"
165fi
166
167AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
168tmp_flags=${CXXFLAGS}
169CXXFLAGS="${CXXFLAGS} -fno-exceptions"
170AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
171AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
172)
173AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
174CXXFLAGS=$tmp_flags
175if test "${ac_cv_cxx_have_exceptions}" = yes; then
176CXXFLAGS="$CXXFLAGS -fno-exceptions"
177fi
178
179
180AC_LANG_RESTORE
181
182  fi
183  CXXTEMPLFLAGS="-fno-implicit-templates"
184
185
186else
187  CXXTEMPFLAGS=""
188fi
189AC_SUBST(CXXTEMPLFLAGS)
190
191AC_OUTPUT(Makefile)
192
193dnl
194dnl Plans:
195dnl 1) look for libraries (warn if not found) for building testprog
196dnl 1) search for perl
Note: See TracBrowser for help on using the repository browser.