configure.in 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940
  1. #############################################################################
  2. #
  3. # MODULE: Grass Compilation
  4. # AUTHOR(S): Original author unknown - probably CERL
  5. # Eric G. Miller - egm2 jps.net
  6. # Justin Hickey - Thailand - jhickey hpcc.nectec.or.th
  7. # Markus Neteler - Germany/Italy - neteler itc.it
  8. # PURPOSE: This configure runs all the tests to determine what components
  9. # are installed on the current system. It also defines certain
  10. # configuration variables for compilation and installation.
  11. # COPYRIGHT: (C) 2000-2009, 2011-2012 by the GRASS Development Team
  12. #
  13. # This program is free software under the GNU General
  14. # Public License (>=v2). Read the file COPYING that
  15. # comes with GRASS for details.
  16. #
  17. # MANUAL: http://www.gnu.org/software/autoconf/manual/autoconf.html
  18. # http://savannah.gnu.org/projects/autoconf/
  19. # Website for config.guess, config.sub:
  20. # wget http://git.savannah.gnu.org/cgit/config.git/plain/config.guess
  21. # wget http://git.savannah.gnu.org/cgit/config.git/plain/config.sub
  22. # Note: use autoconf-2.13
  23. #############################################################################
  24. define([AC_CACHE_LOAD], )
  25. define([AC_CACHE_SAVE], )
  26. define([AC_CACHE_VAL], [
  27. $2
  28. ])
  29. AC_INIT(configure.in)
  30. AC_PREREQ(2.13)
  31. AC_PREFIX_DEFAULT(/usr/local)
  32. AC_CONFIG_HEADER(include/config.h)
  33. AC_CANONICAL_HOST
  34. AC_PROG_CC
  35. LOC_EXEEXT
  36. AC_SUBST(MINGW32)
  37. # Check for full floating-point support, including Infinity and NaN
  38. IEEEFLAG=
  39. LOC_CHECK_FP_INF_NAN([],
  40. [],
  41. [ ac_save_cflags=${CFLAGS}
  42. CFLAGS=-mieee
  43. LOC_CHECK_FP_INF_NAN([ with -mieee],
  44. [IEEEFLAG="-mieee"],
  45. [AC_MSG_WARN([*** Incomplete floating-point support.])],
  46. [AC_MSG_ERROR([*** INTERNAL CONFIGURE ERROR])])
  47. CFLAGS=${ac_save_cflags}],
  48. [ LOC_CHECK_CC_MIEEE ])
  49. CFLAGS="$CFLAGS $IEEEFLAG"
  50. # Set BINDIR
  51. if test -n "${bindir}"; then
  52. BINDIR="${bindir}"
  53. else
  54. BINDIR=/usr/local/bin
  55. fi
  56. AC_SUBST(BINDIR)
  57. # Set SRCDIR and DSTDIR
  58. AC_PATH_PROG(pwd, pwd, pwd)
  59. if test "$MINGW32" = yes ; then
  60. winpwd="pwd -W"
  61. else
  62. winpwd="$pwd"
  63. fi
  64. AC_MSG_CHECKING(for source directory)
  65. if test -z "$srcdir" ; then
  66. SRCDIR=`$pwd`
  67. else
  68. SRCDIR=`(cd "$srcdir" ; $pwd)`
  69. fi
  70. AC_MSG_RESULT("$SRCDIR")
  71. AC_MSG_CHECKING(for build directory)
  72. DSTDIR=`$pwd`
  73. WINDSTDIR=`$winpwd`
  74. AC_MSG_RESULT("$DSTDIR")
  75. AC_SUBST(SRCDIR)
  76. AC_SUBST(DSTDIR)
  77. # Set ARCH
  78. ARCH=
  79. if test -z "${host}"; then
  80. ARCH="unknown"
  81. else
  82. ARCH="${host}"
  83. fi
  84. AC_SUBST(ARCH)
  85. # Use absolute path for aux directory so that install-sh works
  86. AC_CONFIG_AUX_DIR("$SRCDIR")
  87. # Set GISBASE and GRASS_BIN
  88. GISBASE="${WINDSTDIR}/dist.${ARCH}"
  89. GRASS_BIN="${DSTDIR}/bin.${ARCH}"
  90. AC_SUBST(GISBASE)
  91. AC_SUBST(GRASS_BIN)
  92. # Set GRASS_VERSION_*
  93. GRASS_VERSION_FILE=include/VERSION
  94. GRASS_VERSION_MAJOR=`sed -n 1p "${GRASS_VERSION_FILE}"`
  95. GRASS_VERSION_MINOR=`sed -n 2p "${GRASS_VERSION_FILE}"`
  96. GRASS_VERSION_RELEASE=`sed -n 3p "${GRASS_VERSION_FILE}"`
  97. GRASS_VERSION_DATE=`sed -n 4p "${GRASS_VERSION_FILE}"`
  98. GRASS_VERSION_NUMBER=`echo ${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}`
  99. NAME_VER=`echo ${GRASS_VERSION_NUMBER} | sed 's/\..*//'`
  100. changequote(,)
  101. LIB_VER=`echo ${GRASS_VERSION_NUMBER} | sed 's/^\([0-9.]*\).*$/\1/'`
  102. changequote([,])
  103. GRASS_VERSION_SVN="exported"
  104. AC_PATH_PROG(SVN_VERSION, svnversion, no)
  105. if test "$SVN_VERSION" != "no" ; then
  106. GRASS_VERSION_SVN=`$SVN_VERSION -c | cut -f2 -d:`
  107. if test "$GRASS_VERSION_SVN" = "exported" -o "$GRASS_VERSION_SVN" = "Unversioned directory" ; then
  108. GRASS_VERSION_SVN="exported"
  109. else
  110. GRASS_VERSION_SVN="r$GRASS_VERSION_SVN"
  111. fi
  112. fi
  113. AC_SUBST(GRASS_VERSION_FILE)
  114. AC_SUBST(GRASS_VERSION_MAJOR)
  115. AC_SUBST(GRASS_VERSION_MINOR)
  116. AC_SUBST(GRASS_VERSION_RELEASE)
  117. AC_SUBST(GRASS_VERSION_NUMBER)
  118. AC_SUBST(GRASS_VERSION_DATE)
  119. AC_SUBST(GRASS_VERSION_SVN)
  120. AC_SUBST(NAME_VER)
  121. AC_SUBST(LIB_VER)
  122. # Check for MacOSX App
  123. AC_ARG_ENABLE(macosx-app,
  124. [ --enable-macosx-app create a MacOSX application],,
  125. [enable_macosx_app=no])
  126. AC_MSG_CHECKING(for MacOSX App)
  127. case "$enable_macosx_app" in
  128. yes) MACOSX_APP=1 ;;
  129. no) MACOSX_APP= ;;
  130. *) AC_MSG_ERROR([*** You must answer yes or no.]) ;;
  131. esac
  132. AC_MSG_RESULT("$enable_macosx_app")
  133. AC_SUBST(MACOSX_APP)
  134. # Check for MacOSX archs
  135. AC_MSG_CHECKING(for MacOSX architectures)
  136. MACOSX_ARCHS=
  137. if test -z "$with_macosx_archs" ; then
  138. AC_MSG_RESULT(no)
  139. else
  140. for a in $with_macosx_archs
  141. do
  142. # check if valid arch?
  143. case "$a" in
  144. i386|ppc|x86_64|ppc64)
  145. MACOSX_ARCHS="$MACOSX_ARCHS -arch $a"
  146. ;;
  147. esac
  148. done
  149. AC_MSG_RESULT([$MACOSX_ARCHS])
  150. LDFLAGS="$LDFLAGS $MACOSX_ARCHS"
  151. CFLAGS="$CFLAGS $MACOSX_ARCHS"
  152. CXXFLAGS="$CXXFLAGS $MACOSX_ARCHS"
  153. fi
  154. AC_SUBST(MACOSX_ARCHS)
  155. # Done checking MacOSX archs
  156. # Check for MacOSX SDK
  157. AC_MSG_CHECKING(for MacOSX SDK)
  158. MACOSX_SDK=
  159. if test -z "$with_macosx_sdk" ; then
  160. AC_MSG_RESULT(no)
  161. else
  162. AC_CHECK_FILE($with_macosx_sdk/SDKSettings.plist, [
  163. MACOSX_SDK="-isysroot $with_macosx_sdk"],[
  164. AC_MSG_ERROR([*** specified SDK does not exist or is not a SDK])])
  165. LDFLAGS="$LDFLAGS $MACOSX_SDK"
  166. CFLAGS="$CFLAGS $MACOSX_SDK"
  167. CXXFLAGS="$CXXFLAGS $MACOSX_SDK"
  168. fi
  169. AC_SUBST(MACOSX_SDK)
  170. # Done checking MacOSX SDK
  171. # Set INST_DIR
  172. if test -n "$MACOSX_APP" ; then
  173. INSTDIR='${prefix}'"/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.app/Contents/MacOS"
  174. else
  175. INSTDIR='${prefix}'"/grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}"
  176. fi
  177. AC_SUBST(INSTDIR)
  178. # Get flags for building shared libraries
  179. SC_ENABLE_SHARED
  180. ac_save_ldflags="$LDFLAGS"
  181. SC_CONFIG_CFLAGS
  182. LDFLAGS="${ac_save_ldflags} $LDFLAGS"
  183. # Enable options
  184. AC_ARG_ENABLE(w11,
  185. [ --enable-w11 use W11 library for Windows X11 emulation],,
  186. [enable_w11=no])
  187. # With options
  188. LOC_ARG_WITH(cxx, C++)
  189. #LOC_ARG_WITH(g77, GNU Fortran 77, no)
  190. AC_ARG_WITH(macosx-archs,
  191. [ --with-macosx-archs[=arch list]
  192. compile multiple architectures on MacOSX, ie.
  193. universal. Valid architectures are i386, ppc,
  194. x86_64 and ppc64. (default: no [native])],, with_macosx_archs="no")
  195. AC_ARG_WITH(macosx-sdk,
  196. [ --with-macosx-sdk[=path/sdk]
  197. compile with a system SDK on MacOSX. (default: no)],, with_macosx_sdk="no")
  198. LOC_ARG_WITH(tiff, TIFF)
  199. LOC_ARG_WITH(png, PNG)
  200. LOC_ARG_WITH(postgres, PostgreSQL, no)
  201. LOC_ARG_WITH(mysql, MySQL, no)
  202. LOC_ARG_WITH(sqlite, SQLite)
  203. LOC_ARG_WITH(opengl, OpenGL)
  204. LOC_ARG_WITH(odbc, ODBC, no)
  205. LOC_ARG_WITH(fftw, FFTW)
  206. LOC_ARG_WITH(blas, BLAS, no)
  207. LOC_ARG_WITH(lapack, LAPACK, no)
  208. LOC_ARG_WITH(cairo, Cairo)
  209. LOC_ARG_WITH(freetype, FreeType)
  210. LOC_ARG_WITH(nls, NLS, no)
  211. LOC_ARG_WITH(readline, Readline, no)
  212. LOC_ARG_WITH(opendwg, openDWG, no)
  213. LOC_ARG_WITH(regex, regex)
  214. LOC_ARG_WITH(pthread, POSIX threads, no)
  215. LOC_ARG_WITH(openmp, OpenMP, no)
  216. LOC_ARG_WITH(opencl, OpenCL, no)
  217. LOC_ARG_WITH(bzlib, BZIP2, no)
  218. AC_ARG_WITH(gdal,
  219. [ --with-gdal[=path/gdal-config]
  220. enable GDAL/OGR support (gdal-config with path,
  221. e.g. '--with-gdal=/usr/local/bin/gdal-config')])
  222. AC_ARG_WITH(liblas,
  223. [ --with-liblas[=path/liblas-config]
  224. enable libLAS support (liblas-config with path,
  225. e.g. '--with-liblas=/usr/local/bin/liblas-config',
  226. default: no)],, with_liblas="no")
  227. AC_ARG_WITH(pdal,
  228. [ --with-pdal[=path/pdal-config]
  229. enable PDAL support (pdal-config with path,
  230. e.g. '--with-pdal=/usr/local/bin/pdal-config',
  231. default: no)],, with_pdal="no")
  232. AC_ARG_WITH(wxwidgets,
  233. [ --with-wxwidgets[=path/wx-config]
  234. enable wxWidgets support (wx-config with path,
  235. e.g. '--with-wxwidgets=/usr/local/bin/wx-config',
  236. default: no)],, with_wxwidgets="no")
  237. AC_ARG_WITH(netcdf,
  238. [ --with-netcdf[=path/nc-config]
  239. enable NetCDF support (nc-config with path,
  240. e.g. '--with-nc=/usr/local/bin/nc-config',
  241. default: no)],, with_netcdf="no")
  242. # With includes and libs options
  243. AC_ARG_WITH(geos,
  244. [ --with-geos[=path/geos-config]
  245. enable GEOS support (geos-config with path,
  246. e.g. '--with-geos=/usr/local/bin/geos-config',
  247. default: no)],, with_geos="no")
  248. AC_ARG_WITH(includes,
  249. [ --with-includes=DIRS site include files are in DIRS])
  250. AC_ARG_WITH(libs,
  251. [ --with-libs=DIRS site library files are in DIRS])
  252. LOC_ARG_WITH_INC(zlib, zlib)
  253. LOC_ARG_WITH_LIB(zlib, zlib)
  254. LOC_ARG_WITH_INC(bzlib, BZIP2)
  255. LOC_ARG_WITH_LIB(bzlib, BZIP2)
  256. LOC_ARG_WITH_INC(readline, Readline)
  257. LOC_ARG_WITH_LIB(readline, Readline)
  258. LOC_ARG_WITH_INC(tiff, TIFF)
  259. LOC_ARG_WITH_LIB(tiff, TIFF)
  260. LOC_ARG_WITH_INC(png, PNG)
  261. LOC_ARG_WITH_LIB(png, PNG)
  262. LOC_ARG_WITH_INC(postgres, PostgreSQL)
  263. LOC_ARG_WITH_LIB(postgres, PostgreSQL)
  264. LOC_ARG_WITH_INC(mysql, MySQL)
  265. LOC_ARG_WITH_LIB(mysql, MySQL)
  266. LOC_ARG_WITH_INC(sqlite, SQLite)
  267. LOC_ARG_WITH_LIB(sqlite, SQLite)
  268. LOC_ARG_WITH_INC(opengl, OpenGL)
  269. LOC_ARG_WITH_LIB(opengl, OpenGL)
  270. LOC_ARG_WITH_FRAMEWORK(opengl, OpenGL)
  271. LOC_ARG_WITH_INC(odbc, ODBC)
  272. LOC_ARG_WITH_LIB(odbc, ODBC)
  273. LOC_ARG_WITH_INC(fftw, FFTW)
  274. LOC_ARG_WITH_LIB(fftw, FFTW)
  275. LOC_ARG_WITH_INC(blas, BLAS)
  276. LOC_ARG_WITH_LIB(blas, BLAS)
  277. LOC_ARG_WITH_INC(lapack, LAPACK)
  278. LOC_ARG_WITH_LIB(lapack, LAPACK)
  279. LOC_ARG_WITH_INC(cairo, cairo)
  280. LOC_ARG_WITH_LIB(cairo, cairo)
  281. LOC_ARG_WITH_LDFLAGS(cairo, cairo)
  282. LOC_ARG_WITH_INC(freetype, FreeType)
  283. LOC_ARG_WITH_LIB(freetype, FreeType)
  284. LOC_ARG_WITH_INC(proj, External PROJ.4)
  285. LOC_ARG_WITH_LIB(proj, External PROJ.4)
  286. LOC_ARG_WITH_SHARE(proj, External PROJ.4)
  287. LOC_ARG_WITH_INC(opendwg, openDWG)
  288. LOC_ARG_WITH_LIB(opendwg, openDWG)
  289. LOC_ARG_WITH_INC(regex, regex)
  290. LOC_ARG_WITH_LIB(regex, regex)
  291. LOC_ARG_WITH_INC(pthread, POSIX threads)
  292. LOC_ARG_WITH_LIB(pthread, POSIX threads)
  293. LOC_ARG_WITH_INC(openmp, OpenMP)
  294. LOC_ARG_WITH_LIB(openmp, OpenMP)
  295. LOC_ARG_WITH_INC(opencl, OpenCL)
  296. LOC_ARG_WITH_LIB(opencl, OpenCL)
  297. #LOC_ARG_WITH_FRAMEWORK(opencl, OpenCL)
  298. # Put this early on so CPPFLAGS and LDFLAGS have any additional dirs
  299. # With includes option
  300. # Handle Fortran compiler choice
  301. #LOC_CHECK_USE(g77, GNU Fortran 77, USE_G77)
  302. # Done checking fortran
  303. AC_MSG_CHECKING(for additional include dirs)
  304. case "$with_includes" in
  305. y | ye | yes | n | no)
  306. AC_MSG_ERROR([*** You must supply a directory to list --with-includes.])
  307. ;;
  308. esac
  309. AC_MSG_RESULT($with_includes)
  310. if test -n "$with_includes"; then
  311. for dir in $with_includes; do
  312. if test -d "$dir"; then
  313. INCLUDE_DIRS="$INCLUDE_DIRS -I$dir"
  314. else
  315. AC_MSG_ERROR([*** Include directory $dir does not exist.])
  316. fi
  317. done
  318. CPPFLAGS="$CPPFLAGS $INCLUDE_DIRS"
  319. fi
  320. AC_SUBST(INCLUDE_DIRS)
  321. # With libs option
  322. AC_MSG_CHECKING(for additional library dirs)
  323. case "$with_libs" in
  324. y | ye | yes | n | no)
  325. AC_MSG_ERROR([*** You must supply a directory list to --with-libs.])
  326. ;;
  327. esac
  328. AC_MSG_RESULT($with_libs)
  329. if test -n "$with_libs"; then
  330. for dir in $with_libs; do
  331. if test -d "$dir"; then
  332. LIBRARY_DIRS="$LIBRARY_DIRS -L$dir"
  333. else
  334. AC_MSG_ERROR([*** Library directory $dir does not exist.])
  335. fi
  336. done
  337. LDFLAGS="$LDFLAGS $LIBRARY_DIRS"
  338. fi
  339. AC_SUBST(LIBRARY_DIRS)
  340. # Programs and standard headers, libraries, functions
  341. AC_PROG_INSTALL
  342. AC_PROG_LEX
  343. if test "$LEX" = "lex"; then
  344. AC_PATH_PROG(LEXPATH, lex, no)
  345. if test "$LEXPATH" = "no"; then
  346. AC_MSG_ERROR([*** Unable to locate lex.])
  347. fi
  348. fi
  349. AC_PROG_YACC
  350. if test "$YACC" = "yacc"; then
  351. AC_PATH_PROG(YACCPATH, yacc, no)
  352. if test "$YACCPATH" = "no"; then
  353. AC_MSG_ERROR([*** Unable to locate yacc.])
  354. fi
  355. fi
  356. AC_PROG_RANLIB
  357. AC_CHECK_PROGS(AR, ar)
  358. AC_CHECK_PROGS(ENV, env)
  359. AC_PATH_PROG(PERL, perl, no)
  360. AC_HEADER_STDC
  361. #AC_CHECK_HEADERS(curses.h limits.h termio.h termios.h unistd.h values.h)
  362. AC_CHECK_HEADERS(limits.h termio.h termios.h unistd.h values.h f2c.h g2c.h)
  363. AC_CHECK_HEADERS(sys/ioctl.h sys/mtio.h sys/resource.h sys/time.h)
  364. AC_CHECK_HEADERS(sys/timeb.h sys/types.h sys/utsname.h)
  365. AC_CHECK_HEADERS(libintl.h iconv.h)
  366. AC_CHECK_HEADERS(langinfo.h)
  367. AC_HEADER_TIME
  368. AC_TYPE_OFF_T
  369. AC_TYPE_UID_T
  370. AC_TYPE_SIGNAL
  371. AC_CYGWIN
  372. AC_CHECK_FUNCS(ftime gethostname gettimeofday lseek nice time uname)
  373. AC_CHECK_FUNCS(seteuid setpriority setreuid setruid)
  374. AC_CHECK_FUNCS(drand48)
  375. AC_CHECK_FUNCS(putenv setenv)
  376. AC_CHECK_FUNCS(nanosleep)
  377. if test "$cross_compiling" != "yes" ; then
  378. AC_FUNC_SETPGRP
  379. else
  380. CROSS_COMPILING=1
  381. AC_SUBST(CROSS_COMPILING)
  382. fi
  383. AC_MSG_CHECKING(for long long int)
  384. AC_TRY_COMPILE(,[long long int x;],[
  385. AC_MSG_RESULT(yes)
  386. AC_DEFINE(HAVE_LONG_LONG_INT)
  387. ],[
  388. AC_MSG_RESULT(no)
  389. ])
  390. AC_MSG_CHECKING(for W11)
  391. case "$enable_w11" in
  392. yes|no) AC_MSG_RESULT("$enable_w11") ;;
  393. *) AC_MSG_ERROR([*** You must answer yes or no.]) ;;
  394. esac
  395. USE_X11=
  396. USE_W11=
  397. XLIB=
  398. XTLIB=
  399. if test "$enable_w11" = "yes" ; then
  400. X_CFLAGS=-I${SRCDIR}/display/drivers/windows/libW11
  401. X_LIBS='-L$(LIBDIR)'
  402. AC_SUBST(X_CFLAGS)
  403. AC_SUBST(X_LIBS)
  404. USE_W11="1"
  405. USE_X11="1"
  406. XLIB=-lX11
  407. CFLAGS="$CFLAGS -D__W98__"
  408. else
  409. AC_PATH_XTRA
  410. if test "$no_x" != "yes"; then
  411. USE_X11="1"
  412. XLIB=-lX11
  413. XTLIB=-lXt
  414. fi
  415. fi
  416. AC_SUBST(XLIB)
  417. AC_SUBST(XTLIB)
  418. AC_SUBST(USE_X11)
  419. # Note that some systems (FreeBSD for example) need an extra library for
  420. # cuserid
  421. ac_save_libs="$LIBS"
  422. LIBS=""
  423. AC_SEARCH_LIBS(cuserid,[compat])
  424. DBMIEXTRALIB="$LIBS"
  425. LIBS="$ac_save_libs"
  426. AC_SUBST(DBMIEXTRALIB)
  427. AC_CHECK_FUNCS(asprintf)
  428. AC_SUBST(HAVE_ASPRINTF)
  429. # Test if mathlib needs -lm flag or is included with libc
  430. AC_CHECK_FUNC(atan, MATHLIB=, [
  431. AC_CHECK_LIB(m, atan, MATHLIB=-lm, [
  432. AC_MSG_ERROR([*** Failed check for math library.])
  433. ])])
  434. AC_SUBST(MATHLIB)
  435. AC_CHECK_FUNC(dlsym, DLLIB=, [
  436. AC_CHECK_LIB(dl, dlsym, DLLIB=-ldl, [
  437. DLLIB=
  438. ])])
  439. AC_SUBST(DLLIB)
  440. AC_CHECK_FUNC(iconv, ICONVLIB=, [
  441. AC_CHECK_LIB(iconv, iconv, ICONVLIB=-liconv, [
  442. AC_CHECK_LIB(giconv, iconv, ICONVLIB=-lgiconv, [
  443. AC_CHECK_FUNC(libiconv, ICONVLIB=, [
  444. AC_CHECK_LIB(iconv, libiconv, ICONVLIB=-liconv, [
  445. AC_CHECK_LIB(giconv, libiconv, ICONVLIB=-lgiconv, [
  446. AC_MSG_WARN([*** Unable to locate iconv() function.])
  447. ICONVLIB=
  448. ])])])])])])
  449. AC_SUBST(ICONVLIB)
  450. have_socket=1
  451. AC_CHECK_FUNC(socket, SOCKLIB=, [
  452. AC_CHECK_LIB(socket, socket, SOCKLIB=-lsocket, [
  453. have_socket=0
  454. AC_MSG_WARN([*** Unable to locate socket() function.])
  455. ])])
  456. AC_SUBST(SOCKLIB)
  457. if test "$have_socket" = 1 ; then
  458. HAVE_SOCKET=1
  459. AC_DEFINE(HAVE_SOCKET)
  460. else
  461. HAVE_SOCKET=
  462. fi
  463. AC_SUBST(HAVE_SOCKET)
  464. # Mandatory zlib dependency
  465. ZLIBLIBPATH=
  466. ZLIBINCPATH=
  467. ZLIB=
  468. # With zlib includes directory
  469. LOC_CHECK_INC_PATH(zlib,zlib,ZLIBINCPATH)
  470. LOC_CHECK_INCLUDES(zlib.h,zlib,$ZLIBINCPATH)
  471. # With zlib library directory
  472. LOC_CHECK_LIB_PATH(zlib,zlib,ZLIBLIBPATH)
  473. LOC_CHECK_LIBS(z,deflate,zlib,$ZLIBLIBPATH,ZLIB,,,)
  474. #
  475. AC_SUBST(ZLIBINCPATH)
  476. AC_SUBST(ZLIBLIBPATH)
  477. AC_SUBST(ZLIB)
  478. # Done checking zlib
  479. # bzip2 support
  480. LOC_CHECK_USE(bzlib,bzlib,USE_BZIP2)
  481. if test -n "$USE_BZIP2"; then
  482. BZLIBLIBPATH=
  483. BZLIBINCPATH=
  484. BZLIB=
  485. # With bzip2 includes directory
  486. LOC_CHECK_INC_PATH(bzlib,bzlib,BZLIBINCPATH)
  487. LOC_CHECK_INCLUDES(bzlib.h,bzlib,$BZLIBINCPATH)
  488. # With bzip2 library directory
  489. LOC_CHECK_LIB_PATH(bzlib,bzlib,BZLIBLIBPATH)
  490. LOC_CHECK_LIBS(bz2,BZ2_bzBuffToBuffCompress,bzlib,$BZLIBLIBPATH,BZLIB,,,)
  491. #
  492. fi # $USE_BZIP2
  493. AC_SUBST(BZLIBINCPATH)
  494. AC_SUBST(BZLIBLIBPATH)
  495. AC_SUBST(BZLIB)
  496. # Done checking bzip2
  497. # Mandatory PROJ dependency
  498. PROJINC=
  499. PROJLIB=
  500. PROJSHARE=
  501. # With PROJ includes directory
  502. LOC_CHECK_INC_PATH(proj,External PROJ.4,PROJINC)
  503. LOC_CHECK_INCLUDES(proj_api.h,External PROJ.4,$PROJINC)
  504. # PROJ version check
  505. if test "$cross_compiling" = yes; then
  506. AC_MSG_WARN([*** Cannot check PROJ.4 version (cross-compiling).])
  507. else
  508. LOC_CHECK_VERSION_INT(proj_api.h,PJ_VERSION,External PROJ.4,proj_ver,$PROJINC,0)
  509. if test `expr "$proj_ver" \< 446` = 1 ; then
  510. AC_MSG_ERROR([*** PROJ.4.4.6 or later is required.])
  511. fi
  512. fi
  513. # With PROJ library directory
  514. LOC_CHECK_LIB_PATH(proj,External PROJ.4,PROJLIB)
  515. LOC_CHECK_LIBS(proj,pj_get_def,External PROJ.4,$PROJLIB,PROJLIB,,,)
  516. # With PROJ share directory
  517. LOC_CHECK_SHARE_PATH(proj,External PROJ.4,PROJSHARE)
  518. if test -z "$PROJSHARE" ; then
  519. AC_MSG_WARN([*** External PROJ.4 directory not specified; default will be used])
  520. PROJSHARE=/usr/share/proj
  521. fi
  522. # LOC_CHECK_SHARE does not work when cross compiling
  523. if test "$cross_compiling" = "yes" ; then
  524. AC_MSG_CHECKING([for epsg])
  525. AC_MSG_RESULT([unknown (cross-compiling)])
  526. else
  527. LOC_CHECK_SHARE(epsg,External PROJ.4,$PROJSHARE,[
  528. AC_MSG_WARN([*** Unable to locate PROJ data files.])
  529. ])
  530. fi
  531. AC_SUBST(PROJINC)
  532. AC_SUBST(PROJLIB)
  533. AC_SUBST(PROJSHARE)
  534. # nad2bin needs to be in path for installing datum gridshift files
  535. AC_PATH_PROG(NAD2BIN, nad2bin, no)
  536. if test "$NAD2BIN" = "no"; then
  537. AC_MSG_ERROR([*** Unable to locate nad2bin (needs to be in PATH).])
  538. fi
  539. # Done checking PROJ
  540. # Enable regex option
  541. LOC_CHECK_USE(regex,regex,USE_REGEX)
  542. REGEXINCPATH=
  543. REGEXLIBPATH=
  544. REGEXLIB=
  545. if test -n "$USE_REGEX"; then
  546. # With regex includes directory
  547. LOC_CHECK_INC_PATH(regex,regex,REGEXINCPATH)
  548. LOC_CHECK_INCLUDES(regex.h,regex,$REGEXINCPATH)
  549. # With regex library directory
  550. LOC_CHECK_LIB_PATH(regex,regex,REGEXLIBPATH)
  551. LOC_CHECK_FUNC(regcomp,regex functions,REGEXLIB,,,,,[
  552. LOC_CHECK_LIBS(regex,regcomp,regex,$REGEXLIBPATH,REGEXLIB,,,)
  553. ])
  554. fi # $USE_REGEX
  555. AC_SUBST(REGEXINCPATH)
  556. AC_SUBST(REGEXLIBPATH)
  557. AC_SUBST(REGEXLIB)
  558. AC_SUBST(USE_REGEX)
  559. # Done checking regex
  560. # Enable Readline option
  561. LOC_CHECK_USE(readline,Readline,USE_READLINE)
  562. READLINEINCPATH=
  563. READLINELIBPATH=
  564. READLINELIB=
  565. HISTORYLIB=
  566. if test -n "$USE_READLINE"; then
  567. # With Readline includes directory
  568. LOC_CHECK_INC_PATH(readline,Readline,READLINEINCPATH)
  569. LOC_CHECK_INCLUDES(readline/readline.h,Readline,$READLINEINCPATH)
  570. LOC_CHECK_INCLUDES(readline/history.h,Readline,$READLINEINCPATH)
  571. # With Readline library directory
  572. LOC_CHECK_LIB_PATH(readline,Readline,READLINELIBPATH)
  573. LOC_CHECK_LIBS(readline,readline,Readline,$READLINELIBPATH,READLINELIB,,,)
  574. LOC_CHECK_LIBS(history,add_history,History,$READLINELIBPATH,HISTORYLIB,,,)
  575. fi # $USE_READLINE
  576. AC_SUBST(READLINEINCPATH)
  577. AC_SUBST(READLINELIBPATH)
  578. AC_SUBST(READLINELIB)
  579. AC_SUBST(HISTORYLIB)
  580. # Done checking Readline
  581. # GDAL option
  582. AC_MSG_CHECKING(whether to use GDAL)
  583. GDAL_LIBS=
  584. GDAL_CFLAGS=
  585. USE_GDAL=
  586. USE_OGR=
  587. if test "`basename xx/$with_gdal`" = "gdal-config" ; then
  588. GDAL_CONFIG="$with_gdal"
  589. fi
  590. if test "$with_gdal" = "no" ; then
  591. AC_MSG_RESULT(no)
  592. else
  593. AC_MSG_RESULT(yes)
  594. AC_PATH_PROG(GDAL_CONFIG, gdal-config, no)
  595. if test "$GDAL_CONFIG" = "no" ; then
  596. AC_MSG_ERROR([*** couldn't find gdal-config])
  597. fi
  598. if test "$GDAL_CONFIG" != "" ; then
  599. GDAL_LIBS=`"$GDAL_CONFIG" --libs`
  600. GDAL_DEP_LIBS=`"$GDAL_CONFIG" --dep-libs`
  601. GDAL_CFLAGS=`"$GDAL_CONFIG" --cflags`
  602. USE_GDAL=1
  603. if test `"$GDAL_CONFIG" --ogr-enabled` = "yes" ; then
  604. AC_DEFINE(HAVE_OGR)
  605. USE_OGR=1
  606. fi
  607. fi
  608. GDAL=
  609. ac_save_libs="$LIBS"
  610. ac_save_cflags="$CFLAGS"
  611. LIBS="$LIBS $GDAL_LIBS"
  612. CFLAGS="$CFLAGS $GDAL_CFLAGS"
  613. AC_TRY_LINK([#include <gdal.h>],[GDALOpen("foo", GA_ReadOnly);],,[
  614. LIBS="$LIBS $GDAL_DEP_LIBS"
  615. AC_TRY_LINK([#include <gdal.h>],[GDALOpen("foo", GA_ReadOnly);],GDAL_LIBS="$GDAL_LIBS $GDAL_DEP_LIBS",[
  616. AC_MSG_ERROR([*** Unable to locate GDAL library.])
  617. ])
  618. ])
  619. LIBS=${ac_save_libs}
  620. CFLAGS=${ac_save_cflags}
  621. AC_DEFINE(HAVE_GDAL)
  622. fi
  623. AC_SUBST(GDAL_LIBS)
  624. AC_SUBST(GDAL_CFLAGS)
  625. AC_SUBST(USE_GDAL)
  626. AC_SUBST(USE_OGR)
  627. # libLAS option
  628. AC_MSG_CHECKING(whether to use libLAS)
  629. LIBLAS_LIBS=
  630. LIBLAS_CFLAGS=
  631. USE_LIBLAS=
  632. if test "`basename xx/$with_liblas`" = "liblas-config" ; then
  633. LIBLAS_CONFIG="$with_liblas"
  634. fi
  635. if test "$with_liblas" = "no" ; then
  636. AC_MSG_RESULT(no)
  637. else
  638. AC_MSG_RESULT(yes)
  639. AC_PATH_PROG(LIBLAS_CONFIG, liblas-config, no)
  640. if test "$LIBLAS_CONFIG" = "no" ; then
  641. AC_MSG_ERROR([*** couldn't find liblas-config])
  642. fi
  643. if test "$LIBLAS_CONFIG" != "" ; then
  644. LIBLAS_LIBS=`"$LIBLAS_CONFIG" --libs`
  645. LIBLAS_CFLAGS=`"$LIBLAS_CONFIG" --cflags`
  646. LIBLAS_INC=`"$LIBLAS_CONFIG" --includes`
  647. USE_LIBLAS=1
  648. fi
  649. LIBLAS=
  650. ac_save_libs="$LIBS"
  651. ac_save_cflags="$CFLAGS"
  652. ac_save_cppflags="$CPPFLAGS"
  653. LIBS="$LIBS $LIBLAS_LIBS"
  654. CFLAGS="$CFLAGS $LIBLAS_CFLAGS"
  655. CPPFLAGS="$CPPFLAGS $LIBLAS_INC"
  656. AC_TRY_LINK([#include <liblas/capi/liblas.h>],[LASReader_Create("foo");],,[
  657. AC_TRY_LINK([#include <liblas/capi/liblas.h>],[LASReader_Create("foo");],LAS_LIBS="$LAS_LIBS",[
  658. AC_MSG_ERROR([*** Unable to locate libLAS library.])
  659. ])
  660. ])
  661. LIBS=${ac_save_libs}
  662. CFLAGS=${ac_save_cflags}
  663. CPPFLAGS=${ac_save_cppflags}
  664. AC_DEFINE(HAVE_LIBLAS)
  665. fi
  666. AC_SUBST(LIBLAS_LIBS)
  667. AC_SUBST(LIBLAS_CFLAGS)
  668. AC_SUBST(LIBLAS_INC)
  669. AC_SUBST(USE_LIBLAS)
  670. # PDAL option
  671. AC_MSG_CHECKING(whether to use PDAL)
  672. # new and currently used way to switch language to C++
  673. # AC_LANG_PUSH(C++)
  674. AC_LANG_SAVE
  675. AC_LANG_CPLUSPLUS
  676. PDAL_LIBS=
  677. PDAL_CPPFLAGS=
  678. USE_PDAL=
  679. if test "`basename xx/$with_pdal`" = "pdal-config" ; then
  680. PDAL_CONFIG="$with_pdal"
  681. fi
  682. if test "$with_pdal" = "no" ; then
  683. AC_MSG_RESULT(no)
  684. else
  685. AC_MSG_RESULT(yes)
  686. AC_PATH_PROG(PDAL_CONFIG, pdal-config, no)
  687. if test "$PDAL_CONFIG" = "no" ; then
  688. AC_MSG_ERROR([*** could not find pdal-config])
  689. fi
  690. if test "$PDAL_CONFIG" != "" ; then
  691. PDAL_LIBS=`"$PDAL_CONFIG" --libs`
  692. PDAL_CPPFLAGS=`"$PDAL_CONFIG" --cxxflags`
  693. PDAL_INC=`"$PDAL_CONFIG" --includes`
  694. USE_PDAL=1
  695. fi
  696. PDAL=
  697. ac_save_libs="$LIBS"
  698. ac_save_cflags="$CFLAGS"
  699. ac_save_cppflags="$CPPFLAGS"
  700. LIBS="$LIBS $PDAL_LIBS"
  701. CFLAGS="$CFLAGS $PDAL_CFLAGS"
  702. CPPFLAGS="$CPPFLAGS $PDAL_CPPFLAGS $PDAL_INC"
  703. AC_TRY_LINK([#include <pdal/PointTable.hpp>],[pdal::PointTable table;],,[
  704. AC_TRY_LINK([#include <pdal/PointTable.hpp>],[pdal::PointTable table;],PDAL_LIBS="$PDAL_LIBS",[
  705. AC_MSG_ERROR([*** Unable to locate PDAL library.])
  706. ])
  707. ])
  708. LIBS=${ac_save_libs}
  709. CFLAGS=${ac_save_cflags}
  710. CPPFLAGS=${ac_save_cppflags}
  711. AC_DEFINE(HAVE_PDAL)
  712. fi
  713. AC_SUBST(PDAL_LIBS)
  714. AC_SUBST(PDAL_CPPFLAGS)
  715. AC_SUBST(PDAL_INC)
  716. AC_SUBST(USE_PDAL)
  717. # new and currently used way to switch language back to C
  718. # AC_LANG_POP(C++)
  719. AC_LANG_C
  720. AC_LANG_RESTORE
  721. # NetCDF option
  722. AC_MSG_CHECKING(whether to use NetCDF)
  723. NETCDF_LIBS=
  724. NETCDF_CFLAGS=
  725. USE_NETCDF=
  726. if test "`basename xx/$with_netcdf`" = "nc-config" ; then
  727. NETCDF_CONFIG="$with_netcdf"
  728. fi
  729. if test "$with_netcdf" = "no" ; then
  730. AC_MSG_RESULT(no)
  731. else
  732. AC_MSG_RESULT(yes)
  733. AC_PATH_PROG(NETCDF_CONFIG, nc-config, no)
  734. if test "$NETCDF_CONFIG" = "no" ; then
  735. AC_MSG_ERROR([*** couldn't find nc-config])
  736. fi
  737. if test "$NETCDF_CONFIG" != "" ; then
  738. NETCDF_LIBS=`"$NETCDF_CONFIG" --libs`
  739. NETCDF_CFLAGS=`"$NETCDF_CONFIG" --cflags`
  740. USE_NETCDF=1
  741. fi
  742. NETCDF=
  743. ac_save_libs="$LIBS"
  744. ac_save_cflags="$CFLAGS"
  745. LIBS="$LIBS $NETCDF_LIBS"
  746. CFLAGS="$CFLAGS $NETCDF_CFLAGS"
  747. AC_TRY_LINK([#include <netcdf.h>],[nc_create("foo", NC_CLOBBER, NULL);],,[
  748. AC_TRY_LINK([#include <netcdf.h>],[nc_create("foo", NC_CLOBBER, NULL);],NETCDF_LIBS="$NETCDF_LIBS",[
  749. AC_MSG_ERROR([*** Unable to locate NetCDF library.])
  750. ])
  751. ])
  752. LIBS=${ac_save_libs}
  753. CFLAGS=${ac_save_cflags}
  754. AC_DEFINE(HAVE_NETCDF)
  755. fi
  756. AC_SUBST(NETCDF_LIBS)
  757. AC_SUBST(NETCDF_CFLAGS)
  758. AC_SUBST(USE_NETCDF)
  759. # GEOS option
  760. AC_MSG_CHECKING(whether to use GEOS)
  761. GEOS_LIBS=
  762. GEOS_CFLAGS=
  763. USE_GEOS=
  764. # FIXME: "quote" $with_geos ?
  765. if test "`basename xx/$with_geos`" = "geos-config" ; then
  766. GEOS_CONFIG="$with_geos"
  767. fi
  768. if test "$with_geos" = "no" ; then
  769. AC_MSG_RESULT(no)
  770. else
  771. AC_MSG_RESULT(yes)
  772. AC_PATH_PROG(GEOS_CONFIG, geos-config, no)
  773. if test "$GEOS_CONFIG" = "no" ; then
  774. AC_MSG_ERROR([*** couldn't find geos-config])
  775. fi
  776. if test "$GEOS_CONFIG" != "" ; then
  777. GEOS_LIBS=`"$GEOS_CONFIG" --libs`
  778. GEOS_CFLAGS=`"$GEOS_CONFIG" --cflags`
  779. USE_GEOS=1
  780. fi
  781. LOC_CHECK_INCLUDES(geos_c.h,GEOS,$GEOS_CFLAGS)
  782. ### 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
  783. # if test "$MINGW32" = yes ; then
  784. # LOC_CHECK_LIBS(geos_c_i,initGEOS,GEOS,$GEOS_LIBS,GEOS_LIBS)
  785. # else
  786. LOC_CHECK_LIBS(geos_c,initGEOS,GEOS,$GEOS_LIBS,GEOS_LIBS)
  787. # fi
  788. AC_DEFINE(HAVE_GEOS)
  789. fi
  790. AC_SUBST(GEOS_LIBS)
  791. AC_SUBST(GEOS_CFLAGS)
  792. AC_SUBST(USE_GEOS)
  793. # Enable TIFF option
  794. LOC_CHECK_USE(tiff,TIFF,USE_TIFF)
  795. TIFF_INCLUDE_DIRS=
  796. TIFF_LIBRARY_DIRS=
  797. TIFFLIB=
  798. if test -n "$USE_TIFF"; then
  799. # With TIFF includes directory
  800. LOC_CHECK_INC_PATH(tiff,TIFF,TIFF_INCLUDE_DIRS)
  801. LOC_CHECK_INCLUDES(tiffio.h,TIFF,$TIFF_INCLUDE_DIRS)
  802. # With TIFF library directory
  803. LOC_CHECK_LIB_PATH(tiff,TIFF,TIFF_LIBRARY_DIRS)
  804. LOC_CHECK_LIBS(tiff,TIFFOpen,TIFF,$TIFF_LIBRARY_DIRS,TIFFLIB,,,,-ljpeg,$ZLIB,$MATHLIB)
  805. fi # $USE_TIFF
  806. AC_SUBST(TIFF_INCLUDE_DIRS)
  807. AC_SUBST(TIFF_LIBRARY_DIRS)
  808. AC_SUBST(TIFFLIB)
  809. # Done checking TIFF
  810. # Enable PNG option
  811. LOC_CHECK_USE(png,PNG,USE_PNG)
  812. PNGINC=
  813. PNGLIB=
  814. if test -n "$USE_PNG"; then
  815. # With PNG includes directory
  816. LOC_CHECK_INC_PATH(png,PNG,PNGINC)
  817. LOC_CHECK_INCLUDES(png.h,PNG,$PNGINC)
  818. # With PNG library directory
  819. LOC_CHECK_LIB_PATH(png,PNG,PNGLIB)
  820. LOC_CHECK_LIBS(png,png_read_image,PNG,$PNGLIB,PNGLIB,,$ZLIB $MATHLIB,)
  821. fi # $USE_PNG
  822. AC_SUBST(PNGINC)
  823. AC_SUBST(PNGLIB)
  824. AC_SUBST(USE_PNG)
  825. # Done checking PNG
  826. # Enable PostgreSQL option
  827. LOC_CHECK_USE(postgres,PostgreSQL,USE_POSTGRES)
  828. if test -n "$USE_POSTGRES"; then
  829. AC_DEFINE(HAVE_POSTGRES)
  830. fi # $USE_POSTGRES
  831. PQINCPATH=
  832. PQLIBPATH=
  833. PQLIB=
  834. if test -n "$USE_POSTGRES"; then
  835. # With PostgreSQL includes directory
  836. LOC_CHECK_INC_PATH(postgres,PostgreSQL,PQINCPATH)
  837. LOC_CHECK_INCLUDES(libpq-fe.h,PostgreSQL,$PQINCPATH)
  838. fi # $USE_POSTGRES
  839. if test -n "$USE_POSTGRES"; then
  840. # With PostgreSQL library directory
  841. LOC_CHECK_LIB_PATH(postgres,PostgreSQL,PQLIBPATH)
  842. LOC_CHECK_LIBS(pq,PQsetdbLogin,PostgreSQL,$PQLIBPATH,PQLIB,,,,-lcrypt,-lssl -lcrypto)
  843. ac_save_ldflags="$LDFLAGS"
  844. LDFLAGS="$LDFLAGS $PQLIBPATH"
  845. AC_CHECK_LIB(pq,PQcmdTuples, [AC_DEFINE(HAVE_PQCMDTUPLES)], [
  846. AC_CHECK_LIB(pq,PQcmdTuples, [AC_DEFINE(HAVE_PQCMDTUPLES)], [
  847. ], -lcrypt)
  848. ])
  849. LDFLAGS="${ac_save_ldflags}"
  850. fi # $USE_POSTGRES
  851. AC_SUBST(USE_POSTGRES)
  852. AC_SUBST(PQINCPATH)
  853. AC_SUBST(PQLIBPATH)
  854. AC_SUBST(PQLIB)
  855. # Done checking PostgreSQL
  856. # Enable MySQL option
  857. LOC_CHECK_USE(mysql,MySQL,USE_MYSQL)
  858. MYSQLINCPATH=
  859. MYSQLLIBPATH=
  860. MYSQLLIB=
  861. if test -n "$USE_MYSQL"; then
  862. # With MySQL includes directory
  863. LOC_CHECK_INC_PATH(mysql,MySQL,MYSQLINCPATH)
  864. LOC_CHECK_INCLUDES(mysql.h,MySQL,$MYSQLINCPATH)
  865. fi # $USE_MYSQL
  866. if test -n "$USE_MYSQL"; then
  867. # With MySQL library directory
  868. LOC_CHECK_LIB_PATH(mysql,MySQL,MYSQLLIBPATH)
  869. LOC_CHECK_LIBS(mysqlclient,mysql_query,MySQL,$MYSQLLIBPATH,MYSQLLIB,,,,$ZLIB,$SOCKLIB,$MATHLIB)
  870. # Check for libmysqld (for embedded version of the driver)
  871. AC_PATH_PROG(MYSQLD_CONFIG, mysql_config, no)
  872. if test "$MYSQLD_CONFIG" = "no" ; then
  873. AC_MSG_ERROR([*** couldn't find mysql_config])
  874. fi
  875. if test "$MYSQLD_CONFIG" != "" ; then
  876. AC_LANG_SAVE
  877. AC_LANG_CPLUSPLUS
  878. ac_save_libs="$LIBS"
  879. MYSQLDLIB=`"$MYSQLD_CONFIG" --libmysqld-libs`
  880. LIBS="$MYSQLDLIB $LIBS"
  881. AC_CHECK_FUNC(mysql_server_init,,[MYSQLDLIB="";
  882. AC_MSG_WARN([libmysqld not found])] )
  883. LIBS=$ac_save_libs
  884. AC_LANG_C
  885. AC_LANG_RESTORE
  886. fi
  887. fi # $USE_MYSQL
  888. AC_SUBST(USE_MYSQL)
  889. AC_SUBST(MYSQLINCPATH)
  890. AC_SUBST(MYSQLLIBPATH)
  891. AC_SUBST(MYSQLLIB)
  892. AC_SUBST(MYSQLDLIB)
  893. # Done checking MySQL
  894. # Enable SQLite option
  895. LOC_CHECK_USE(sqlite,SQLite,USE_SQLITE)
  896. SQLITEINCPATH=
  897. SQLITELIBPATH=
  898. SQLITELIB=
  899. if test -n "$USE_SQLITE"; then
  900. # With SQLite includes directory
  901. LOC_CHECK_INC_PATH(sqlite,SQLite,SQLITEINCPATH)
  902. LOC_CHECK_INCLUDES(sqlite3.h,SQLite,$SQLITEINCPATH)
  903. AC_DEFINE(HAVE_SQLITE)
  904. fi # $USE_SQLITE
  905. if test -n "$USE_SQLITE"; then
  906. # With SQLite library directory
  907. LOC_CHECK_LIB_PATH(sqlite,SQLite,SQLITELIBPATH)
  908. LOC_CHECK_LIBS(sqlite3,sqlite3_open,SQLite,$SQLITELIBPATH,SQLITELIB,,,,$MATHLIB,$DLLIB)
  909. fi # $USE_SQLITE
  910. AC_SUBST(USE_SQLITE)
  911. AC_SUBST(SQLITEINCPATH)
  912. AC_SUBST(SQLITELIBPATH)
  913. AC_SUBST(SQLITELIB)
  914. # Done checking SQLite
  915. # Enable OpenGL option
  916. OPENGLINC=
  917. OPENGLLIB=
  918. OPENGLULIB=
  919. USE_OPENGL=
  920. OPENGL_X11=
  921. OPENGL_AQUA=
  922. OPENGL_WINDOWS=
  923. AC_MSG_CHECKING(whether to use OpenGL)
  924. AC_MSG_RESULT("$with_opengl")
  925. case "$with_opengl" in
  926. n|no)
  927. OPENGL_TYPE=none
  928. ;;
  929. y|yes|x|x11|glx)
  930. OPENGL_TYPE=X11
  931. USE_OPENGL=1
  932. OPENGL_X11=1
  933. ;;
  934. aqua|mac|osx|macosx|agl)
  935. OPENGL_TYPE=Aqua
  936. USE_OPENGL=1
  937. OPENGL_AQUA=1
  938. ;;
  939. win|windows|mswin|wgl)
  940. OPENGL_TYPE=Windows
  941. USE_OPENGL=1
  942. OPENGL_WINDOWS=1
  943. ;;
  944. *)
  945. AC_MSG_ERROR([*** Valid arguments for --with-opengl= are yes,no,x11,aqua,windows.])
  946. ;;
  947. esac
  948. if test -n "$USE_OPENGL" ; then
  949. if test "$OPENGL_X11" = 1 ; then
  950. # With OpenGL includes directory
  951. LOC_CHECK_INC_PATH(opengl,OpenGL,OPENGLINC)
  952. LOC_CHECK_INCLUDES(GL/gl.h GL/glu.h,OpenGL,$OPENGLINC $X_CFLAGS)
  953. # With OpenGL library directory
  954. LOC_CHECK_LIB_PATH(opengl,OpenGL,OPENGL_LIB_PATH)
  955. LOC_CHECK_LIBS(GL,glBegin,OpenGL,$OPENGL_LIB_PATH,OPENGLLIB,$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB,,,-lpthread,-lXext)
  956. LOC_CHECK_LIBS(GLU,gluBeginCurve,GLU,$OPENGL_LIB_PATH,OPENGLULIB,$OPENGLLIB $X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $MATHLIB,,,-lstdc++)
  957. OPENGLLIB="$OPENGL_LIB_PATH $OPENGLLIB"
  958. OPENGLULIB="$OPENGL_LIB_PATH $OPENGLULIB"
  959. LOC_CHECK_FUNC(glXCreatePbuffer,,,,,$OPENGLLIB,[AC_DEFINE(HAVE_PBUFFERS)])
  960. LOC_CHECK_FUNC(glXCreateGLXPixmap,,,,,$OPENGLLIB,[AC_DEFINE(HAVE_PIXMAPS)])
  961. AC_DEFINE(OPENGL_X11)
  962. fi # $OPENGL_X11
  963. if test "$OPENGL_AQUA" = 1 ; then
  964. LOC_CHECK_FRAMEWORK_PATH(opengl,OpenGL,OPENGLPATH)
  965. LOC_CHECK_INCLUDES(OpenGL/gl.h OpenGL/glu.h,OpenGL,$OPENGLPATH)
  966. LOC_CHECK_FUNC(glBegin,OpenGL library,OPENGLLIB,-framework OpenGL -framework AGL -framework ApplicationServices,$OPENGLPATH)
  967. LOC_CHECK_FUNC(gluBeginCurve,GLU library,OPENGLLIB,,$OPENGLPATH,$OPENGLLIB)
  968. OPENGLINC="$OPENGLPATH"
  969. OPENGLLIBPATH="$OPENGLPATH"
  970. AC_DEFINE(OPENGL_AQUA)
  971. fi # $OPENGL_AQUA
  972. if test "$OPENGL_WINDOWS" = 1 ; then
  973. # With OpenGL includes directory
  974. LOC_CHECK_INC_PATH(opengl,OpenGL,OPENGLINC)
  975. LOC_CHECK_INCLUDES(GL/gl.h GL/glu.h,OpenGL,$OPENGLINC)
  976. # With OpenGL library directory
  977. LOC_CHECK_LIB_PATH(opengl,OpenGL,OPENGL_LIB_PATH)
  978. ac_save_cflags="$CFLAGS"
  979. CFLAGS="$CFLAGS $OPENGLINC"
  980. LOC_CHECK_LINK(opengl32,[#include <GL/gl.h>],[glEnd();],OpenGL,$OPENGL_LIB_PATH,OPENGLLIB)
  981. LOC_CHECK_LINK(glu32,[#include <GL/glu.h>],[gluNewQuadric();],GLU,$OPENGL_LIB_PATH,OPENGLULIB,$OPENGLLIB)
  982. CFLAGS="${ac_save_cflags}"
  983. OPENGLLIB="$OPENGL_LIB_PATH $OPENGLLIB"
  984. OPENGLULIB="$OPENGL_LIB_PATH $OPENGLULIB"
  985. AC_DEFINE(OPENGL_WINDOWS)
  986. fi # $OPENGL_WINDOWS
  987. fi # $USE_OPENGL
  988. AC_SUBST(USE_OPENGL)
  989. AC_SUBST(OPENGL_X11)
  990. AC_SUBST(OPENGL_AQUA)
  991. AC_SUBST(OPENGL_WINDOWS)
  992. AC_SUBST(OPENGLINC)
  993. AC_SUBST(OPENGLLIB)
  994. AC_SUBST(OPENGLULIB)
  995. # Done checking OpenGL
  996. # Enable ODBC option
  997. LOC_CHECK_USE(odbc,ODBC,USE_ODBC)
  998. ODBCINC=
  999. ODBCLIB=
  1000. if test -n "$USE_ODBC"; then
  1001. # With ODBC includes directory
  1002. LOC_CHECK_INC_PATH(odbc,ODBC,ODBCINC)
  1003. LOC_CHECK_INCLUDES(sql.h,ODBC,$ODBCINC)
  1004. # With ODBC library directory
  1005. LOC_CHECK_LIB_PATH(odbc,ODBC,ODBCLIB)
  1006. LOC_CHECK_LIBS(odbc,SQLConnect,ODBC,$ODBCLIB,ODBCLIB,$ICONVLIB,,[
  1007. LOC_CHECK_LIBS(iodbc,SQLConnect,ODBC,$ODBCLIB,ODBCLIB,,,[
  1008. ac_save_cflags="$CFLAGS"
  1009. CFLAGS="$CFLAGS $ODBCINC"
  1010. LOC_CHECK_LINK(odbc32,[#include <windows.h>
  1011. #include <sql.h>],[SQLAllocEnv((SQLHENV *)0);],ODBC,$ODBCLIB,ODBCLIB)
  1012. CFLAGS="${ac_save_cflags}"
  1013. ])
  1014. ])
  1015. fi # $USE_ODBC
  1016. AC_SUBST(ODBCINC)
  1017. AC_SUBST(ODBCLIB)
  1018. # Done checking ODBC
  1019. # Enable FFTW option
  1020. LOC_CHECK_USE(fftw,FFTW,USE_FFTW)
  1021. FFTWINC=
  1022. FFTWLIB=
  1023. if test -n "$USE_FFTW"; then
  1024. # With FFTW includes directory
  1025. LOC_CHECK_INC_PATH(fftw,FFTW,FFTWINC)
  1026. LOC_CHECK_INCLUDES(fftw3.h,FFTW,$FFTWINC,[
  1027. LOC_CHECK_INCLUDES(fftw.h,FFTW,,[
  1028. LOC_CHECK_INCLUDES(dfftw.h,FFTW,,)
  1029. ])
  1030. ])
  1031. # With FFTW library directory
  1032. LOC_CHECK_LIB_PATH(fftw,FFTW,FFTWLIB)
  1033. LOC_CHECK_LIBS(fftw3, fftw_execute,FFTW,$FFTWLIB,FFTWLIB,,$MATHLIB,[
  1034. LOC_CHECK_LIBS(fftw, fftwnd_one,FFTW,$FFTWLIB,FFTWLIB,,$MATHLIB,[
  1035. LOC_CHECK_LIBS(dfftw,fftwnd_one,FFTW,$FFTWLIB,FFTWLIB,,$MATHLIB,)
  1036. ])
  1037. ])
  1038. fi # $USE_FFTW
  1039. AC_SUBST(FFTWINC)
  1040. AC_SUBST(FFTWLIB)
  1041. # Done checking FFTW
  1042. # Enable BLAS option
  1043. LOC_CHECK_USE(blas,BLAS,USE_BLAS)
  1044. BLASLIB=
  1045. BLASINC=
  1046. if test -n "$USE_BLAS"; then
  1047. # With BLAS includes directory
  1048. # BLAS doesn't have includes (FORTRAN library)
  1049. # With BLAS library directory
  1050. LOC_CHECK_INC_PATH(blas, BLAS, BLASINC)
  1051. LOC_CHECK_LIB_PATH(blas, BLAS, BLASLIB)
  1052. # See if cblas.h exists (CBLAS,ATLAS,others)
  1053. save_CPPFLAGS="$CPPFLAGS"
  1054. CPPFLAGS="$BLASINC $CPPFLAGS"
  1055. AC_CHECK_HEADERS(cblas.h)
  1056. CPPFLAGS="$save_CPPFLAGS"
  1057. LOC_CHECK_LIBS(blas,dnrm2_,BLAS,$BLASLIB,BLASLIB,$MATHLIB,,,-lg2c)
  1058. blas_ok=no
  1059. # Check for ATLAS
  1060. save_LDFLAGS="$LDFLAGS"
  1061. LDFLAGS="$BLASLIB $LDFLAGS"
  1062. AC_CHECK_LIB(atlas, ATL_xerbla,
  1063. [AC_CHECK_LIB(f77blas, sgemm_,
  1064. [AC_CHECK_LIB(cblas, cblas_dgemm,
  1065. [blas_ok=yes; BLASLIB="-lcblas -lf77blas -latlas"],
  1066. [],[-lf77blas -latlas])],
  1067. [],[-latlas])]
  1068. )
  1069. LDFLAGS="$save_LDFLAGS"
  1070. # Do we have ATLAS?
  1071. if test $blas_ok = yes; then
  1072. AC_DEFINE(HAVE_LIBATLAS)
  1073. fi
  1074. # BLAS in Apple vecLib framework? (Mac OS-X)
  1075. # not dependent on APP build
  1076. #if test -n "$MACOSX_APP"; then
  1077. if test $blas_ok = no; then
  1078. vlib_flags="-framework vecLib"
  1079. save_LIBS="$LIBS"
  1080. LIBS="$vlib_flags $LIBS"
  1081. AC_MSG_CHECKING([for sgemm in $vlib_flags])
  1082. AC_TRY_LINK([], [sgemm], [blas_ok=yes; BLASLIB="$vlib_flags"], [BLASLIB=""])
  1083. AC_MSG_RESULT($blas_ok)
  1084. LIBS="$save_LIBS"
  1085. fi
  1086. #fi # $MACOSX_APP
  1087. # BLAS in PhiPACK libraries? (requires generic BLAS, too)
  1088. if test $blas_ok = no; then
  1089. AC_CHECK_LIB(blas, sgemm_,
  1090. [AC_CHECK_LIB(dgemm, dgemm_,
  1091. [AC_CHECK_LIB(sgemm, sgemm_,
  1092. [blas_ok=yes; BLASLIB="-lsgemm -ldgemm -lblas"],
  1093. [], [-lblas])],
  1094. [], [-lblas])]
  1095. )
  1096. fi
  1097. # BLAS in Sun Performance library?
  1098. if test $blas_ok = no; then
  1099. if test "x$GCC" != xyes; then # only works with Sun CC
  1100. AC_CHECK_LIB(sunmath, acosp,
  1101. [AC_CHECK_LIB(sunperf, sgemm_,
  1102. [blas_ok=yes; BLASLIB="-xlic_lib=sunperf -lsunmath"],
  1103. [], [-lsunmath])]
  1104. )
  1105. fi
  1106. fi
  1107. # Generic BLAS library
  1108. if test $blas_ok = no; then
  1109. AC_CHECK_LIB(blas, sgemm_, [blas_ok=yes; BLASLIB="-lblas"])
  1110. fi
  1111. if test $blas_ok = yes; then
  1112. AC_DEFINE(HAVE_LIBBLAS)
  1113. fi
  1114. fi # $USE_BLAS
  1115. AC_SUBST(BLASLIB)
  1116. AC_SUBST(BLASINC)
  1117. # Done checking BLAS
  1118. # Enable LAPACK option
  1119. LOC_CHECK_USE(lapack,LAPACK,USE_LAPACK)
  1120. LAPACKLIB=
  1121. LAPACKINC=
  1122. # LAPACK is useless without BLAS
  1123. if test -n "$USE_BLAS"; then
  1124. if test -n "$USE_LAPACK"; then
  1125. # With LAPACK includes directory
  1126. # LAPACK doesn't have includes (FORTRAN library)
  1127. # With LAPACK library directory
  1128. lapack_ok=no
  1129. LOC_CHECK_INC_PATH(lapack, LAPACK, LAPACKINC)
  1130. LOC_CHECK_LIB_PATH(lapack, LAPACK, LAPACKLIB)
  1131. # See if clapack.h exists (ATLAS)
  1132. save_CPPFLAGS="$CPPFLAGS"
  1133. CPPFLAGS="$LAPACKINC $CPPFLAGS"
  1134. AC_CHECK_HEADERS(clapack.h)
  1135. CPPFLAGS="$save_CPPFLAGS"
  1136. # LAPACK linked to by default?
  1137. if test lapack_ok=no; then
  1138. save_LIBS="$LIBS"; LIBS="$LIBS $BLASLIB $MATHLIB $FLIBS"
  1139. save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS"
  1140. AC_CHECK_FUNC(dsegv_, [lapack_ok=yes])
  1141. LIBS="$save_LIBS"
  1142. LDFLAGS="$save_LDFLAGS"
  1143. fi
  1144. # Generic LAPACK library?
  1145. if test $lapack_ok = no; then
  1146. save_libs="$LIBS"; LIBS="$BLASLIB $MATHLIB $LIBS"
  1147. save_LDFLAGS="$LDFLAGS"; LDFLAGS="$LAPACKLIB $LDFLAGS"
  1148. AC_CHECK_LIB(lapack, desgv_,
  1149. [lapack_ok=yes; LAPACKLIB="-llapack"], [], [$FLIBS])
  1150. LIBS="$save_LIBS"
  1151. LDFLAGS="$save_LDFLAGS"
  1152. fi
  1153. if test $lapack_ok = no; then
  1154. LOC_CHECK_LIBS(lapack,dgesv_,LAPACK,$LAPACKLIB,LAPACKLIB,$BLASLIB $MATHLIB,,,-lg2c)
  1155. fi
  1156. AC_DEFINE(HAVE_LIBLAPACK)
  1157. fi # $USE_LAPACK
  1158. fi # $USE_BLAS
  1159. AC_SUBST(LAPACKLIB)
  1160. AC_SUBST(LAPACKINC)
  1161. # Done checking LAPACK
  1162. # Enable Cairo display driver option
  1163. LOC_CHECK_USE(cairo,Cairo,USE_CAIRO)
  1164. CAIROINC=
  1165. CAIROLIB=
  1166. if test -n "$USE_CAIRO"; then
  1167. cairo="cairo"
  1168. pkgs="cairo-ft cairo-fc cairo-pdf cairo-ps cairo-svg fontconfig"
  1169. if test -n "$USE_X11"; then
  1170. pkgs="$pkgs cairo-xlib cairo-xlib-xrender"
  1171. fi
  1172. for pkg in $pkgs ; do
  1173. if pkg-config --exists $pkg ; then
  1174. cairo="$cairo $pkg"
  1175. fi
  1176. done
  1177. # With Cairo includes directory
  1178. #FIXME: somehow quote dirs with spaces in $cairo ?
  1179. CAIROINC=`pkg-config --cflags $cairo`
  1180. LOC_CHECK_INC_PATH(cairo,cairo,CAIROINC)
  1181. LOC_CHECK_INCLUDES(cairo.h,Cairo,$CAIROINC)
  1182. # With Cairo library directory
  1183. CAIROLIB=`pkg-config --libs $cairo`
  1184. LOC_CHECK_LIB_PATH(cairo,cairo,CAIROLIB)
  1185. LOC_CHECK_LDFLAGS(cairo,cairo,CAIROLIB)
  1186. LOC_CHECK_FUNC(cairo_create,,,,,$CAIROLIB,[:])
  1187. LOC_CHECK_FUNC(cairo_xlib_surface_create_with_xrender_format,,,,,$CAIROLIB,
  1188. [CAIRO_HAS_XRENDER=1],[CAIRO_HAS_XRENDER=])
  1189. AC_SUBST(CAIRO_HAS_XRENDER)
  1190. LOC_CHECK_FUNC(cairo_xlib_surface_get_xrender_format,,,,,$CAIROLIB,
  1191. [CAIRO_HAS_XRENDER_SURFACE=1],[CAIRO_HAS_XRENDER_SURFACE=])
  1192. AC_SUBST(CAIRO_HAS_XRENDER_SURFACE)
  1193. CAIROLIB="$CAIROLIB $CAIROLDFLAGS"
  1194. fi # $USE_CAIRO
  1195. AC_SUBST(CAIROINC)
  1196. AC_SUBST(CAIROLIB)
  1197. AC_SUBST(USE_CAIRO)
  1198. # Done checking Cairo
  1199. # Enable FreeType option
  1200. LOC_CHECK_USE(freetype,FreeType,USE_FREETYPE)
  1201. FTINC=
  1202. FTLIB=
  1203. if test -n "$USE_FREETYPE"; then
  1204. # With FreeType includes directory
  1205. LOC_CHECK_INC_PATH(freetype,FreeType,FTINC)
  1206. LOC_CHECK_INCLUDES(ft2build.h,FreeType,$FTINC)
  1207. # With FreeType library directory
  1208. LOC_CHECK_LIB_PATH(freetype,FreeType,FTLIB)
  1209. LOC_CHECK_LIBS(freetype,FT_Init_FreeType,FreeType,$FTLIB,FTLIB,,,)
  1210. fi # $USE_FREETYPE
  1211. AC_SUBST(FTINC)
  1212. AC_SUBST(FTLIB)
  1213. # Done checking FreeType
  1214. # Enable NLS option
  1215. LOC_CHECK_USE(nls,NLS,USE_NLS)
  1216. INTLLIB=
  1217. HAVE_NLS=
  1218. if test -n "${USE_NLS}" ; then
  1219. AC_DEFINE(USE_NLS)
  1220. AC_CHECK_FUNC(gettext, INTLLIB=, [
  1221. AC_CHECK_LIB(intl, gettext, INTLLIB=-lintl, [
  1222. AC_MSG_ERROR([*** Unable to locate gettext() function.])
  1223. ])])
  1224. HAVE_NLS=1
  1225. fi
  1226. AC_SUBST(INTLLIB)
  1227. AC_SUBST(HAVE_NLS)
  1228. # Enable C++ option
  1229. LOC_CHECK_USE(cxx,C++,USE_CXX)
  1230. if test -n "$USE_CXX"; then
  1231. AC_PROG_CXX
  1232. else
  1233. CXX=
  1234. CXXFLAGS=
  1235. AC_SUBST(CXX)
  1236. AC_SUBST(CXXFLAGS)
  1237. fi
  1238. # Done checking C++
  1239. # Enable openDWG option
  1240. LOC_CHECK_USE(opendwg,openDWG,USE_OPENDWG)
  1241. OPENDWGINCPATH=
  1242. OPENDWGLIBPATH=
  1243. OPENDWGLIB=
  1244. if test -n "${USE_OPENDWG}"; then
  1245. # With OPENDWG includes directory
  1246. LOC_CHECK_INC_PATH(opendwg,openDGW,OPENDWGINCPATH)
  1247. LOC_CHECK_INCLUDES(ad2.h,openDWG,$OPENDWGINCPATH)
  1248. # With OPENDWG library directory
  1249. LOC_CHECK_LIB_PATH(opendwg,openDWG,OPENDWGLIBPATH)
  1250. #search for ad2.a, ad3.a ... in openDWG toolkit directory:
  1251. #FIX ME how to program this test??
  1252. #LOC_CHECK_LIBS(ad?.a,adSeekLayer,openDWG,$OPENDWGLIBPATH,OPENDWGLIB,,)
  1253. #
  1254. #for now hack (but working):
  1255. TRUEOPENDWGLIBPATH=`echo "$OPENDWGLIBPATH" | cut -b3-`
  1256. adlib=`ls -1 "$TRUEOPENDWGLIBPATH"/ad?.a | tail -1`
  1257. OPENDWGLIB="$adlib"
  1258. fi # $USE_OPENDWG
  1259. AC_SUBST(OPENDWGINCPATH)
  1260. AC_SUBST(OPENDWGLIBPATH)
  1261. AC_SUBST(OPENDWGLIB)
  1262. AC_SUBST(USE_OPENDWG)
  1263. # Done checking OPENDWG
  1264. # Enable pthread option
  1265. LOC_CHECK_USE(pthread,POSIX threads,USE_PTHREAD)
  1266. PTHREADINCPATH=
  1267. PTHREADLIBPATH=
  1268. PTHREADLIB=
  1269. if test -n "$USE_PTHREAD"; then
  1270. # With pthread includes directory
  1271. LOC_CHECK_INC_PATH(pthread,POSIX threads,PTHREADINCPATH)
  1272. LOC_CHECK_INCLUDES(pthread.h,POSIX threads,$PTHREADINCPATH)
  1273. # With pthread library directory
  1274. LOC_CHECK_LIB_PATH(pthread,POSIX threads,PTHREADLIBPATH)
  1275. LOC_CHECK_FUNC(pthread_create,POSIX threads functions,PTHREADLIB,,,,,[
  1276. LOC_CHECK_LIBS(pthread,pthread_create,POSIX threads,$PTHREADLIBPATH,PTHREADLIB,,,)
  1277. ])
  1278. fi # $USE_PTHREAD
  1279. AC_SUBST(PTHREADINCPATH)
  1280. AC_SUBST(PTHREADLIBPATH)
  1281. AC_SUBST(PTHREADLIB)
  1282. AC_SUBST(USE_PTHREAD)
  1283. # Done checking pthread
  1284. # Enable OpenMP option
  1285. LOC_CHECK_USE(openmp,OpenMP,USE_OPENMP)
  1286. OMPINCPATH=
  1287. OMPLIBPATH=
  1288. OMPLIB=
  1289. OMPCFLAGS=
  1290. if test -n "$USE_OPENMP"; then
  1291. # With OpenMP includes directory
  1292. LOC_CHECK_INC_PATH(openmp,OpenMP,OMPINCPATH)
  1293. LOC_CHECK_INCLUDES(omp.h,OpenMP,$OMPINCPATH)
  1294. # With OpenMP library directory
  1295. # GCC et al.: -lgomp
  1296. # Solaris cc: -lmtsk
  1297. # AIX xlc: -lxlsmp
  1298. # SGI IRIX 6.5 MIPSpro C/C++: -lmp
  1299. LOC_CHECK_LIB_PATH(openmp,OpenMP,OMPLIBPATH)
  1300. LOC_CHECK_FUNC(GOMP_parallel_start,OpenMP functions,OMPLIB,,,,,[
  1301. LOC_CHECK_LIBS(gomp,GOMP_parallel_start,OpenMP,$OMPLIBPATH,OMPLIB,,,)
  1302. ])
  1303. # compiler dependent
  1304. #if test ${CC} = "gcc" ; then
  1305. if test x$GCC = xyes ; then
  1306. # GNU C compiler (>= 4.2.1)
  1307. OMPCFLAGS=-fopenmp
  1308. elif test ${CC} = "icc" ; then
  1309. # Intel compiler
  1310. OMPCFLAGS=-openmp
  1311. elif test ${CC} = "opencc" ; then
  1312. # AMD's x86 Open64 compiler
  1313. OMPCFLAGS=-mp
  1314. elif test ${CC} = "pgcc" ; then
  1315. # Portland Group's compiler
  1316. OMPCFLAGS=-mp
  1317. # ... anybody else?
  1318. fi
  1319. # try to build a test program with "$CC $OMPCLFAGS" to confirm it works
  1320. #...how?
  1321. #echo "int main() {return 0;}" > test.c
  1322. #$CC $OMPCLFAGS test.c -o test
  1323. fi # $USE_OPENMP
  1324. AC_SUBST(OMPINCPATH)
  1325. AC_SUBST(OMPLIBPATH)
  1326. AC_SUBST(OMPLIB)
  1327. AC_SUBST(OMPCFLAGS)
  1328. AC_SUBST(USE_OPENMP)
  1329. # Done checking OpenMP
  1330. # Enable OpenCL option
  1331. LOC_CHECK_USE(opencl,OpenCL,USE_OPENCL)
  1332. OCLINCPATH=
  1333. OCLLIBPATH=
  1334. OCLLIB=
  1335. if test -n "$USE_OPENCL"; then
  1336. # With OpenCL includes directory
  1337. LOC_CHECK_INC_PATH(opencl,OpenCL,OCLINCPATH)
  1338. if test -n "$MACOSX_APP" ; then
  1339. LOC_CHECK_INCLUDES(OpenCL/opencl.h,OpenCL,$OCLINCPATH)
  1340. # With OpenCL library directory
  1341. ### FIXME: ###
  1342. #LOC_CHECK_FRAMEWORK_PATH(opencl,OpenCL,OPENCLPATH)
  1343. # last term in following would become ',$OPENCLPATH)' if above is uncommented
  1344. LOC_CHECK_FUNC(clGetPlatformInfo,OpenCL library,OCLLIB,-framework OpenCL,)
  1345. else
  1346. LOC_CHECK_INCLUDES(CL/cl.h,OpenCL,$OCLINCPATH)
  1347. # With OpenCL library directory
  1348. LOC_CHECK_LIB_PATH(opencl,OpenCL,OCLLIBPATH)
  1349. LOC_CHECK_LIBS(OpenCL,clGetPlatformInfo,OpenCL,$OCLLIBPATH,OCLLIB,,,)
  1350. # expanded symbol check: yes? no?
  1351. #LOC_CHECK_FUNC(clGetPlatformInfo,OpenCL functions,OCLLIB,,,,,[
  1352. #LOC_CHECK_LIBS(OpenCL,clGetPlatformInfo,OpenCL,$OCLLIBPATH,OCLLIB,,,)
  1353. #])
  1354. fi
  1355. fi # $USE_OPENCL
  1356. AC_SUBST(OCLINCPATH)
  1357. AC_SUBST(OCLLIBPATH)
  1358. AC_SUBST(OCLLIB)
  1359. AC_SUBST(USE_OPENCL)
  1360. # Done checking OpenCL
  1361. # Enable LFS (from cdr-tools, tar, and autoconf 2.68)
  1362. dnl Check for large file support
  1363. dnl Do this last to make sure that no large file definition
  1364. dnl in confdefs.h will modify our results
  1365. AC_SYS_LARGEFILE
  1366. ac_save_cflags=${CFLAGS}
  1367. CFLAGS="$LFS_CFLAGS ${ac_save_cflags}"
  1368. dnl Warning do not run this test. it interferes with the test
  1369. dnl AC_CHECK_FUNCS(fseeko ftello) from above.
  1370. dnl The test AC_HAVE_LARGEFILES will check whether ftello/fseeko
  1371. dnl are available in Large File mode
  1372. AC_FUNC_FSEEKO
  1373. AC_HAVE_LARGEFILES
  1374. CFLAGS=${ac_save_cflags}
  1375. # Done large file support
  1376. USE_TERMIO=
  1377. AC_SUBST(USE_TERMIO)
  1378. STRIPFLAG=
  1379. AC_SUBST(STRIPFLAG)
  1380. GRASS_HOME="${DSTDIR}"
  1381. AC_SUBST(GRASS_HOME)
  1382. AC_OUTPUT(include/Make/Platform.make include/Make/Doxyfile_arch_html include/Make/Doxyfile_arch_latex include/version.h grass.pc)
  1383. LOC_MSG([Copying config.status to config.status.${ARCH}])
  1384. cp -f config.status config.status.${ARCH}
  1385. # Display configuration status
  1386. LOC_MSG()
  1387. LOC_MSG([GRASS is now configured for: ${host}])
  1388. LOC_MSG()
  1389. LOC_MSG([ Source directory: ${SRCDIR}])
  1390. LOC_MSG([ Build directory: ${DSTDIR}])
  1391. LOC_MSG([ Installation directory: ${INSTDIR}])
  1392. LOC_MSG([ Startup script in directory:${bindir}])
  1393. LOC_MSG([ C compiler: ${CC} ${CFLAGS}])
  1394. LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}])
  1395. LOC_MSG([ Building shared libraries: ${shared_ok}])
  1396. LOC_MSG([ OpenGL platform: ${OPENGL_TYPE}])
  1397. LOC_MSG()
  1398. LOC_MSG_USE(MacOSX application,MACOSX_APP)
  1399. LOC_MSG([ MacOSX architectures: ${MACOSX_ARCHS}])
  1400. LOC_MSG([ MacOSX SDK: ${MACOSX_SDK}])
  1401. LOC_MSG()
  1402. LOC_MSG_USE(BLAS support,USE_BLAS)
  1403. LOC_MSG_USE(BZIP2 support,USE_BZIP2)
  1404. LOC_MSG_USE(C++ support,USE_CXX)
  1405. LOC_MSG_USE(Cairo support,USE_CAIRO)
  1406. LOC_MSG_USE(DWG support,USE_OPENDWG)
  1407. LOC_MSG_USE(FFTW support,USE_FFTW)
  1408. LOC_MSG_USE(FreeType support,USE_FREETYPE)
  1409. LOC_MSG_USE(GDAL support,USE_GDAL)
  1410. LOC_MSG_USE(GEOS support,USE_GEOS)
  1411. LOC_MSG_USE(LAPACK support,USE_LAPACK)
  1412. LOC_MSG_USE(Large File support (LFS), USE_LARGEFILES)
  1413. LOC_MSG_USE(libLAS support,USE_LIBLAS)
  1414. LOC_MSG_USE(MySQL support,USE_MYSQL)
  1415. LOC_MSG_USE(NetCDF support,USE_NETCDF)
  1416. LOC_MSG_USE(NLS support,USE_NLS)
  1417. LOC_MSG_USE(ODBC support,USE_ODBC)
  1418. LOC_MSG_USE(OGR support,USE_OGR)
  1419. LOC_MSG_USE(OpenCL support,USE_OPENCL)
  1420. LOC_MSG_USE(OpenGL support,USE_OPENGL)
  1421. LOC_MSG_USE(OpenMP support,USE_OPENMP)
  1422. LOC_MSG_USE(PDAL support,USE_PDAL)
  1423. LOC_MSG_USE(PNG support,USE_PNG)
  1424. LOC_MSG_USE(POSIX thread support,USE_PTHREAD)
  1425. LOC_MSG_USE(PostgreSQL support,USE_POSTGRES)
  1426. LOC_MSG_USE(Readline support,USE_READLINE)
  1427. LOC_MSG_USE(Regex support,USE_REGEX)
  1428. LOC_MSG_USE(SQLite support,USE_SQLITE)
  1429. LOC_MSG_USE(TIFF support,USE_TIFF)
  1430. LOC_MSG_USE(X11 support,USE_X11)
  1431. LOC_MSG()