1 | dnl |
---|
2 | dnl Process this file with autoconf to produce a configure script. |
---|
3 | dnl |
---|
4 | |
---|
5 | AC_INIT(factor.h) |
---|
6 | |
---|
7 | dnl |
---|
8 | dnl Set up variables for Makefile.in |
---|
9 | dnl |
---|
10 | AC_SUBST(libfacversion) |
---|
11 | libfacversion="0.2.2" |
---|
12 | AC_SUBST(libfac) |
---|
13 | libfac="libfac" |
---|
14 | AC_SUBST(libfac_g) |
---|
15 | libfac_g="libfac-g" |
---|
16 | AC_SUBST(libsingfac) |
---|
17 | libsingfac="libsingfac" |
---|
18 | AC_SUBST(libsingfac_g) |
---|
19 | libsingfac_g="libsingfac-g" |
---|
20 | AC_SUBST(factorH) |
---|
21 | factorH="factor.h" |
---|
22 | AC_SUBST(targetname) |
---|
23 | |
---|
24 | dnl |
---|
25 | dnl Parse options |
---|
26 | dnl |
---|
27 | |
---|
28 | AC_ARG_WITH( |
---|
29 | debug, |
---|
30 | [ --with-debug build with debugging options turned on]) |
---|
31 | |
---|
32 | AC_ARG_WITH( |
---|
33 | Singular, |
---|
34 | [ --with-Singular build for use with Singular]) |
---|
35 | |
---|
36 | if test "$with_Singular" = yes; then |
---|
37 | AC_DEFINE(HAVE_SINGULAR) |
---|
38 | if test "$with_debug" = yes; then |
---|
39 | targetname="libsingfac-g" |
---|
40 | else |
---|
41 | targetname="libsingfac" |
---|
42 | fi |
---|
43 | else |
---|
44 | if test "$with_debug" = yes; then |
---|
45 | targetname="libfac-g" |
---|
46 | else |
---|
47 | targetname="libfac" |
---|
48 | fi |
---|
49 | fi |
---|
50 | |
---|
51 | dnl |
---|
52 | dnl add to -I and -L, if necessary |
---|
53 | dnl |
---|
54 | if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \ |
---|
55 | test "${ac_default_prefix}" != "/usr/local" || \ |
---|
56 | test "${includedir}" != '${prefix}/include'; then |
---|
57 | CPPFLAGS="-I${includedir} ${CPPFLAGS}" |
---|
58 | fi |
---|
59 | CPPFLAGS="-I./factor ${CPPFLAGS}" |
---|
60 | |
---|
61 | if (test "x${prefix} != xNONE && test "${prefix} != "/usr/local") || \ |
---|
62 | test "${ac_default_prefix}" != "/usr/local" || \ |
---|
63 | test "${libdir}" != '${prefix}/lib'; then |
---|
64 | LDFLAGS="-L${libdir} ${LDFLAGS}" |
---|
65 | fi |
---|
66 | LDFLAGS="-L. ${LDFLAGS}" |
---|
67 | |
---|
68 | if test "${CXXFLAGS+set}" != set; then |
---|
69 | ac_cxxflags_set=no |
---|
70 | if test "$with_debug" = yes; then |
---|
71 | CXXFLAGS="-g" |
---|
72 | else |
---|
73 | CXXFLAGS="-O" |
---|
74 | AC_DEFINE(NDEBUG) |
---|
75 | fi |
---|
76 | fi |
---|
77 | |
---|
78 | |
---|
79 | dnl |
---|
80 | dnl Checks for programs. |
---|
81 | dnl |
---|
82 | AC_LANG_CPLUSPLUS |
---|
83 | AC_PROG_CXX |
---|
84 | AC_REQUIRE_CPP |
---|
85 | AC_PROG_MAKE_SET |
---|
86 | AC_PROG_RANLIB |
---|
87 | AC_CHECK_PROG(AR,ar,ar) |
---|
88 | if test -z "$AR"; then |
---|
89 | AC_MSG_ERROR(Need ar) |
---|
90 | fi |
---|
91 | |
---|
92 | dnl |
---|
93 | dnl Checks for header files. |
---|
94 | dnl |
---|
95 | AC_CHECK_HEADERS(factory.h) |
---|
96 | |
---|
97 | if test "$ac_cv_header_factory_h" != yes; then |
---|
98 | if test "$enable_factory" != yes; then |
---|
99 | AC_MSG_ERROR(Need factory.h to built libfac) |
---|
100 | else |
---|
101 | AC_MSG_WARN(Make sure to _install_ factory.h befor building libfac) |
---|
102 | fi |
---|
103 | fi |
---|
104 | |
---|
105 | dnl |
---|
106 | dnl Checks for libraries. |
---|
107 | dnl |
---|
108 | |
---|
109 | |
---|
110 | dnl |
---|
111 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
112 | dnl |
---|
113 | AC_C_CONST |
---|
114 | AC_C_INLINE |
---|
115 | |
---|
116 | dnl |
---|
117 | dnl Last, but not least, customize CFLAGS |
---|
118 | dnl |
---|
119 | if test ${GXX} = yes; then |
---|
120 | if test "$ac_cxxflags_set" = no; then |
---|
121 | if test "$with_debug" = yes; then |
---|
122 | CXXFLAGS="-O -g" |
---|
123 | else |
---|
124 | CXXFLAGS="-O3 " |
---|
125 | fi |
---|
126 | fi |
---|
127 | CXXTEMPLFLAGS="-fno-implicit-templates" |
---|
128 | else |
---|
129 | CXXTEMPFLAGS="" |
---|
130 | fi |
---|
131 | AC_SUBST(CXXTEMPLFLAGS) |
---|
132 | |
---|
133 | AC_OUTPUT(Makefile) |
---|