~ubuntu-branches/ubuntu/trusty/lifelines/trusty

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Felipe Augusto van de Wiel (faw)
  • Date: 2007-08-14 00:02:04 UTC
  • mfrom: (1.1.4 upstream) (3.1.4 gutsy)
  • Revision ID: james.westby@ubuntu.com-20070814000204-mpv5faygl0dgq3qi
Tags: 3.0.61-1
* New upstream release. (Closes: #387856).
* Fixing documentation build problems also fixes FTBFS if built twice in a
  row. (Closes: #424543).
* Adding lynx as a build dependency. This is necessary to generate txt files
  from html, discovered while fixing #424543.
* Upstream fix: charset for gedcom file in unicode. (Closes: #396206).
* Upstream fim: updating documentation about desc-tex2. (Closes: #405501).
* Bumping Standards-Version to 3.7.2 without package changes.
* Dropping local debian patches added upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
dnl
 
2
dnl Configure script for lifelines software
 
3
dnl
 
4
dnl Process this file with autoconf to produce a configure script.
 
5
 
 
6
dnl **************************************************************
 
7
dnl Autoconf Preamble
 
8
dnl **************************************************************
 
9
 
 
10
AC_INIT(src/liflines/main.c)
 
11
AC_PREREQ(2.50)
 
12
AC_REVISION([for lifelines, built with autoconf] AC_ACVERSION)
 
13
AC_CONFIG_AUX_DIR(build/autotools)
 
14
AC_CANONICAL_HOST
 
15
 
 
16
AM_INIT_AUTOMAKE(lifelines, 3.0.61)
 
17
 
 
18
AM_CONFIG_HEADER(config.h)
 
19
AM_MAINTAINER_MODE
 
20
 
 
21
dnl **************************************************************
 
22
dnl Check for Compile-Chain Programs
 
23
dnl **************************************************************
 
24
 
 
25
dnl Checks for programs.
 
26
AC_PROG_CC
 
27
AC_PROG_RANLIB
 
28
AC_PROG_INSTALL
 
29
 
 
30
dnl MTE: 01/11/04: Force the use of GNU Bison only.
 
31
dnl MTE: AC_PROG_YACC will find any YACC, but only
 
32
dnl MTE: Bison works for us.
 
33
AC_PROG_YACC
 
34
if test "$YACC" != "bison -y";
 
35
then
 
36
  echo "LifeLines requires GNU Bison to compile src/interp/yacc.y."
 
37
  exit
 
38
fi
 
39
 
 
40
dnl **************************************************************
 
41
dnl Check for Internationalization Support (gettext and iconv)
 
42
dnl **************************************************************
 
43
 
 
44
dnl Internationalization (gettext)
 
45
dnl ALL_LINGUAS is not needed with latest autotools
 
46
dnl but debian maintainer still needs it
 
47
dnl These languages should be a copy of po/LINGUAS
 
48
ALL_LINGUAS="da de el eo es fr it nl pl rw sv"
 
49
AM_GNU_GETTEXT(,need-ngettext)
 
50
 
 
51
dnl codeset conversion library
 
52
AM_ICONV
 
53
 
 
54
dnl **************************************************************
 
55
dnl Apply OS/Compiler-Specific Settings
 
56
dnl **************************************************************
 
57
 
 
58
dnl Add warning flags when using The GNU C Compiler
 
59
if test "${ac_cv_prog_gcc}" = "yes"; then
 
60
  # -ansi breaks compile of liflines/askprogram.c [pere 2000-12-31]
 
61
  for flag in \
 
62
        -W \
 
63
        -Wall \
 
64
        -Wcast-align \
 
65
        -Wmissing-declarations \
 
66
        -Wmissing-prototypes \
 
67
        -Wreturn-type \
 
68
        -Wstrict-prototypes \
 
69
        -pedantic
 
70
  do
 
71
    JAPHAR_GREP_CFLAGS($flag,    [ CFLAGS="$CFLAGS $flag"    ])
 
72
  done
 
73
 
 
74
  dnl Add debugging as well
 
75
  CFLAGS="${CFLAGS} -g"
 
76
fi
 
77
 
 
78
# OS-Specific Fixups
 
79
# Cygwin - fixes linker problems
 
80
# Darwin - will pick up Fink-installed headers and libraries
 
81
case $host in
 
82
  *pc-cygwin*)
 
83
    CFLAGS="${CFLAGS} -DBROKEN_LINKER"
 
84
    ;;  
 
85
  *apple-darwin*)
 
86
    CPPFLAGS="${CPPFLAGS} -I/sw/include";
 
87
    LDFLAGS="${LDFLAGS} -L/sw/lib"
 
88
    ;;
 
89
esac
 
90
 
 
91
dnl **************************************************************
 
92
dnl Handle Docs Target
 
93
dnl **************************************************************
 
94
 
 
95
# Shall we build the docs?
 
96
AC_ARG_WITH(docs,
 
97
    [  --with-docs             Build the docs (requires sgmltools) ],
 
98
    [with_docs=$withval],
 
99
    [with_docs=no]
 
100
)
 
101
 
 
102
DOCS_TARGET=""
 
103
if test "$with_docs" = "yes"
 
104
then
 
105
        echo Looking for sgmltools
 
106
        AC_PATH_PROG(SGMLTOOLS, sgmltools, FAIL)
 
107
        if test "$SGMLTOOLS" = "FAIL"; then
 
108
                AC_MSG_RESULT( ******************************************************************* )
 
109
                AC_MSG_RESULT( *** Cannot find sgmltools to build docs. skipping building docs *** )
 
110
                AC_MSG_RESULT( *** Visit http://sgmltools-lite.sourceforge.net and install it. *** )
 
111
                AC_MSG_RESULT( ******************************************************************* )
 
112
        else
 
113
                DOCS_TARGET="simple"
 
114
 
 
115
        fi
 
116
fi
 
117
 
 
118
AC_SUBST(DOCS_TARGET)
 
119
 
 
120
dnl **************************************************************
 
121
dnl Handle Profiling Target
 
122
dnl **************************************************************
 
123
 
 
124
# Compile with profiling, to find bottlenecks
 
125
AC_ARG_WITH(profiling,
 
126
  [  --with-profiling        Compile with profiling support],
 
127
  [# Does it work for other compilers then GCC? [pere 2000-12-30]
 
128
   if test "${ac_cv_prog_gcc}" = "yes"; then
 
129
      CFLAGS="${CFLAGS} -pg -a"
 
130
      LDFLAGS="${LDFLAGS} -pg -a"
 
131
 
 
132
      # Make sure 'config.h' is changed if profiling is turned on, to
 
133
      # trigger recompile for every source file.
 
134
      AC_DEFINE(PROFILING, 1, [Profiling enabled?])
 
135
   else
 
136
      echo "Do not know how to perform profiling using this compiler!"
 
137
   fi
 
138
  ]
 
139
)
 
140
 
 
141
dnl **************************************************************
 
142
dnl Check for Standard Headers/Structures/Libraries
 
143
dnl **************************************************************
 
144
 
 
145
echo Looking for header files
 
146
AC_CHECK_HEADERS( getopt.h dirent.h pwd.h locale.h windows.h )
 
147
AC_CHECK_HEADERS( wchar.h wctype.h )
 
148
AC_CHECK_HEADERS( math.h )
 
149
AC_CHECK_HEADERS( ncurses/curses.h ncursesw/curses.h )
 
150
 
 
151
echo Looking for library functions
 
152
AC_CHECK_FUNCS( _vsnprintf heapwalk _heapwalk getpwuid setlocale )
 
153
AC_CHECK_FUNCS( wcscoll towlower towupper iswspace iswalpha)
 
154
AC_CHECK_LIB( m, sin )
 
155
AC_CHECK_LIB( m, cos )
 
156
AC_CHECK_LIB( m, tan )
 
157
AC_CHECK_LIB( m, asin )
 
158
AC_CHECK_LIB( m, acos )
 
159
AC_CHECK_LIB( m, atan )
 
160
 
 
161
echo Looking for curses-compatible screen output library
 
162
AC_CHECK_LIB(ncursesw, tparm)
 
163
if test "$ac_cv_lib_ncursesw_tparm" = "yes"; then
 
164
  echo Using ncursesw
 
165
else
 
166
AC_CHECK_LIB(ncurses, tparm)
 
167
if test "$ac_cv_lib_ncurses_tparm" = "yes"; then
 
168
  echo Using ncurses
 
169
else
 
170
  echo Looking for curses
 
171
  AC_CHECK_LIB(curses, main)
 
172
  if test "$ac_cv_lib_curses_main" = "yes"; then
 
173
    echo Using curses
 
174
  else
 
175
    case $host in
 
176
      *mingw32*)
 
177
        echo "Didn't find an up-to-date ncurses or curses library!"
 
178
        echo "Using LifeLines version of curses for Windows."
 
179
      ;;
 
180
      *)
 
181
        echo "Didn't find an up-to-date ncurses or curses library!"
 
182
        echo "Link problems may result!"
 
183
      ;;
 
184
    esac
 
185
  fi
 
186
fi
 
187
fi
 
188
 
 
189
dnl Check for replacement functions
 
190
AC_REPLACE_FUNCS( sleep scandir alphasort getopt snprintf vsnprintf )
 
191
AC_REPLACE_FUNCS( nl_langinfo wcslen has_key )
 
192
AC_REPLACE_FUNCS( _llnull )
 
193
 
 
194
dnl **************************************************************
 
195
dnl Platform/Version-Specific Checks
 
196
dnl **************************************************************
 
197
 
 
198
echo Looking for header files and libraries to support heap walking
 
199
dnl We need to cheat on OSX/Darwin.  The standard configure
 
200
dnl check brings in a C++ header which bombs and causes
 
201
dnl configure to display a particularly nasty warning, which
 
202
dnl we don't want to expose to end-users.
 
203
case $host in
 
204
  *apple-darwin*)
 
