source: git/libfac/configure.in @ 980552

fieker-DuValspielwiese
Last change on this file since 980552 was 980552, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: date/version by configure git-svn-id: file:///usr/local/Singular/svn/trunk@11157 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)
9AC_CONFIG_HEADER(factor/version.h)
10
11dnl
12dnl Set up variables for Makefile.in
13dnl
14dnl Change libfac variables here:
15libfac_name="\"Factorization and characteristic sets library\""
16AC_SUBST(libfac_name)
17libfac_version="3.1.0"
18AC_DEFINE_UNQUOTED(LIBFAC_VERSION,"$libfac_version")
19AC_SUBST(libfac_version)
20libfac_date="\"Aug 2008\""
21AC_DEFINE_UNQUOTED(LIBFAC_DATE,$libfac_date)
22AC_SUBST(libfac_date)
23libfac_author="\"M. Messollen\""
24AC_SUBST(libfac_author)
25
26AC_SUBST(libfac)
27libfac="libfac"
28AC_SUBST(libfac_g)
29libfac_g="libfac-g"
30AC_SUBST(libsingfac)
31libsingfac="libsingfac"
32AC_SUBST(libsingfac_g)
33libsingfac_g="libsingfac-g"
34AC_SUBST(factorH)
35factorH="factor.h"
36AC_SUBST(targetname)
37
38dnl
39dnl Parse options
40dnl
41
42AC_ARG_WITH(
43  debug,
44  [  --with-debug    build with debugging options turned on])
45
46AC_ARG_WITH(
47  Singular,
48  [  --with-Singular build for use with Singular])
49
50if test "$with_Singular" = yes; then
51  AC_DEFINE(SINGULAR)
52  AC_DEFINE(NOSTREAMIO)
53  if test "$with_debug" = yes; then
54     targetname="libsingfac-g"
55  else
56     targetname="libsingfac"
57  fi
58else
59  if test "$with_debug" = yes; then
60     targetname="libfac-g"
61  else
62     targetname="libfac"
63  fi
64fi
65
66AC_ARG_WITH(
67  Singularerror,
68  [  --with-Singularerror use error reporting from Singular])
69
70if test "$with_Singularerror" = yes; then
71  AC_DEFINE(SINGULAR_ERROR)
72fi
73
74AC_ARG_WITH(
75  NOSTREAMIO,
76  [  --with-NOSTREAMIO : do not require iostream include nor library])
77
78if test "$with_NOSTREAMIO" = yes; then
79  AC_DEFINE(NOSTREAMIO)
80fi
81
82dnl
83dnl add to -I and -L, if necessary
84dnl
85if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \
86  test "${ac_default_prefix}" != "/usr/local" || \
87  test "${includedir}" != '${prefix}/include'; then
88  CPPFLAGS="-I${includedir} ${CPPFLAGS}"
89fi
90CPPFLAGS="-I./factor ${CPPFLAGS}"
91
92if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \
93  test "${ac_default_prefix}" != "/usr/local" || \
94  test "${libdir}" != '${prefix}/lib'; then
95  LDFLAGS="-L${libdir} ${LDFLAGS}"
96fi
97LDFLAGS="-L. ${LDFLAGS}"
98
99if test "${CXXFLAGS+set}" != set; then
100  ac_cxxflags_set=no
101  if test "$with_debug" = yes; then
102    CXXFLAGS="-g"
103  else
104    CXXFLAGS="-O"
105    AC_DEFINE(NDEBUG)
106  fi
107fi
108
109dnl
110dnl Checks for programs.
111dnl
112AC_LANG_CPLUSPLUS
113AC_PROG_CXX
114AC_REQUIRE_CPP
115AC_PROG_MAKE_SET
116AC_PROG_RANLIB
117AC_CHECK_PROG(AR,ar,ar)
118if test -z "$AR"; then
119  AC_MSG_ERROR(Need ar)
120fi
121
122dnl
123dnl programs for installation
124dnl
125dnl ac_save_path=${PATH}
126dnl PATH="$PATH:.."
127dnl AC_PROG_INSTALL
128dnl AC_PATH_PROG(MKINSTALLDIRS, mkinstalldirs, -mkdir -p)
129dnl PATH="$ac_save_path"
130
131dnl
132dnl Checks for header files.
133dnl
134AC_CHECK_HEADER(factory.h,,AC_MSG_WARN(factory.h not found! Install factory before building libfac!))
135
136dnl
137dnl Checks for libraries.
138dnl
139
140dnl
141dnl Checks for typedefs, structures, and compiler characteristics.
142dnl
143
144dnl
145dnl Last, but not least, customize CFLAGS
146dnl
147if test x${GXX} = xyes; 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 -fno-rtti
156AC_LANG_SAVE
157AC_LANG_CPLUSPLUS
158AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
159tmp_flags=${CXXFLAGS}
160CXXFLAGS="${CXXFLAGS} -fno-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 -fno-rtti"
168fi
169
170AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
171tmp_flags=${CXXFLAGS}
172CXXFLAGS="${CXXFLAGS} -fno-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 -fno-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)
Note: See TracBrowser for help on using the repository browser.