configure.ac 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. AC_PREREQ(2.59)
  2. AC_REVISION($Id$)
  3. #
  4. # configure.ac
  5. #
  6. # The iODBC driver manager.
  7. #
  8. # Copyright (C) 1995 Ke Jin <[email protected]>
  9. # Copyright (C) 1996-2021 OpenLink Software <[email protected]>
  10. # All Rights Reserved.
  11. #
  12. # This software is released under the terms of either of the following
  13. # licenses:
  14. #
  15. # - GNU Library General Public License (see LICENSE.LGPL)
  16. # - The BSD License (see LICENSE.BSD).
  17. #
  18. # Note that the only valid version of the LGPL license as far as this
  19. # project is concerned is the original GNU Library General Public License
  20. # Version 2, dated June 1991.
  21. #
  22. # While not mandated by the BSD license, any patches you make to the
  23. # iODBC source code may be contributed back into the iODBC project
  24. # at your discretion. Contributions will benefit the Open Source and
  25. # Data Access community as a whole. Submissions may be made at:
  26. #
  27. # http://www.iodbc.org
  28. #
  29. #
  30. # GNU Library Generic Public License Version 2
  31. # ============================================
  32. # This library is free software; you can redistribute it and/or
  33. # modify it under the terms of the GNU Library General Public
  34. # License as published by the Free Software Foundation; only
  35. # Version 2 of the License dated June 1991.
  36. #
  37. # This library is distributed in the hope that it will be useful,
  38. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  39. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  40. # Library General Public License for more details.
  41. #
  42. # You should have received a copy of the GNU Library General Public
  43. # License along with this library; if not, write to the Free
  44. # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  45. #
  46. #
  47. # The BSD License
  48. # ===============
  49. # Redistribution and use in source and binary forms, with or without
  50. # modification, are permitted provided that the following conditions
  51. # are met:
  52. #
  53. # 1. Redistributions of source code must retain the above copyright
  54. # notice, this list of conditions and the following disclaimer.
  55. # 2. Redistributions in binary form must reproduce the above copyright
  56. # notice, this list of conditions and the following disclaimer in
  57. # the documentation and/or other materials provided with the
  58. # distribution.
  59. # 3. Neither the name of OpenLink Software Inc. nor the names of its
  60. # contributors may be used to endorse or promote products derived
  61. # from this software without specific prior written permission.
  62. #
  63. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  64. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  65. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  66. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OPENLINK OR
  67. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  68. # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  69. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  70. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  71. # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  72. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  73. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  74. #
  75. ##########################################################################
  76. ## ##
  77. ## Version info ##
  78. ## ##
  79. ##########################################################################
  80. m4_define(V_iodbc_major, [3]) # ODBC Major version
  81. m4_define(V_iodbc_minor, [52]) # ODBC Minor version
  82. m4_define(V_iodbc_patch, [16]) # Increase every release
  83. m4_define(V_iodbc_devel, [-dev]) # -dev, -rc1 or empty for stable
  84. m4_define(V_iodbc_date, [210705]) # YYMMDD of release
  85. m4_define(V_iodbc_shlib, [30]) # Increase every change
  86. ##########################################################################
  87. ## ##
  88. ## Initialization ##
  89. ## ##
  90. ##########################################################################
  91. AC_INIT([iODBC Driver Manager],
  92. V_iodbc_major.V_iodbc_minor.V_iodbc_patch[]V_iodbc_devel,
  93. [[email protected]],
  94. [libiodbc])
  95. AC_CONFIG_SRCDIR([include/isql.h])
  96. AC_CONFIG_AUX_DIR(admin)
  97. AC_CONFIG_MACRO_DIR(admin)
  98. AC_CONFIG_HEADERS(include/config.h)
  99. AM_INIT_AUTOMAKE
  100. AC_CANONICAL_HOST
  101. AM_MAINTAINER_MODE
  102. ##########################################################################
  103. ## ##
  104. ## Version information ##
  105. ## ##
  106. #########################################################################
  107. #
  108. # Version information for SQLGetInfo(SQL_DM_VER) call
  109. #
  110. BUILD_MAJOR="V_iodbc_patch" # last digit of version number
  111. BUILD_MINOR="V_iodbc_date" # year/month/day of release
  112. BUILD_VER="${BUILD_MAJOR}${BUILD_MINOR}"
  113. #
  114. # Library version numbers
  115. #
  116. lib3_version=3:V_iodbc_shlib:1 # ODBC 3.x mode
  117. lib2_version=2:55:0 # ODBC 2.x mode (do not change)
  118. ##########################################################################
  119. ## ##
  120. ## Check whether config.cache belongs to this machine ##
  121. ## ##
  122. ##########################################################################
  123. AC_MSG_CHECKING(cached information)
  124. hostcheck="$host"
  125. AC_CACHE_VAL(ac_cv_hostcheck, [ ac_cv_hostcheck="$hostcheck" ])
  126. if test "$ac_cv_hostcheck" != "$hostcheck"; then
  127. AC_MSG_RESULT(changed)
  128. AC_MSG_WARN([Running on a different architecture.])
  129. AC_MSG_WARN([Can't use cached values.])
  130. AC_MSG_ERROR([Please remove the invalid config.cache file, then try again.])
  131. else
  132. AC_MSG_RESULT(ok)
  133. fi
  134. ##########################################################################
  135. ## ##
  136. ## Save configuration for later reuse ##
  137. ## ##
  138. ##########################################################################
  139. OPL_CONFIG_NICE([config.nice])
  140. ##########################################################################
  141. ## ##
  142. ## Set Layout for iODBC ##
  143. ## ##
  144. ##########################################################################
  145. AC_PREFIX_DEFAULT(/usr/local)
  146. AC_MSG_CHECKING(for iODBC installation layout)
  147. AC_ARG_WITH(layout, [dnl
  148. AS_HELP_STRING([--with-layout=LAYOUT], [Choose installation layout])dnl
  149. ],
  150. [ case "${withval}" in
  151. yes|no) IODBC_LAYOUT=unset ;;
  152. *) IODBC_LAYOUT=${withval} ;;
  153. esac
  154. ], [IODBC_LAYOUT=unset])
  155. #
  156. # Defaults for Layout
  157. #
  158. install_libodbc=true
  159. case ${IODBC_LAYOUT} in
  160. unset) # No Layout set
  161. iodbc_layout="default"
  162. inidir=/etc
  163. ;;
  164. [[Gg]][[Nn]][[Uu]]) # GNU
  165. iodbc_layout="GNU"
  166. test "x$prefix" = xNONE && prefix=/usr/local
  167. inidir=${prefix}/etc/iodbc
  168. ;;
  169. [[Dd]][[Ee]][[Bb]][[Ii]][[Aa]][[Nn]]) # Debian
  170. iodbc_layout="Debian"
  171. test "x$prefix" = xNONE && prefix=/usr
  172. inidir=/etc
  173. install_libodbc=false
  174. ;;
  175. [[Gg]][[Ee]][[Nn]][[Tt]][[Oo]][[Oo]]) # Gentoo
  176. iodbc_layout="Gentoo"
  177. test "x$prefix" = xNONE && prefix=/usr
  178. includedir='${prefix}/include/iodbc'
  179. inidir=/etc/iodbc
  180. install_libodbc=false
  181. ;;
  182. [[Rr]][[Ee]][[Dd]][[Hh]][[Aa]][[Tt]]) # RedHat
  183. iodbc_layout=RedHat
  184. test "x$prefix" = xNONE && prefix=/usr
  185. inidir=/etc
  186. ;;
  187. [[Ff]][[Rr]][[Ee]][[Ee]][[Bb]][[Ss]][[Dd]]) # FreeBSD
  188. iodbc_layout=FreeBSD
  189. test "x$prefix" = xNONE && prefix=/usr
  190. inidir=/etc
  191. ;;
  192. [[Oo]][[Pp]][[Tt]]) # /opt
  193. iodbc_layout=opt
  194. test "x$prefix" = xNONE && prefix=/opt/iodbc
  195. inidir=/etc
  196. ;;
  197. [[Oo]][[Pp]][[Ee]][[Nn]][[Ll]][[Ii]][[Nn]][[Kk]]) # OpenLink
  198. iodbc_layout=openlink
  199. prefix=/usr/local/iODBC
  200. inidir=/etc
  201. ;;
  202. *) # UNKNOWN
  203. AC_MSG_RESULT(unknown)
  204. echo ""
  205. echo "Supported layouts: Debian FreeBSD GNU OpenLink opt RedHat"
  206. echo ""
  207. AC_MSG_ERROR([unable to continue])
  208. ;;
  209. esac
  210. AC_MSG_RESULT([${iodbc_layout}])
  211. ##########################################################################
  212. ## ##
  213. ## Check for C compiler ##
  214. ## ##
  215. ##########################################################################
  216. AC_PROG_CC
  217. AM_PROG_CC_C_O
  218. AC_PROG_CC_STDC
  219. AC_PROG_CPP
  220. AC_LANG([C])
  221. AC_C_CONST
  222. ##########################################################################
  223. ## ##
  224. ## Check for standard programs ##
  225. ## ##
  226. ##########################################################################
  227. AC_PROG_INSTALL
  228. AC_PROG_LN_S
  229. AC_PROG_MAKE_SET
  230. LT_INIT
  231. ##########################################################################
  232. ## ##
  233. ## Check for standard header files ##
  234. ## ##
  235. ##########################################################################
  236. AC_HEADER_STDC
  237. AC_HEADER_TIME
  238. AC_CHECK_HEADERS(wchar.h)
  239. ##########################################################################
  240. ## ##
  241. ## Check for specific library functions ##
  242. ## ##
  243. ##########################################################################
  244. AC_CHECK_FUNCS(strerror setenv asprintf snprintf gettimeofday localtime_r)
  245. dnl Unicode
  246. AC_CHECK_FUNCS(wcslen wcscpy wcsncpy wcschr wcscat wcscmp towlower wcsncasecmp)
  247. ##########################################################################
  248. ## ##
  249. ## Check if we want to build the GUI applications and libraries ##
  250. ## ##
  251. ##########################################################################
  252. AC_ARG_ENABLE(gui, [dnl
  253. AS_HELP_STRING([--enable-gui], [build GUI applications (default)])
  254. AS_HELP_STRING([--disable-gui], [build GUI applications])dnl
  255. ],
  256. [ case "${enableval}" in
  257. yes) USE_GUI=true ;;
  258. no) USE_GUI=false ;;
  259. *) AC_MSG_ERROR(bad value ${enableval} for --enable-gui) ;;
  260. esac
  261. ],[USE_GUI=true])
  262. ##########################################################################
  263. ## ##
  264. ## Check for GTK library functions ##
  265. ## ##
  266. ##########################################################################
  267. USE_GTK=false
  268. if test x$USE_GUI = xtrue
  269. then
  270. no_gtk=""
  271. # Check for GTK+ 2.x
  272. AM_PATH_GTK_2_0(2.0.0)
  273. if test x$no_gtk != x
  274. then
  275. # Try GTK 1.2.x instead
  276. no_gtk=""
  277. AM_PATH_GTK(1.2.3)
  278. fi
  279. if test x$no_gtk = x
  280. then
  281. USE_GTK=true
  282. fi
  283. fi
  284. ##########################################################################
  285. ## ##
  286. ## Now make the final checks whether we can use GUI extensions ##
  287. ## ##
  288. ##########################################################################
  289. if test x$USE_GTK = xfalse
  290. then
  291. USE_GUI=false
  292. fi
  293. if test x$USE_GUI = xtrue
  294. then
  295. AC_DEFINE(GUI, 1, [Define if we detected a GUI library we can use])
  296. fi
  297. AM_CONDITIONAL(GUI, [test x$USE_GUI = xtrue])
  298. AM_CONDITIONAL(GTK, [test x$USE_GTK = xtrue])
  299. ##########################################################################
  300. ## ##
  301. ## Check for dynamic load module ##
  302. ## ##
  303. ##########################################################################
  304. AC_CHECK_HEADERS(dlfcn.h dl.h dld.h)
  305. save_LIBS="$LIBS"
  306. LIBADD_DL=""
  307. AC_CHECK_LIB(dl, dlopen,
  308. [
  309. AC_DEFINE(HAVE_LIBDL, 1, [Define if you have the -ldl library])
  310. LIBADD_DL="-ldl"
  311. LIBS="$LIBS -ldl"
  312. ]
  313. )
  314. AC_CHECK_FUNCS(dlopen _dlopen dlsym dladdr)
  315. AC_MSG_CHECKING([whether dlsym() requires a leading underscore in symbol names])
  316. _LT_TRY_DLOPEN_SELF([
  317. AC_MSG_RESULT(no)
  318. ], [
  319. AC_MSG_RESULT(yes)
  320. AC_DEFINE(NEED_USCORE, 1, [Define if dlsym() requires a leading underscore in symbol names. ])
  321. ], [
  322. AC_MSG_RESULT(no)
  323. ], [])
  324. ##########################################################################
  325. ## Check if the dl library has the Dl_info structure ##
  326. ##########################################################################
  327. AC_MSG_CHECKING([for Dl_info])
  328. AC_TRY_COMPILE([
  329. #ifndef _GNU_SOURCE
  330. #define _GNU_SOURCE 1
  331. #endif
  332. #include <dlfcn.h>
  333. ],[
  334. Dl_info* info = 0;
  335. dladdr(0, info);
  336. ],[
  337. AC_DEFINE(HAVE_DL_INFO, 1, [Define to 1 if you have the Dl_info structure])
  338. AC_MSG_RESULT(yes)
  339. ],[
  340. AC_MSG_RESULT(no)
  341. ])
  342. ##########################################################################
  343. ## Check for dynamic load module (hpux) ##
  344. ##########################################################################
  345. AC_CHECK_FUNC(shl_load,
  346. [AC_DEFINE(HAVE_SHL_LOAD, 1, [Define if you have the shl_load function])],
  347. [AC_CHECK_LIB(dld, shl_load,
  348. [AC_DEFINE(HAVE_SHL_LOAD, 1, [Define if you have the shl_load function]) LIBADD_DL="-ldld"])]
  349. )
  350. ##########################################################################
  351. ## Check for dynamic load module (hpux) ##
  352. ##########################################################################
  353. AC_CHECK_LIB(dld, dld_link,
  354. [AC_DEFINE(HAVE_DLD, 1, [Define if you have the -ldld library])dnl
  355. test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="-ldld"])
  356. ##########################################################################
  357. ## Check for dynamic load module (macos) ##
  358. ##########################################################################
  359. AC_CHECK_FUNC(NSCreateObjectFileImageFromFile,
  360. [AC_DEFINE(HAVE_DYLD, 1, [Define if you have the DYLD library])])
  361. AC_SUBST(LIBADD_DL)
  362. LIBS="$save_LIBS"
  363. ##########################################################################
  364. ## ##
  365. ## Set version information ##
  366. ## ##
  367. ##########################################################################
  368. AC_MSG_CHECKING(for iODBC mode)
  369. AC_ARG_ENABLE(odbc3, [dnl
  370. AS_HELP_STRING([--enable-odbc3], [build ODBC 3.x compatible driver manager (default)])
  371. AS_HELP_STRING([--disable-odbc3], [build ODBC 2.x compatible driver manager])dnl
  372. ],
  373. [
  374. case "${enableval}" in
  375. yes) odbcmode=3 ;;
  376. no) odbcmode=2
  377. AC_MSG_ERROR(--disable-odbc3 temporarily disabled)
  378. ;;
  379. *) AC_MSG_ERROR(bad value ${enableval} for --enable-odbc3) ;;
  380. esac
  381. ],
  382. [
  383. odbcmode=3 # set default to ODBC 3.x mode
  384. ])
  385. if test "x$odbcmode" = "x3"
  386. then
  387. lib_version=$lib3_version
  388. CFLAGS="$CFLAGS -DODBCVER=0x0350 -DIODBC_BUILD=$BUILD_VER"
  389. AC_MSG_RESULT(ODBC 3.x compatible mode)
  390. else
  391. lib_version=$lib2_version
  392. CFLAGS="$CFLAGS -DODBCVER=0x0250 -DIODBC_BUILD=$BUILD_VER"
  393. AC_MSG_RESULT(ODBC 2.x compatible mode)
  394. fi
  395. AC_SUBST(odbcmode)
  396. AC_SUBST(lib_version)
  397. ##########################################################################
  398. ## ##
  399. ## Where to find the system odbc.ini file **
  400. ## ##
  401. ##########################################################################
  402. #
  403. # First determine the systemwide default directory according
  404. # to GNU specifications
  405. #
  406. AC_MSG_CHECKING(system config directory)
  407. sysinidir=`eval echo $sysconfdir`
  408. case "$sysinidir" in
  409. NONE*)
  410. sysinidir=$ac_default_prefix/etc
  411. ;;
  412. /usr/etc)
  413. sysinidir=/etc
  414. ;;
  415. *)
  416. sysinidir=`eval echo $sysconfdir`
  417. ;;
  418. esac
  419. AC_MSG_RESULT($sysinidir)
  420. #
  421. # Now allow to overrule this directory with a custom setting
  422. #
  423. AC_MSG_CHECKING(for iODBC ini directory)
  424. AC_ARG_WITH(iodbc-inidir, [dnl
  425. AS_HELP_STRING([--with-iodbc-inidir=DIR], [where the system odbc.ini file should be located])
  426. AS_HELP_STRING([ ], [(default is /etc)])dnl
  427. ],
  428. [
  429. case "$withval" in
  430. yes|no)
  431. inidir=$sysinidir
  432. ;;
  433. *)
  434. inidir=$withval
  435. ;;
  436. esac
  437. ])
  438. AC_MSG_RESULT($inidir)
  439. AC_SUBST(inidir)
  440. AC_DEFINE_UNQUOTED(SYS_ODBC_INI, "$inidir/odbc.ini",
  441. [Define path to systemwide odbc.ini file])
  442. AC_DEFINE_UNQUOTED(SYS_ODBCINST_INI, "$inidir/odbcinst.ini",
  443. [Define path to systemwide odbcinst.ini file])
  444. #
  445. # Now allow to override default FileDSN directory with a custom setting
  446. #
  447. filedsnpath=$inidir/ODBCDataSources
  448. AC_MSG_CHECKING(for FILEDSN default directory)
  449. AC_ARG_WITH(iodbc-filedsnpath, [dnl
  450. AS_HELP_STRING([--with-iodbc-filedsnpath=DIR], [default location for FILEDSN data sources])
  451. AS_HELP_STRING([ ], [(default is $inidir/ODBCDataSources)])dnl
  452. ],
  453. [
  454. case "$withval" in
  455. yes|no)
  456. filedsnpath=$inidir/ODBCDataSources
  457. ;;
  458. *)
  459. filedsnpath=$withval
  460. ;;
  461. esac
  462. ])
  463. AC_MSG_RESULT($filedsnpath)
  464. AC_SUBST(filedsnpath)
  465. AC_DEFINE_UNQUOTED(DEFAULT_FILEDSNPATH, "$filedsnpath",
  466. [Default location for FILEDSN data sources])
  467. ##########################################################################
  468. ## ##
  469. ## Create libodbc.so if requested ##
  470. ## ##
  471. ##########################################################################
  472. AC_MSG_CHECKING(for libodbc.so link)
  473. AC_ARG_ENABLE(libodbc, [dnl
  474. AS_HELP_STRING([--enable-libodbc], [install extra libodbc.so library (default)])
  475. AS_HELP_STRING([--disable-libodbc], [do not install extra libodbc.so library ])dnl
  476. ],
  477. [ case "${enableval}" in
  478. yes) install_libodbc=true ;;
  479. no) install_libodbc=false ;;
  480. *) AC_MSG_ERROR(bad value ${enableval} for --enable-libodbc) ;;
  481. esac
  482. ],[])
  483. AC_MSG_RESULT([$install_libodbc])
  484. AM_CONDITIONAL(INSTALL_LIBODBC, [test x$install_libodbc = xtrue])
  485. ##########################################################################
  486. ## ##
  487. ## Checkout pthread situation ##
  488. ## ##
  489. ##########################################################################
  490. # for backward compatibility
  491. AC_ARG_WITH(pthreads,[],
  492. [
  493. AC_MSG_WARN([--with-pthreads flag is deprecated, use --enable-pthreads])
  494. ],[])
  495. AC_MSG_CHECKING(for thread model)
  496. AC_ARG_ENABLE(pthreads, [dnl
  497. AS_HELP_STRING([--enable-pthreads], [build threaded libraries and applications (default)])
  498. AS_HELP_STRING([--disable-pthreads], [build non-threaded libraries and applications])dnl
  499. ],
  500. [ case "${enableval}" in
  501. yes) USE_PTHREADS=true ;;
  502. no) USE_PTHREADS=false ;;
  503. *) AC_MSG_ERROR(bad value ${enableval} for --enable-pthreads) ;;
  504. esac
  505. ],[USE_PTHREADS=true])
  506. if test x$USE_PTHREADS = xtrue
  507. then
  508. AC_MSG_RESULT(enabled pthread support)
  509. CPPFLAGS="$CPPFLAGS -DWITH_PTHREADS -D_REENTRANT"
  510. found_lib=false
  511. AC_MSG_CHECKING(for OS dependent thread flags)
  512. case $host in
  513. *-aix*)
  514. # Unless overruled by the user, we prefer this compiler
  515. if test "x$CC" = "xcc"
  516. then
  517. CC=cc_r7
  518. fi
  519. AC_MSG_RESULT([using $CC for AIX])
  520. ;;
  521. *UnixWare*)
  522. CFLAGS="$CFLAGS -Kthread"
  523. AC_MSG_RESULT([use -Kthread for UnixWare])
  524. ;;
  525. i[3456]86-dg-dgux*)
  526. CFLAGS="$CFLAGS -D_POSIX4A_DRAFT6_SOURCE"
  527. LIBS="$LIBS -lthread"
  528. AC_MSG_RESULT([use -lthread for DG/UX])
  529. ;;
  530. *-freebsd*)
  531. CFLAGS="$CFLAGS -pthread"
  532. AC_MSG_RESULT([use -pthread for FreeBSD])
  533. ;;
  534. *-hpux*)
  535. LIBS="$LIBS -lpthread -lcl"
  536. AC_MSG_RESULT([use -lpthread for HP/UX])
  537. ;;
  538. *-osf3.*)
  539. CPPFLAGS="$CPPFLAGS -DOLD_PTHREADS"
  540. LIBS="$LIBS -lpthreads -lmach -lc_r"
  541. AC_MSG_RESULT([use -lpthreads for OSF 3.2])
  542. ;;
  543. *-osf4.*)
  544. LIBS="$LIBS -lpthread"
  545. AC_MSG_RESULT([use -lpthread for OSF 4.x])
  546. ;;
  547. *)
  548. AC_MSG_RESULT([none])
  549. ;;
  550. esac
  551. #
  552. # Check headers
  553. #
  554. AC_CHECK_HEADER([pthread.h], , [AC_MSG_ERROR([pthreads header not found])])
  555. #
  556. # If mutex functions are in C library, we should not need to link
  557. # with -lpthread
  558. #
  559. AC_CHECK_FUNC(pthread_mutex_lock, [found_lib=true])
  560. #
  561. # Check out the various libraries
  562. #
  563. if test x$found_lib = xfalse
  564. then
  565. IODBC_CHECK_PTHREAD_LIB(pthreads, pthread_mutex_lock,
  566. [
  567. LIBS="$LIBS -lpthreads"
  568. found_lib=true
  569. ])
  570. fi
  571. if test x$found_lib = xfalse
  572. then
  573. IODBC_CHECK_PTHREAD_LIB(pthread, pthread_mutex_lock,
  574. [
  575. LIBS="$LIBS -lpthread"
  576. found_lib=true
  577. ])
  578. fi
  579. else
  580. AC_MSG_RESULT(no thread support)
  581. fi
  582. ##########################################################################
  583. ## ##
  584. ## OS dependent libraries ##
  585. ## ##
  586. ##########################################################################
  587. LIBADD_OS=""
  588. AC_MSG_CHECKING(for OS dependent libraries and link flags)
  589. AM_CONDITIONAL(DARWIN, false)
  590. case $host in
  591. *-hpux*)
  592. LDFLAGS="$LDFLAGS -Wl,+s"
  593. AC_MSG_RESULT([use -Wl,+s for HP/UX])
  594. ;;
  595. *-darwin*)
  596. AM_CONDITIONAL(DARWIN, true)
  597. CFLAGS="$CFLAGS -DNO_FRAMEWORKS"
  598. LIBADD_OS="-Wl,-framework,Carbon"
  599. AC_MSG_RESULT([$LIBADD_OS])
  600. ;;
  601. *)
  602. AC_MSG_RESULT(none)
  603. ;;
  604. esac
  605. AC_SUBST(LIBADD_OS)
  606. ##########################################################################
  607. ## ##
  608. ## Generate Makefiles etc. ##
  609. ## ##
  610. ##########################################################################
  611. AC_CONFIG_FILES([
  612. Makefile
  613. admin/Makefile
  614. admin/libiodbc.spec
  615. admin/libiodbc.pc
  616. bin/Makefile
  617. bin/iodbc-config
  618. etc/Makefile
  619. man/Makefile
  620. man/iodbc-config.1
  621. man/iodbctest.1
  622. man/iodbctestw.1
  623. man/iodbcadm-gtk.1
  624. include/Makefile
  625. iodbc/Makefile
  626. iodbc/trace/Makefile
  627. iodbcinst/Makefile
  628. iodbcadm/Makefile
  629. iodbcadm/gtk/Makefile
  630. drvproxy/Makefile
  631. drvproxy/gtk/Makefile
  632. samples/Makefile
  633. ])
  634. AC_CONFIG_COMMANDS([default],[
  635. chmod 755 bin/iodbc-config
  636. ])
  637. AC_OUTPUT
  638. ##########################################################################
  639. ## ##
  640. ## Display configuration information ##
  641. ## ##
  642. ##########################################################################
  643. # ----------------------------------------------------------------------
  644. # Color settings
  645. # ----------------------------------------------------------------------
  646. B=`tput bold 2>/dev/null`
  647. N=`tput sgr0 2>/dev/null`
  648. cat <<EOF
  649. ${B}${PACKAGE_STRING} configuration summary${N}
  650. `echo "${PACKAGE_STRING} configuration summary" | sed 's/./=/g'`
  651. ${B}Installation variables${N}
  652. layout ${iodbc_layout}
  653. prefix ${prefix}
  654. exec_prefix ${exec_prefix}
  655. ${B}Installation paths${N}
  656. programs ${bindir}
  657. include files ${includedir}
  658. libraries ${libdir}
  659. manual pages ${mandir}
  660. ${B}Configuration files${N}
  661. odbc.ini ${inidir}/odbc.ini
  662. odbcinst.ini ${inidir}/odbcinst.ini
  663. default FILEDSN path ${filedsnpath}
  664. ${B}Extensions${N}
  665. ODBC Version ${odbcmode}
  666. GUI Extensions ${USE_GUI}
  667. ThreadSafe ${USE_PTHREADS}
  668. Install libodbc.so ${install_libodbc}
  669. EOF