205
    HAVE_ALLOC_H=no
 
206
    HAVE_MALLOC_H=no
 
207
    HAVE_HEAPWALK=no
 
208
    HAVE__HEAPWALK=no
 
209
    ;;
 
210
  *)
 
211
    AC_CHECK_HEADERS( alloc.h malloc.h )
 
212
    AC_CHECK_FUNCS( heapwalk _heapwalk )
 
213
    ;;
 
214
esac
 
215
 
 
216
dnl ngettext function missing from 0.10.35
 
217
echo Looking for ngettext
 
218
saved_libs="$LIBS"
 
219
LIBS="$LIBS $LIBINTL"
 
220
AC_TRY_LINK([#include <libintl.h>], [ngettext("","",0);],
 
221
    ac_cv_func_ngettext=yes, ac_cv_func_ngettext=no)
 
222
  if test "$ac_cv_func_ngettext" = yes; then
 
223
    echo "found ngettext"
 
224
    AC_DEFINE(HAVE_NGETTEXT, 1, [Define if you have the ngettext() function.])
 
225
  else
 
226
    echo "couldn't find ngettext"
 
227
    LIBS="$saved_libs"
 
228
  fi
 
229
 
 
230
case $host_os in
 
231
  *windows*)
 
232
    AC_DEFINE(LINES_CONFIG_FILE,"lines.cfg",[lifelines configuration file])
 
