source: git/libfac/configure.in @ 6434aa9

spielwiese
Last change on this file since 6434aa9 was 6434aa9, checked in by Hans Schönemann <hannes@…>, 23 years ago
*hannes: version 0.3.3 git-svn-id: file:///usr/local/Singular/svn/trunk@5599 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="0.3.3"
18AC_SUBST(libfac_date)
19libfac_date="\"Aug 22 2001\""
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
137
138dnl
139dnl Checks for typedefs, structures, and compiler characteristics.
140dnl
141AC_C_CONST
142AC_C_INLINE
143
144dnl
145dnl Last, but not least, customize CFLAGS
146dnl
147if test ${GXX} = yes; then
148
149  if test "$ac_cxxflags_set" = no; then
150    if test "$with_debug" = yes; then
151       CXXFLAGS="-O -g"
152    else
153       CXXFLAGS="-O3 "
154    fi
155# check whether CXX accepts --no-rtti
156AC_LANG_SAVE
157AC_LANG_CPLUSPLUS
158AC_MSG_CHECKING(whether gcc accepts --no-rtti)
159tmp_flags=${CXXFLAGS}
160CXXFLAGS="${CXXFLAGS} --no-rtti"
161AC_CACHE_VAL(ac_cv_cxx_have_rtti,
162AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
163)
164AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
165CXXFLAGS=$tmp_flags
166if test "${ac_cv_cxx_have_rtti}" = yes; then
167CXXFLAGS="$CXXFLAGS --no-rtti"
168fi
169
170AC_MSG_CHECKING(whether gcc accepts --no-exceptions)
171tmp_flags=${CXXFLAGS}
172CXXFLAGS="${CXXFLAGS} --no-exceptions"
173AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
174AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
175)
176AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
177CXXFLAGS=$tmp_flags
178if test "${ac_cv_cxx_have_exceptions}" = yes; then
179CXXFLAGS="$CXXFLAGS --no-exceptions"
180fi
181
182
183AC_LANG_RESTORE
184
185  fi
186  CXXTEMPLFLAGS="-fno-implicit-templates"
187
188
189else
190  CXXTEMPFLAGS=""
191fi
192AC_SUBST(CXXTEMPLFLAGS)
193
194AC_OUTPUT(Makefile)
195
196dnl
197dnl Plans:
198dnl 1) look for libraries (warn if not found) for building testprog
199dnl 1) search for perl
Note: See TracBrowser for help on using the repository browser.