configure.ac 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.59)
  4. # This version is the version returned by ns-slapd -v
  5. AC_INIT([dirsrv], [1.1.0b1], [http://bugzilla.redhat.com/])
  6. # AC_CONFIG_HEADER must be called right after AC_INIT.
  7. AC_CONFIG_HEADERS([config.h])
  8. AM_INIT_AUTOMAKE([1.9 foreign subdir-objects])
  9. AM_MAINTAINER_MODE
  10. AC_CANONICAL_HOST
  11. # Checks for programs.
  12. AC_PROG_CXX
  13. AC_PROG_CC
  14. AM_PROG_CC_C_O
  15. # disable static libs by default - we only use a couple
  16. AC_DISABLE_STATIC
  17. AC_PROG_LIBTOOL
  18. # Checks for header files.
  19. AC_HEADER_DIRENT
  20. AC_HEADER_STDC
  21. AC_HEADER_SYS_WAIT
  22. AC_CHECK_HEADERS([arpa/inet.h fcntl.h malloc.h netdb.h netinet/in.h stdlib.h string.h strings.h sys/file.h sys/socket.h sys/time.h unistd.h])
  23. # Checks for typedefs, structures, and compiler characteristics.
  24. AC_HEADER_STAT
  25. AC_C_CONST
  26. AC_HEADER_STDBOOL
  27. AC_TYPE_UID_T
  28. AC_TYPE_PID_T
  29. AC_TYPE_SIZE_T
  30. AC_HEADER_TIME
  31. AC_STRUCT_TM
  32. # Checks for library functions.
  33. AC_FUNC_CHOWN
  34. AC_FUNC_CLOSEDIR_VOID
  35. AC_FUNC_ERROR_AT_LINE
  36. AC_FUNC_FORK
  37. AC_FUNC_LSTAT
  38. AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
  39. AC_FUNC_MALLOC
  40. AC_FUNC_MEMCMP
  41. AC_FUNC_MMAP
  42. AC_TYPE_SIGNAL
  43. AC_FUNC_STAT
  44. AC_FUNC_STRERROR_R
  45. AC_FUNC_STRFTIME
  46. AC_FUNC_VPRINTF
  47. AC_CHECK_FUNCS([setrlimit endpwent ftruncate getcwd gethostbyname inet_ntoa localtime_r memmove memset mkdir munmap putenv rmdir socket strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strstr strtol tzset])
  48. AC_MSG_CHECKING(for --enable-debug)
  49. AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debug features (default: no)]),
  50. [
  51. AC_MSG_RESULT(yes)
  52. debug_defs="-DDEBUG -DMCC_DEBUG"
  53. ],
  54. [
  55. AC_MSG_RESULT(no)
  56. debug_defs=""
  57. ])
  58. AC_SUBST([debug_defs])
  59. # Used for legacy style packaging where we bundle all of the dependencies.
  60. AC_MSG_CHECKING(for --enable-bundle)
  61. AC_ARG_ENABLE(bundle, AS_HELP_STRING([--enable-bundle], [Enable bundled dependencies (default: no)]),
  62. [
  63. AC_MSG_RESULT(yes)
  64. bundle="1";
  65. ],
  66. [
  67. AC_MSG_RESULT(no)
  68. bundle="";
  69. ])
  70. AM_CONDITIONAL(BUNDLE,test "$bundle" = "1")
  71. # these enables are for optional or experimental features
  72. if test -z "$enable_pam_passthru" ; then
  73. enable_pam_passthru=yes # if not set on cmdline, set default
  74. fi
  75. AC_MSG_CHECKING(for --enable-pam-passthru)
  76. AC_ARG_ENABLE(pam-passthru,
  77. AS_HELP_STRING([--enable-pam-passthru],
  78. [enable the PAM passthrough auth plugin (default: yes)]))
  79. if test "$enable_pam_passthru" = yes ; then
  80. AC_MSG_RESULT(yes)
  81. AC_DEFINE([ENABLE_PAM_PASSTHRU], [1], [enable the pam passthru auth plugin])
  82. else
  83. AC_MSG_RESULT(no)
  84. fi
  85. AM_CONDITIONAL(enable_pam_passthru,test "$enable_pam_passthru" = "yes")
  86. if test -z "$enable_dna" ; then
  87. enable_dna=yes # if not set on cmdline, set default
  88. fi
  89. AC_MSG_CHECKING(for --enable-dna)
  90. AC_ARG_ENABLE(dna,
  91. AS_HELP_STRING([--enable-dna],
  92. [enable the Distributed Numeric Assignment (DNA) plugin (default: yes)]))
  93. if test "$enable_dna" = yes ; then
  94. AC_MSG_RESULT(yes)
  95. AC_DEFINE([ENABLE_DNA], [1], [enable the dna plugin])
  96. else
  97. AC_MSG_RESULT(no)
  98. fi
  99. AM_CONDITIONAL(enable_dna,test "$enable_dna" = "yes")
  100. if test -z "$enable_ldapi" ; then
  101. enable_ldapi=yes # if not set on cmdline, set default
  102. fi
  103. AC_MSG_CHECKING(for --enable-ldapi)
  104. AC_ARG_ENABLE(ldapi,
  105. AS_HELP_STRING([--enable-ldapi],
  106. [enable LDAP over unix domain socket (LDAPI) support (default: yes)]))
  107. if test "$enable_ldapi" = yes ; then
  108. AC_MSG_RESULT(yes)
  109. AC_DEFINE([ENABLE_LDAPI], [1], [enable ldapi support in the server])
  110. else
  111. AC_MSG_RESULT(no)
  112. fi
  113. AM_CONDITIONAL(enable_ldapi,test "$enable_ldapi" = "yes")
  114. if test -z "$enable_bitwise" ; then
  115. enable_bitwise=yes # if not set on cmdline, set default
  116. fi
  117. AC_MSG_CHECKING(for --enable-bitwise)
  118. AC_ARG_ENABLE(bitwise,
  119. AS_HELP_STRING([--enable-bitwise],
  120. [enable the bitwise matching rule plugin (default: yes)]))
  121. if test "$enable_bitwise" = yes ; then
  122. AC_MSG_RESULT(yes)
  123. AC_DEFINE([ENABLE_BITWISE], [1], [enable the bitwise plugin])
  124. else
  125. AC_MSG_RESULT(no)
  126. fi
  127. AM_CONDITIONAL(enable_bitwise,test "$enable_bitwise" = "yes")
  128. # the default prefix - override with --prefix or --with-fhs
  129. AC_PREFIX_DEFAULT([/opt/$PACKAGE_NAME])
  130. brand=fedora
  131. capbrand=Fedora
  132. vendor="Fedora Project"
  133. m4_include(m4/fhs.m4)
  134. # installation paths - by default, we store everything
  135. # under the prefix. The with-fhs option will use /usr,
  136. # /etc, and /var. The with-fhs-opt option will use the
  137. # prefix, but it's sysconfdir and localstatedir will be
  138. # /etc/opt, and /var/opt.
  139. if test "$with_fhs_opt" = "yes"; then
  140. # Override sysconfdir and localstatedir if FHS optional
  141. # package was requested.
  142. sysconfdir='/etc/opt'
  143. localstatedir='/var/opt'
  144. # relative to datadir
  145. sampledatadir=/data
  146. # relative to datadir
  147. scripttemplatedir=/script-templates
  148. # relative to libdir
  149. serverdir=
  150. # relative to libdir
  151. serverplugindir=/plugins
  152. # relative to datadir
  153. infdir=/inf
  154. # location of property/resource files, relative to datadir
  155. propertydir=/properties
  156. # relative to libdir
  157. perldir=/perl
  158. else
  159. if test "$with_fhs" = "yes"; then
  160. ac_default_prefix=/usr
  161. prefix=$ac_default_prefix
  162. exec_prefix=$prefix
  163. dnl as opposed to the default /usr/etc
  164. sysconfdir='/etc'
  165. dnl as opposed to the default /usr/var
  166. localstatedir='/var'
  167. fi
  168. # relative to datadir
  169. sampledatadir=/$PACKAGE_NAME/data
  170. # relative to datadir
  171. scripttemplatedir=/$PACKAGE_NAME/script-templates
  172. # relative to libdir
  173. serverdir=/$PACKAGE_NAME
  174. # relative to libdir
  175. serverplugindir=/$PACKAGE_NAME/plugins
  176. # relative to datadir
  177. infdir=/$PACKAGE_NAME/inf
  178. # location of property/resource files, relative to datadir
  179. propertydir=/$PACKAGE_NAME/properties
  180. # relative to libdir
  181. perldir=/$PACKAGE_NAME/perl
  182. fi
  183. # Shared paths for all layouts
  184. # relative to sysconfdir
  185. configdir=/$PACKAGE_NAME/config
  186. # relative to sysconfdir
  187. schemadir=/$PACKAGE_NAME/schema
  188. # default user, group
  189. defaultuser=nobody
  190. defaultgroup=nobody
  191. AC_SUBST(configdir)
  192. AC_SUBST(sampledatadir)
  193. AC_SUBST(propertydir)
  194. AC_SUBST(schemadir)
  195. AC_SUBST(serverdir)
  196. AC_SUBST(serverplugindir)
  197. AC_SUBST(scripttemplatedir)
  198. AC_SUBST(perldir)
  199. AC_SUBST(infdir)
  200. AC_SUBST(defaultuser)
  201. AC_SUBST(defaultgroup)
  202. # check for --with-instconfigdir
  203. AC_MSG_CHECKING(for --with-instconfigdir)
  204. AC_ARG_WITH(instconfigdir,
  205. AS_HELP_STRING([--with-instconfigdir=/path],
  206. [Base directory for instance specific writable configuration directories (default $sysconfdir/$PACKAGE_NAME)]),
  207. [
  208. if test $withval = yes ; then
  209. AC_ERROR([Please specify a full path with --with-instconfigdir])
  210. fi
  211. instconfigdir="$withval"
  212. ],
  213. [
  214. dnl this value is expanded out in Makefile.am
  215. instconfigdir='$(sysconfdir)/$(PACKAGE_NAME)'
  216. ])
  217. AC_SUBST(instconfigdir)
  218. # WINNT should be true if building on Windows system not using
  219. # cygnus, mingw, or the like and using cmd.exe as the shell
  220. AM_CONDITIONAL([WINNT], false)
  221. # Deal with platform dependent defines
  222. # relative to sysconfdir
  223. initdir=/rc.d
  224. # on most platforms, we will just use perl from PATH
  225. # On some platforms, we cannot. Why not just use any old
  226. # perl? Because of perldap. We use a perldap that is
  227. # compiled to either 32bit or 64bit, so we must use a native
  228. # perl binary compiled with the same bitsize. On Solaris
  229. # and HP-UX, /usr/bin/perl is 32 bit, so we cannot use
  230. # those with our 64 bit compiled product.
  231. perlexec='/usr/bin/env perl'
  232. case $host in
  233. *-*-linux*)
  234. AC_DEFINE([XP_UNIX], [1], [UNIX])
  235. AC_DEFINE([Linux], [1], [Linux])
  236. AC_DEFINE([LINUX], [1], [Linux])
  237. AC_DEFINE([LINUX2_0], [1], [Linux 2.0])
  238. AC_DEFINE([LINUX2_2], [1], [Linux 2.2])
  239. AC_DEFINE([LINUX2_4], [1], [Linux 2.4])
  240. platform="linux"
  241. # relative to sysconfdir
  242. initdir=/rc.d/init.d
  243. ;;
  244. ia64-hp-hpux*)
  245. AC_DEFINE([XP_UNIX], [1], [UNIX])
  246. AC_DEFINE([hpux], [1], [HP-UX])
  247. AC_DEFINE([HPUX], [1], [HP-UX])
  248. AC_DEFINE([HPUX11], [1], [HP-UX 11])
  249. AC_DEFINE([HPUX11_23], [1], [HP-UX 11.23])
  250. AC_DEFINE([CPU_ia64], [], [cpu type ia64])
  251. AC_DEFINE([OS_hpux], [1], [OS HP-UX])
  252. AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
  253. AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
  254. # assume 64 bit
  255. perlexec='/opt/perl_64/bin/perl'
  256. platform="hpux"
  257. ;;
  258. hppa*-hp-hpux*)
  259. AC_DEFINE([XP_UNIX], [1], [UNIX])
  260. AC_DEFINE([hpux], [1], [HP-UX])
  261. AC_DEFINE([HPUX], [1], [HP-UX])
  262. AC_DEFINE([HPUX11], [1], [HP-UX 11])
  263. AC_DEFINE([HPUX11_11], [1], [HP-UX 11.11])
  264. AC_DEFINE([CPU_hppa], [], [cpu type pa-risc])
  265. AC_DEFINE([OS_hpux], [1], [OS HP-UX])
  266. AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
  267. AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
  268. # assume 64 bit
  269. perlexec='/opt/perl_64/bin/perl'
  270. platform="hpux"
  271. ;;
  272. sparc-sun-solaris*)
  273. AC_DEFINE([XP_UNIX], [1], [UNIX])
  274. AC_DEFINE([SVR4], [1], [SVR4])
  275. AC_DEFINE([__svr4], [1], [SVR4])
  276. AC_DEFINE([__svr4__], [1], [SVR4])
  277. AC_DEFINE([_SVID_GETTOD], [1], [SVID_GETTOD])
  278. AC_DEFINE([SOLARIS], [1], [SOLARIS])
  279. AC_DEFINE([CPU_sparc], [], [cpu type sparc])
  280. AC_DEFINE([OS_solaris], [1], [OS SOLARIS])
  281. AC_DEFINE([sunos5], [1], [SunOS5])
  282. AC_DEFINE([OSVERSION], [509], [OS version])
  283. AC_DEFINE([_REENTRANT], [1], [_REENTRANT])
  284. dnl socket nsl and dl are required to link several programs and libdb
  285. LIBSOCKET=-lsocket
  286. AC_SUBST([LIBSOCKET], [$LIBSOCKET])
  287. LIBNSL=-lnsl
  288. AC_SUBST([LIBNSL], [$LIBNSL])
  289. LIBDL=-ldl
  290. AC_SUBST([LIBDL], [$LIBDL])
  291. dnl Cstd and Crun are required to link any C++ related code
  292. LIBCSTD=-lCstd
  293. AC_SUBST([LIBCSTD], [$LIBCSTD])
  294. LIBCRUN=-lCrun
  295. AC_SUBST([LIBCRUN], [$LIBCRUN])
  296. platform="solaris"
  297. # assume 64 bit
  298. perlexec='/opt/perl5x/bin/perl'
  299. # relative to sysconfdir
  300. initdir=/init.d
  301. ;;
  302. *)
  303. platform=""
  304. ;;
  305. esac
  306. AC_SUBST(initdir)
  307. AC_SUBST(perlexec)
  308. AM_CONDITIONAL(HPUX,test "$platform" = "hpux")
  309. AM_CONDITIONAL(SOLARIS,test "$platform" = "solaris")
  310. # Check for library dependencies
  311. m4_include(m4/nspr.m4)
  312. m4_include(m4/nss.m4)
  313. m4_include(m4/mozldap.m4)
  314. m4_include(m4/db.m4)
  315. m4_include(m4/sasl.m4)
  316. m4_include(m4/svrcore.m4)
  317. m4_include(m4/icu.m4)
  318. m4_include(m4/netsnmp.m4)
  319. PACKAGE_BASE_VERSION=`echo $PACKAGE_VERSION | awk -F\. '{print $1"."$2}'`
  320. AC_SUBST(PACKAGE_BASE_VERSION)
  321. # write out paths for binary components
  322. AC_SUBST(nspr_inc)
  323. AC_SUBST(nspr_lib)
  324. AC_SUBST(nspr_libdir)
  325. AC_SUBST(nss_inc)
  326. AC_SUBST(nss_lib)
  327. AC_SUBST(nss_libdir)
  328. AC_SUBST(ldapsdk_inc)
  329. AC_SUBST(ldapsdk_lib)
  330. AC_SUBST(ldapsdk_libdir)
  331. AC_SUBST(ldapsdk_bindir)
  332. AC_SUBST(db_inc)
  333. AC_SUBST(db_incdir)
  334. AC_SUBST(db_lib)
  335. AC_SUBST(db_libdir)
  336. AC_SUBST(db_bindir)
  337. AC_SUBST(db_libver)
  338. AC_SUBST(sasl_inc)
  339. AC_SUBST(sasl_lib)
  340. AC_SUBST(sasl_libdir)
  341. AC_SUBST(svrcore_inc)
  342. AC_SUBST(svrcore_lib)
  343. AC_SUBST(icu_lib)
  344. AC_SUBST(icu_inc)
  345. AC_SUBST(icu_bin)
  346. AC_SUBST(netsnmp_inc)
  347. AC_SUBST(netsnmp_lib)
  348. AC_SUBST(netsnmp_libdir)
  349. AC_SUBST(netsnmp_link)
  350. AC_SUBST(brand)
  351. AC_SUBST(capbrand)
  352. AC_SUBST(vendor)
  353. AC_DEFINE([LDAP_DEBUG], [1], [LDAP debug flag])
  354. AC_DEFINE([LDAP_DONT_USE_SMARTHEAP], [1], [Don't use smartheap])
  355. # libtool on fedora/rhel contains some gcc-isms which cause problems
  356. # if not using gcc (e.g. Forte on Solaris, aCC on HP-UX)
  357. # we remove them here
  358. if test "$GCC" != yes ; then
  359. AC_MSG_NOTICE([Not using gcc - fixing libtool to remove gcc-isms . . .])
  360. cp -p libtool libtool.orig
  361. cp -p libtool libtool.tmp
  362. # dnl note the special chars @<:@ and @:>@ - since m4 treats [ and ] specially,
  363. # we have to use the quadrigraph @<:@ for [ and @:>@ for ] - and you thought
  364. # perl produced write-only code . . .
  365. sed -e '/^gcc_dir/ d' \
  366. -e '/^gcc_ver/ d' \
  367. -e 's/^predep_objects=.*echo \("@<:@^"@:>@*"\).*$/predep_objects=\1/' \
  368. -e 's/^postdep_objects=.*echo \("@<:@^"@:>@*"\).*$/postdep_objects=\1/' \
  369. -e 's/^compiler_lib_search_path=.*echo \("@<:@^"@:>@*"\).*$/compiler_lib_search_path=\1/' \
  370. -e 's/^sys_lib_search_path_spec=.*echo \("@<:@^"@:>@*"\).*$/sys_lib_search_path_spec=\1/' \
  371. libtool > libtool.tmp
  372. cp -p libtool.tmp libtool
  373. rm -f libtool.tmp
  374. fi
  375. AC_CONFIG_FILES([Makefile])
  376. AC_OUTPUT