source: git/factory/libfac/configure.in @ c10f46

spielwiese
Last change on this file since c10f46 was 16055bd, checked in by Martin Lee <martinlee84@…>, 12 years ago
chg: move libfac into factory
  • Property mode set to 100644
File size: 3.5 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.5"
18AC_DEFINE_UNQUOTED(LIBFAC_VERSION,"$libfac_version")
19AC_SUBST(libfac_version)
20libfac_date="\"July 2012\""
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
46targetname="libsingfac"
47
48AC_ARG_WITH(
49  NOSTREAMIO,
50  [  --with-NOSTREAMIO : do not require iostream include nor library])
51
52if test "$with_NOSTREAMIO" = yes; then
53  AC_DEFINE(NOSTREAMIO)
54fi
55
56dnl
57dnl add to -I and -L, if necessary
58dnl
59if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \
60  test "${ac_default_prefix}" != "/usr/local" || \
61  test "${includedir}" != '${prefix}/include'; then
62  CPPFLAGS="-I${includedir} ${CPPFLAGS}"
63fi
64CPPFLAGS="-I./factor ${CPPFLAGS}"
65
66if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \
67  test "${ac_default_prefix}" != "/usr/local" || \
68  test "${libdir}" != '${prefix}/lib'; then
69  LDFLAGS="-L${libdir} ${LDFLAGS}"
70fi
71LDFLAGS="-L. ${LDFLAGS}"
72
73if test "${CXXFLAGS+set}" != set; then
74  ac_cxxflags_set=no
75  if test "$with_debug" = yes; then
76    CXXFLAGS="-g"
77  else
78    CXXFLAGS="-O"
79    AC_DEFINE(NDEBUG)
80  fi
81fi
82
83dnl
84dnl Checks for programs.
85dnl
86AC_LANG_CPLUSPLUS
87AC_PROG_CXX
88AC_REQUIRE_CPP
89AC_PROG_MAKE_SET
90AC_PROG_RANLIB
91AC_CHECK_PROG(AR,ar,ar)
92if test -z "$AR"; then
93  AC_MSG_ERROR(Need ar)
94fi
95
96dnl
97dnl programs for installation
98dnl
99dnl ac_save_path=${PATH}
100dnl PATH="$PATH:.."
101dnl AC_PROG_INSTALL
102dnl AC_PATH_PROG(MKINSTALLDIRS, mkinstalldirs, -mkdir -p)
103dnl PATH="$ac_save_path"
104
105dnl
106dnl Checks for header files.
107dnl
108AC_CHECK_HEADER(factory.h,,AC_MSG_WARN(factory.h not found! Install factory before building libfac!))
109
110dnl
111dnl Checks for libraries.
112dnl
113
114dnl
115dnl Checks for typedefs, structures, and compiler characteristics.
116dnl
117
118dnl
119dnl Last, but not least, customize CFLAGS
120dnl
121if test x${GXX} = xyes; then
122
123  if test "$ac_cxxflags_set" = no; then
124    if test "$with_debug" = yes; then
125       CXXFLAGS="-O -g"
126    else
127       CXXFLAGS="-O3 "
128    fi
129# check whether CXX accepts -fno-rtti
130AC_LANG_SAVE
131AC_LANG_CPLUSPLUS
132AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
133tmp_flags=${CXXFLAGS}
134CXXFLAGS="${CXXFLAGS} -fno-rtti"
135AC_CACHE_VAL(ac_cv_cxx_have_rtti,
136AC_TRY_COMPILE(,,ac_cv_cxx_have_rtti=yes,ac_cv_cxx_have_rtti=no)
137)
138AC_MSG_RESULT(${ac_cv_cxx_have_rtti})
139CXXFLAGS=$tmp_flags
140if test "${ac_cv_cxx_have_rtti}" = yes; then
141CXXFLAGS="$CXXFLAGS -fno-rtti"
142fi
143
144AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
145tmp_flags=${CXXFLAGS}
146CXXFLAGS="${CXXFLAGS} -fno-exceptions"
147AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
148AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
149)
150AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
151CXXFLAGS=$tmp_flags
152if test "${ac_cv_cxx_have_exceptions}" = yes; then
153CXXFLAGS="$CXXFLAGS -fno-exceptions"
154fi
155
156
157AC_LANG_RESTORE
158
159  fi
160  CXXTEMPLFLAGS="-fno-implicit-templates"
161
162
163else
164  CXXTEMPFLAGS=""
165fi
166AC_SUBST(CXXTEMPLFLAGS)
167
168AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.