source: git/configure.in @ a3abbf1

RELEASE/1.0RELEASE/1.2debug-cidebug-ci-sanitisersstereowalls-data
Last change on this file since a3abbf1 was a3abbf1, checked in by Olly Betts <olly@…>, 18 years ago

Bump version to 1.0.39.

git-svn-id: file:///home/survex-svn/survex/trunk@3158 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 11.1 KB
Line 
1dnl Process this file with autoconf to produce a configure script
2
3dnl CFLAGS=-DDEFAULTLANG=fr to build with French as the default language.
4
5dnl Need autoconf 2.13 or later for 3 argument version of AC_DEFINE
6dnl Need autoconf 2.50 or later for AC_ARG_VAR
7AC_PREREQ(2.50)
8AC_INIT(src/cavern.c)
9
10dnl next line is for make_release
11CHANGELOG_FROM_TAG=v1_0_38
12AM_INIT_AUTOMAKE(survex, 1.0.39)
13RELEASE=1
14
15AC_SUBST(RELEASE)
16AM_CONFIG_HEADER(config.h)
17
18dnl don't reformat the next line, miniam.pl pulls out the value
19COPYRIGHT_MSG="Copyright (C) 1990-2006 Olly Betts"
20
21AVEN_COPYRIGHT_MSG="Copyright (C) 1999-2002 Mark R. Shinwell"
22
23AC_DEFINE_UNQUOTED(COPYRIGHT_MSG, ["$COPYRIGHT_MSG"], [Copyright Message])
24AC_DEFINE_UNQUOTED(AVEN_COPYRIGHT_MSG, ["$AVEN_COPYRIGHT_MSG"],
25                   [Copyright Message for Aven])
26
27AC_SUBST(COPYRIGHT_MSG)
28AC_SUBST(AVEN_COPYRIGHT_MSG)
29
30dnl set PRETTYPACKAGE to PACKAGE with the first character capitalised
31PRETTYPACKAGE=`echo "$PACKAGE"|cut -b1|tr a-z A-Z``echo "$PACKAGE"|cut -b2-`
32AC_DEFINE_UNQUOTED(PRETTYPACKAGE, "$PRETTYPACKAGE",
33                   [Name of package (capitalised)])
34AC_SUBST(PRETTYPACKAGE)
35
36dnl set COMMAVERSION to VERSION with the dots replaced by commas -
37dnl e.g. "0,99" or "1,0,22"
38COMMAVERSION=`echo "$VERSION"|tr '.' ','`
39AC_DEFINE_UNQUOTED(COMMAVERSION, $COMMAVERSION,
40                   [Version number of package (comma-separated)])
41AC_SUBST(COMMAVERSION)
42
43PKGDOCDIR='${prefix}/doc/${PACKAGE}'
44AC_ARG_ENABLE(docdir,
45[  --enable-docdir=DIR Set directory for installing documentation to DIR],
46[case $enableval in
47 yes|no)
48  AC_MSG_ERROR([configure: Syntax: configure --enable-docdir=DIR]) ;;
49esac
50PKGDOCDIR="$enableval"
51]
52)
53PKGDOCDIR_EXPANDED=`(
54 test NONE = "$prefix" && prefix="$ac_default_prefix"
55 test NONE = "$exec_prefix" && exec_prefix="$prefix"
56 eval echo "$PKGDOCDIR"
57)`
58AC_SUBST(PKGDOCDIR)
59AC_SUBST(PKGDOCDIR_EXPANDED)
60
61DEFAULTLANG=en
62AC_ARG_ENABLE(defaultlang,
63[  --enable-defaultlang=LANG Set the default language for messages to LANG],
64[case $enableval in
65 yes|no) # until we support Norwegian...
66  AC_MSG_ERROR([configure: Syntax: configure --enable-defaultlang=LANGUAGE]) ;;
67esac
68DEFAULTLANG="$enableval"
69AC_DEFINE_UNQUOTED(DEFAULTLANG, [$enableval], [Default language for messages])
70]
71)
72AC_SUBST(DEFAULTLANG)
73
74AC_ARG_ENABLE(testprogs,
75[  --enable-testprogs Enable building of various test harness programs],
76[case $enableval in
77 yes) TESTPROGS="dump3d printxbm" ;;
78 no) TESTPROGS= ;;
79 *) AC_MSG_ERROR(bad value $enableval for --enable-testprogs) ;;
80esac
81]
82AC_SUBST(TESTPROGS)
83)
84
85AC_CANONICAL_HOST
86
87dnl Checks for programs.
88AC_PROG_CC
89AC_PROG_CPP
90
91AVEN='aven$(EXEEXT)'
92AC_ARG_ENABLE(aven,
93[  --disable-aven Don't try to build Aven cave viewer],
94[case $enableval in
95  yes) ;;
96  no) AVEN= ;;
97  *) AC_MSG_ERROR(bad value $enableval for --enable-aven) ;;
98esac])
99
100if test -n "$AVEN" ; then
101  AC_PROG_CXX
102  AC_PROG_CXXCPP
103else
104  dnl We don't want to fail to build Survex just because there's no C++
105  dnl compiler installed, so we need to invoke AC_PROG_CXX conditionally.
106  dnl This bodge is required in order to do that...
107  am__fastdepCXX_TRUE='#'
108  am__fastdepCXX_FALSE=
109fi
110
111AC_LANG_C
112
113AC_PROG_MAKE_SET
114
115AC_EXEEXT
116AC_OBJEXT
117
118case $host_os in
119*mingw*|*cygwin*|windows*) mswindows=yes ;;
120*) mswindows=no ;;
121esac
122
123case $host in
124powerpc-*-darwin*) macosx=yes ;; # wxWindows uses this to detect MacOS X
125*) macosx=no ;;
126esac
127
128AC_C_BIGENDIAN
129
130AC_ARG_VAR(STRIP, [Command for discarding symbols from object files])
131AC_PATH_TOOL(STRIP, strip, [echo "not stripping "])
132
133AC_CHECK_LIB(m, sqrt)
134
135AC_PATH_XTRA
136
137WINPROGS=
138if test yes = "$mswindows"; then
139  WINPROGS='printwin$(EXEEXT) editwrap$(EXEEXT)'
140  AC_MSG_RESULT(building printwin and editwrap)
141fi
142AC_SUBST(WINPROGS)
143
144AC_ARG_VAR(WXCONFIG, [wxWindows configuration script to use to build Aven])
145
146if test yes = "$no_x"; then
147  AC_MSG_RESULT([not building xcaverot (X libraries not found or disabled)])
148  if test -z "$WXCONFIG" && test no = "$mswindows"; then
149    AC_MSG_RESULT([not building aven (X libraries not found or disabled)])
150    AVEN=
151  fi
152else
153  AC_CHECK_LIB(Xext, XdbeQueryExtension, X_EXTRA_LIBS="-lXext $X_EXTRA_LIBS", ,
154               $X_LIBS $X_PRE_LIBS -lX11 -lXext $X_EXTRA_LIBS)
155  CAVEROT=xcaverot ${CAVEROT}
156  AC_MSG_RESULT(building xcaverot)
157fi
158
159AM_CONDITIONAL(WIN32, [test yes = "$mswindows"])
160AM_CONDITIONAL(MACOSX, [test yes = "$macosx"])
161
162if test -n "$AVEN"; then
163  if test -n "$WXCONFIG" ; then
164    dnl WXCONFIG specified - sanity check the value
165    dnl don't check for --ldflags - older wx-config didn't do that
166    if (exec >&5 2>&5;$WXCONFIG --libs --cflags --cxxflags;exit $?) then
167      :
168    else
169      AC_MSG_ERROR(['$WXCONFIG --libs --cflags --cxxflags' doesn't work, bailing out])
170    fi
171  else
172    # prefer wx2.6 (or wx2.5) - a few things work better with it.
173    if test yes = "$macosx" ; then
174      AC_PATH_PROGS(WXCONFIG, [wxmac-2.6-config wxmac-2.5-config wxmac-2.4-config wxmac-config])
175      wxdef=__WXMAC__
176    elif test yes = "$mswindows" ; then
177      AC_PATH_PROGS(WXCONFIG, [wxmsw-2.6-config wxmsw-2.5-config wxmsw-2.4-config wxmsw-config])
178      wxdef=__WXMSW__
179    else
180      AC_PATH_PROGS(WXCONFIG, [wxgtk-2.6-config wxgtk-2.5-config wxgtk-2.4-config wxgtk-config])
181      wxdef=__WXGTK__
182    fi
183    if test -z "$WXCONFIG" ; then
184      dnl see if wx-config exists and is for the correct version
185      AC_PATH_PROGS(WXCONFIG, [wx-config])
186      if test -n "$WXCONFIG" ; then
187        if (exec >&5 2>&5;$WXCONFIG --cflags|grep -e -D"$wxdef";exit $?) then
188          :
189        else
190          WXCONFIG=
191        fi
192      fi
193    fi
194    if test -z "$WXCONFIG" ; then
195      AC_MSG_RESULT([not building aven (wxWindows not found)])
196      AVEN=
197    fi
198  fi
199
200  if test -n "$AVEN"; then
201    WX_LIBS=`$WXCONFIG --libs`
202    AC_SUBST(WX_LIBS)
203    dnl older wx-config didn't support this - error goes to stderr, with
204    dnl nothing to stdout, so just ignore stderr
205    WX_LDFLAGS=`$WXCONFIG --ldflags 2> /dev/null`
206    AC_SUBST(WX_LDFLAGS)
207    WX_CFLAGS=`$WXCONFIG --cflags`
208    AC_SUBST(WX_CFLAGS)
209    WX_CXXFLAGS=`$WXCONFIG --cxxflags`
210    AC_SUBST(WX_CXXFLAGS)
211    AC_MSG_RESULT(building aven)
212  fi
213fi
214
215AM_CONDITIONAL(AVEN, [test -n "$AVEN"])
216
217AC_LANG_C
218
219AC_SUBST(CAVEROT)
220AC_SUBST(AVEN)
221
222dnl only build extra man pages on Unix - the ".exe" messes us up otherwise
223dnl FIXME: probably no point building man pages except on Unix
224if test -z "$ac_exeext" ; then
225  dnl can't use \> as freebsd sed doesn't support it
226  EXTRA_MANS=`echo "$CAVEROT $AVEN"|sed 's/\$(EXEEXT)//g;s/\([[^ ]]\) /\1.1 /g;s/\(.\)$/\1.1/'`
227else
228  EXTRA_MANS=
229fi
230AC_SUBST(EXTRA_MANS)
231
232dnl caverot libraries...
233AC_SUBST(CRLIB)
234dnl caverot platform specific sources...
235AC_SUBST(CROBJX)
236
237dnl Checks for header files.
238AC_HEADER_STDC
239dnl don't use AC_CHECK_FUNCS for setjmp - mingw #define-s it to _setjmp
240AC_CHECK_HEADERS(limits.h string.h setjmp.h)
241
242dnl Checks for typedefs, structures, and compiler characteristics.
243AC_C_CONST
244AC_TYPE_SIZE_T
245AC_STRUCT_TM
246AC_TYPE_SIGNAL
247
248dnl check if CLOCKS_PER_SEC is defined by time.h (as ANSI says it should be)
249dnl if it isn't, assume it is 1000000, as it is on SunOS 4
250AC_TRY_COMPILE([#include <time.h>],[
251#ifndef CLOCKS_PER_SEC
252choke me
253#endif
254], , AC_DEFINE(CLOCKS_PER_SEC, 1000000, [For old systems which don't define it themselves]))
255
256dnl Look for a signed 32 bit integer type
257AC_MSG_CHECKING(for 32 bit integer type)
258AC_TRY_COMPILE(,[switch (0) { case (sizeof(int)==4): case 0: break; }],
259INT32_T=int,
260AC_TRY_COMPILE(,[switch (0) { case (sizeof(long)==4): case 0: break; }],
261INT32_T=long,
262AC_MSG_ERROR(not found)
263)
264)
265AC_MSG_RESULT($INT32_T)
266AC_DEFINE_UNQUOTED(INT32_T,$INT32_T,[signed 32 bit integer type])
267
268dnl Look for a signed 16 bit integer type
269AC_MSG_CHECKING(for 16 bit integer type)
270AC_TRY_COMPILE(,[switch (0) { case (sizeof(short)==2): case 0: break; }],
271INT16_T=short,
272AC_TRY_COMPILE(,[switch (0) { case (sizeof(int)==2): case 0: break; }],
273INT16_T=int,
274AC_MSG_ERROR(not found)
275)
276)
277AC_MSG_RESULT($INT16_T)
278AC_DEFINE_UNQUOTED(INT16_T,$INT16_T,[signed 16 bit integer type])
279
280dnl Checks for library functions.
281AC_FUNC_STRFTIME
282if test yes != "$ac_cv_func_strftime"; then
283  AC_LIBOBJ(strftime)
284fi
285AC_FUNC_VPRINTF
286dnl check for strcasecmp here as well as below - this one is to get
287dnl HAVE_STRCASECMP defined if appropriate (for img.c)
288AC_CHECK_FUNCS(popen signal getpwuid round strcasecmp hypot)
289
290dnl difftime seems to be an ANSI invention
291AC_CHECK_FUNCS(difftime)
292
293dnl try to find a case-insensitive compare
294
295strcasecmp=no
296dnl The order of these tests is important.
297AC_CHECK_FUNC(strcasecmp, [strcasecmp=strcasecmp])
298if test no = "$strcasecmp"; then
299  AC_CHECK_FUNC(stricmp, [strcasecmp=stricmp])
300fi
301if test no = "$strcasecmp"; then
302  AC_CHECK_FUNC(strcmpi, [strcasecmp=strcmpi])
303fi
304
305AC_MSG_CHECKING([how to compare strings ignoring case])
306case $strcasecmp in
307no)
308  AC_LIBOBJ(strcasecmp)
309  AC_MSG_RESULT([using own implementation of strcasecmp]) ;;
310strcasecmp)
311  AC_MSG_RESULT([strcasecmp]) ;;
312*)
313  AC_DEFINE_UNQUOTED(strcasecmp, "$strcasecmp",
314    [strcasecmp define for systems which call it something else])
315  AC_MSG_RESULT([$strcasecmp]) ;;
316esac
317
318AC_MSG_CHECKING(for sgmltools v2 or v3)
319case `(exec 2>&5 ; sgmltools --version)` in
320*" version 2"*)
321  sgmltools=sgmltools
322  AC_MSG_RESULT(yes) ;;
323*" version 3"*)
324  sgmltools=sgmltools
325  AC_MSG_RESULT(yes) ;;
326*)
327  sgmltools="$MISSING sgmltools"
328  AC_MSG_RESULT(no) ;;
329esac
330AC_SUBST(sgmltools)
331
332dnl extra warning flags for building with GCC
333if test yes = "$GCC"; then
334  if test yes = "$cross_compiling"; then
335    AM_CFLAGS="$AM_CFLAGS -Werror -Wall -Wunused -Wpointer-arith\
336      -Wwrite-strings -Wcast-align"
337    AM_CXXFLAGS="$AM_CXXFLAGS -Werror -Wall -Wunused -Wpointer-arith\
338      -Wwrite-strings -Wcast-align"
339  else
340    AM_CFLAGS="$AM_CFLAGS -Wall -W -Wunused -Wshadow -Wpointer-arith\
341      -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wnested-externs\
342      -Wcast-align"
343    dnl -W causes problems with wxWindows
344    AM_CXXFLAGS="$AM_CXXFLAGS -Wall -Wunused -Wshadow -Wpointer-arith\
345      -Wwrite-strings -Wcast-align"
346  fi
347  dnl too many complaints from headers, etc: -Wconversion
348fi
349AC_SUBST(AM_CFLAGS)
350AC_SUBST(AM_CXXFLAGS)
351
352AC_ARG_ENABLE(profiling,
353[  --enable-profiling Build binaries to generate profiling information],
354[case $enableval in
355  yes) AM_CXXFLAGS="$AM_CXXFLAGS -pg"
356       AM_CFLAGS="$AM_CFLAGS -pg"
357       AC_MSG_RESULT(building binaries to generate profiling information);;
358  no) ;;
359  *) AC_MSG_ERROR(bad value $enableval for --enable-profiling) ;;
360esac])
361
362DOCS_OTHER="manual.rtf manual.txt manual.ps"
363AC_SUBST(DOCS_OTHER)
364
365HTMLFILES="AUTHORS.htm ChngeLog.htm GPL.htm HACKING.htm NEWS.htm OLDNEWS.htm TODO.htm index.htm 3dformat.htm"
366AC_SUBST(HTMLFILES)
367
368EXTRA_TEXT="AUTHORS COPYING NEWS TODO ChangeLog"
369AC_SUBST(EXTRA_TEXT)
370
371AC_SUBST_FILE(DESC)
372DESC=desc.txt
373AC_SUBST_FILE(AVENDESC)
374AVENDESC=desc-aven.txt
375AC_SUBST_FILE(SVXEDITDESC)
376SVXEDITDESC=desc-svxedit.txt
377
378dnl Don't define DATADIR if building for MS Windows - it won't be used, and
379dnl can conflict with the DATADIR typedef in objidl.h
380if test no = "$mswindows"; then
381  AC_DEFINE_DIR(DATADIR, datadir, [Location of platform independent support files])
382fi
383
384AC_OUTPUT(Makefile src/Makefile doc/Makefile lib/Makefile lib/icons/Makefile
385 tests/Makefile debian/Makefile survex.iss doc/index.htm doc/survex.1
386 src/borlandc/config.h src/riscos/config.h src/msvc/config.h
387 doc/version.ent debian/copyright survex.spec src/svxedit lib/survex.keys)
Note: See TracBrowser for help on using the repository browser.