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