1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065 |
- #############################################################################
- #
- # MODULE: Grass Compilation
- # AUTHOR(S): Original author unknown - probably CERL
- # Eric G. Miller - egm2 jps.net
- # Justin Hickey - Thailand - jhickey hpcc.nectec.or.th
- # Markus Neteler - Germany/Italy - neteler itc.it
- # Nicklas Larsson (update to autoconfig 2.69)
- # PURPOSE: This configure runs all the tests to determine what components
- # are installed on the current system. It also defines certain
- # configuration variables for compilation and installation.
- # COPYRIGHT: (C) 2000-2021 by the GRASS Development Team
- #
- # This program is free software under the GNU General
- # Public License (>=v2). Read the file COPYING that
- # comes with GRASS for details.
- #
- # MANUAL: http://www.gnu.org/software/autoconf/manual/autoconf.html
- # http://savannah.gnu.org/projects/autoconf/
- # Website for config.guess, config.sub:
- # wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess
- # wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub
- # Note: use autoconf-2.69
- #############################################################################
- define([AC_CACHE_LOAD], )
- define([AC_CACHE_SAVE], )
- define([AC_CACHE_VAL], [
- $2
- ])
- AC_INIT
- AC_CONFIG_SRCDIR([configure.ac])
- AC_PREREQ([2.69])
- AC_CONFIG_HEADER(include/grass/config.h)
- AC_CANONICAL_HOST
- AC_PROG_CC
- LOC_EXEEXT
- AC_SUBST(MINGW32)
- # Set WINDRES
- if test "$MINGW32" = yes ; then
- WINDRES=${WINDRES-windres}
- else
- WINDRES=
- fi
- AC_SUBST(WINDRES)
- # Check for custom PKG_CONFIG
- PKG_CONFIG=${PKG_CONFIG-pkg-config}
- # Check for full floating-point support, including Infinity and NaN
- IEEEFLAG=
- LOC_CHECK_FP_INF_NAN([],
- [],
- [ ac_save_cflags=${CFLAGS}
- CFLAGS=-mieee
- LOC_CHECK_FP_INF_NAN([ with -mieee],
- [IEEEFLAG="-mieee"],
- [AC_MSG_WARN([*** Incomplete floating-point support.])],
- [AC_MSG_ERROR([*** INTERNAL CONFIGURE ERROR])])
- CFLAGS=${ac_save_cflags}],
- [ LOC_CHECK_CC_MIEEE ])
- CFLAGS="$CFLAGS $IEEEFLAG"
- # Set BINDIR
- if test -n "${bindir}"; then
- BINDIR="${bindir}"
- else
- BINDIR=/usr/local/bin
- fi
- AC_SUBST(BINDIR)
- # Set SRCDIR and DSTDIR
- AC_PATH_PROG(pwd, pwd, pwd)
- if test "$MINGW32" = yes -a "$cross_compiling" != yes ; then
- winpwd="pwd -W"
- else
- winpwd="$pwd"
- fi
- AC_MSG_CHECKING(for source directory)
- if test -z "$srcdir" ; then
- SRCDIR=`$pwd`
- else
- SRCDIR=`(cd "$srcdir" ; $pwd)`
- fi
- AC_MSG_RESULT("$SRCDIR")
- AC_MSG_CHECKING(for build directory)
- DSTDIR=`$pwd`
- WINDSTDIR=`$winpwd`
- AC_MSG_RESULT("$DSTDIR")
- AC_SUBST(SRCDIR)
- AC_SUBST(DSTDIR)
- # Set ARCH
- ARCH=
- if test -z "${host}"; then
- ARCH="unknown"
- else
- ARCH="${host}"
- fi
- AC_SUBST(ARCH)
- # Set GISBASE and GRASS_BIN
- GISBASE="${WINDSTDIR}/dist.${ARCH}"
- GRASS_BIN="${DSTDIR}/bin.${ARCH}"
- AC_SUBST(GISBASE)
- AC_SUBST(GRASS_BIN)
- # Set GRASS_VERSION_*
- GRASS_VERSION_FILE=include/VERSION
- GRASS_VERSION_MAJOR=`sed -n 1p "${GRASS_VERSION_FILE}"`
- GRASS_VERSION_MINOR=`sed -n 2p "${GRASS_VERSION_FILE}"`
- GRASS_VERSION_RELEASE=`sed -n 3p "${GRASS_VERSION_FILE}"`
- GRASS_VERSION_DATE=`sed -n 4p "${GRASS_VERSION_FILE}"`
- GRASS_VERSION_NUMBER=`echo ${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}`
- NAME_VER=`echo ${GRASS_VERSION_NUMBER} | sed 's/\..*//'`
- changequote(,)
- LIB_VER=`echo ${GRASS_VERSION_NUMBER} | sed 's/^\([0-9.]*\).*$/\1/'`
- changequote([,])
- GRASS_VERSION_GIT="exported"
- # get git short hash + date of last change in GRASS headers
- # (and anything else in include)
- GRASS_HEADERS_GIT_HASH=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
- GRASS_HEADERS_GIT_DATE=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
- AC_PATH_PROG(GIT, git, no)
- if test "$GIT" != "no" ; then
- GRASS_VERSION_GIT=`$GIT rev-parse --short HEAD 2>/dev/null`
- if test -z "$GRASS_VERSION_GIT"; then
- GRASS_VERSION_GIT="exported"
- fi
- GRASS_HEADERS_GIT_HASH=`$GIT log -1 --pretty=format:"%h" -- "${SRCDIR}/include" 2>/dev/null`
- if test -z "$GRASS_HEADERS_GIT_HASH"; then
- GRASS_HEADERS_GIT_HASH=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
- fi
- GRASS_HEADERS_GIT_DATE=`date -d $($GIT log -1 --pretty=format:"%cI" -- "${SRCDIR}/include") -u +%FT%T%z | sed 's/\(..\)$/:\1/'` 2>/dev/null
- if test -z "$GRASS_HEADERS_GIT_DATE"; then
- GRASS_HEADERS_GIT_DATE=`date -u +%FT%T%z | sed 's/\(..\)$/:\1/'`
- fi
- fi
- AC_SUBST(GRASS_VERSION_FILE)
- AC_SUBST(GRASS_VERSION_MAJOR)
- AC_SUBST(GRASS_VERSION_MINOR)
- AC_SUBST(GRASS_VERSION_RELEASE)
- AC_SUBST(GRASS_VERSION_NUMBER)
- AC_SUBST(GRASS_VERSION_DATE)
- AC_SUBST(GRASS_VERSION_GIT)
- AC_SUBST(GRASS_HEADERS_GIT_HASH)
- AC_SUBST(GRASS_HEADERS_GIT_DATE)
- AC_SUBST(NAME_VER)
- AC_SUBST(LIB_VER)
- # Check for MacOSX App
- AC_ARG_ENABLE(macosx-app,
- [ --enable-macosx-app create a MacOSX application],,
- [enable_macosx_app=no])
- AC_MSG_CHECKING(for MacOSX App)
- case "$enable_macosx_app" in
- yes) MACOSX_APP=1 ;;
- no) MACOSX_APP= ;;
- *) AC_MSG_ERROR([*** You must answer yes or no.]) ;;
- esac
- AC_MSG_RESULT("$enable_macosx_app")
- AC_SUBST(MACOSX_APP)
- # Check for MacOSX archs
- AC_MSG_CHECKING(for MacOSX architectures)
- MACOSX_ARCHS=
- if test -z "$with_macosx_archs" ; then
- AC_MSG_RESULT(no)
- else
- for a in $with_macosx_archs
- do
- # check if valid arch?
- case "$a" in
- i386|ppc|x86_64|ppc64)
- MACOSX_ARCHS="$MACOSX_ARCHS -arch $a"
- ;;
- esac
- done
- AC_MSG_RESULT([$MACOSX_ARCHS])
- LDFLAGS="$LDFLAGS $MACOSX_ARCHS"
- CFLAGS="$CFLAGS $MACOSX_ARCHS"
- CXXFLAGS="$CXXFLAGS $MACOSX_ARCHS"
- fi
- AC_SUBST(MACOSX_ARCHS)
- # Done checking MacOSX archs
- # Check for MacOSX SDK
- AC_MSG_CHECKING(for MacOSX SDK)
- MACOSX_SDK=
- if test -z "$with_macosx_sdk" ; then
- AC_MSG_RESULT(no)
- else
- AC_CHECK_FILE($with_macosx_sdk/SDKSettings.plist, [
- MACOSX_SDK="-isysroot $with_macosx_sdk"],[
- AC_MSG_ERROR([*** specified SDK does not exist or is not a SDK])])
- LDFLAGS="$LDFLAGS $MACOSX_SDK"
- CFLAGS="$CFLAGS $MACOSX_SDK"
- CXXFLAGS="$CXXFLAGS $MACOSX_SDK"
- fi
- AC_SUBST(MACOSX_SDK)
- # Done checking MacOSX SDK
- # Set INST_DIR
- if test -n "$MACOSX_APP" ; then
- INSTDIR='${prefix}'"/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.app/Contents/MacOS"
- else
- INSTDIR='${prefix}'"/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}"
- fi
- AC_SUBST(INSTDIR)
- # Get flags for building shared libraries
- SC_ENABLE_SHARED
- ac_save_ldflags="$LDFLAGS"
- SC_CONFIG_CFLAGS
- LDFLAGS="${ac_save_ldflags} $LDFLAGS"
- # Enable options
- AC_ARG_ENABLE(w11,
- [ --enable-w11 use W11 library for Windows X11 emulation],,
- [enable_w11=no])
- # With options
- LOC_ARG_WITH(cxx, C++)
- #LOC_ARG_WITH(g77, GNU Fortran 77, no)
- AC_ARG_WITH(macosx-archs,
- [ --with-macosx-archs[=arch list]
- compile multiple architectures on MacOSX, ie.
- universal. Valid architectures are i386, ppc,
- x86_64 and ppc64. (default: no [native])],, with_macosx_archs="no")
- AC_ARG_WITH(macosx-sdk,
- [ --with-macosx-sdk[=path/sdk]
- compile with a system SDK on MacOSX. (default: no)],, with_macosx_sdk="no")
- LOC_ARG_WITH(tiff, TIFF)
- LOC_ARG_WITH(png, PNG)
- LOC_ARG_WITH(postgres, PostgreSQL, no)
- LOC_ARG_WITH(mysql, MySQL, no)
- LOC_ARG_WITH(sqlite, SQLite)
- LOC_ARG_WITH(opengl, OpenGL)
- LOC_ARG_WITH(odbc, ODBC, no)
- LOC_ARG_WITH(fftw, FFTW)
- LOC_ARG_WITH(blas, BLAS, no)
- LOC_ARG_WITH(lapack, LAPACK, no)
- LOC_ARG_WITH(cairo, Cairo)
- LOC_ARG_WITH(freetype, FreeType)
- LOC_ARG_WITH(nls, NLS, no)
- LOC_ARG_WITH(readline, Readline, no)
- LOC_ARG_WITH(opendwg, openDWG, no)
- LOC_ARG_WITH(regex, regex)
- LOC_ARG_WITH(pthread, POSIX threads, no)
- LOC_ARG_WITH(openmp, OpenMP, no)
- LOC_ARG_WITH(opencl, OpenCL, no)
- LOC_ARG_WITH(bzlib, BZIP2, no)
- LOC_ARG_WITH(zstd, Zstandard)
- AC_ARG_WITH(gdal,
- [ --with-gdal[=path/gdal-config]
- enable GDAL/OGR support (gdal-config with path,
- e.g. '--with-gdal=/usr/local/bin/gdal-config')])
- AC_ARG_WITH(liblas,
- [ --with-liblas[=path/liblas-config]
- enable libLAS support (liblas-config with path,
- e.g. '--with-liblas=/usr/local/bin/liblas-config',
- default: no)],, with_liblas="no")
- AC_ARG_WITH(pdal,
- [ --with-pdal[=path/pdal-config]
- enable PDAL support (pdal-config with path,
- e.g. '--with-pdal=/usr/local/bin/pdal-config',
- default: no)],, with_pdal="no")
- AC_ARG_WITH(wxwidgets,
- [ --with-wxwidgets[=path/wx-config]
- enable wxWidgets support (wx-config with path,
- e.g. '--with-wxwidgets=/usr/local/bin/wx-config',
- default: no)],, with_wxwidgets="no")
- AC_ARG_WITH(netcdf,
- [ --with-netcdf[=path/nc-config]
- enable NetCDF support (nc-config with path,
- e.g. '--with-nc=/usr/local/bin/nc-config',
- default: no)],, with_netcdf="no")
- # With includes and libs options
- AC_ARG_WITH(geos,
- [ --with-geos[=path/geos-config]
- enable GEOS support (geos-config with path,
- e.g. '--with-geos=/usr/local/bin/geos-config',
- default: no)],, with_geos="no")
- AC_ARG_WITH(includes,
- [ --with-includes=DIRS site include files are in DIRS])
- AC_ARG_WITH(libs,
- [ --with-libs=DIRS site library files are in DIRS])
- LOC_ARG_WITH_INC(zlib, zlib)
- LOC_ARG_WITH_LIB(zlib, zlib)
- LOC_ARG_WITH_INC(bzlib, BZIP2)
- LOC_ARG_WITH_LIB(bzlib, BZIP2)
- LOC_ARG_WITH_INC(zstd, ZSTD)
- LOC_ARG_WITH_LIB(zstd, ZSTD)
- LOC_ARG_WITH_INC(readline, Readline)
- LOC_ARG_WITH_LIB(readline, Readline)
- LOC_ARG_WITH_INC(tiff, TIFF)
- LOC_ARG_WITH_LIB(tiff, TIFF)
- LOC_ARG_WITH_INC(png, PNG)
- LOC_ARG_WITH_LIB(png, PNG)
- LOC_ARG_WITH_INC(postgres, PostgreSQL)
- LOC_ARG_WITH_LIB(postgres, PostgreSQL)
- LOC_ARG_WITH_INC(mysql, MySQL)
- LOC_ARG_WITH_LIB(mysql, MySQL)
- LOC_ARG_WITH_INC(sqlite, SQLite)
- LOC_ARG_WITH_LIB(sqlite, SQLite)
- LOC_ARG_WITH_INC(opengl, OpenGL)
- LOC_ARG_WITH_LIB(opengl, OpenGL)
- LOC_ARG_WITH_FRAMEWORK(opengl, OpenGL)
- LOC_ARG_WITH_INC(odbc, ODBC)
- LOC_ARG_WITH_LIB(odbc, ODBC)
- LOC_ARG_WITH_INC(fftw, FFTW)
- LOC_ARG_WITH_LIB(fftw, FFTW)
- LOC_ARG_WITH_INC(blas, BLAS)
- LOC_ARG_WITH_LIB(blas, BLAS)
- LOC_ARG_WITH_INC(lapack, LAPACK)
- LOC_ARG_WITH_LIB(lapack, LAPACK)
- LOC_ARG_WITH_INC(cairo, cairo)
- LOC_ARG_WITH_LIB(cairo, cairo)
- LOC_ARG_WITH_LDFLAGS(cairo, cairo)
- LOC_ARG_WITH_INC(freetype, FreeType)
- LOC_ARG_WITH_LIB(freetype, FreeType)
- LOC_ARG_WITH_INC(proj, External PROJ.4)
- LOC_ARG_WITH_LIB(proj, External PROJ.4)
- LOC_ARG_WITH_SHARE(proj, External PROJ.4)
- LOC_ARG_WITH_INC(opendwg, openDWG)
- LOC_ARG_WITH_LIB(opendwg, openDWG)
- LOC_ARG_WITH_INC(regex, regex)
- LOC_ARG_WITH_LIB(regex, regex)
- LOC_ARG_WITH_INC(pthread, POSIX threads)
- LOC_ARG_WITH_LIB(pthread, POSIX threads)
- LOC_ARG_WITH_INC(openmp, OpenMP)
- LOC_ARG_WITH_LIB(openmp, OpenMP)
- LOC_ARG_WITH_INC(opencl, OpenCL)
- LOC_ARG_WITH_LIB(opencl, OpenCL)
- #LOC_ARG_WITH_FRAMEWORK(opencl, OpenCL)
- # Put this early on so CPPFLAGS and LDFLAGS have any additional dirs
- # With includes option
- # Handle Fortran compiler choice
- #LOC_CHECK_USE(g77, GNU Fortran 77, USE_G77)
- # Done checking fortran
- AC_MSG_CHECKING(for additional include dirs)
- case "$with_includes" in
- y | ye | yes | n | no)
- AC_MSG_ERROR([*** You must supply a directory to list --with-includes.])
- ;;
- esac
- AC_MSG_RESULT($with_includes)
- if test -n "$with_includes"; then
- for dir in $with_includes; do
- if test -d "$dir"; then
- INCLUDE_DIRS="$INCLUDE_DIRS -I$dir"
- else
- AC_MSG_ERROR([*** Include directory $dir does not exist.])
- fi
- done
- CPPFLAGS="$CPPFLAGS $INCLUDE_DIRS"
- fi
- AC_SUBST(INCLUDE_DIRS)
- # With libs option
- AC_MSG_CHECKING(for additional library dirs)
- case "$with_libs" in
- y | ye | yes | n | no)
- AC_MSG_ERROR([*** You must supply a directory list to --with-libs.])
- ;;
- esac
- AC_MSG_RESULT($with_libs)
- if test -n "$with_libs"; then
- for dir in $with_libs; do
- if test -d "$dir"; then
- LIBRARY_DIRS="$LIBRARY_DIRS -L$dir"
- else
- AC_MSG_ERROR([*** Library directory $dir does not exist.])
- fi
- done
- LDFLAGS="$LDFLAGS $LIBRARY_DIRS"
- fi
- AC_SUBST(LIBRARY_DIRS)
- # Programs and standard headers, libraries, functions
- AC_PROG_INSTALL
- AC_PROG_LEX
- if test "$LEX" = "lex"; then
- AC_PATH_PROG(LEXPATH, lex, no)
- if test "$LEXPATH" = "no"; then
- AC_MSG_ERROR([*** Unable to locate lex.])
- fi
- fi
- AC_PROG_YACC
- if test "$YACC" = "yacc"; then
- AC_PATH_PROG(YACCPATH, yacc, no)
- if test "$YACCPATH" = "no"; then
- AC_MSG_ERROR([*** Unable to locate yacc.])
- fi
- fi
- AC_PROG_RANLIB
- AC_CHECK_PROGS(AR, ar)
- AC_CHECK_PROGS(ENV, env)
- AC_PATH_PROG(PERL, perl, no)
- AC_HEADER_STDC
- #AC_CHECK_HEADERS(curses.h limits.h termio.h termios.h unistd.h values.h)
- AC_CHECK_HEADERS(limits.h termio.h termios.h unistd.h values.h f2c.h g2c.h)
- AC_CHECK_HEADERS(sys/ioctl.h sys/mtio.h sys/resource.h sys/time.h)
- AC_CHECK_HEADERS(sys/timeb.h sys/types.h sys/utsname.h)
- AC_CHECK_HEADERS(libintl.h iconv.h)
- AC_CHECK_HEADERS(langinfo.h)
- AC_HEADER_TIME
- AC_TYPE_OFF_T
- AC_TYPE_UID_T
- AC_CANONICAL_HOST
- case $host_os in
- *cygwin* ) CYGWIN=yes;;
- * ) CYGWIN=no;;
- esac
- AC_CHECK_FUNCS(ftime gethostname gettimeofday lseek nice time uname)
- AC_CHECK_FUNCS(seteuid setpriority setreuid setruid)
- AC_CHECK_FUNCS(drand48)
- AC_CHECK_FUNCS(putenv setenv)
- AC_CHECK_FUNCS(nanosleep)
- if test "$cross_compiling" != "yes" ; then
- AC_FUNC_SETPGRP
- else
- CROSS_COMPILING=1
- AC_SUBST(CROSS_COMPILING)
- fi
- AC_MSG_CHECKING(for long long int)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[long long int x;]])],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_LONG_LONG_INT, 1, [define if "long long int" is available])
- ],[
- AC_MSG_RESULT(no)
- ])
- AC_MSG_CHECKING(for int64_t)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[int64_t x;]])],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_INT64_T, 1, [define if "int64_t" is available])
- ],[
- AC_MSG_RESULT(no)
- ])
- AC_MSG_CHECKING(for W11)
- case "$enable_w11" in
- yes|no) AC_MSG_RESULT("$enable_w11") ;;
- *) AC_MSG_ERROR([*** You must answer yes or no.]) ;;
- esac
- USE_X11=
- USE_W11=
- XLIB=
- XTLIB=
- if test "$enable_w11" = "yes" ; then
- X_CFLAGS=-I${SRCDIR}/display/drivers/windows/libW11
- X_LIBS='-L$(LIBDIR)'
- AC_SUBST(X_CFLAGS)
- AC_SUBST(X_LIBS)
- USE_W11="1"
- USE_X11="1"
- XLIB=-lX11
- CFLAGS="$CFLAGS -D__W98__"
- else
- AC_PATH_XTRA
- if test "$no_x" != "yes"; then
- USE_X11="1"
- XLIB=-lX11
- XTLIB=-lXt
- fi
- fi
- AC_SUBST(XLIB)
- AC_SUBST(XTLIB)
- AC_SUBST(USE_X11)
- # Note that some systems (FreeBSD for example) need an extra library for
- # cuserid
- ac_save_libs="$LIBS"
- LIBS=""
- AC_SEARCH_LIBS(cuserid,[compat])
- DBMIEXTRALIB="$LIBS"
- LIBS="$ac_save_libs"
- AC_SUBST(DBMIEXTRALIB)
- AC_CHECK_FUNCS(asprintf)
- AC_SUBST(HAVE_ASPRINTF)
- # Test if mathlib needs -lm flag or is included with libc
- AC_CHECK_FUNC(atan, MATHLIB=, [
- AC_CHECK_LIB(m, atan, MATHLIB=-lm, [
- AC_MSG_ERROR([*** Failed check for math library.])
- ])])
- AC_SUBST(MATHLIB)
- AC_CHECK_FUNC(dlsym, DLLIB=, [
- AC_CHECK_LIB(dl, dlsym, DLLIB=-ldl, [
- DLLIB=
- ])])
- AC_SUBST(DLLIB)
- AC_CHECK_FUNC(iconv, ICONVLIB=, [
- AC_CHECK_LIB(iconv, iconv, ICONVLIB=-liconv, [
- AC_CHECK_LIB(giconv, iconv, ICONVLIB=-lgiconv, [
- AC_CHECK_FUNC(libiconv, ICONVLIB=, [
- AC_CHECK_LIB(iconv, libiconv, ICONVLIB=-liconv, [
- AC_CHECK_LIB(giconv, libiconv, ICONVLIB=-lgiconv, [
- AC_MSG_WARN([*** Unable to locate iconv() function.])
- ICONVLIB=
- ])])])])])])
- AC_SUBST(ICONVLIB)
- have_socket=1
- AC_CHECK_FUNC(socket, SOCKLIB=, [
- AC_CHECK_LIB(socket, socket, SOCKLIB=-lsocket, [
- have_socket=0
- AC_MSG_WARN([*** Unable to locate socket() function.])
- ])])
- AC_SUBST(SOCKLIB)
- if test "$have_socket" = 1 ; then
- HAVE_SOCKET=1
- AC_DEFINE(HAVE_SOCKET, 1, [define if socket() exists])
- else
- HAVE_SOCKET=
- fi
- AC_SUBST(HAVE_SOCKET)
- # Mandatory zlib dependency
- ZLIBLIBPATH=
- ZLIBINCPATH=
- ZLIB=
- # With zlib includes directory
- LOC_CHECK_INC_PATH(zlib,zlib,ZLIBINCPATH)
- LOC_CHECK_INCLUDES(zlib.h,zlib,$ZLIBINCPATH)
- # With zlib library directory
- LOC_CHECK_LIB_PATH(zlib,zlib,ZLIBLIBPATH)
- LOC_CHECK_LIBS(z,deflate,zlib,$ZLIBLIBPATH,ZLIB,,,)
- #
- AC_SUBST(ZLIBINCPATH)
- AC_SUBST(ZLIBLIBPATH)
- AC_SUBST(ZLIB)
- # Done checking zlib
- # bzip2 support
- BZIP2LIBPATH=
- BZIP2INCPATH=
- BZIP2LIB=
- LOC_CHECK_USE(bzlib,bzlib,USE_BZIP2)
- if test -n "$USE_BZIP2"; then
- # With bzip2 includes directory
- LOC_CHECK_INC_PATH(bzlib,bzlib,BZIP2INCPATH)
- LOC_CHECK_INCLUDES(bzlib.h,bzlib,$BZIP2INCPATH)
- # With bzip2 library directory
- LOC_CHECK_LIB_PATH(bzlib,bzlib,BZIP2LIBPATH)
- LOC_CHECK_LIBS(bz2,BZ2_bzBuffToBuffCompress,bzlib,$BZIP2LIBPATH,BZIP2LIB,,,)
- #
- fi # $USE_BZIP2
- AC_SUBST(BZIP2INCPATH)
- AC_SUBST(BZIP2LIBPATH)
- AC_SUBST(BZIP2LIB)
- # Done checking bzip2
- # zstd support
- ZSTDLIBPATH=
- ZSTDINCPATH=
- ZSTDLIB=
- LOC_CHECK_USE(zstd,zstd,USE_ZSTD)
- if test -n "$USE_ZSTD"; then
- # With zstd includes directory
- LOC_CHECK_INC_PATH(zstd,zstd,ZSTDINCPATH)
- LOC_CHECK_INCLUDES(zstd.h,zstd,$ZSTDINCPATH)
- # With zstd library directory
- LOC_CHECK_LIB_PATH(zstd,zstd,ZSTDLIBPATH)
- LOC_CHECK_LIBS(zstd,ZSTD_compress,zstd,$ZSTDLIBPATH,ZSTDLIB,,,)
- #
- fi # $USE_ZSTD
- AC_SUBST(ZSTDINCPATH)
- AC_SUBST(ZSTDLIBPATH)
- AC_SUBST(ZSTDLIB)
- # Done checking zstd
- # Mandatory PROJ dependency
- PROJINC=
- PROJLIB=
- PROJSHARE=
- PROJ4API=0
- PROJMAJOR=4
- # With PROJ includes directory
- LOC_CHECK_INC_PATH(proj,External PROJ,PROJINC)
- # PROJ version check: if proj.h exists, it must be proj 5+
- LOC_CHECK_INCLUDES(proj.h,External PROJ,$PROJINC,PROJ4API=1)
- if test $PROJ4API = 0 ; then
- LOC_CHECK_VERSION_INT(proj.h,PROJ_VERSION_MAJOR,External PROJ major,proj_ver_major,$PROJINC,0)
- LOC_CHECK_VERSION_INT(proj.h,PROJ_VERSION_MINOR,External PROJ minor,proj_ver_minor,$PROJINC,0)
- LOC_CHECK_VERSION_INT(proj.h,PROJ_VERSION_PATCH,External PROJ patch,proj_ver_patch,$PROJINC,0)
- AC_MSG_RESULT([found PROJ version "${proj_ver_major}.${proj_ver_minor}.${proj_ver_patch}"])
- PROJMAJOR=${proj_ver_major}
- # minimum required PROJ 5+ version to use the new PROJ API: 5.1.0
- if test ${proj_ver_major} = 5 && test `expr ${proj_ver_minor} \< 1` = 1 ; then
- AC_MSG_WARN([At least PROJ version "5.1.0" is required for the new API ])
- PROJ4API=1
- fi
- else
- LOC_CHECK_VERSION_INT(proj_api.h,PJ_VERSION,External PROJ.4,proj_ver,$PROJINC,0)
- if test `expr ${proj_ver} \>= 600` = 1 ; then
- PROJMAJOR=6
- elif test `expr ${proj_ver} \>= 500` = 1 ; then
- PROJMAJOR=5
- elif test `expr ${proj_ver} \>= 400` = 1 ; then
- PROJMAJOR=4
- fi
- AC_MSG_RESULT([found PROJ version "${proj_ver}"])
- fi
- if test $PROJ4API = 0 ; then
- AC_MSG_RESULT([using new PROJ version 5+ API])
- # With PROJ library directory
- LOC_CHECK_LIB_PATH(proj,External PROJ,PROJLIB)
- LOC_CHECK_LIBS(proj,proj_pj_info,External PROJ,$PROJLIB,PROJLIB,,,)
- else
- AC_MSG_RESULT([using old PROJ version 4 API])
- AC_DEFINE(USE_PROJ4API, 1, [define if using old PROJ version 4 API])
- LOC_CHECK_INCLUDES(proj_api.h,External PROJ,$PROJINC)
- # PROJ version check for v4.x
- if test "$cross_compiling" = yes; then
- AC_MSG_WARN([*** Cannot check PROJ.4 version (cross-compiling).])
- else
- LOC_CHECK_VERSION_INT(proj_api.h,PJ_VERSION,External PROJ.4,proj_ver,$PROJINC,0)
- if test `expr ${proj_ver} \< 446` = 1 ; then
- AC_MSG_ERROR([*** PROJ.4.4.6 or later is required.])
- fi
- fi
- # With PROJ library directory
- LOC_CHECK_LIB_PATH(proj,External PROJ.4,PROJLIB)
- LOC_CHECK_LIBS(proj,pj_get_def,External PROJ.4,$PROJLIB,PROJLIB,,,)
- fi
- # With PROJ share directory
- LOC_CHECK_SHARE_PATH(proj,External PROJ,PROJSHARE)
- if test -z "$PROJSHARE" ; then
- AC_MSG_WARN([*** External PROJ directory not specified; default will be used])
- PROJSHARE=/usr/share/proj
- fi
- # check if share/proj/epsg exists only for PROJ < 6
- if test `expr ${PROJMAJOR} \< 6` = 1 ; then
- # LOC_CHECK_SHARE does not work when cross compiling
- if test "$cross_compiling" = "yes" ; then
- AC_MSG_CHECKING([for epsg])
- AC_MSG_RESULT([unknown (cross-compiling)])
- else
- LOC_CHECK_SHARE(epsg,External PROJ,$PROJSHARE,[
- AC_MSG_WARN([*** Unable to locate PROJ data files.])
- ])
- fi
- fi
- AC_SUBST(PROJINC)
- AC_SUBST(PROJLIB)
- AC_SUBST(PROJSHARE)
- # Done checking PROJ
- # Enable regex option
- LOC_CHECK_USE(regex,regex,USE_REGEX)
- REGEXINCPATH=
- REGEXLIBPATH=
- REGEXLIB=
- if test -n "$USE_REGEX"; then
- # With regex includes directory
- LOC_CHECK_INC_PATH(regex,regex,REGEXINCPATH)
- LOC_CHECK_INCLUDES(regex.h,regex,$REGEXINCPATH)
- # With regex library directory
- LOC_CHECK_LIB_PATH(regex,regex,REGEXLIBPATH)
- LOC_CHECK_FUNC(regcomp,regex functions,REGEXLIB,,,,,[
- LOC_CHECK_LIBS(regex,regcomp,regex,$REGEXLIBPATH,REGEXLIB,,,)
- ])
- fi # $USE_REGEX
- AC_SUBST(REGEXINCPATH)
- AC_SUBST(REGEXLIBPATH)
- AC_SUBST(REGEXLIB)
- AC_SUBST(USE_REGEX)
- # Done checking regex
- # Enable Readline option
- LOC_CHECK_USE(readline,Readline,USE_READLINE)
- READLINEINCPATH=
- READLINELIBPATH=
- READLINELIB=
- HISTORYLIB=
- if test -n "$USE_READLINE"; then
- # With Readline includes directory
- LOC_CHECK_INC_PATH(readline,Readline,READLINEINCPATH)
- LOC_CHECK_INCLUDES(readline/readline.h,Readline,$READLINEINCPATH)
- LOC_CHECK_INCLUDES(readline/history.h,Readline,$READLINEINCPATH)
- # With Readline library directory
- LOC_CHECK_LIB_PATH(readline,Readline,READLINELIBPATH)
- LOC_CHECK_LIBS(readline,readline,Readline,$READLINELIBPATH,READLINELIB,,,)
- LOC_CHECK_LIBS(history,add_history,History,$READLINELIBPATH,HISTORYLIB,,,)
- fi # $USE_READLINE
- AC_SUBST(READLINEINCPATH)
- AC_SUBST(READLINELIBPATH)
- AC_SUBST(READLINELIB)
- AC_SUBST(HISTORYLIB)
- # Done checking Readline
- # GDAL option
- AC_MSG_CHECKING(whether to use GDAL)
- GDAL_LIBS=
- GDAL_CFLAGS=
- USE_GDAL=
- USE_OGR=
- if test "`basename xx/$with_gdal`" = "gdal-config" ; then
- GDAL_CONFIG="$with_gdal"
- fi
- if test "$with_gdal" = "no" ; then
- AC_MSG_RESULT(no)
- else
- AC_MSG_RESULT(yes)
- AC_PATH_PROG(GDAL_CONFIG, gdal-config, no)
- if test "$GDAL_CONFIG" = "no" ; then
- AC_MSG_ERROR([*** couldn't find gdal-config])
- fi
- if test "$GDAL_CONFIG" != "" ; then
- GDAL_LIBS=`"$GDAL_CONFIG" --libs`
- GDAL_DEP_LIBS=`"$GDAL_CONFIG" --dep-libs`
- GDAL_CFLAGS=`"$GDAL_CONFIG" --cflags`
- USE_GDAL=1
- if test `"$GDAL_CONFIG" --ogr-enabled` = "yes" ; then
- AC_DEFINE(HAVE_OGR, 1, [define if OGR is to be used])
- USE_OGR=1
- fi
- fi
- GDAL=
- ac_save_libs="$LIBS"
- ac_save_cflags="$CFLAGS"
- LIBS="$LIBS $GDAL_LIBS"
- CFLAGS="$CFLAGS $GDAL_CFLAGS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gdal.h>]], [[GDALOpen("foo", GA_ReadOnly);]])],[],[
- LIBS="$LIBS $GDAL_DEP_LIBS"
- AC_TRY_LINK([#include <gdal.h>],[GDALOpen("foo", GA_ReadOnly);],GDAL_LIBS="$GDAL_LIBS $GDAL_DEP_LIBS",[
- AC_MSG_ERROR([*** Unable to locate GDAL library.])
- ])
- ])
- LIBS=${ac_save_libs}
- CFLAGS=${ac_save_cflags}
- AC_DEFINE(HAVE_GDAL, 1, [define if GDAL is to be used])
- fi
- AC_SUBST(GDAL_LIBS)
- AC_SUBST(GDAL_CFLAGS)
- AC_SUBST(USE_GDAL)
- AC_SUBST(USE_OGR)
- # libLAS option
- AC_MSG_CHECKING(whether to use libLAS)
- LIBLAS_LIBS=
- LIBLAS_CFLAGS=
- USE_LIBLAS=
- if test "`basename xx/$with_liblas`" = "liblas-config" ; then
- LIBLAS_CONFIG="$with_liblas"
- fi
- if test "$with_liblas" = "no" ; then
- AC_MSG_RESULT(no)
- else
- AC_MSG_RESULT(yes)
- AC_PATH_PROG(LIBLAS_CONFIG, liblas-config, no)
- if test "$LIBLAS_CONFIG" = "no" ; then
- AC_MSG_ERROR([*** couldn't find liblas-config])
- fi
- if test "$LIBLAS_CONFIG" != "" ; then
- LIBLAS_LIBS=`"$LIBLAS_CONFIG" --libs`
- LIBLAS_CFLAGS=`"$LIBLAS_CONFIG" --cflags`
- LIBLAS_INC=`"$LIBLAS_CONFIG" --includes`
- USE_LIBLAS=1
- fi
- LIBLAS=
- ac_save_libs="$LIBS"
- ac_save_cflags="$CFLAGS"
- ac_save_cppflags="$CPPFLAGS"
- LIBS="$LIBS $LIBLAS_LIBS"
- CFLAGS="$CFLAGS $LIBLAS_CFLAGS"
- CPPFLAGS="$CPPFLAGS $LIBLAS_INC"
- AC_CHECK_HEADERS(liblas/capi/liblas.h)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <liblas/capi/liblas.h>]], [[LASReader_Create("foo");]])],[],[
- AC_TRY_LINK([#include <liblas/capi/liblas.h>],[LASReader_Create("foo");],LAS_LIBS="$LAS_LIBS",[
- AC_MSG_ERROR([*** Unable to locate libLAS library.])
- ])
- ])
- LIBS=${ac_save_libs}
- CFLAGS=${ac_save_cflags}
- CPPFLAGS=${ac_save_cppflags}
- AC_DEFINE(HAVE_LIBLAS, 1, [define if liblas exists])
- fi
- AC_SUBST(LIBLAS_LIBS)
- AC_SUBST(LIBLAS_CFLAGS)
- AC_SUBST(LIBLAS_INC)
- AC_SUBST(USE_LIBLAS)
- # PDAL option
- AC_MSG_CHECKING(whether to use PDAL)
- AC_LANG_PUSH(C++)
- PDAL_LIBS=
- PDAL_CPPFLAGS=
- USE_PDAL=
- if test "`basename xx/$with_pdal`" = "pdal-config" ; then
- PDAL_CONFIG="$with_pdal"
- fi
- if test "$with_pdal" = "no" ; then
- AC_MSG_RESULT(no)
- else
- AC_MSG_RESULT(yes)
- AC_PATH_PROG(PDAL_CONFIG, pdal-config, no)
- if test "$PDAL_CONFIG" = "no" ; then
- AC_MSG_ERROR([*** could not find pdal-config])
- fi
- if test "$PDAL_CONFIG" != "" ; then
- PDAL_LIBS=`"$PDAL_CONFIG" --libs`
- PDAL_CPPFLAGS=`"$PDAL_CONFIG" --cxxflags`
- PDAL_INC=`"$PDAL_CONFIG" --includes`
- USE_PDAL=1
- fi
- PDAL=
- ac_save_libs="$LIBS"
- ac_save_cflags="$CFLAGS"
- ac_save_cppflags="$CPPFLAGS"
- LIBS="$LIBS $PDAL_LIBS"
- CFLAGS="$CFLAGS $PDAL_CFLAGS"
- CPPFLAGS="$CPPFLAGS $PDAL_CPPFLAGS $PDAL_INC"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pdal/PointTable.hpp>
- #include <pdal/Streamable.hpp>
- class St:public pdal::Streamable {};]], [[pdal::PointTable table;]])],[],[
- AC_TRY_LINK([#include <pdal/PointTable.hpp>
- #include <pdal/Streamable.hpp>
- class St:public pdal::Streamable {};],[pdal::PointTable table;],PDAL_LIBS="$PDAL_LIBS",[
- AC_MSG_ERROR([*** Unable to locate suitable (>=1.7.1) PDAL library.])
- ])
- ])
- LIBS=${ac_save_libs}
- CFLAGS=${ac_save_cflags}
- CPPFLAGS=${ac_save_cppflags}
- AC_DEFINE(HAVE_PDAL, 1, [define if PDAL exists])
- fi
- AC_SUBST(PDAL_LIBS)
- AC_SUBST(PDAL_CPPFLAGS)
- AC_SUBST(PDAL_INC)
- AC_SUBST(USE_PDAL)
- AC_LANG_POP(C++)
- # NetCDF option
- AC_MSG_CHECKING(whether to use NetCDF)
- NETCDF_LIBS=
- NETCDF_CFLAGS=
- USE_NETCDF=
- if test "`basename xx/$with_netcdf`" = "nc-config" ; then
- NETCDF_CONFIG="$with_netcdf"
- fi
- if test "$with_netcdf" = "no" ; then
- AC_MSG_RESULT(no)
- else
- AC_MSG_RESULT(yes)
- AC_PATH_PROG(NETCDF_CONFIG, nc-config, no)
- if test "$NETCDF_CONFIG" = "no" ; then
- AC_MSG_ERROR([*** couldn't find nc-config])
- fi
- if test "$NETCDF_CONFIG" != "" ; then
- NETCDF_LIBS=`"$NETCDF_CONFIG" --libs`
- NETCDF_CFLAGS=`"$NETCDF_CONFIG" --cflags`
- USE_NETCDF=1
- fi
- NETCDF=
- ac_save_libs="$LIBS"
- ac_save_cflags="$CFLAGS"
- LIBS="$LIBS $NETCDF_LIBS"
- CFLAGS="$CFLAGS $NETCDF_CFLAGS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netcdf.h>]], [[nc_create("foo", NC_CLOBBER, NULL);]])],[],[
- AC_TRY_LINK([#include <netcdf.h>],[nc_create("foo", NC_CLOBBER, NULL);],NETCDF_LIBS="$NETCDF_LIBS",[
- AC_MSG_ERROR([*** Unable to locate NetCDF library.])
- ])
- ])
- LIBS=${ac_save_libs}
- CFLAGS=${ac_save_cflags}
- AC_DEFINE(HAVE_NETCDF, 1, [define if NetCDF exists])
- fi
- AC_SUBST(NETCDF_LIBS)
- AC_SUBST(NETCDF_CFLAGS)
- AC_SUBST(USE_NETCDF)
- # GEOS option
- AC_MSG_CHECKING(whether to use GEOS)
- GEOS_LIBS=
- GEOS_CFLAGS=
- USE_GEOS=
- # FIXME: "quote" $with_geos ?
- if test "`basename xx/$with_geos`" = "geos-config" ; then
- GEOS_CONFIG="$with_geos"
- fi
- if test "$with_geos" = "no" ; then
- AC_MSG_RESULT(no)
- else
- AC_MSG_RESULT(yes)
- AC_PATH_PROG(GEOS_CONFIG, geos-config, no)
- if test "$GEOS_CONFIG" = "no" ; then
- AC_MSG_ERROR([*** couldn't find geos-config])
- fi
-
- if test "$GEOS_CONFIG" != "" ; then
- GEOS_LIBS=`"$GEOS_CONFIG" --clibs`
- GEOS_CFLAGS=`"$GEOS_CONFIG" --cflags`
- USE_GEOS=1
- fi
-
- LOC_CHECK_INCLUDES(geos_c.h,GEOS,$GEOS_CFLAGS)
- ### geos 3.3.6 installs geos_c.lib, see http://osgeo-org.1560.n6.nabble.com/osgeo4w-329-update-geos-to-3-3-6-td5024605.html
- # if test "$MINGW32" = yes ; then
- # LOC_CHECK_LIBS(geos_c_i,initGEOS,GEOS,$GEOS_LIBS,GEOS_LIBS)
- # else
- LOC_CHECK_LIBS(geos_c,initGEOS,GEOS,$GEOS_LIBS,GEOS_LIBS)
- # fi
- AC_DEFINE(HAVE_GEOS, 1, [define if GEOS is to be used])
- fi
- AC_SUBST(GEOS_LIBS)
- AC_SUBST(GEOS_CFLAGS)
- AC_SUBST(USE_GEOS)
- # Enable TIFF option
- LOC_CHECK_USE(tiff,TIFF,USE_TIFF)
- TIFF_INCLUDE_DIRS=
- TIFF_LIBRARY_DIRS=
- TIFFLIB=
- if test -n "$USE_TIFF"; then
- # With TIFF includes directory
- LOC_CHECK_INC_PATH(tiff,TIFF,TIFF_INCLUDE_DIRS)
- LOC_CHECK_INCLUDES(tiffio.h,TIFF,$TIFF_INCLUDE_DIRS)
- # With TIFF library directory
- LOC_CHECK_LIB_PATH(tiff,TIFF,TIFF_LIBRARY_DIRS)
- LOC_CHECK_LIBS(tiff,TIFFOpen,TIFF,$TIFF_LIBRARY_DIRS,TIFFLIB,,,,-ljpeg,$ZLIB,$MATHLIB)
- fi # $USE_TIFF
- AC_SUBST(TIFF_INCLUDE_DIRS)
- AC_SUBST(TIFF_LIBRARY_DIRS)
- AC_SUBST(TIFFLIB)
- # Done checking TIFF
- # Enable PNG option
- LOC_CHECK_USE(png,PNG,USE_PNG)
- PNGINC=
- PNGLIB=
- if test -n "$USE_PNG"; then
- # With PNG includes directory
- LOC_CHECK_INC_PATH(png,PNG,PNGINC)
- LOC_CHECK_INCLUDES(png.h,PNG,$PNGINC)
- # With PNG library directory
- LOC_CHECK_LIB_PATH(png,PNG,PNGLIB)
- LOC_CHECK_LIBS(png,png_read_image,PNG,$PNGLIB,PNGLIB,,$ZLIB $MATHLIB,)
- fi # $USE_PNG
- AC_SUBST(PNGINC)
- AC_SUBST(PNGLIB)
- AC_SUBST(USE_PNG)
- # Done checking PNG
- # Enable PostgreSQL option
- LOC_CHECK_USE(postgres,PostgreSQL,USE_POSTGRES)
- if test -n "$USE_POSTGRES"; then
- AC_DEFINE(HAVE_POSTGRES, 1, [define if PostgreSQL is to be used])
- fi # $USE_POSTGRES
- PQINCPATH=
- PQLIBPATH=
- PQLIB=
- if test -n "$USE_POSTGRES"; then
- # With PostgreSQL includes directory
- LOC_CHECK_INC_PATH(postgres,PostgreSQL,PQINCPATH)
- LOC_CHECK_INCLUDES(libpq-fe.h,PostgreSQL,$PQINCPATH)
- fi # $USE_POSTGRES
- if test -n "$USE_POSTGRES"; then
- # With PostgreSQL library directory
- LOC_CHECK_LIB_PATH(postgres,PostgreSQL,PQLIBPATH)
- LOC_CHECK_LIBS(pq,PQsetdbLogin,PostgreSQL,$PQLIBPATH,PQLIB,,,,-lcrypt,-lssl -lcrypto)
- ac_save_ldflags="$LDFLAGS"
- LDFLAGS="$LDFLAGS $PQLIBPATH"
- AC_CHECK_LIB(pq,PQcmdTuples, [AC_DEFINE(HAVE_PQCMDTUPLES, 1, [define if PQcmdTuples in lpq])], [
- AC_CHECK_LIB(pq,PQcmdTuples, [AC_DEFINE(HAVE_PQCMDTUPLES, 1, [define if PQcmdTuples in lpq])], [
- ], -lcrypt)
- ])
- LDFLAGS="${ac_save_ldflags}"
- fi # $USE_POSTGRES
- AC_SUBST(USE_POSTGRES)
- AC_SUBST(PQINCPATH)
- AC_SUBST(PQLIBPATH)
- AC_SUBST(PQLIB)
- # Done checking PostgreSQL
- # Enable MySQL option
- LOC_CHECK_USE(mysql,MySQL,USE_MYSQL)
- MYSQLINCPATH=
- MYSQLLIBPATH=
- MYSQLLIB=
- if test -n "$USE_MYSQL"; then
- # With MySQL includes directory
- LOC_CHECK_INC_PATH(mysql,MySQL,MYSQLINCPATH)
- LOC_CHECK_INCLUDES(mysql.h,MySQL,$MYSQLINCPATH)
- fi # $USE_MYSQL
- if test -n "$USE_MYSQL"; then
- # With MySQL library directory
- LOC_CHECK_LIB_PATH(mysql,MySQL,MYSQLLIBPATH)
- LOC_CHECK_LIBS(mysqlclient,mysql_query,MySQL,$MYSQLLIBPATH,MYSQLLIB,,,,$ZLIB,$SOCKLIB,$MATHLIB)
- # Check for libmysqld (for embedded version of the driver)
- AC_PATH_PROG(MYSQLD_CONFIG, mysql_config, no)
- if test "$MYSQLD_CONFIG" = "no" ; then
- AC_MSG_ERROR([*** couldn't find mysql_config])
- fi
- if test "$MYSQLD_CONFIG" != "" ; then
- AC_LANG_PUSH([C++])
- ac_save_libs="$LIBS"
- MYSQLDLIB=`"$MYSQLD_CONFIG" --libmysqld-libs`
- LIBS="$MYSQLDLIB $LIBS"
- AC_CHECK_FUNC(mysql_server_init,,[MYSQLDLIB="";
- AC_MSG_WARN([libmysqld not found])] )
- LIBS=$ac_save_libs
- AC_LANG_POP([C++])
- fi
- fi # $USE_MYSQL
- AC_SUBST(USE_MYSQL)
- AC_SUBST(MYSQLINCPATH)
- AC_SUBST(MYSQLLIBPATH)
- AC_SUBST(MYSQLLIB)
- AC_SUBST(MYSQLDLIB)
- # Done checking MySQL
- # Enable SQLite option
- LOC_CHECK_USE(sqlite,SQLite,USE_SQLITE)
- SQLITEINCPATH=
- SQLITELIBPATH=
- SQLITELIB=
- if test -n "$USE_SQLITE"; then
- # With SQLite includes directory
- LOC_CHECK_INC_PATH(sqlite,SQLite,SQLITEINCPATH)
- LOC_CHECK_INCLUDES(sqlite3.h,SQLite,$SQLITEINCPATH)
- AC_DEFINE(HAVE_SQLITE, 1, [define if SQLite is to be used])
- fi # $USE_SQLITE
- if test -n "$USE_SQLITE"; then
- # With SQLite library directory
- LOC_CHECK_LIB_PATH(sqlite,SQLite,SQLITELIBPATH)
- LOC_CHECK_LIBS(sqlite3,sqlite3_open,SQLite,$SQLITELIBPATH,SQLITELIB,,,,$MATHLIB,$DLLIB)
- fi # $USE_SQLITE
- AC_SUBST(USE_SQLITE)
- AC_SUBST(SQLITEINCPATH)
- AC_SUBST(SQLITELIBPATH)
- AC_SUBST(SQLITELIB)
- # Done checking SQLite
- # Enable OpenGL option
- OPENGLINC=
- OPENGLLIB=
- OPENGLULIB=
- USE_OPENGL=
- OPENGL_X11=
- OPENGL_AQUA=
- OPENGL_WINDOWS=
- AC_MSG_CHECKING(whether to use OpenGL)
- AC_MSG_RESULT("$with_opengl")
- case "$with_opengl" in
- n|no)
- OPENGL_TYPE=none
- ;;
- y|yes|x|x11|glx)
- OPENGL_TYPE=X11
- USE_OPENGL=1
- OPENGL_X11=1
- ;;
- aqua|mac|osx|macosx|agl)
- OPENGL_TYPE=Aqua
- USE_OPENGL=1
- OPENGL_AQUA=1
- ;;
- win|windows|mswin|wgl)
- OPENGL_TYPE=Windows
- USE_OPENGL=1
- OPENGL_WINDOWS=1
- ;;
- *)
- AC_MSG_ERROR([*** Valid arguments for --with-opengl= are yes,no,x11,aqua,windows.])
- ;;
- esac
- if test -n "$USE_OPENGL" ; then
- if test "$OPENGL_X11" = 1 ; then
- # With OpenGL includes directory
- LOC_CHECK_INC_PATH(opengl,OpenGL,OPENGLINC)
- LOC_CHECK_INCLUDES(GL/gl.h GL/glu.h,OpenGL,$OPENGLINC $X_CFLAGS)
- # With OpenGL library directory
- LOC_CHECK_LIB_PATH(opengl,OpenGL,OPENGL_LIB_PATH)
- LOC_CHECK_LIBS(GL,glBegin,OpenGL,$OPENGL_LIB_PATH,OPENGLLIB,$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB,,,-lpthread,-lXext)
- LOC_CHECK_LIBS(GLU,gluBeginCurve,GLU,$OPENGL_LIB_PATH,OPENGLULIB,$OPENGLLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB,,,-lstdc++)
- OPENGLLIB="$OPENGL_LIB_PATH $OPENGLLIB"
- OPENGLULIB="$OPENGL_LIB_PATH $OPENGLULIB"
- LOC_CHECK_FUNC(glXCreatePbuffer,,,,,$OPENGLLIB,[AC_DEFINE(HAVE_PBUFFERS, 1, [define if glXCreatePbuffer exists])])
- LOC_CHECK_FUNC(glXCreateGLXPixmap,,,,,$OPENGLLIB,[AC_DEFINE(HAVE_PIXMAPS, 1, [define if glXCreateGLXPixmap exists])])
- AC_DEFINE(OPENGL_X11, 1, [define if OpenGL uses X11])
- fi # $OPENGL_X11
- if test "$OPENGL_AQUA" = 1 ; then
- LOC_CHECK_FRAMEWORK_PATH(opengl,OpenGL,OPENGLPATH)
- LOC_CHECK_INCLUDES(OpenGL/gl.h OpenGL/glu.h,OpenGL,$OPENGLPATH)
- LOC_CHECK_FUNC(glBegin,OpenGL library,OPENGLLIB,-framework OpenGL -framework AGL -framework ApplicationServices,$OPENGLPATH)
- LOC_CHECK_FUNC(gluBeginCurve,GLU library,OPENGLLIB,,$OPENGLPATH,$OPENGLLIB)
- OPENGLINC="$OPENGLPATH"
- OPENGLLIBPATH="$OPENGLPATH"
- AC_DEFINE(OPENGL_AQUA, 1, [define if OpenGL uses Aqua (MacOS X)])
- fi # $OPENGL_AQUA
- if test "$OPENGL_WINDOWS" = 1 ; then
- # With OpenGL includes directory
- LOC_CHECK_INC_PATH(opengl,OpenGL,OPENGLINC)
- LOC_CHECK_INCLUDES(GL/gl.h GL/glu.h,OpenGL,$OPENGLINC)
- # With OpenGL library directory
- LOC_CHECK_LIB_PATH(opengl,OpenGL,OPENGL_LIB_PATH)
- ac_save_cflags="$CFLAGS"
- CFLAGS="$CFLAGS $OPENGLINC"
- LOC_CHECK_LINK(opengl32,[#include <GL/gl.h>],[glEnd();],OpenGL,$OPENGL_LIB_PATH,OPENGLLIB)
- LOC_CHECK_LINK(glu32,[#include <GL/glu.h>],[gluNewQuadric();],GLU,$OPENGL_LIB_PATH,OPENGLULIB,$OPENGLLIB)
- CFLAGS="${ac_save_cflags}"
- OPENGLLIB="$OPENGL_LIB_PATH $OPENGLLIB"
- OPENGLULIB="$OPENGL_LIB_PATH $OPENGLULIB"
- AC_DEFINE(OPENGL_WINDOWS, 1, [define if OpenGL uses Windows])
- fi # $OPENGL_WINDOWS
- fi # $USE_OPENGL
- AC_SUBST(USE_OPENGL)
- AC_SUBST(OPENGL_X11)
- AC_SUBST(OPENGL_AQUA)
- AC_SUBST(OPENGL_WINDOWS)
- AC_SUBST(OPENGLINC)
- AC_SUBST(OPENGLLIB)
- AC_SUBST(OPENGLULIB)
- # Done checking OpenGL
- # Enable ODBC option
- LOC_CHECK_USE(odbc,ODBC,USE_ODBC)
- ODBCINC=
- ODBCLIB=
- if test -n "$USE_ODBC"; then
- # With ODBC includes directory
- LOC_CHECK_INC_PATH(odbc,ODBC,ODBCINC)
- AC_CHECK_HEADER([windows.h],
- AC_DEFINE(HAVE_WINDOWS_H, 1, [Define to 1 if you have the <windows.h> header file.]))
-
- ac_save_cppflags="$CPPFLAGS"
- CPPFLAGS="$ODBCINC $CPPFLAGS"
- AC_CHECK_HEADER([sql.h],
- AC_DEFINE(HAVE_SQL_H, 1, [Define to 1 if you have the <sql.h> header file.]),
- AC_MSG_ERROR([*** Unable to locate <sql.h>.]),[#if defined(HAVE_WINDOWS_H)
- # include <windows.h>
- #endif
- ])
- CPPFLAGS=$ac_save_cppflags
- # With ODBC library directory
- LOC_CHECK_LIB_PATH(odbc,ODBC,ODBCLIB)
- LOC_CHECK_LIBS(odbc,SQLConnect,ODBC,$ODBCLIB,ODBCLIB,$ICONVLIB,,[
- LOC_CHECK_LIBS(iodbc,SQLConnect,ODBC,$ODBCLIB,ODBCLIB,,,[
- ac_save_cflags="$CFLAGS"
- CFLAGS="$CFLAGS $ODBCINC"
- LOC_CHECK_LINK(odbc32,[#include <windows.h>
- #include <sql.h>],[SQLAllocEnv((SQLHENV *)0);],ODBC,$ODBCLIB,ODBCLIB)
- CFLAGS="${ac_save_cflags}"
- ])
- ])
- fi # $USE_ODBC
- AC_SUBST(ODBCINC)
- AC_SUBST(ODBCLIB)
- # Done checking ODBC
- # Enable FFTW option
- LOC_CHECK_USE(fftw,FFTW,USE_FFTW)
- FFTWINC=
- FFTWLIB=
- if test -n "$USE_FFTW"; then
- # With FFTW includes directory
- LOC_CHECK_INC_PATH(fftw,FFTW,FFTWINC)
- LOC_CHECK_INCLUDES(fftw3.h,FFTW,$FFTWINC,[
- LOC_CHECK_INCLUDES(fftw.h,FFTW,,[
- LOC_CHECK_INCLUDES(dfftw.h,FFTW,,)
- ])
- ])
- # With FFTW library directory
- LOC_CHECK_LIB_PATH(fftw,FFTW,FFTWLIB)
- LOC_CHECK_LIBS(fftw3, fftw_execute,FFTW,$FFTWLIB,FFTWLIB,,$MATHLIB,[
- LOC_CHECK_LIBS(fftw, fftwnd_one,FFTW,$FFTWLIB,FFTWLIB,,$MATHLIB,[
- LOC_CHECK_LIBS(dfftw,fftwnd_one,FFTW,$FFTWLIB,FFTWLIB,,$MATHLIB,)
- ])
- ])
- fi # $USE_FFTW
- AC_SUBST(FFTWINC)
- AC_SUBST(FFTWLIB)
- # Done checking FFTW
- # Enable BLAS option
- LOC_CHECK_USE(blas,BLAS,USE_BLAS)
- BLASLIB=
- BLASINC=
- if test -n "$USE_BLAS"; then
- # With BLAS includes directory
- # BLAS doesn't have includes (FORTRAN library)
- # With BLAS library directory
- LOC_CHECK_INC_PATH(blas, BLAS, BLASINC)
- LOC_CHECK_LIB_PATH(blas, BLAS, BLASLIB)
- # See if cblas.h exists (CBLAS,ATLAS,others)
- save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$BLASINC $CPPFLAGS"
- AC_CHECK_HEADERS(cblas.h)
- CPPFLAGS="$save_CPPFLAGS"
- LOC_CHECK_LIBS(blas,dnrm2_,BLAS,$BLASLIB,BLASLIB,$MATHLIB,,,-lg2c)
- blas_ok=no
- # Check for ATLAS
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$BLASLIB $LDFLAGS"
- AC_CHECK_LIB(atlas, ATL_xerbla,
- [AC_CHECK_LIB(f77blas, sgemm_,
- [AC_CHECK_LIB(cblas, cblas_dgemm,
- [blas_ok=yes; BLASLIB="-lcblas -lf77blas -latlas"],
- [],[-lf77blas -latlas])],
- [],[-latlas])]
- )
- LDFLAGS="$save_LDFLAGS"
- # Do we have ATLAS?
- if test $blas_ok = yes; then
- AC_DEFINE(HAVE_LIBATLAS, 1, [define if ATLAS exists])
- fi
- # BLAS in Apple vecLib framework? (Mac OS-X)
- # not dependent on APP build
- #if test -n "$MACOSX_APP"; then
- if test $blas_ok = no; then
- vlib_flags="-framework vecLib"
- save_LIBS="$LIBS"
- LIBS="$vlib_flags $LIBS"
- AC_MSG_CHECKING([for sgemm in $vlib_flags])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[sgemm]])],[blas_ok=yes; BLASLIB="$vlib_flags"],[BLASLIB=""])
- AC_MSG_RESULT($blas_ok)
- LIBS="$save_LIBS"
- fi
- #fi # $MACOSX_APP
- # BLAS in PhiPACK libraries? (requires generic BLAS, too)
- if test $blas_ok = no; then
- AC_CHECK_LIB(blas, sgemm_,
- [AC_CHECK_LIB(dgemm, dgemm_,
- [AC_CHECK_LIB(sgemm, sgemm_,
- [blas_ok=yes; BLASLIB="-lsgemm -ldgemm -lblas"],
- [], [-lblas])],
- [], [-lblas])]
- )
- fi
- # BLAS in Sun Performance library?
- if test $blas_ok = no; then
- if test "x$GCC" != xyes; then # only works with Sun CC
- AC_CHECK_LIB(sunmath, acosp,
- [AC_CHECK_LIB(sunperf, sgemm_,
- [blas_ok=yes; BLASLIB="-xlic_lib=sunperf -lsunmath"],
- [], [-lsunmath])]
- )
- fi
- fi
- # Generic BLAS library
- if test $blas_ok = no; then
- AC_CHECK_LIB(blas, sgemm_, [blas_ok=yes; BLASLIB="-lblas"])
- fi
- if test $blas_ok = yes; then
- AC_DEFINE(HAVE_LIBBLAS, 1, [define if BLAS exists])
- fi
- fi # $USE_BLAS
- AC_SUBST(BLASLIB)
- AC_SUBST(BLASINC)
- # Done checking BLAS
- # Enable LAPACK option
- LOC_CHECK_USE(lapack,LAPACK,USE_LAPACK)
- LAPACKLIB=
- LAPACKINC=
- # LAPACK is useless without BLAS
- if test -n "$USE_BLAS"; then
- if test -n "$USE_LAPACK"; then
- # With LAPACK includes directory
- # LAPACK doesn't have includes (FORTRAN library)
- # With LAPACK library directory
- lapack_ok=no
- LOC_CHECK_INC_PATH(lapack, LAPACK, LAPACKINC)
- LOC_CHECK_LIB_PATH(lapack, LAPACK, LAPACKLIB)
- # See if clapack.h exists (ATLAS)
- save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$LAPACKINC $CPPFLAGS"
- AC_CHECK_HEADERS(clapack.h)
- CPPFLAGS="$save_CPPFLAGS"
- # LAPACK linked to by default?
- if test lapack_ok=no; then
- save_LIBS="$LIBS"; LIBS="$LIBS $BLASLIB $MATHLIB $FLIBS"
- save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS"
- AC_CHECK_FUNC(dsegv_, [lapack_ok=yes])
- LIBS="$save_LIBS"
- LDFLAGS="$save_LDFLAGS"
- fi
- # Generic LAPACK library?
- if test $lapack_ok = no; then
- save_libs="$LIBS"; LIBS="$BLASLIB $MATHLIB $LIBS"
- save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS"
- AC_CHECK_LIB(lapack, desgv_,
- [lapack_ok=yes; LAPACKLIB="-llapack"], [], [$FLIBS])
- LIBS="$save_LIBS"
- LDFLAGS="$save_LDFLAGS"
- fi
- if test $lapack_ok = no; then
- LOC_CHECK_LIBS(lapack,dgesv_,LAPACK,$LAPACKLIB,LAPACKLIB,$BLASLIB $MATHLIB,,,-lg2c)
- fi
- AC_DEFINE(HAVE_LIBLAPACK, 1, [define if LAPACK exists])
- fi # $USE_LAPACK
- fi # $USE_BLAS
- AC_SUBST(LAPACKLIB)
- AC_SUBST(LAPACKINC)
- # Done checking LAPACK
- # Enable Cairo display driver option
- LOC_CHECK_USE(cairo,Cairo,USE_CAIRO)
- CAIROINC=
- CAIROLIB=
- if test -n "$USE_CAIRO"; then
- cairo="cairo"
- pkgs="cairo-ft cairo-fc cairo-pdf cairo-ps cairo-svg fontconfig"
- if test -n "$USE_X11"; then
- pkgs="$pkgs cairo-xlib cairo-xlib-xrender"
- fi
- for pkg in $pkgs ; do
- if $PKG_CONFIG --exists $pkg ; then
- cairo="$cairo $pkg"
- fi
- done
- # With Cairo includes directory
- #FIXME: somehow quote dirs with spaces in $cairo ?
- CAIROINC=`$PKG_CONFIG --cflags $cairo`
- LOC_CHECK_INC_PATH(cairo,cairo,CAIROINC)
- LOC_CHECK_INCLUDES(cairo.h,Cairo,$CAIROINC)
- # With Cairo library directory
- CAIROLIB=`$PKG_CONFIG --libs $cairo`
- LOC_CHECK_LIB_PATH(cairo,cairo,CAIROLIB)
- LOC_CHECK_LDFLAGS(cairo,cairo,CAIROLIB)
- LOC_CHECK_FUNC(cairo_create,,,,,$CAIROLIB,[:])
- LOC_CHECK_FUNC(cairo_xlib_surface_create_with_xrender_format,,,,,$CAIROLIB,
- [CAIRO_HAS_XRENDER=1],[CAIRO_HAS_XRENDER=])
- AC_SUBST(CAIRO_HAS_XRENDER)
- LOC_CHECK_FUNC(cairo_xlib_surface_get_xrender_format,,,,,$CAIROLIB,
- [CAIRO_HAS_XRENDER_SURFACE=1],[CAIRO_HAS_XRENDER_SURFACE=])
- AC_SUBST(CAIRO_HAS_XRENDER_SURFACE)
- CAIROLIB="$CAIROLIB $CAIROLDFLAGS"
- fi # $USE_CAIRO
- AC_SUBST(CAIROINC)
- AC_SUBST(CAIROLIB)
- AC_SUBST(USE_CAIRO)
- # Done checking Cairo
- # Enable FreeType option
- LOC_CHECK_USE(freetype,FreeType,USE_FREETYPE)
- FTINC=
- FTLIB=
- if test -n "$USE_FREETYPE"; then
- # With FreeType includes directory
- FTINC=`$PKG_CONFIG --cflags freetype2`
- LOC_CHECK_INC_PATH(freetype,FreeType,FTINC)
- LOC_CHECK_INCLUDES(ft2build.h,FreeType,$FTINC)
- # With FreeType library directory
- FTLIB=`$PKG_CONFIG --libs freetype2`
- LOC_CHECK_LIB_PATH(freetype,FreeType,FTLIB)
- LOC_CHECK_LIBS(freetype,FT_Init_FreeType,FreeType,$FTLIB,FTLIB,,,)
- fi # $USE_FREETYPE
- AC_SUBST(FTINC)
- AC_SUBST(FTLIB)
- # Done checking FreeType
- # Enable NLS option
- LOC_CHECK_USE(nls,NLS,USE_NLS)
- INTLLIB=
- HAVE_NLS=
- if test -n "${USE_NLS}" ; then
- AC_DEFINE(USE_NLS, 1, [define if NLS requested])
- AC_CHECK_FUNC(gettext, INTLLIB=, [
- AC_CHECK_LIB(intl, gettext, INTLLIB=-lintl, [
- AC_MSG_ERROR([*** Unable to locate gettext() function.])
- ])])
- HAVE_NLS=1
- fi
- AC_SUBST(INTLLIB)
- AC_SUBST(HAVE_NLS)
- # Enable C++ option
-
- LOC_CHECK_USE(cxx,C++,USE_CXX)
- if test -n "$USE_CXX"; then
- AC_PROG_CXX
- else
- CXX=
- CXXFLAGS=
- AC_SUBST(CXX)
- AC_SUBST(CXXFLAGS)
- fi
- # Done checking C++
- # Enable openDWG option
- LOC_CHECK_USE(opendwg,openDWG,USE_OPENDWG)
- OPENDWGINCPATH=
- OPENDWGLIBPATH=
- OPENDWGLIB=
- if test -n "${USE_OPENDWG}"; then
- # With OPENDWG includes directory
- LOC_CHECK_INC_PATH(opendwg,openDGW,OPENDWGINCPATH)
- LOC_CHECK_INCLUDES(ad2.h,openDWG,$OPENDWGINCPATH)
- # With OPENDWG library directory
- LOC_CHECK_LIB_PATH(opendwg,openDWG,OPENDWGLIBPATH)
- #search for ad2.a, ad3.a ... in openDWG toolkit directory:
- #FIX ME how to program this test??
- #LOC_CHECK_LIBS(ad?.a,adSeekLayer,openDWG,$OPENDWGLIBPATH,OPENDWGLIB,,)
- #
- #for now hack (but working):
- TRUEOPENDWGLIBPATH=`echo "$OPENDWGLIBPATH" | cut -b3-`
- adlib=`ls -1 "$TRUEOPENDWGLIBPATH"/ad?.a | tail -1`
- OPENDWGLIB="$adlib"
- fi # $USE_OPENDWG
- AC_SUBST(OPENDWGINCPATH)
- AC_SUBST(OPENDWGLIBPATH)
- AC_SUBST(OPENDWGLIB)
- AC_SUBST(USE_OPENDWG)
- # Done checking OPENDWG
- # Enable pthread option
- LOC_CHECK_USE(pthread,POSIX threads,USE_PTHREAD)
- PTHREADINCPATH=
- PTHREADLIBPATH=
- PTHREADLIB=
- if test -n "$USE_PTHREAD"; then
- # With pthread includes directory
- LOC_CHECK_INC_PATH(pthread,POSIX threads,PTHREADINCPATH)
- LOC_CHECK_INCLUDES(pthread.h,POSIX threads,$PTHREADINCPATH)
- # With pthread library directory
- LOC_CHECK_LIB_PATH(pthread,POSIX threads,PTHREADLIBPATH)
- LOC_CHECK_FUNC(pthread_create,POSIX threads functions,PTHREADLIB,,,,,[
- LOC_CHECK_LIBS(pthread,pthread_create,POSIX threads,$PTHREADLIBPATH,PTHREADLIB,,,)
- ])
- fi # $USE_PTHREAD
- AC_SUBST(PTHREADINCPATH)
- AC_SUBST(PTHREADLIBPATH)
- AC_SUBST(PTHREADLIB)
- AC_SUBST(USE_PTHREAD)
- # Done checking pthread
- # Enable OpenMP option
- LOC_CHECK_USE(openmp,OpenMP,USE_OPENMP)
- OMPINCPATH=
- OMPLIBPATH=
- OMPLIB=
- OMPCFLAGS=
- if test -n "$USE_OPENMP"; then
- # With OpenMP includes directory
- LOC_CHECK_INC_PATH(openmp,OpenMP,OMPINCPATH)
- LOC_CHECK_INCLUDES(omp.h,OpenMP,$OMPINCPATH)
- # With OpenMP library directory
- # GCC et al.: -lgomp
- # Solaris cc: -lmtsk
- # AIX xlc: -lxlsmp
- # SGI IRIX 6.5 MIPSpro C/C++: -lmp
- LOC_CHECK_LIB_PATH(openmp,OpenMP,OMPLIBPATH)
- LOC_CHECK_FUNC(GOMP_parallel_start,OpenMP functions,OMPLIB,,,,,[
- LOC_CHECK_LIBS(gomp,GOMP_parallel_start,OpenMP,$OMPLIBPATH,OMPLIB,,,)
- ])
- # compiler dependent
- #if test ${CC} = "gcc" ; then
- if test x$GCC = xyes ; then
- # GNU C compiler (>= 4.2.1)
- OMPCFLAGS=-fopenmp
- elif test ${CC} = "icc" ; then
- # Intel compiler
- OMPCFLAGS=-openmp
- elif test ${CC} = "opencc" ; then
- # AMD's x86 Open64 compiler
- OMPCFLAGS=-mp
- elif test ${CC} = "pgcc" ; then
- # Portland Group's compiler
- OMPCFLAGS=-mp
- # ... anybody else?
- fi
- # try to build a test program with "$CC $OMPCLFAGS" to confirm it works
- #...how?
- #echo "int main() {return 0;}" > test.c
- #$CC $OMPCLFAGS test.c -o test
- fi # $USE_OPENMP
- AC_SUBST(OMPINCPATH)
- AC_SUBST(OMPLIBPATH)
- AC_SUBST(OMPLIB)
- AC_SUBST(OMPCFLAGS)
- AC_SUBST(USE_OPENMP)
- # Done checking OpenMP
- # Enable OpenCL option
- LOC_CHECK_USE(opencl,OpenCL,USE_OPENCL)
- OCLINCPATH=
- OCLLIBPATH=
- OCLLIB=
- if test -n "$USE_OPENCL"; then
- # With OpenCL includes directory
- LOC_CHECK_INC_PATH(opencl,OpenCL,OCLINCPATH)
- if test -n "$MACOSX_APP" ; then
- LOC_CHECK_INCLUDES(OpenCL/opencl.h,OpenCL,$OCLINCPATH)
- # With OpenCL library directory
- ### FIXME: ###
- #LOC_CHECK_FRAMEWORK_PATH(opencl,OpenCL,OPENCLPATH)
- # last term in following would become ',$OPENCLPATH)' if above is uncommented
- LOC_CHECK_FUNC(clGetPlatformInfo,OpenCL library,OCLLIB,-framework OpenCL,)
- else
- LOC_CHECK_INCLUDES(CL/cl.h,OpenCL,$OCLINCPATH)
- # With OpenCL library directory
- LOC_CHECK_LIB_PATH(opencl,OpenCL,OCLLIBPATH)
- LOC_CHECK_LIBS(OpenCL,clGetPlatformInfo,OpenCL,$OCLLIBPATH,OCLLIB,,,)
- # expanded symbol check: yes? no?
- #LOC_CHECK_FUNC(clGetPlatformInfo,OpenCL functions,OCLLIB,,,,,[
- #LOC_CHECK_LIBS(OpenCL,clGetPlatformInfo,OpenCL,$OCLLIBPATH,OCLLIB,,,)
- #])
- fi
- fi # $USE_OPENCL
- AC_SUBST(OCLINCPATH)
- AC_SUBST(OCLLIBPATH)
- AC_SUBST(OCLLIB)
- AC_SUBST(USE_OPENCL)
- # Done checking OpenCL
- # Enable LFS (from cdr-tools, tar, and autoconf 2.68)
- dnl Check for large file support
- dnl Do this last to make sure that no large file definition
- dnl in confdefs.h will modify our results
- AC_SYS_LARGEFILE
- ac_save_cflags=${CFLAGS}
- CFLAGS="$LFS_CFLAGS ${ac_save_cflags}"
- dnl Warning do not run this test. it interferes with the test
- dnl AC_CHECK_FUNCS(fseeko ftello) from above.
- dnl The test AC_HAVE_LARGEFILES will check whether ftello/fseeko
- dnl are available in Large File mode
- AC_FUNC_FSEEKO
- AC_HAVE_LARGEFILES
- CFLAGS=${ac_save_cflags}
- # Done large file support
- USE_TERMIO=
- AC_SUBST(USE_TERMIO)
- STRIPFLAG=
- AC_SUBST(STRIPFLAG)
- GRASS_HOME="${DSTDIR}"
- AC_SUBST(GRASS_HOME)
- AC_CONFIG_FILES([include/Make/Platform.make include/Make/Doxyfile_arch_html include/Make/Doxyfile_arch_latex include/grass/version.h grass.pc])
- AC_OUTPUT
- LOC_MSG([Copying config.status to config.status.${ARCH}])
- cp -f config.status config.status.${ARCH}
- # Display configuration status
- LOC_MSG()
- LOC_MSG([GRASS is now configured for: ${host}])
- LOC_MSG()
- LOC_MSG([ Source directory: ${SRCDIR}])
- LOC_MSG([ Build directory: ${DSTDIR}])
- LOC_MSG([ Installation directory: ${INSTDIR}])
- LOC_MSG([ Startup script in directory:${bindir}])
- LOC_MSG([ C compiler: ${CC} ${CFLAGS}])
- LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}])
- LOC_MSG([ Building shared libraries: ${shared_ok}])
- LOC_MSG([ OpenGL platform: ${OPENGL_TYPE}])
- LOC_MSG()
- LOC_MSG_USE(MacOSX application,MACOSX_APP)
- LOC_MSG([ MacOSX architectures: ${MACOSX_ARCHS}])
- LOC_MSG([ MacOSX SDK: ${MACOSX_SDK}])
- LOC_MSG()
- LOC_MSG_USE(BLAS support,USE_BLAS)
- LOC_MSG_USE(BZIP2 support,USE_BZIP2)
- LOC_MSG_USE(C++ support,USE_CXX)
- LOC_MSG_USE(Cairo support,USE_CAIRO)
- LOC_MSG_USE(DWG support,USE_OPENDWG)
- LOC_MSG_USE(FFTW support,USE_FFTW)
- LOC_MSG_USE(FreeType support,USE_FREETYPE)
- LOC_MSG_USE(GDAL support,USE_GDAL)
- LOC_MSG_USE(GEOS support,USE_GEOS)
- LOC_MSG_USE(LAPACK support,USE_LAPACK)
- LOC_MSG_USE(Large File support (LFS), USE_LARGEFILES)
- LOC_MSG_USE(libLAS support,USE_LIBLAS)
- LOC_MSG_USE(MySQL support,USE_MYSQL)
- LOC_MSG_USE(NetCDF support,USE_NETCDF)
- LOC_MSG_USE(NLS support,USE_NLS)
- LOC_MSG_USE(ODBC support,USE_ODBC)
- LOC_MSG_USE(OGR support,USE_OGR)
- LOC_MSG_USE(OpenCL support,USE_OPENCL)
- LOC_MSG_USE(OpenGL support,USE_OPENGL)
- LOC_MSG_USE(OpenMP support,USE_OPENMP)
- LOC_MSG_USE(PDAL support,USE_PDAL)
- LOC_MSG_USE(PNG support,USE_PNG)
- LOC_MSG_USE(POSIX thread support,USE_PTHREAD)
- LOC_MSG_USE(PostgreSQL support,USE_POSTGRES)
- LOC_MSG_USE(Readline support,USE_READLINE)
- LOC_MSG_USE(Regex support,USE_REGEX)
- LOC_MSG_USE(SQLite support,USE_SQLITE)
- LOC_MSG_USE(TIFF support,USE_TIFF)
- LOC_MSG_USE(X11 support,USE_X11)
- LOC_MSG_USE(Zstandard support,USE_ZSTD)
- LOC_MSG()
- # remove when the new PROJ API is stable
- if test $PROJ4API = 0 ; then
- AC_MSG_RESULT([ using new PROJ 5+ API])
- else
- AC_MSG_RESULT([ using old PROJ 4 API])
- fi
- LOC_MSG()
|