source: git/libfac/configure.in @ d3ff79

spielwiese
Last change on this file since d3ff79 was d3ff79, checked in by Olaf Bachmann <obachman@…>, 23 years ago
--no-rtti stuff git-svn-id: file:///usr/local/Singular/svn/trunk@4898 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.7 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.0"
18AC_SUBST(libfac_date)
19libfac_date="\"Sep 11 1997\""
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
63dnl
64dnl add to -I and -L, if necessary
65dnl
66if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \
67  test "${ac_default_prefix}" != "/usr/local" || \
68  test "${includedir}" != '${prefix}/include'; then
69  CPPFLAGS="-I${includedir} ${CPPFLAGS}"
70fi
71CPPFLAGS="-I./factor ${CPPFLAGS}"
72
73if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \
74  test "${ac_default_prefix}" != "/usr/local" || \
75  test "${libdir}" != '${prefix}/lib'; then
76  LDFLAGS="-L${libdir} ${LDFLAGS}"
77fi
78LDFLAGS="-L. ${LDFLAGS}"
79
80if test "${CXXFLAGS+set}" != set; then
81  ac_cxxflags_set=no
82  if test "$with_debug" = yes; then
83    CXXFLAGS="-g"
84  else
85    CXXFLAGS="-O"
86    AC_DEFINE(NDEBUG)
87  fi 
88fi
89
90dnl
91dnl Checks for programs.
92dnl
93AC_LANG_CPLUSPLUS 
94AC_PROG_CXX
95AC_REQUIRE_CPP
96AC_PROG_MAKE_SET
97AC_PROG_RANLIB
98AC_CHECK_PROG(AR,ar,ar)
99if test -z "$AR"; then
100  AC_MSG_ERROR(Need ar)
101fi
102
103dnl
104dnl programs for installation
105dnl
106dnl ac_save_path=${PATH}
107dnl PATH="$PATH:.." 
108dnl AC_PROG_INSTALL
109dnl AC_PATH_PROG(MKINSTALLDIRS, mkinstalldirs, -mkdir -p)
110dnl PATH="$ac_save_path"
111
112dnl
113dnl Checks for header files.
114dnl
115AC_CHECK_HEADER(factory.h,,AC_MSG_WARN(factory.h not found! Install factory before building libfac!))
116
117dnl
118dnl Checks for libraries.
119dnl
120
121
122dnl
123dnl Checks for typedefs, structures, and compiler characteristics.
124dnl
125AC_C_CONST
126AC_C_INLINE
127
128dnl
129dnl Last, but not least, customize CFLAGS
130dnl
131if test ${GXX} = yes; then
132
133# check whether CXX accepts --no-rtti
134AC_MSG_CHECKING(whether gcc accepts --no-rtti)
135tmp_flags=${CXXFLAGS}
136CXXFLAGS="${CXXFLAGS} --no-rtti"
137AC_LANG_SAVE
138AC_LANG_CPLUSPLUS
139AC_CACHE_VAL(ac_cv_cxx_have_rtti,
140AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
141)
142AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
143if test "${ac_cv_cxx_have_rtti}" != yes; then
144CXXFLAGS=$temp_flags
145else
146CXX="${CXX} --no-rtti"
147fi
148
149# check whether gcc accepts --no-exceptions
150AC_MSG_CHECKING(whether gcc accepts --no-exceptions)
151CXXFLAGS="${CXXFLAGS} --no-exceptions"
152AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
153AC_TRY_COMPILE(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
154)
155AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
156if test "${ac_cv_cxx_have_exceptions}" != yes; then
157CXXFLAGS=$temp_flags
158else
159CXX="${CXX} --no-exceptions"
160fi
161
162AC_LANG_RESTORE
163CXXFLAGS=$temp_flags
164 
165fi
166
167  if test "$ac_cxxflags_set" = no; then
168    if test "$with_debug" = yes; then
169       CXXFLAGS="-O -g"
170    else
171       CXXFLAGS="-O3 "
172    fi
173  fi
174  CXXTEMPLFLAGS="-fno-implicit-templates"
175else
176  CXXTEMPFLAGS=""
177fi
178AC_SUBST(CXXTEMPLFLAGS)
179 
180AC_OUTPUT(Makefile)
181
182dnl
183dnl Plans:
184dnl 1) look for libraries (warn if not found) for building testprog
185dnl 1) search for perl
Note: See TracBrowser for help on using the repository browser.