233
    ;;
 
234
  *)
 
235
    AC_DEFINE(LINES_CONFIG_FILE,".linesrc",[lifelines configuration file])
 
236
    ;;
 
237
esac
 
238
 
 
239
dnl bind_textdomain_codeset function missing from 0.10.35
 
240
echo Looking for bind_textdomain_codeset
 
241
saved_libs="$LIBS"
 
242
LIBS="$LIBS $LIBINTL"
 
243
AC_TRY_LINK([#include <libintl.h>], [bind_textdomain_codeset("","");],
 
244
    ac_cv_func_bind_textdomain_codeset=yes, ac_cv_func_bind_textdomain_codeset=no)
 
245
  if test "$ac_cv_func_bind_textdomain_codeset" = yes; then
 
246
    echo "found bind_textdomain_codeset"
 
247
    AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [Define if you have the bind_textdomain_codeset() function.])
 
248
  else
 
249
    echo "couldn't find bind_textdomain_codeset"
 
250
    LIBS="$saved_libs"
 
251
  fi
 
252
 
 
253
dnl **************************************************************
 
254
dnl Build Makefiles
 
255
dnl **************************************************************
 
256
 
 
257
AC_OUTPUT(Makefile \
 
258
        src/Makefile \
 
259
        src/arch/Makefile \
 
260
        src/btree/Makefile \
 
261
        src/interp/Makefile \
 
262
        src/gedlib/Makefile \
 
263
        src/stdlib/Makefile \
 
264
        src/liflines/Makefile \
 
265
        src/tools/Makefile \
 
266
        src/ui/Makefile \
 
267
        src/hdrs/Makefile \
 
268
        src/hdrs/win32/Makefile \
 
269
        docs/Makefile \
 
270
        reports/Makefile \
 
271
        reports/st/Makefile \
 
272
        tt/Makefile \
 
273
        win32/Makefile \
 
274
        build/Makefile \
 
275
        intl/Makefile \
 
276
        po/Makefile.in)