1# Process this file with autoconf to produce a configure script. 2# 3# 4# Copyright (C) 2000-2019 The Xastir Group 5 6 7######################################################################### 8# SET VERSION HERE! 9# 10# Note that the most standard OSS method of doing numbering is: 11# Major.Minor.PatchLevel 12# 13# If we are only doing patches, change the PATCHLEVEL number. 14# If we add new features, change the MINOR number. 15# If we feel we've added enough new features or rewritten enough 16# code to warrant it, change the MAJOR number. 17# 18# Also: We adopted the convention of using odd numbers for development 19# or development releases, even numbers for STABLE releases. 20# 21# 22# AC_INIT(): 23# It should look something like this: ([xastir], [2.0.8], [xastir@xastir.org]) 24# The revision number must contain at least one '.' and two digits. 25AC_INIT([xastir], [2.1.8], [xastir@xastir.org]) 26######################################################################### 27 28 29AC_PREREQ(2.60) 30 31AC_CONFIG_SRCDIR([src/xastir.h]) 32#AM_CONFIG_HEADER(config.h) 33AC_CONFIG_HEADERS(config.h) 34AM_INIT_AUTOMAKE([subdir-objects]) 35AM_SILENT_RULES(yes) 36 37echo "" 38echo "Configuring AC_PACKAGE_NAME AC_PACKAGE_VERSION" 39echo "" 40 41# Take out the dots in order to create the TOCALL 42AC_DEFINE_UNQUOTED(XASTIR_TOCALL, "`echo AC_PACKAGE_VERSION | sed -e 's/^/APX/' -e 's/\.//g'`", [Defines the version tocall]) 43 44# Check for host type 45AC_CANONICAL_HOST 46 47# Define _GNU_SOURCE if appropriate 48# doesn't work with older (heh) autoconfs 49# This macro is now obsolete as of autoconf 2.60 and should no longer 50# be used: AC_GNU_SOURCE 51# autoconf 2.60 was released in 2006, so it should be safe to assume all 52# users have at least this version by now. 53AC_USE_SYSTEM_EXTENSIONS(_GNU_SOURCE) 54 55# Checks for programs. 56AC_PROG_CC 57AC_PROG_CPP 58AC_PROG_INSTALL 59AC_PROG_LN_S 60AC_PROG_MAKE_SET 61AC_PROG_AWK 62AC_PROG_RANLIB 63#AC_PROG_YACC 64 65AM_PROG_CC_C_O 66 67# test for devices 68XASTIR_DETECT_DEVICES 69 70# add includes and libs 71XASTIR_ADD_SEARCH_PATHS 72 73# check for pthread first 74ACX_PTHREAD 75 76# add compiler flags 77XASTIR_COMPILER_FLAGS 78 79# set XASTIR_SYSTEM 80XASTIR_SET_SYSTEM 81 82# Check for binaries 83use_festival=yes 84use_gpsman=yes 85use_err_popups=no 86use_lsb=no 87use_spatial_db=no 88use_postgis=no 89use_mysql_spatial=no 90AC_ARG_WITH(festival,[ --without-festival Disable festival features.],use_festival=$withval) 91 92AC_ARG_WITH(gpsman,[ --without-gpsman Disable gpsman features.],use_gpsman=$withval) 93 94AC_ARG_WITH(errorpopups,[ --with-errorpopups Send error popups to stderr.],use_err_popups=$withval) 95 96AC_ARG_WITH(lsb,[ --with-lsb Enable Linux Standard Base.],use_lsb=$withval) 97 98# Now that all the various "use_" variables are set, probe for binaries. 99XASTIR_DETECT_BINARIES 100 101# if the probes failed, then make sure the "use_" variables are set to no, 102# even if we requested them. 103if test "x${festival}" = "xno"; then 104 use_festival=no 105fi 106if test "x${gpsman}" = "xno"; then 107 use_gpsman=no 108fi 109 110 111# JMT - XXX - what is this and why is it relevant? 112#AC_DEFINE(_REENTRANT, 1, [Use reentrant code if available.]) 113AC_DEFINE_UNQUOTED(STIPPLE, 1, [Legacy stuff, use crowbar and lets keep going]) 114 115# Checks for libraries. 116# 117# 118# Find the X11 include and library directories. 119# 120AC_PATH_XTRA 121if test "$no_x" = "yes"; then 122 AC_MSG_ERROR(*** No X11! Install X-Windows development headers/libraries! ***) 123fi 124 125CPPFLAGS="$CPPFLAGS $X_CFLAGS" 126LDFLAGS="$LDFLAGS $X_LIBS" 127LIBS="$LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS" 128 129AC_SEARCH_LIBS(tan,math m) 130AC_CHECK_LIB([Xext], [XextAddDisplay]) 131 132#*********************************** 133# Check for libXp removed on 31 Oct 2015 134# This was in place for a very long time, but libxp is now deprecated and 135# has even been removed from some distros 136# 137# XpGetDocumentData is not used *anywhere* in Xastir, but some distros have 138# a Motif library that is linked against it. This is supposed to be 139# taken care of by the shared library loader, not by explicit linking, but 140# as late as 2007 some distros had it linked wrong. It appears as of 2015 141# that nobody still does that, and this check causes more harm than good. 142# 143# If the build of Xastir fails at link time looking for XpGetDocumentData, 144# then somebody *does* still do that incorrect shared library linking, 145# and y9ou'll need to re-enable this on your system 146# 147#AC_CHECK_LIB([Xp], [XpGetDocumentData]) 148#************************************ 149AC_CHECK_LIB([Xt], [XtDisplay]) 150AC_CHECK_LIB([Xm], [XmTextFindString]) 151 152 153 154#use_html2text=no 155#AC_PATH_PROG(html2text, [html2text --version], no, $BINPATH) 156#if test "$html2text" != "no"; then 157# AC_DEFINE_UNQUOTED(HAVE_HTML2TEXT, 1, [Define if you have html2text]) 158# AC_DEFINE_UNQUOTED(HTML2TEXT_PATH, "${html2text}", [Path to html2text]) 159# use_html2text=yes 160#fi 161 162 163 164use_sed=no 165AC_PATH_PROG(sed, [sed --version], no, $BINPATH) 166if test "$sed" != "no"; then 167 AC_DEFINE_UNQUOTED(HAVE_SED, 1, [Define if you have sed]) 168 AC_DEFINE_UNQUOTED(SED_PATH, "${sed}", [Path to sed]) 169 use_sed=yes 170fi 171 172 173 174use_mv=no 175AC_PATH_PROG(mv, [mv --version], no, $BINPATH) 176if test "$mv" != "no"; then 177 AC_DEFINE_UNQUOTED(HAVE_MV, 1, [Define if you have mv]) 178 AC_DEFINE_UNQUOTED(MV_PATH, "${mv}", [Path to mv]) 179 use_mv=yes 180fi 181 182 183 184use_xfontsel=no 185AC_PATH_PROG(xfontsel, xfontsel, no, $BINPATH) 186if test "$xfontsel" != "no"; then 187 AC_DEFINE_UNQUOTED(HAVE_XFONTSEL, 1, [Define if you have xfontsel]) 188 AC_DEFINE_UNQUOTED(XFONTSEL_PATH, "${xfontsel}", [Path to xfontsel]) 189 use_xfontsel=yes 190fi 191 192 193 194use_curl=no 195curl_desired=yes 196# Note: Had to move AC_CHECK_HEADER here instead of inside the first 197# "if" statement: It corrupted later tests, don't know why. The 198# only downside is that we check for the libcurl headers even if 199# --without-libcurl was specified on the command-line. 200AC_CHECK_HEADER(curl/curl.h, CURL_INC="yes", CURL_INC="no") 201AC_ARG_WITH(libcurl,[ --without-libcurl Disable libcurl features.],curl_desired=$withval) 202if test "${curl_desired}" = "yes"; then 203 if test "${CURL_INC}" = "yes"; then 204 if test "${use_lsb}" = "no"; then 205 # Important: when using the three-argument version of AC_CHECK_LIB, you 206 # must do all of what is normally the default behavior in the third argument, 207 # not just the extra stuff you want to accomplish: 208 AC_CHECK_LIB([curl], [curl_global_init], 209 [use_curl="yes" 210 LIBS="${LIBS} -lcurl" 211 AC_DEFINE(HAVE_LIBCURL, 1, 212 [Define to 1 if your `curl' library has curl_global_init.]) 213 ]) 214 else 215 AC_DEFINE(HAVE_LIBCURL, 1, [Define to 1 if your `curl' library has curl_global_init.] ) 216 LIBS="${LIBS} -lcurl" 217 use_curl=yes 218 fi 219 fi 220fi 221# Test for wget only if above libcurl tests fail 222use_wget=no 223if test "${use_curl}" = "no"; then 224 AC_PATH_PROG(wget, [wget --version], no, $BINPATH) 225 if test "$wget" != "no"; then 226 AC_DEFINE_UNQUOTED(HAVE_WGET, 1, [Define if you have wget]) 227 AC_DEFINE_UNQUOTED(WGET_PATH, "${wget}", [Path to wget]) 228 use_wget=yes 229 fi 230fi 231 232 233 234use_retrieval=no 235if test "${use_curl}" = "yes"; then 236 use_retrieval="yes (libcurl)" 237else 238 if test "${use_wget}" = "yes"; then 239 use_retrieval="yes (wget)" 240 fi 241fi 242 243 244 245# Test for libgps, used for accessing GPSD daemon 246#use_libgps=no 247#AC_CHECK_HEADER(gps.h, GPS_INC="yes", GPS_INC="no") 248#if test "${GPS_INC}" = "yes"; then 249# AC_CHECK_LIB([gps], [gps_open], 250# [use_libgps="yes" 251# LIBS="${LIBS} -lgps" 252# AC_DEFINE(HAVE_LIBGPS, 1, 253# [Define to 1 if your `libgps' library has gps_open.]) 254# ]) 255#fi 256 257 258 259# JMT - XXX - why is this here? 260AC_CHECK_LIB(compat, main, 261 [LIBCOMPAT="-lcompat" 262 AC_SUBST(LIBCOMPAT)]) 263 264# Check for sched_yield in librt (Needed for Solaris) 265AC_CHECK_LIB(rt, sched_yield, LIBS="-lrt $LIBS") 266 267# Check for endian 268AC_C_BIGENDIAN 269 270 271 272# Our old stuff. Doesn't work in all cases. 273# Checks for header files. 274#AC_CHECK_HEADERS([Xm/Xm.h],MOTIF_INC="yes", AC_MSG_ERROR(*** Cannot find Motif include files: Please install one of Motif/OpenMotif/Lesstif development packages. ***)) 275 276XASTIR_PATH_MOTIF 277if test "x$xm_includes" != "x" ; then 278 CFLAGS="$CFLAGS -I$xm_includes" 279 CPPFLAGS="$CPPFLAGS -I$xm_includes" 280fi 281if test "x$xm_libraries" != "x" ; then 282 LDFLAGS="-L$xm_libraries $LDFLAGS" 283fi 284 285AC_SUBST(LDFLAGS) 286AC_SUBST(LIBS) 287 288 289# 290AC_FUNC_ALLOCA 291AC_HEADER_DIRENT 292AC_HEADER_STDC 293AC_HEADER_SYS_WAIT 294AC_CHECK_HEADERS([argz.h arpa/inet.h fcntl.h limits.h locale.h malloc.h math.h netdb.h]) 295AC_CHECK_HEADERS([netinet/in.h nl_types.h stdarg.h stddef.h stdlib.h string.h strings.h]) 296AC_CHECK_HEADERS([sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h signal.h]) 297AC_CHECK_HEADERS([termios.h unistd.h]) 298 299# Checks for typedefs, structures, and compiler characteristics. 300# 301AC_C_CONST 302AC_TYPE_UID_T 303AC_C_INLINE 304AC_TYPE_PID_T 305AC_TYPE_SIZE_T 306AC_HEADER_TIME 307#AC_STRUCT_TM 308AC_TYPE_SIGNAL 309AC_STRUCT_TIMEZONE 310 311#Some (Mac?) systems don't define this where it should be, so we kludge 312AC_CHECK_TYPES(socklen_t,,,[#include <sys/types.h> 313#include <sys/socket.h>]) 314 315# some BSD systems do not define sighandler_t, but rather sig_t 316AC_CHECK_TYPES(sighandler_t,,,[#include <signal.h>]) 317AC_CHECK_TYPES(sig_t,,,[#include <signal.h>]) 318 319# some BSD systems do not define sighandler_t, but rather sig_t 320AC_CHECK_TYPES(sigjmp_buf,,,[#include <setjmp.h>]) 321 322#Force this into config.h.in 323AH_BOTTOM([#ifndef HAVE_SOCKLEN_T 324#define socklen_t int 325#endif]) 326 327 328# Check for tm_gmtoff in tm 329AC_CHECK_GMTOFF 330 331# Checks for library functions. 332# 333AC_FUNC_FORK 334AC_PROG_GCC_TRADITIONAL 335AC_FUNC_GETPGRP 336AC_FUNC_MALLOC 337AC_FUNC_MKTIME 338AC_FUNC_MMAP 339AC_FUNC_STAT 340AC_FUNC_STRFTIME 341AC_FUNC_STRTOD 342AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify alarm dcgettext]) 343AC_CHECK_FUNCS([getcwd getpgrp gethostbyname gethostname gettimeofday]) 344AC_CHECK_FUNCS([getwd inet_ntoa memmove mempcpy memset mkdir munmap pow]) 345AC_CHECK_FUNCS([putenv select setenv setlocale settimeofday signal sigignore]) 346AC_CHECK_FUNCS([snprintf socket sqrt stpcpy strcasecmp strchr strdup]) 347AC_CHECK_FUNCS([strerror strncasecmp strpbrk strptime strrchr strstr]) 348AC_CHECK_FUNCS([strtof strtol strtoul tzset vsnprintf]) 349 350# Check for deprecated/current pthread functions 351AC_CHECK_FUNCS([pthread_mutexattr_setkind_np pthread_mutexattr_settype]) 352 353# this is a GNU extension and not present on all systems. 354AC_CHECK_FUNCS([strndup]) 355 356#this is also a recent extension that should not be counted on 357AC_CHECK_FUNCS([roundf]) 358 359# Check for libproj (need to do this before test for geotiff, which is the 360# only thing we have that uses proj 361 362use_proj=yes 363AC_ARG_WITH(libproj,[ --without-libproj Disable libproj features.],use_proj=$withval) 364if test "${use_proj}" = "yes"; then 365 use_proj=no 366 AC_CHECK_LIB([proj], [proj_create_crs_to_crs], [use_proj=yes LIBS="$LIBS -lproj" 367 AC_DEFINE(HAVE_PROJ, 1, Define to 1 if you have the `libproj' library (-lproj). )], 368 [ AC_CHECK_LIB([proj], [pj_init], [use_proj=yes LIBS="$LIBS -lproj" 369 AC_DEFINE(HAVE_PROJ, 1, Define to 1 if you have the `libproj' library (-lproj). )])] 370 371 ) 372fi 373 374 375# Check for Shapelib 376use_shapelib=yes 377shapelib_desired=yes 378AC_ARG_WITH(shapelib,[ --without-shapelib Disable shapelib features.],shapelib_desired=$withval) 379if test "${shapelib_desired}" = "no"; then 380 use_shapelib=no 381fi 382if test "${shapelib_desired}" = "yes" ; then 383 use_shapelib=no 384 AC_CHECK_HEADERS([shapefil.h libshp/shapefil.h], 385 [AC_CHECK_LIB([shp], [DBFOpen], 386 [use_shapelib=yes 387 LIBS="$LIBS -lshp" 388 AC_DEFINE(HAVE_LIBSHP, 1, 389 [Define to 1 if you have the `shp' library (-lshp).]) 390 ]) 391 break 392 ]) 393fi 394 395# Shapelib requires pcre now 396use_pcre=no 397if test "${shapelib_desired}" = "yes" -a "${use_shapelib}" = "yes"; then 398 AC_CHECK_HEADERS([pcre.h pcre/pcre.h], 399 [AC_CHECK_LIB([pcre], [pcre_compile], 400 [use_pcre=yes 401 LIBS="$LIBS -lpcre" 402 AC_DEFINE(HAVE_LIBPCRE, 1, Define to 1 if you have the `pcre' library (-lpcre). ) 403 ]) 404 break 405 ]) 406 if test "${use_pcre}" = "no" 407 then 408 AC_MSG_ERROR([Shapelib support requires PCRE, and we could not find PCRE. Either disable shapelib by specifying "--without-shapelib" or install PCRE libraries and headers]) 409 fi 410fi 411 412if test "${shapelib_desired}" = "yes" -a "${use_shapelib}" = "no"; then 413 AC_MSG_WARN([**************************************************************** ]) 414 AC_MSG_WARN([Your system does not have shapelib installed. ]) 415 AC_MSG_WARN([Install shapelib on your system to eliminate this warning. ]) 416 AC_MSG_WARN([**************************************************************** ]) 417 use_shapelib=no 418fi 419 420 421 422 423# Check for XPM 424use_xpm="no" 425if test "${use_lsb}" = "no"; then 426 AC_CHECK_HEADERS(X11/xpm.h, 427 [ 428 #action if found in addition to setting HAVE_X11_XPM_H 429 AC_SEARCH_LIBS(XpmWriteFileFromPixmap, [Xpm], 430 [ 431 # action if found (in addition to adding -lXpm to LIBS 432 use_xpm="yes" 433 AC_DEFINE(HAVE_LIBXPM, 1, [Define to 1 if you have the `Xpm' library (-lXpm).] ) 434 ]) 435 ], 436 [ 437 # Action if X11/xpm.h is not found: look for Xm/XpmI.h instead 438 AC_CHECK_HEADERS(Xm/XpmI.h, 439 [ # Action if found, in addition to setting HAVE_XM_XPMI_H 440 441 AC_SEARCH_LIBS(XmeXpmWriteFileFromPixmap, [Xm], 442 [ 443 # action if -lXm is found, in addition to adding -lXm to LIBS 444 use_xpm="yes" 445 AC_DEFINE(HAVE_LIBXPM_IN_XM, 1, [Define to 1 if the `Xm' library (-lXm) is used for Xpm.]) 446 ], 447 [ #action if -lXm not found: issue warning 448 AC_MSG_WARN([**************************************************************** ]) 449 AC_MSG_WARN([Your system does not have a library that contains XpmWriteFileFromPixmap]) 450 AC_MSG_WARN([PNG snapshots cannot work. ]) 451 AC_MSG_WARN([**************************************************************** ]) 452 ]) 453 ]) 454 ]) 455else 456 AC_DEFINE(HAVE_LIBXPM, 1, Define to 1 if you have the `Xpm' library (-lXpm). ) 457 AC_DEFINE(HAVE_LIBXPM_IN_XM, 1, Define to 1 if the `Xm' library (-lXm) is used for Xpm. ) 458 AC_DEFINE(HAVE_X11_XPM_H, 1, Define to 1 if you have 'X11/xpm.h' ) 459fi 460 461 462#check for libtiff, libgeotiff 463# libjpeg.a and libz.a need to be compiled under LSB 464 465 466use_geotiff=yes 467AC_ARG_WITH(geotiff, [ --without-geotiff Disable geotiff features.], use_geotiff=$withval) 468if test "${use_geotiff}" = "yes"; then 469 if test "${use_proj}" = "yes" ; then 470 if test "${use_lsb}" = "yes" ; then 471 use_tiff=yes 472 use_geotiff=yes 473 LIBS="$LIBS -lgeotiff -ltiff -ljpeg -lz -lproj" 474 AC_DEFINE(HAVE_TIFF, 1,Define to 1 if you have the 'tiff' library (-ltiff)) 475 AC_DEFINE(HAVE_LIBGEOTIFF, 1,Define to 1 if you have the `geotiff' library (-lgeotiff).) 476 else 477 AC_CHECK_HEADER(xtiffio.h, , use_geotiff="no") 478 if test "${use_geotiff}" = "yes"; then 479 AC_CHECK_LIB(tiff, TIFFClose, use_tiff=yes 480 LIBS="$LIBS -ltiff" 481 AC_DEFINE(HAVE_TIFF, 1,Define to 1 if you have the 'tiff' library (-ltiff))) 482 if test "${use_tiff}" = "yes"; then 483 use_geotiff=no 484 AC_CHECK_LIB(geotiff, GTIFNew, use_geotiff=yes 485 LIBS="$LIBS -lgeotiff" 486 AC_DEFINE(HAVE_LIBGEOTIFF, 1,Define to 1 if you have the `geotiff' library (-lgeotiff).)) 487 else 488 echo "*** Warning: geotiff requires libtiff." 489 use_geotiff=no 490 fi 491 else 492 echo "*** Warning: geotiff include files not found." 493 fi 494 fi 495 else 496 echo "*** Warning: geotiff requires libproj." 497 use_geotiff=no 498 fi 499fi 500 501# Check for spatial database support 502use_postgis=no 503AC_ARG_WITH(postgis, [ --with-postgis Enable Postgresql with PostGIS.],use_postgis=$withval) 504if test "${use_postgis}" != "no"; then 505 XASTIR_CHECK_POSTGIS 506fi 507use_mysql=no 508AC_ARG_WITH(mysql, [ --with-mysql Enable MySQL, with spatial support if available.],use_mysql=$withval) 509if test "${use_mysql}" != "no"; then 510 XASTIR_CHECK_MYSQL 511fi 512 513if test "${use_postgis}" = "yes"; then 514 use_spatial_db=yes 515 AC_DEFINE(HAVE_SPATIAL_DB, 1, [Spatial database support available] ) 516 AC_DEFINE(HAVE_DB, 1, [Database support available] ) 517fi 518if test "${use_mysql_spatial}" = "yes"; then 519 use_spatial_db=yes 520 AC_DEFINE(HAVE_DB, 1, [Database support available] ) 521 AC_DEFINE(HAVE_SPATIAL_DB, 1, [Spatial database support available] ) 522elif test use_mysql_any = "yes"; then 523 AC_DEFINE(HAVE_DB, 1, [Database support available] ) 524fi 525 526# Check for AX.25 library 527use_ax25=yes 528AC_ARG_WITH(ax25,[ --without-ax25 Disable ax25 features.],use_ax25=$withval) 529if test "${use_ax25}" = "yes"; then 530 use_ax25=no 531 AC_CHECK_HEADERS(netax25/ax25.h, [AC_CHECK_LIB(ax25, ax25_config_load_ports, use_ax25=yes 532 LIBS="$LIBS -lax25" 533 AC_DEFINE(HAVE_LIBAX25, 1, Define to 1 if you have the `ax25' library (-lax25). ) 534 break)]) 535fi 536 537 538AC_ARG_ENABLE(davis, [ --enable-davis Turn on Davis support], 539 [case "${enableval}" in 540 yes) davis=true ;; 541 no) davis=false ;; 542 *) AC_MSG_ERROR(bad value ${enableval} for --enable-davis) ;; 543 esac],[davis=false]) 544AM_CONDITIONAL(DAVIS, test x$davis = xtrue) 545if test "${davis}" = "true"; then 546 davis=yes 547else 548 davis=no 549fi 550 551 552 553 554 555# Check for LIBGC, a Garbage Collection library. If found, allow 556# linking it with Xastir, but require the "--with-libgc" flag to 557# enable it. 558use_libgc=no 559AC_ARG_WITH(libgc,[ --with-libgc Enable libgc features.],use_libgc=$withval) 560if test "${use_libgc}" = "yes"; then 561 AC_CHECK_HEADERS([gc.h], LIBGC_INC="yes", use_libgc=no) 562 AC_CHECK_LIB([gc], [GC_init], , use_libgc=no) 563fi 564 565 566 567 568 569# Check whether profiling was requested. If so, add the "-pg" flag 570# to CFLAGS. Require "--with-profiling" flag to enable it. 571use_profiling=no 572AC_ARG_WITH(profiling,[ --with-profiling Enable profiling features.],use_profiling=$withval) 573if test "${use_profiling}" = "yes"; then 574 CFLAGS="$CFLAGS -pg" 575fi 576 577 578 579 580 581# Check for Berkeley DB. 582use_map_cache=yes 583AC_ARG_WITH(map_cache,[ --without-map-cache Disable Berkeley DB Map Caching.],use_map_cache=$withval) 584if test "${use_map_cache}" = "yes"; then 585 XASTIR_BERKELEY_DB_CHK 586fi 587 588 589 590 591 592# Check for GraphicsMagick. If not available/desired then check for 593# ImageMagick. These checks are VERY important to have as the last, 594# as they mess up previous checks if they fail. 595# 596use_graphicsmagick=yes 597use_imagemagick=no 598AC_ARG_WITH(graphicsmagick,[ --without-graphicsmagick Disable graphicsmagick features.],use_graphicsmagick=$withval) 599if test "${use_graphicsmagick}" = "yes"; then 600 if test "${use_lsb}" = "no"; then 601 XASTIR_CHECK_GRAPHICSMAGICK 602 else 603 MAGIC_BIN="/opt/lsb-tmp/bin/GraphicsMagick-config" 604 CPPFLAGS="$CPPFLAGS `${MAGIC_BIN} --cppflags`" 605 CXXFLAGS="$CXXFLAGS `${MAGIC_BIN} --cflags`" 606 CFLAGS="$CFLAGS `${MAGIC_BIN} --cflags`" 607 LDFLAGS="$LDFLAGS `${MAGIC_BIN} --ldflags`" 608 LIBS="${MAGIC_LIB_DIR} `${MAGIC_BIN} --libs` $LIBS" 609 AC_DEFINE(HAVE_GRAPHICSMAGICK, 1, [GraphicsMagick image library]) 610 fi 611fi 612# 613# Note: This must be a separate "if" as the use_graphicsmagick 614# variable gets set to "no" if GM is not available above. 615# 616if test "${use_graphicsmagick}" = "no"; then 617 use_imagemagick=yes 618 AC_ARG_WITH(imagemagick,[ --without-imagemagick Disable imagemagick features.],use_imagemagick=$withval) 619 if test "${use_imagemagick}" = "yes"; then 620 XASTIR_CHECK_IMAGEMAGICK 621 fi 622fi 623# 624# 625# 626if test "${use_imagemagick}" = "yes" -o "${use_graphicsmagick}" = "yes"; then 627 AC_DEFINE(HAVE_MAGICK, 1, [GraphicsMagick or ImageMagick library]) 628fi 629 630 631 632 633 634# Set XASTIR_DATA_BASE in CPPFLAGS due to Gnu coding standard that requires 635# datadir expansion to be deferred until make time. 636if test "x${datadir}" = "x"; then 637 CPPFLAGS="$CPPFLAGS -DXASTIR_DATA_BASE=\\\"${ac_default_prefix}/share/xastir\\\"" 638else 639 CPPFLAGS="$CPPFLAGS -DXASTIR_DATA_BASE=\\\"${datadir}/xastir\\\"" 640fi 641 642 643 644# Add a special option that makes Cygwin link much faster (from 645# Henk de Groot) 646save_LDFLAGS="$LDFLAGS" 647LDFLAGS="-Wl,--no-keep-memory $LDFLAGS" 648AC_LINK_IFELSE( 649 [AC_LANG_PROGRAM([[#include <sys/types.h>]], 650 [[/* Stupid useless test for linker flags */ 651 exit(0);]])], 652 [xa_cv_no_keep_memory=yes], 653 [xa_cv_no_keep_memory=no]) 654 655if test "${xa_cv_no_keep_memory}" = "no"; then 656 LDFLAGS="$save_LDFLAGS" 657fi 658 659# 660# Assure we have this order for these LIBS: "-lXm -lXt -lX11" by 661# adding them to the beginning. Add spaces around them for the 662# following steps. Here I'm adding them to the beginning so the 663# dupe-check portion will take out the later ones that might be in 664# the wrong order. If they're in the wrong order, we can get 665# "Error: Shell widget xastir has zero width and/or height" when 666# Xastir is started up. Can also get "Error: attempt to add 667# non-widget child "DropSiteManager" to parent", but that can also 668# be caused by other problems with libraries. 669# 670LIBS=" -lXm -lXt -lX11 $LIBS" 671 672# 673# Remove duplicate entries. Thanks to Paul Lutt, ke7xt, for this! 674# 675# Don't get rid of dupes on the LIBS line. We may need the same 676# "-Llibdir" called out several times, immediately prior to each 677# "-llibrary" that needs it. 678# 679changequote(,) 680CFLAGS=`echo "$CFLAGS" | awk '{for(i=1;i<=NF;++i) {if (arg[$i]++ == 0) s = s " " $i} print s}'` 681CPPFLAGS=`echo "$CPPFLAGS" | awk '{for(i=1;i<=NF;++i) {if (arg[$i]++ == 0) s = s " " $i} print s}'` 682LDFLAGS=`echo "$LDFLAGS" | awk '{for(i=1;i<=NF;++i) {if (arg[$i]++ == 0) s = s " " $i} print s}'` 683#LIBS=`echo "$LIBS" | awk '{for(i=1;i<=NF;++i) {if (arg[$i]++ == 0) s = s " " $i} print s}'` 684changequote([,]) 685 686 687# 688# Remove "-g" CFLAGS/CPPFLAGS entries. Note: This is a _bad_ idea 689# as debuggers won't have a symbol table to work from! 690# 691#changequote(,) 692#CFLAGS=`echo "$CFLAGS" | awk '{for(i=1;i<=NF;++i) {if ($i != "-g") s = s " " $i} print s}'` 693#CPPFLAGS=`echo "$CPPFLAGS" | awk '{for(i=1;i<=NF;++i) {if ($i != "-g") s = s " " $i} print s}'` 694#changequote([,]) 695 696 697# 698# Change the compiler optimization if using Windows/Cygwin in order 699# to reduce memory usage and speed up the compile. Here we change 700# "-O2" to "-O1" or " " in CFLAGS/CPPFLAGS to reduce the level of 701# optimization. 702# We also wish to remove "-no-undefined" from LDFLAGS on Cygwin, as 703# we use GCC for our linking instead of libtool, and GCC doesn't 704# like that flag at the link stage. 705# 706case "$host_os" in 707cygwin*) 708 changequote(,) 709 CFLAGS=`echo "$CFLAGS" | awk '{for(i=1;i<=NF;++i) {if ($i != "-O2") s = s " " $i} print s}'` 710 CPPFLAGS=`echo "$CPPFLAGS" | awk '{for(i=1;i<=NF;++i) {if ($i != "-O2") s = s " " $i} print s}'` 711 LDFLAGS=`echo "$LDFLAGS" | awk '{for(i=1;i<=NF;++i) {if ($i != "-no-undefined") s = s " " $i} print s}'` 712 changequote([,]) 713;; 714esac 715 716 717# Create the ILIBS defined variable. We add spaces here in the else 718# clauses in order to make the REGRESSION_TESTS format nicely. We 719# take them back out before we define the variable that Xastir uses 720# for it's Help->About dialog. 721# 722if test "${use_ax25}" = "yes"; then 723 ILIBS="AX25" 724else 725 ILIBS=" " 726fi 727if test "${use_festival}" = "yes"; then 728 ILIBS="$ILIBS Festival" 729else 730 ILIBS="$ILIBS " 731fi 732if test "${use_gpsman}" = "yes"; then 733 ILIBS="$ILIBS GPSMan" 734else 735 ILIBS="$ILIBS " 736fi 737if test "${use_graphicsmagick}" = "yes"; then 738 ILIBS="$ILIBS GraphicsMagick" 739else 740 if test "${use_imagemagick}" = "yes"; then 741 ILIBS="$ILIBS ImageMagick " 742 else 743 ILIBS="$ILIBS " 744 fi 745fi 746if test "${use_proj}" = "yes"; then 747 ILIBS="$ILIBS libProj" 748else 749 ILIBS="$ILIBS " 750fi 751if test "${use_geotiff}" = "yes"; then 752 ILIBS="$ILIBS GeoTiff" 753else 754 ILIBS="$ILIBS " 755fi 756if test "${use_shapelib}" = "yes"; then 757 ILIBS="$ILIBS ShapeLib" 758else 759 ILIBS="$ILIBS " 760fi 761if test "${use_pcre}" = "yes"; then 762 ILIBS="$ILIBS PCRE" 763else 764 ILIBS="$ILIBS " 765fi 766if test "${use_map_cache}" = "yes"; then 767 ILIBS="$ILIBS map_caching" 768else 769 ILIBS="$ILIBS " 770fi 771if test "${use_err_popups}" = "yes"; then 772 ILIBS="$ILIBS error_popups" 773else 774 ILIBS="$ILIBS " 775fi 776if test "${use_libgc}" = "yes"; then 777 ILIBS="$ILIBS libgc" 778else 779 ILIBS="$ILIBS " 780fi 781if test "${use_profiling}" = "yes"; then 782 ILIBS="$ILIBS profiling" 783else 784 ILIBS="$ILIBS " 785fi 786if test "${use_lsb}" = "yes"; then 787 ILIBS="$ILIBS LSB" 788else 789 ILIBS="$ILIBS " 790fi 791if test "${use_curl}" = "yes"; then 792 ILIBS="$ILIBS libcurl" 793else 794 if test "${use_wget}" = "yes"; then 795 ILIBS="$ILIBS wget " 796 else 797 ILIBS="$ILIBS " 798 fi 799fi 800 801# Write out the library information to "summary.log". Here we want 802# the spaces for the undefined pieces, so REGRESSION_TESTS formats 803# nicely. 804echo "$ILIBS" >summary.log 805 806 807# 808# Remove extraneous spaces from output variables (asthetic) 809# 810ILIBS=`echo $ILIBS | sed -e 's/ */ /g'` 811X_CFLAGS=`echo $X_CFLAGS | sed -e 's/ */ /g'` 812X_PRE_LIBS=`echo $X_PRE_LIBS | sed -e 's/ */ /g'` 813X_LIBS=`echo $X_LIBS | sed -e 's/ */ /g'` 814X_EXTRA_LIBS=`echo $X_EXTRA_LIBS | sed -e 's/ */ /g'` 815 816CC=`echo $CC | sed -e 's/ */ /g'` 817CFLAGS=`echo $CFLAGS | sed -e 's/ */ /g'` 818CPPFLAGS=`echo $CPPFLAGS | sed -e 's/ */ /g'` 819CXXFLAGS=`echo $CXXFLAGS | sed -e 's/ */ /g'` 820LDFLAGS=`echo $LDFLAGS | sed -e 's/ */ /g'` 821TESTED_LIBS=`echo $LIBS | sed -e 's/ */ /g'` 822MAGICK_DEP_LIBS=`echo $MAGICK_DEP_LIBS | sed -e 's/ */ /g'` 823LIBS=`echo $LIBS | sed -e 's/ */ /g'` 824 825 826 827tmp_path="$ac_default_prefix" 828tmp_bin_path="$ac_default_prefix" 829if test "x$prefix" != xNONE; then 830 tmp_path="$prefix" 831 tmp_bin_path="$prefix" 832fi 833if test "x$exec_prefix" != xNONE; then 834 tmp_bin_path="$exec_prefix" 835fi 836AC_DEFINE_UNQUOTED(XASTIR_PATH, "`echo $tmp_path`", [Path to installed Xastir files.]) 837AC_DEFINE_UNQUOTED(XASTIR_BIN_PATH, "`echo $tmp_bin_path`", [Path to installed Xastir binaries.]) 838 839 840 841AC_DEFINE_UNQUOTED(XASTIR_INSTALLED_LIBS, "`echo $ILIBS`", [Defines the installed libs]) 842 843 844AC_SUBST(LDFLAGS) 845AC_SUBST(LIBS) 846#AC_SUBST(CPPFLAGS) 847AC_SUBST(X_CFLAGS) 848#AC_SUBST(LDFLAGS) 849#AC_SUBST(X_PRE_LIBS) 850#AC_SUBST(X_LIBS) 851#AC_SUBST(X_EXTRA_LIBS) 852 853AC_CONFIG_FILES([Makefile \ 854 callpass/Makefile \ 855 config/Makefile \ 856 help/Makefile \ 857 scripts/Makefile \ 858 src/Makefile \ 859 src/rtree/Makefile \ 860 symbols/Makefile \ 861 xastir.spec \ 862 xastir-min.spec \ 863 xastir-lsb.spec]) 864AC_CONFIG_FILES([scripts/get-BOMdata],[chmod +x scripts/get-BOMdata]) 865AC_CONFIG_FILES([scripts/get-NWSdata],[chmod +x scripts/get-NWSdata]) 866AC_CONFIG_FILES([scripts/get-gnis],[chmod +x scripts/get-gnis]) 867AC_CONFIG_FILES([scripts/get-pop],[chmod +x scripts/get-pop]) 868AC_CONFIG_FILES([scripts/get-fcc-rac.pl],[chmod +x scripts/get-fcc-rac.pl]) 869AC_CONFIG_FILES([scripts/icontable.pl],[chmod +x scripts/icontable.pl]) 870 871AC_OUTPUT 872 873# Please leave these in as they're very useful for debug when we 874# port to new platforms! Leave them commented out unless doing 875# debugging on the configure scripts. 876# 877#echo "" 878#echo " LIBS: $LIBS" 879#echo " LDFLAGS: $LDFLAGS" 880#echo " CFLAGS: $CFLAGS" 881#echo " CPPFLAGS: $CPPFLAGS" 882#echo " X_LIBS: $X_LIBS" 883#echo " X_PRE_LIBS: $X_PRE_LIBS" 884#echo "X_EXTRA_LIBS: $X_EXTRA_LIBS" 885 886 887# Write a short summary of the configure tests/results to 888# "summary.log" 889egrep -e "checking |result:|gcc version" config.log >> summary.log 890 891 892echo =========================================== 893echo 894echo AC_PACKAGE_NAME AC_PACKAGE_VERSION has been configured to use the following 895echo options and external libraries: 896echo 897echo MINIMUM OPTIONS: 898echo " ShapeLib (Vector maps) .................... : $use_shapelib" 899echo 900echo RECOMMENDED OPTIONS: 901 902echo " Xpm / Snapshots ........................... : $use_xpm" 903echo -n " GraphicsMagick/ImageMagick (Raster maps) .. : " 904if test "${use_graphicsmagick}" = "yes"; then 905 echo "yes (GraphicsMagick)" 906else 907 if test "${use_imagemagick}" = "yes"; then 908 echo "yes (ImageMagick)" 909 else 910 echo "no" 911 fi 912fi 913echo " pcre (Shapefile customization) ............ : $use_pcre" 914echo " Berkeley DB map caching-Raster map speedups : $use_map_cache" 915echo " internet map retrieval .................... : $use_retrieval" 916echo 917echo FOR THE ADVENTUROUS: 918echo " AX25 (Linux Kernel I/O Drivers) ........... : $use_ax25" 919echo " libproj (USGS Topos & Aerial Photos) ...... : $use_proj" 920echo " GeoTiff (USGS Topos & Aerial Photos) ...... : $use_geotiff" 921echo " Festival (Text-to-speech) ................. : $use_festival" 922echo " GPSMan/gpsmanshp (GPS downloads) .......... : $use_gpsman" 923#echo " GPSD Client (libgps) ...................... : $use_libgps" 924 925if test "${use_err_popups}" = "yes" -o "${use_libgc}" = "yes" -o "${use_profiling}" = "yes" -o "${use_lsb}" = "yes" -o "${use_spatial_db}" = "yes" -o "$use_mysql_any" = "yes"; then 926 echo 927 echo DEVELOPER OPTIONS: 928 echo " ErrorPopups (Old Method) .................. : $use_err_popups" 929 echo " libgc (Debug memory usage) ................ : $use_libgc" 930 echo " profiling (Debug code efficiency) ......... : $use_profiling" 931 echo " Linux Standard Base (LSB) ................. : $use_lsb" 932 echo " Spatial database support .................. : $use_spatial_db" 933 echo " Spatial database Postgresql/Postgis ....... : $use_postgis" 934 echo " MySQL ..................................... : $use_mysql_any" 935 echo " MySQL Spatial database support ............ : $use_mysql_spatial" 936fi 937 938#echo Davis/MySQL............................. : $davis 939echo 940echo AC_PACKAGE_NAME will be installed in $prefix/bin. 941if test "x$xastirpath" != "x" ; then 942 echo Warning: You have an old copy of Xastir at $xastirpath. 943fi 944echo "Type 'make' to build Xastir (Use 'gmake' instead on some systems)." 945 946 947