configure.ac 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.59)
  4. AC_INIT([dirsrv],[1.0],[http://bugzilla.redhat.com/])
  5. # AC_CONFIG_HEADER must be called right after AC_INIT.
  6. AC_CONFIG_HEADERS([config.h])
  7. # include the version information
  8. . $srcdir/VERSION.sh
  9. AC_MSG_NOTICE(This is configure for $PACKAGE_TARNAME $PACKAGE_VERSION)
  10. AC_DEFINE_UNQUOTED([DS_PACKAGE_VERSION], "$PACKAGE_VERSION", [package version])
  11. AC_DEFINE_UNQUOTED([DS_PACKAGE_TARNAME], "$PACKAGE_TARNAME", [package tarball name])
  12. AC_DEFINE_UNQUOTED([DS_PACKAGE_BUGREPORT], "$PACKAGE_BUGREPORT", [package bug report url])
  13. AC_DEFINE_UNQUOTED([DS_PACKAGE_STRING], "$PACKAGE_STRING", [package string])
  14. AM_INIT_AUTOMAKE([1.9 foreign subdir-objects dist-bzip2 no-dist-gzip no-define])
  15. # define these for automake distdir
  16. VERSION=$PACKAGE_VERSION
  17. PACKAGE=$PACKAGE_TARNAME
  18. AC_DEFINE_UNQUOTED([VERSION], "$VERSION", [package version])
  19. AC_DEFINE_UNQUOTED([PACKAGE], "$PACKAGE", [package tar name])
  20. AC_SUBST([CONSOLE_VERSION])
  21. AM_MAINTAINER_MODE
  22. AC_CANONICAL_HOST
  23. # Checks for programs.
  24. AC_PROG_CXX
  25. AC_PROG_CC
  26. AM_PROG_CC_C_O
  27. AM_PROG_AS
  28. # disable static libs by default - we only use a couple
  29. AC_DISABLE_STATIC
  30. AC_PROG_LIBTOOL
  31. # Checks for header files.
  32. AC_HEADER_DIRENT
  33. AC_HEADER_STDC
  34. AC_HEADER_SYS_WAIT
  35. 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 inttypes.h])
  36. # Checks for typedefs, structures, and compiler characteristics.
  37. AC_HEADER_STAT
  38. AC_C_CONST
  39. AC_HEADER_STDBOOL
  40. AC_TYPE_UID_T
  41. AC_TYPE_PID_T
  42. AC_TYPE_SIZE_T
  43. AC_HEADER_TIME
  44. AC_STRUCT_TM
  45. # Checks for library functions.
  46. AC_FUNC_CHOWN
  47. AC_FUNC_CLOSEDIR_VOID
  48. AC_FUNC_ERROR_AT_LINE
  49. AC_FUNC_FORK
  50. AC_FUNC_LSTAT
  51. AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
  52. AC_FUNC_MALLOC
  53. AC_FUNC_MEMCMP
  54. AC_FUNC_MMAP
  55. AC_TYPE_SIGNAL
  56. AC_FUNC_STAT
  57. AC_FUNC_STRERROR_R
  58. AC_FUNC_STRFTIME
  59. AC_FUNC_VPRINTF
  60. 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])
  61. AC_MSG_CHECKING(for --enable-debug)
  62. AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debug features (default: no)]),
  63. [
  64. AC_MSG_RESULT(yes)
  65. debug_defs="-DDEBUG -DMCC_DEBUG"
  66. ],
  67. [
  68. AC_MSG_RESULT(no)
  69. debug_defs=""
  70. ])
  71. AC_SUBST([debug_defs])
  72. # Used for legacy style packaging where we bundle all of the dependencies.
  73. AC_MSG_CHECKING(for --enable-bundle)
  74. AC_ARG_ENABLE(bundle, AS_HELP_STRING([--enable-bundle], [Enable bundled dependencies (default: no)]),
  75. [
  76. AC_MSG_RESULT(yes)
  77. bundle="1";
  78. ],
  79. [
  80. AC_MSG_RESULT(no)
  81. bundle="";
  82. ])
  83. AM_CONDITIONAL(BUNDLE,test "$bundle" = "1")
  84. # these enables are for optional or experimental features
  85. if test -z "$enable_pam_passthru" ; then
  86. enable_pam_passthru=yes # if not set on cmdline, set default
  87. fi
  88. AC_MSG_CHECKING(for --enable-pam-passthru)
  89. AC_ARG_ENABLE(pam-passthru,
  90. AS_HELP_STRING([--enable-pam-passthru],
  91. [enable the PAM passthrough auth plugin (default: yes)]))
  92. if test "$enable_pam_passthru" = yes ; then
  93. AC_MSG_RESULT(yes)
  94. AC_DEFINE([ENABLE_PAM_PASSTHRU], [1], [enable the pam passthru auth plugin])
  95. else
  96. AC_MSG_RESULT(no)
  97. fi
  98. AM_CONDITIONAL(enable_pam_passthru,test "$enable_pam_passthru" = "yes")
  99. if test -z "$enable_dna" ; then
  100. enable_dna=yes # if not set on cmdline, set default
  101. fi
  102. AC_MSG_CHECKING(for --enable-dna)
  103. AC_ARG_ENABLE(dna,
  104. AS_HELP_STRING([--enable-dna],
  105. [enable the Distributed Numeric Assignment (DNA) plugin (default: yes)]))
  106. if test "$enable_dna" = yes ; then
  107. AC_MSG_RESULT(yes)
  108. AC_DEFINE([ENABLE_DNA], [1], [enable the dna plugin])
  109. else
  110. AC_MSG_RESULT(no)
  111. fi
  112. AM_CONDITIONAL(enable_dna,test "$enable_dna" = "yes")
  113. if test -z "$enable_ldapi" ; then
  114. enable_ldapi=yes # if not set on cmdline, set default
  115. fi
  116. AC_MSG_CHECKING(for --enable-ldapi)
  117. AC_ARG_ENABLE(ldapi,
  118. AS_HELP_STRING([--enable-ldapi],
  119. [enable LDAP over unix domain socket (LDAPI) support (default: yes)]))
  120. if test "$enable_ldapi" = yes ; then
  121. AC_MSG_RESULT(yes)
  122. AC_DEFINE([ENABLE_LDAPI], [1], [enable ldapi support in the server])
  123. else
  124. AC_MSG_RESULT(no)
  125. fi
  126. AM_CONDITIONAL(enable_ldapi,test "$enable_ldapi" = "yes")
  127. if test -z "$enable_autobind" ; then
  128. enable_autobind=no # if not set on cmdline, set default
  129. fi
  130. AC_MSG_CHECKING(for --enable-autobind)
  131. AC_ARG_ENABLE(autobind,
  132. AS_HELP_STRING([--enable-autobind],
  133. [enable auto bind over unix domain socket (LDAPI) support (default: no)]))
  134. if test "$enable_ldapi" = yes -a "$enable_autobind" = yes ; then
  135. AC_MSG_RESULT(yes)
  136. AC_DEFINE([ENABLE_AUTOBIND], [1], [enable ldapi auto bind support in the server])
  137. else
  138. AC_MSG_RESULT(no)
  139. fi
  140. AM_CONDITIONAL(enable_autobind,test "$enable_autobind" = "yes")
  141. if test -z "$enable_auto_dn_suffix" ; then
  142. enable_auto_dn_suffix=no # if not set on cmdline, set default
  143. fi
  144. AC_MSG_CHECKING(for --enable-auto-dn-suffix)
  145. AC_ARG_ENABLE(autobind,
  146. AS_HELP_STRING([--enable-auto-dn-suffix],
  147. [enable auto bind with auto dn suffix over unix domain socket (LDAPI) support (default: no)]))
  148. if test "$enable_ldapi" = yes -a "$enable_autobind" = yes -a "$enable_auto_dn_suffix" = "yes"; then
  149. AC_MSG_RESULT(yes)
  150. AC_DEFINE([ENABLE_AUTO_DN_SUFFIX], [1], [enable ldapi auto bind with auto dn suffix support in the server])
  151. else
  152. AC_MSG_RESULT(no)
  153. fi
  154. AM_CONDITIONAL(enable_auto_dn_suffix,test "$enable_auto_dn_suffix" = "yes")
  155. if test -z "$enable_bitwise" ; then
  156. enable_bitwise=yes # if not set on cmdline, set default
  157. fi
  158. AC_MSG_CHECKING(for --enable-bitwise)
  159. AC_ARG_ENABLE(bitwise,
  160. AS_HELP_STRING([--enable-bitwise],
  161. [enable the bitwise matching rule plugin (default: yes)]))
  162. if test "$enable_bitwise" = yes ; then
  163. AC_MSG_RESULT(yes)
  164. AC_DEFINE([ENABLE_BITWISE], [1], [enable the bitwise plugin])
  165. else
  166. AC_MSG_RESULT(no)
  167. fi
  168. AM_CONDITIONAL(enable_bitwise,test "$enable_bitwise" = "yes")
  169. if test -z "$enable_presence" ; then
  170. enable_presence=no # if not set on cmdline, set default
  171. fi
  172. AC_MSG_CHECKING(for --enable-presence)
  173. AC_ARG_ENABLE(presence,
  174. AS_HELP_STRING([--enable-presence],
  175. [enable the presence plugin (default: no)]))
  176. if test "$enable_presence" = yes ; then
  177. AC_MSG_RESULT(yes)
  178. AC_DEFINE([ENABLE_PRESENCE], [1], [enable the presence plugin])
  179. else
  180. AC_MSG_RESULT(no)
  181. fi
  182. AM_CONDITIONAL(enable_presence,test "$enable_presence" = "yes")
  183. if test -z "$enable_acctpolicy" ; then
  184. enable_acctpolicy=yes # if not set on cmdline, set default
  185. fi
  186. AC_MSG_CHECKING(for --enable-acctpolicy)
  187. AC_ARG_ENABLE(acctpolicy,
  188. AS_HELP_STRING([--enable-acctpolicy],
  189. [enable the account policy plugin (default: yes)]))
  190. if test "$enable_acctpolicy" = yes ; then
  191. AC_MSG_RESULT(yes)
  192. AC_DEFINE([ENABLE_ACCTPOLICY], [1], [enable the account policy plugin])
  193. else
  194. AC_MSG_RESULT(no)
  195. fi
  196. AM_CONDITIONAL(enable_acctpolicy,test "$enable_acctpolicy" = "yes")
  197. # the default prefix - override with --prefix or --with-fhs
  198. AC_PREFIX_DEFAULT([/opt/$PACKAGE_NAME])
  199. m4_include(m4/fhs.m4)
  200. # installation paths - by default, we store everything
  201. # under the prefix. The with-fhs option will use /usr,
  202. # /etc, and /var. The with-fhs-opt option will use the
  203. # prefix, but it's sysconfdir and localstatedir will be
  204. # /etc/opt, and /var/opt.
  205. if test "$with_fhs_opt" = "yes"; then
  206. # Override sysconfdir and localstatedir if FHS optional
  207. # package was requested.
  208. sysconfdir='/etc/opt'
  209. localstatedir='/var/opt'
  210. # relative to datadir
  211. sampledatadir=/data
  212. # relative to datadir
  213. scripttemplatedir=/script-templates
  214. # relative to datadir
  215. updatedir=/updates
  216. # relative to libdir
  217. serverdir=
  218. # relative to includedir
  219. serverincdir=
  220. # relative to libdir
  221. serverplugindir=/plugins
  222. # relative to datadir
  223. infdir=/inf
  224. # relative to datadir
  225. mibdir=/mibs
  226. # location of property/resource files, relative to datadir
  227. propertydir=/properties
  228. # relative to libdir
  229. perldir=/perl
  230. else
  231. if test "$with_fhs" = "yes"; then
  232. ac_default_prefix=/usr
  233. prefix=$ac_default_prefix
  234. exec_prefix=$prefix
  235. dnl as opposed to the default /usr/etc
  236. sysconfdir='/etc'
  237. dnl as opposed to the default /usr/var
  238. localstatedir='/var'
  239. fi
  240. # relative to datadir
  241. sampledatadir=/$PACKAGE_NAME/data
  242. # relative to datadir
  243. scripttemplatedir=/$PACKAGE_NAME/script-templates
  244. # relative to datadir
  245. updatedir=/$PACKAGE_NAME/updates
  246. # relative to libdir
  247. serverdir=/$PACKAGE_NAME
  248. # relative to includedir
  249. serverincdir=/$PACKAGE_NAME
  250. # relative to libdir
  251. serverplugindir=/$PACKAGE_NAME/plugins
  252. # relative to datadir
  253. infdir=/$PACKAGE_NAME/inf
  254. # relative to datadir
  255. mibdir=/$PACKAGE_NAME/mibs
  256. # location of property/resource files, relative to datadir
  257. propertydir=/$PACKAGE_NAME/properties
  258. # relative to libdir
  259. perldir=/$PACKAGE_NAME/perl
  260. fi
  261. # if mandir is the default value, override it
  262. # otherwise, the user must have set it - just use it
  263. if test X"$mandir" = X'${prefix}/man' ; then
  264. mandir='$(datadir)/man'
  265. fi
  266. # Shared paths for all layouts
  267. # relative to sysconfdir
  268. configdir=/$PACKAGE_NAME/config
  269. # relative to sysconfdir
  270. schemadir=/$PACKAGE_NAME/schema
  271. # default user, group
  272. defaultuser=nobody
  273. defaultgroup=nobody
  274. if test -z "$with_tmpfiles_d" ; then
  275. if test -d $sysconfdir/tmpfiles.d ; then
  276. with_tmpfiles_d='$(sysconfdir)/tmpfiles.d'
  277. fi
  278. fi
  279. AC_MSG_CHECKING(for --with-tmpfiles-d)
  280. AC_ARG_WITH(tmpfiles-d,
  281. AS_HELP_STRING([--with-tmpfiles-d=PATH],
  282. [system uses tmpfiles.d to handle temp files/dirs (default: $with_tmpfiles_d)])
  283. )
  284. if test "$with_tmpfiles_d" = yes ; then
  285. AC_MSG_ERROR([You must specify --with-tmpfiles-d=/full/path/to/tmpfiles.d directory])
  286. elif test "$with_tmpfiles_d" = no ; then
  287. with_tmpfiles_d=
  288. else
  289. AC_MSG_RESULT([$with_tmpfiles_d])
  290. fi
  291. AC_SUBST(with_tmpfiles_d)
  292. AC_SUBST(configdir)
  293. AC_SUBST(sampledatadir)
  294. AC_SUBST(propertydir)
  295. AC_SUBST(schemadir)
  296. AC_SUBST(serverdir)
  297. AC_SUBST(serverincdir)
  298. AC_SUBST(serverplugindir)
  299. AC_SUBST(scripttemplatedir)
  300. AC_SUBST(perldir)
  301. AC_SUBST(infdir)
  302. AC_SUBST(mibdir)
  303. AC_SUBST(mandir)
  304. AC_SUBST(updatedir)
  305. AC_SUBST(defaultuser)
  306. AC_SUBST(defaultgroup)
  307. # check for --with-instconfigdir
  308. AC_MSG_CHECKING(for --with-instconfigdir)
  309. AC_ARG_WITH(instconfigdir,
  310. AS_HELP_STRING([--with-instconfigdir=/path],
  311. [Base directory for instance specific writable configuration directories (default $sysconfdir/$PACKAGE_NAME)]),
  312. [
  313. if test $withval = yes ; then
  314. AC_ERROR([Please specify a full path with --with-instconfigdir])
  315. fi
  316. instconfigdir="$withval"
  317. AC_MSG_RESULT($withval)
  318. ],
  319. [
  320. dnl this value is expanded out in Makefile.am
  321. instconfigdir='$(sysconfdir)/$(PACKAGE_NAME)'
  322. AC_MSG_RESULT(no)
  323. ])
  324. AC_SUBST(instconfigdir)
  325. # WINNT should be true if building on Windows system not using
  326. # cygnus, mingw, or the like and using cmd.exe as the shell
  327. AM_CONDITIONAL([WINNT], false)
  328. # Deal with platform dependent defines
  329. # initdir is the location for the SysV init scripts - very heavily platform
  330. # dependent and not specified in fhs or lsb
  331. initdir='$(sysconfdir)/rc.d'
  332. AC_MSG_CHECKING(for --with-initddir)
  333. AC_ARG_WITH(initddir,
  334. AS_HELP_STRING([--with-initddir=/path],
  335. [Absolute path (not relative like some of the other options) that should contain the SysV init scripts (default '$(sysconfdir)/rc.d')]),
  336. [
  337. if test "$withval" = yes -o "$withval" = no ; then
  338. AC_ERROR([Please specify a full path with --with-initddir])
  339. fi
  340. AC_MSG_RESULT($withval)
  341. ],
  342. [
  343. AC_MSG_RESULT(no)
  344. ])
  345. # on most platforms, we will just use perl from PATH
  346. # On some platforms, we cannot. Why not just use any old
  347. # perl? Because of perldap. We use a perldap that is
  348. # compiled to either 32bit or 64bit, so we must use a native
  349. # perl binary compiled with the same bitsize. On Solaris
  350. # and HP-UX, /usr/bin/perl is 32 bit, so we cannot use
  351. # those with our 64 bit compiled product.
  352. perlexec='/usr/bin/env perl'
  353. # we use stty in perl scripts to disable password echo
  354. # this doesn't work unless the full absolute path of the
  355. # stty command is used e.g. system("stty -echo") does not
  356. # work but system("/bin/stty -echo") does work
  357. # since the path of stty may not be the same on all
  358. # platforms, we set the default here to /bin/stty and
  359. # allow that value to be overridden in the platform
  360. # specific section below
  361. sttyexec=/bin/stty
  362. case $host in
  363. *-*-linux*)
  364. AC_DEFINE([XP_UNIX], [1], [UNIX])
  365. AC_DEFINE([Linux], [1], [Linux])
  366. AC_DEFINE([LINUX], [1], [Linux])
  367. AC_DEFINE([LINUX2_0], [1], [Linux 2.0])
  368. AC_DEFINE([LINUX2_2], [1], [Linux 2.2])
  369. AC_DEFINE([LINUX2_4], [1], [Linux 2.4])
  370. AC_DEFINE([_GNU_SOURCE], [1], [GNU Source])
  371. platform="linux"
  372. initdir='$(sysconfdir)/rc.d/init.d'
  373. # do arch specific linux stuff here
  374. case $host in
  375. i*86-*-linux*)
  376. AC_DEFINE([CPU_x86], [], [cpu type x86])
  377. AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
  378. AC_CHECK_DECLS([__sync_add_and_fetch])
  379. ;;
  380. x86_64-*-linux*)
  381. AC_DEFINE([CPU_x86_64], [], [cpu type x86_64])
  382. AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
  383. AC_CHECK_DECLS([__sync_add_and_fetch])
  384. ;;
  385. esac
  386. # some programs use the native thread library directly
  387. THREADLIB=-lpthread
  388. AC_SUBST([THREADLIB], [$THREADLIB])
  389. LIBCRYPT=-lcrypt
  390. AC_SUBST([LIBCRYPT], [$LIBCRYPT])
  391. ;;
  392. ia64-hp-hpux*)
  393. AC_DEFINE([XP_UNIX], [1], [UNIX])
  394. AC_DEFINE([hpux], [1], [HP-UX])
  395. AC_DEFINE([HPUX], [1], [HP-UX])
  396. AC_DEFINE([HPUX11], [1], [HP-UX 11])
  397. AC_DEFINE([HPUX11_23], [1], [HP-UX 11.23])
  398. AC_DEFINE([CPU_ia64], [], [cpu type ia64])
  399. AC_DEFINE([OS_hpux], [1], [OS HP-UX])
  400. AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
  401. AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
  402. AC_DEFINE([_INCLUDE_STDC__SOURCE_199901], [1], [to pick up all of the printf format macros in inttypes.h])
  403. # assume 64 bit
  404. perlexec='/opt/perl_64/bin/perl'
  405. platform="hpux"
  406. initconfigdir="/$PACKAGE_NAME/config"
  407. # HPUX doesn't use /etc for this
  408. initdir=/init.d
  409. ;;
  410. hppa*-hp-hpux*)
  411. AC_DEFINE([XP_UNIX], [1], [UNIX])
  412. AC_DEFINE([hpux], [1], [HP-UX])
  413. AC_DEFINE([HPUX], [1], [HP-UX])
  414. AC_DEFINE([HPUX11], [1], [HP-UX 11])
  415. AC_DEFINE([HPUX11_11], [1], [HP-UX 11.11])
  416. AC_DEFINE([CPU_hppa], [], [cpu type pa-risc])
  417. AC_DEFINE([OS_hpux], [1], [OS HP-UX])
  418. AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
  419. AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
  420. AC_DEFINE([_INCLUDE_STDC__SOURCE_199901], [1], [to pick up all of the printf format macros in inttypes.h])
  421. AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
  422. # assume 64 bit
  423. initconfigdir="/$PACKAGE_NAME/config"
  424. perlexec='/opt/perl_64/bin/perl'
  425. platform="hpux"
  426. # HPUX doesn't use /etc for this
  427. initdir=/init.d
  428. ;;
  429. sparc-sun-solaris*)
  430. AC_DEFINE([XP_UNIX], [1], [UNIX])
  431. AC_DEFINE([SVR4], [1], [SVR4])
  432. AC_DEFINE([__svr4], [1], [SVR4])
  433. AC_DEFINE([__svr4__], [1], [SVR4])
  434. AC_DEFINE([_SVID_GETTOD], [1], [SVID_GETTOD])
  435. AC_DEFINE([SOLARIS], [1], [SOLARIS])
  436. AC_DEFINE([CPU_sparc], [], [cpu type sparc])
  437. AC_DEFINE([OS_solaris], [1], [OS SOLARIS])
  438. AC_DEFINE([sunos5], [1], [SunOS5])
  439. AC_DEFINE([OSVERSION], [509], [OS version])
  440. AC_DEFINE([_REENTRANT], [1], [_REENTRANT])
  441. AC_DEFINE([NO_DOMAINNAME], [1], [no getdomainname])
  442. AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
  443. dnl socket nsl and dl are required to link several programs and libdb
  444. LIBSOCKET=-lsocket
  445. AC_SUBST([LIBSOCKET], [$LIBSOCKET])
  446. LIBNSL=-lnsl
  447. AC_SUBST([LIBNSL], [$LIBNSL])
  448. LIBDL=-ldl
  449. AC_SUBST([LIBDL], [$LIBDL])
  450. dnl Cstd and Crun are required to link any C++ related code
  451. LIBCSTD=-lCstd
  452. AC_SUBST([LIBCSTD], [$LIBCSTD])
  453. LIBCRUN=-lCrun
  454. AC_SUBST([LIBCRUN], [$LIBCRUN])
  455. platform="solaris"
  456. # assume 64 bit
  457. perlexec='/usr/lib/sparcv9/dirsec/perl5x/bin/perl'
  458. initdir='$(sysconfdir)/init.d'
  459. ;;
  460. *)
  461. platform=""
  462. ;;
  463. esac
  464. # cmd line overrides default setting above
  465. if test -n "$with_initddir" ; then
  466. initdir="$with_initddir"
  467. fi
  468. AC_SUBST(initdir)
  469. AC_SUBST(perlexec)
  470. AC_SUBST(sttyexec)
  471. # set default initconfigdir if not already set
  472. # value will be set so as to be relative to $(sysconfdir)
  473. if test -z "$initconfigdir" ; then
  474. if test -d /etc/sysconfig ; then
  475. initconfigdir=/sysconfig
  476. elif test -d /etc/default ; then
  477. initconfigdir=/default
  478. else
  479. initconfigdir="/$PACKAGE_NAME/config"
  480. fi
  481. fi
  482. AC_SUBST(initconfigdir)
  483. AM_CONDITIONAL(HPUX,test "$platform" = "hpux")
  484. AM_CONDITIONAL(SOLARIS,test "$platform" = "solaris")
  485. # Check for library dependencies
  486. m4_include(m4/nspr.m4)
  487. m4_include(m4/nss.m4)
  488. m4_include(m4/openldap.m4)
  489. m4_include(m4/mozldap.m4)
  490. m4_include(m4/db.m4)
  491. m4_include(m4/sasl.m4)
  492. m4_include(m4/svrcore.m4)
  493. m4_include(m4/icu.m4)
  494. m4_include(m4/netsnmp.m4)
  495. m4_include(m4/kerberos.m4)
  496. m4_include(m4/pcre.m4)
  497. m4_include(m4/selinux.m4)
  498. PACKAGE_BASE_VERSION=`echo $PACKAGE_VERSION | awk -F\. '{print $1"."$2}'`
  499. AC_SUBST(PACKAGE_BASE_VERSION)
  500. # set sasl_path for wrapper scripts
  501. if test -z "$sasl_libdir" ; then
  502. sasl_path="$libdir/sasl2"
  503. else
  504. sasl_path="$sasl_libdir/sasl2"
  505. fi
  506. AM_CONDITIONAL(SELINUX,test "$with_selinux" = "yes")
  507. AM_CONDITIONAL(OPENLDAP,test "$with_openldap" = "yes")
  508. # write out paths for binary components
  509. AC_SUBST(nspr_inc)
  510. AC_SUBST(nspr_lib)
  511. AC_SUBST(nspr_libdir)
  512. AC_SUBST(nss_inc)
  513. AC_SUBST(nss_lib)
  514. AC_SUBST(nss_libdir)
  515. AC_SUBST(ldapsdk_inc)
  516. AC_SUBST(ldapsdk_lib)
  517. AC_SUBST(ldapsdk_libdir)
  518. AC_SUBST(ldapsdk_bindir)
  519. AC_SUBST(openldap_inc)
  520. AC_SUBST(openldap_lib)
  521. AC_SUBST(openldap_libdir)
  522. AC_SUBST(openldap_bindir)
  523. AC_SUBST(ldaptool_bindir)
  524. AC_SUBST(ldaptool_opts)
  525. AC_SUBST(plainldif_opts)
  526. AC_SUBST(ol_libver)
  527. AC_SUBST(db_inc)
  528. AC_SUBST(db_incdir)
  529. AC_SUBST(db_lib)
  530. AC_SUBST(db_libdir)
  531. AC_SUBST(db_bindir)
  532. AC_SUBST(db_libver)
  533. AC_SUBST(sasl_inc)
  534. AC_SUBST(sasl_lib)
  535. AC_SUBST(sasl_libdir)
  536. AC_SUBST(sasl_path)
  537. AC_SUBST(svrcore_inc)
  538. AC_SUBST(svrcore_lib)
  539. AC_SUBST(icu_lib)
  540. AC_SUBST(icu_inc)
  541. AC_SUBST(icu_bin)
  542. AC_SUBST(netsnmp_inc)
  543. AC_SUBST(netsnmp_lib)
  544. AC_SUBST(netsnmp_libdir)
  545. AC_SUBST(netsnmp_link)
  546. AC_SUBST(pcre_inc)
  547. AC_SUBST(pcre_lib)
  548. AC_SUBST(pcre_libdir)
  549. AC_SUBST(brand)
  550. AC_SUBST(capbrand)
  551. AC_SUBST(vendor)
  552. AC_DEFINE([LDAP_DEBUG], [1], [LDAP debug flag])
  553. AC_DEFINE([LDAP_DONT_USE_SMARTHEAP], [1], [Don't use smartheap])
  554. # libtool on fedora/rhel contains some gcc-isms which cause problems
  555. # if not using gcc (e.g. Forte on Solaris, aCC on HP-UX)
  556. # we remove them here
  557. if test "$GCC" != yes ; then
  558. AC_MSG_NOTICE([Not using gcc - fixing libtool to remove gcc-isms . . .])
  559. cp -p libtool libtool.orig
  560. cp -p libtool libtool.tmp
  561. # dnl note the special chars @<:@ and @:>@ - since m4 treats [ and ] specially,
  562. # we have to use the quadrigraph @<:@ for [ and @:>@ for ] - and you thought
  563. # perl produced write-only code . . .
  564. sed -e '/^gcc_dir/ d' \
  565. -e '/^gcc_ver/ d' \
  566. -e 's/^predep_objects=.*echo \("@<:@^"@:>@*"\).*$/predep_objects=\1/' \
  567. -e 's/^postdep_objects=.*echo \("@<:@^"@:>@*"\).*$/postdep_objects=\1/' \
  568. -e 's/^compiler_lib_search_path=.*echo \("@<:@^"@:>@*"\).*$/compiler_lib_search_path=\1/' \
  569. -e 's/^sys_lib_search_path_spec=.*echo \("@<:@^"@:>@*"\).*$/sys_lib_search_path_spec=\1/' \
  570. libtool > libtool.tmp
  571. cp -p libtool.tmp libtool
  572. rm -f libtool.tmp
  573. fi
  574. AC_CONFIG_FILES([Makefile])
  575. AC_OUTPUT