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
RevLine 
[1a80b4]1dnl
2dnl Process this file with autoconf to produce a configure script.
3dnl
4
[3e55bc]5dnl
6dnl Initialisation
7dnl
[1a80b4]8AC_INIT(factor.h)
[980552]9AC_CONFIG_HEADER(factor/version.h)
[1a80b4]10
11dnl
12dnl Set up variables for Makefile.in
13dnl
[3e55bc]14dnl Change libfac variables here:
15libfac_name="\"Factorization and characteristic sets library\""
[980552]16AC_SUBST(libfac_name)
[070c1b4]17libfac_version="3.1.5"
[980552]18AC_DEFINE_UNQUOTED(LIBFAC_VERSION,"$libfac_version")
19AC_SUBST(libfac_version)
[070c1b4]20libfac_date="\"July 2012\""
[980552]21AC_DEFINE_UNQUOTED(LIBFAC_DATE,$libfac_date)
22AC_SUBST(libfac_date)
[3e55bc]23libfac_author="\"M. Messollen\""
[980552]24AC_SUBST(libfac_author)
[3e55bc]25
[1a80b4]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
[b55c379]46targetname="libsingfac"
[be1d41]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
[1a80b4]56dnl
[c7bbf3]57dnl add to -I and -L, if necessary
[1a80b4]58dnl
59if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \
60  test "${ac_default_prefix}" != "/usr/local" || \
[c7bbf3]61  test "${includedir}" != '${prefix}/include'; then
[1a80b4]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" || \
[c7bbf3]68  test "${libdir}" != '${prefix}/lib'; then
[1a80b4]69  LDFLAGS="-L${libdir} ${LDFLAGS}"
70fi
71LDFLAGS="-L. ${LDFLAGS}"
72
[4a81ec]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)
[c7bbf3]80  fi
[1a80b4]81fi
82
83dnl
84dnl Checks for programs.
85dnl
[c7bbf3]86AC_LANG_CPLUSPLUS
[1a80b4]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
[3e55bc]97dnl programs for installation
[1a80b4]98dnl
[3e55bc]99dnl ac_save_path=${PATH}
[c7bbf3]100dnl PATH="$PATH:.."
[3e55bc]101dnl AC_PROG_INSTALL
102dnl AC_PATH_PROG(MKINSTALLDIRS, mkinstalldirs, -mkdir -p)
103dnl PATH="$ac_save_path"
[dc32d42]104
[3e55bc]105dnl
106dnl Checks for header files.
107dnl
108AC_CHECK_HEADER(factory.h,,AC_MSG_WARN(factory.h not found! Install factory before building libfac!))
[1a80b4]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
[0083eb]121if test x${GXX} = xyes; then
[104fd23]122
[fc7220]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
[29bf6a]129# check whether CXX accepts -fno-rtti
[fc7220]130AC_LANG_SAVE
131AC_LANG_CPLUSPLUS
[29bf6a]132AC_MSG_CHECKING(whether gcc accepts -fno-rtti)
[d3ff79]133tmp_flags=${CXXFLAGS}
[29bf6a]134CXXFLAGS="${CXXFLAGS} -fno-rtti"
[104fd23]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})
[fc7220]139CXXFLAGS=$tmp_flags
140if test "${ac_cv_cxx_have_rtti}" = yes; then
[29bf6a]141CXXFLAGS="$CXXFLAGS -fno-rtti"
[104fd23]142fi
143
[29bf6a]144AC_MSG_CHECKING(whether gcc accepts -fno-exceptions)
[fc7220]145tmp_flags=${CXXFLAGS}
[29bf6a]146CXXFLAGS="${CXXFLAGS} -fno-exceptions"
[104fd23]147AC_CACHE_VAL(ac_cv_cxx_have_exceptions,
[a550fd5]148AC_TRY_LINK(,,ac_cv_cxx_have_exceptions=yes,ac_cv_cxx_have_exceptions=no)
[104fd23]149)
150AC_MSG_RESULT(${ac_cv_cxx_have_exceptions})
[fc7220]151CXXFLAGS=$tmp_flags
152if test "${ac_cv_cxx_have_exceptions}" = yes; then
[29bf6a]153CXXFLAGS="$CXXFLAGS -fno-exceptions"
[104fd23]154fi
155
[fc7220]156
[d3ff79]157AC_LANG_RESTORE
[104fd23]158
[1a80b4]159  fi
160  CXXTEMPLFLAGS="-fno-implicit-templates"
[fc7220]161
162
[1a80b4]163else
164  CXXTEMPFLAGS=""
165fi
166AC_SUBST(CXXTEMPLFLAGS)
[c7bbf3]167
[1a80b4]168AC_OUTPUT(Makefile)
Note: See TracBrowser for help on using the repository browser.