forked from lifelines/lifelines
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
268 lines (233 loc) · 8.24 KB
/
configure.ac
File metadata and controls
268 lines (233 loc) · 8.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
dnl
dnl Configure script for lifelines software
dnl
dnl Process this file with autoconf to produce a configure script.
dnl **************************************************************
dnl Autoconf Section
dnl **************************************************************
AC_INIT(lifelines, 3.1.1)
AC_PREREQ(2.50)
AC_REVISION([for lifelines, built with autoconf] AC_ACVERSION)
AC_CONFIG_AUX_DIR(build/autotools)
AC_CANONICAL_HOST
dnl **************************************************************
dnl Automake Section
dnl **************************************************************
dnl Use 'foreign' to avoid requiring GNU files in top-level.
AM_INIT_AUTOMAKE([foreign])
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
dnl **************************************************************
dnl Internationalization Section
dnl **************************************************************
dnl gettext
AM_GNU_GETTEXT([external],[need-ngettext])
AM_GNU_GETTEXT_VERSION([0.11.5])
dnl iconv
AM_ICONV
dnl langinfo
AM_LANGINFO_CODESET
dnl **************************************************************
dnl Compile-Chain Section
dnl **************************************************************
dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
dnl MTE: 01/11/04: Force the use of GNU Bison only.
dnl MTE: AC_PROG_YACC will find any YACC, but only
dnl MTE: Bison works for us.
AC_PROG_YACC
if test "$YACC" != "bison -y";
then
echo "LifeLines requires GNU Bison to compile src/interp/yacc.y."
exit
fi
dnl **************************************************************
dnl OS/Compiler-Specific Section
dnl **************************************************************
dnl Add warning flags when using The GNU C Compiler
if test "${ac_cv_prog_gcc}" = "yes"; then
CFLAGS="${CFLAGS} -W -Wall"
CFLAGS="${CFLAGS} -Wcast-align -Wmissing-declarations -Wmissing-prototypes"
CFLAGS="${CFLAGS} -Wreturn-type -Wstrict-prototypes -pedantic"
dnl Add debugging as well
CFLAGS="${CFLAGS} -g"
fi
# OS-Specific Fixups
# Cygwin - fixes linker problems
# Darwin - will pick up Fink-installed headers and libraries
case $host in
*pc-cygwin*)
CFLAGS="${CFLAGS} -DBROKEN_LINKER"
;;
*apple-darwin*)
CPPFLAGS="${CPPFLAGS} -I/sw/include";
LDFLAGS="${LDFLAGS} -L/sw/lib"
;;
esac
dnl **************************************************************
dnl Handle Docs Target
dnl **************************************************************
# Shall we build the docs?
AC_ARG_WITH(docs,
[ --with-docs Build the docs from source (requires xmlto and dblatex) ],
[build_docs=$withval],
[build_docs=no])
if test "$build_docs" = "yes"
then
echo "Looking for xmlto"
AC_PATH_PROG(TOOL_XMLTO, xmlto, FAIL)
if test "$TOOL_XMLTO" = "FAIL"; then
AC_MSG_RESULT( ************************************************************************ )
AC_MSG_RESULT( ******** Cannot find xmlto to build docs. Will not build docs. ******** )
AC_MSG_RESULT( ************************************************************************ )
build_docs=no
fi
AC_PATH_PROG(TOOL_DBLATEX, dblatex, FAIL)
if test "$TOOL_DBLATEX" = "FAIL"; then
AC_MSG_RESULT( ************************************************************************ )
AC_MSG_RESULT( ******* Cannot find dblatex to build docs. Will not build docs. ******* )
AC_MSG_RESULT( ************************************************************************ )
build_docs=no
fi
fi
AM_CONDITIONAL(BUILD_DOCS, test "$build_docs" = "yes")
dnl **************************************************************
dnl Handle Profiling Target
dnl **************************************************************
# Compile with profiling, to find bottlenecks
AC_ARG_WITH(profiling,
[ --with-profiling Compile with profiling support],
[# Does it work for other compilers then GCC? [pere 2000-12-30]
if test "${ac_cv_prog_gcc}" = "yes"; then
CFLAGS="${CFLAGS} -pg -a"
LDFLAGS="${LDFLAGS} -pg -a"
# Make sure 'config.h' is changed if profiling is turned on, to
# trigger recompile for every source file.
AC_DEFINE(PROFILING, 1, [Profiling enabled?])
else
echo "Do not know how to perform profiling using this compiler!"
fi
]
)
dnl **************************************************************
dnl Check for Standard Headers/Structures/Libraries
dnl **************************************************************
echo Looking for header files
AC_CHECK_HEADERS( getopt.h dirent.h pwd.h locale.h windows.h )
AC_CHECK_HEADERS( wchar.h wctype.h )
AC_CHECK_HEADERS( math.h )
echo Looking for library functions
AC_CHECK_FUNCS( _vsnprintf heapwalk _heapwalk getpwuid setlocale )
AC_CHECK_FUNCS( wcscoll towlower towupper iswspace iswalpha )
AC_SEARCH_LIBS( sin, m )
AC_SEARCH_LIBS( cos, m )
AC_SEARCH_LIBS( tan, m )
AC_SEARCH_LIBS( asin, m )
AC_SEARCH_LIBS( acos, m )
AC_SEARCH_LIBS( atan, m )
dnl Check for replacement functions
AC_REPLACE_FUNCS( sleep scandir alphasort getopt snprintf vsnprintf )
AC_REPLACE_FUNCS( nl_langinfo wcslen has_key )
AC_REPLACE_FUNCS( _llnull )
dnl **************************************************************
dnl Check for curses
dnl **************************************************************
dnl Since some distributions package wide and narrow functions
dnl in separate libraries, we need to check for them separately.
dnl We also need to search for a wide character routine, so that
dnl we can warn if only a narrow version of curses is found.
dnl
dnl We search for libraries first, since its easier to tell if
dnl the right libraries are installed than the right headers.
echo Looking for curses libraries
AC_CHECK_LIB(ncursesw, in_wch)
if test "$ac_cv_lib_ncursesw_in_wch" = "yes"; then
echo Using ncursesw
else
AC_CHECK_LIB(ncurses, in_wch)
if test "$ac_cv_lib_ncurses_in_wch" = "yes"; then
echo Using ncurses
else
AC_CHECK_LIB(cursesw, in_wch)
if test "$ac_cv_lib_cursesw_in_wch" = "yes"; then
echo Using cursesw
else
AC_CHECK_LIB(curses, in_wch)
if test "$ac_cv_lib_curses_in_wch" = "yes"; then
echo Using curses
else
case $host in
*mingw32*)
echo "Using LifeLines version of curses for Windows."
;;
*)
echo "LifeLines requires a curses implementation with wide character support!"
exit
;;
esac
fi
fi
fi
fi
dnl Check for headers
echo Looking for curses headers
AC_CHECK_HEADERS( ncursesw/curses.h ncurses/curses.h curses.h )
dnl **************************************************************
dnl Platform/Version-Specific Checks
dnl **************************************************************
echo Looking for header files and libraries to support heap walking
dnl We need to cheat on OSX/Darwin. The standard configure
dnl check brings in a C++ header which bombs and causes
dnl configure to display a particularly nasty warning, which
dnl we don't want to expose to end-users.
case $host in
*apple-darwin*)
HAVE_ALLOC_H=no
HAVE_MALLOC_H=no
HAVE_HEAPWALK=no
HAVE__HEAPWALK=no
;;
*)
AC_CHECK_HEADERS( alloc.h malloc.h )
AC_CHECK_FUNCS( heapwalk _heapwalk )
;;
esac
case $host_os in
*windows*)
AC_DEFINE(LINES_CONFIG_FILE,"lines.cfg",[lifelines configuration file])
;;
*)
AC_DEFINE(LINES_CONFIG_FILE,".linesrc",[lifelines configuration file])
;;
esac
dnl **************************************************************
dnl Build Makefiles
dnl **************************************************************
AC_OUTPUT(Makefile \
src/Makefile \
src/arch/Makefile \
src/arch/mswin/Makefile \
src/btree/Makefile \
src/interp/Makefile \
src/gedlib/Makefile \
src/stdlib/Makefile \
src/liflines/Makefile \
src/tools/Makefile \
src/ui/Makefile \
src/hdrs/Makefile \
src/hdrs/mswin/Makefile \
docs/man/Makefile \
docs/manual/Makefile \
docs/editor/Makefile \
docs/Makefile \
reports/Makefile \
reports/desc-tex2/Makefile \
reports/novel/Makefile \
reports/pedtex/Makefile \
reports/ps-fan/Makefile \
reports/st/Makefile \
tt/Makefile \
build/Makefile \
po/Makefile.in)