configure.ac 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  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 tar-pax])
  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([RPM_VERSION])
  21. AC_SUBST([RPM_RELEASE])
  22. AC_SUBST([CONSOLE_VERSION])
  23. AM_MAINTAINER_MODE
  24. AC_CANONICAL_HOST
  25. # Checks for programs.
  26. AC_PROG_CXX
  27. AC_PROG_CC
  28. AM_PROG_CC_C_O
  29. AM_PROG_AS
  30. # disable static libs by default - we only use a couple
  31. AC_DISABLE_STATIC
  32. AC_PROG_LIBTOOL
  33. # Checks for header files.
  34. AC_HEADER_DIRENT
  35. AC_HEADER_STDC
  36. AC_HEADER_SYS_WAIT
  37. 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 mntent.h])
  38. # Checks for typedefs, structures, and compiler characteristics.
  39. AC_HEADER_STAT
  40. AC_C_CONST
  41. AC_HEADER_STDBOOL
  42. AC_TYPE_UID_T
  43. AC_TYPE_PID_T
  44. AC_TYPE_SIZE_T
  45. AC_HEADER_TIME
  46. AC_STRUCT_TM
  47. # Checks for library functions.
  48. AC_FUNC_CHOWN
  49. AC_FUNC_CLOSEDIR_VOID
  50. AC_FUNC_ERROR_AT_LINE
  51. AC_FUNC_FORK
  52. AC_FUNC_LSTAT
  53. AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
  54. AC_FUNC_MALLOC
  55. AC_FUNC_MEMCMP
  56. AC_FUNC_MMAP
  57. AC_TYPE_SIGNAL
  58. AC_FUNC_STAT
  59. AC_FUNC_STRERROR_R
  60. AC_FUNC_STRFTIME
  61. AC_FUNC_VPRINTF
  62. 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])
  63. AC_MSG_CHECKING(for --enable-debug)
  64. AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debug features (default: no)]),
  65. [
  66. AC_MSG_RESULT(yes)
  67. debug_defs="-DDEBUG -DMCC_DEBUG"
  68. ],
  69. [
  70. AC_MSG_RESULT(no)
  71. debug_defs=""
  72. ])
  73. AC_SUBST([debug_defs])
  74. # Used for legacy style packaging where we bundle all of the dependencies.
  75. AC_MSG_CHECKING(for --enable-bundle)
  76. AC_ARG_ENABLE(bundle, AS_HELP_STRING([--enable-bundle], [Enable bundled dependencies (default: no)]),
  77. [
  78. AC_MSG_RESULT(yes)
  79. bundle="1";
  80. ],
  81. [
  82. AC_MSG_RESULT(no)
  83. bundle="";
  84. ])
  85. AM_CONDITIONAL(BUNDLE,test "$bundle" = "1")
  86. # these enables are for optional or experimental features
  87. if test -z "$enable_pam_passthru" ; then
  88. enable_pam_passthru=yes # if not set on cmdline, set default
  89. fi
  90. AC_MSG_CHECKING(for --enable-pam-passthru)
  91. AC_ARG_ENABLE(pam-passthru,
  92. AS_HELP_STRING([--enable-pam-passthru],
  93. [enable the PAM passthrough auth plugin (default: yes)]))
  94. if test "$enable_pam_passthru" = yes ; then
  95. # check for pam header file used by plugins/pass_passthru/pam_ptimpl.c
  96. AC_CHECK_HEADER([security/pam_appl.h], [], [AC_MSG_ERROR([Missing header file security/pam_appl.h])])
  97. AC_MSG_RESULT(yes)
  98. AC_DEFINE([ENABLE_PAM_PASSTHRU], [1], [enable the pam passthru auth plugin])
  99. else
  100. AC_MSG_RESULT(no)
  101. fi
  102. AM_CONDITIONAL(enable_pam_passthru,test "$enable_pam_passthru" = "yes")
  103. if test -z "$enable_dna" ; then
  104. enable_dna=yes # if not set on cmdline, set default
  105. fi
  106. AC_MSG_CHECKING(for --enable-dna)
  107. AC_ARG_ENABLE(dna,
  108. AS_HELP_STRING([--enable-dna],
  109. [enable the Distributed Numeric Assignment (DNA) plugin (default: yes)]))
  110. if test "$enable_dna" = yes ; then
  111. AC_MSG_RESULT(yes)
  112. AC_DEFINE([ENABLE_DNA], [1], [enable the dna plugin])
  113. else
  114. AC_MSG_RESULT(no)
  115. fi
  116. AM_CONDITIONAL(enable_dna,test "$enable_dna" = "yes")
  117. if test -z "$enable_ldapi" ; then
  118. enable_ldapi=yes # if not set on cmdline, set default
  119. fi
  120. AC_MSG_CHECKING(for --enable-ldapi)
  121. AC_ARG_ENABLE(ldapi,
  122. AS_HELP_STRING([--enable-ldapi],
  123. [enable LDAP over unix domain socket (LDAPI) support (default: yes)]))
  124. if test "$enable_ldapi" = yes ; then
  125. AC_MSG_RESULT(yes)
  126. AC_DEFINE([ENABLE_LDAPI], [1], [enable ldapi support in the server])
  127. else
  128. AC_MSG_RESULT(no)
  129. fi
  130. AM_CONDITIONAL(enable_ldapi,test "$enable_ldapi" = "yes")
  131. if test -z "$enable_autobind" ; then
  132. enable_autobind=no # if not set on cmdline, set default
  133. fi
  134. AC_MSG_CHECKING(for --enable-autobind)
  135. AC_ARG_ENABLE(autobind,
  136. AS_HELP_STRING([--enable-autobind],
  137. [enable auto bind over unix domain socket (LDAPI) support (default: no)]))
  138. if test "$enable_ldapi" = yes -a "$enable_autobind" = yes ; then
  139. AC_MSG_RESULT(yes)
  140. AC_DEFINE([ENABLE_AUTOBIND], [1], [enable ldapi auto bind support in the server])
  141. else
  142. AC_MSG_RESULT(no)
  143. fi
  144. AM_CONDITIONAL(enable_autobind,test "$enable_autobind" = "yes")
  145. if test -z "$enable_auto_dn_suffix" ; then
  146. enable_auto_dn_suffix=no # if not set on cmdline, set default
  147. fi
  148. AC_MSG_CHECKING(for --enable-auto-dn-suffix)
  149. AC_ARG_ENABLE(autobind,
  150. AS_HELP_STRING([--enable-auto-dn-suffix],
  151. [enable auto bind with auto dn suffix over unix domain socket (LDAPI) support (default: no)]))
  152. if test "$enable_ldapi" = yes -a "$enable_autobind" = yes -a "$enable_auto_dn_suffix" = "yes"; then
  153. AC_MSG_RESULT(yes)
  154. AC_DEFINE([ENABLE_AUTO_DN_SUFFIX], [1], [enable ldapi auto bind with auto dn suffix support in the server])
  155. else
  156. AC_MSG_RESULT(no)
  157. fi
  158. AM_CONDITIONAL(enable_auto_dn_suffix,test "$enable_auto_dn_suffix" = "yes")
  159. if test -z "$enable_bitwise" ; then
  160. enable_bitwise=yes # if not set on cmdline, set default
  161. fi
  162. AC_MSG_CHECKING(for --enable-bitwise)
  163. AC_ARG_ENABLE(bitwise,
  164. AS_HELP_STRING([--enable-bitwise],
  165. [enable the bitwise matching rule plugin (default: yes)]))
  166. if test "$enable_bitwise" = yes ; then
  167. AC_MSG_RESULT(yes)
  168. AC_DEFINE([ENABLE_BITWISE], [1], [enable the bitwise plugin])
  169. else
  170. AC_MSG_RESULT(no)
  171. fi
  172. AM_CONDITIONAL(enable_bitwise,test "$enable_bitwise" = "yes")
  173. if test -z "$enable_presence" ; then
  174. enable_presence=no # if not set on cmdline, set default
  175. fi
  176. AC_MSG_CHECKING(for --enable-presence)
  177. AC_ARG_ENABLE(presence,
  178. AS_HELP_STRING([--enable-presence],
  179. [enable the presence plugin (default: no)]))
  180. if test "$enable_presence" = yes ; then
  181. AC_MSG_RESULT(yes)
  182. AC_DEFINE([ENABLE_PRESENCE], [1], [enable the presence plugin])
  183. else
  184. AC_MSG_RESULT(no)
  185. fi
  186. AM_CONDITIONAL(enable_presence,test "$enable_presence" = "yes")
  187. if test -z "$enable_acctpolicy" ; then
  188. enable_acctpolicy=yes # if not set on cmdline, set default
  189. fi
  190. AC_MSG_CHECKING(for --enable-acctpolicy)
  191. AC_ARG_ENABLE(acctpolicy,
  192. AS_HELP_STRING([--enable-acctpolicy],
  193. [enable the account policy plugin (default: yes)]))
  194. if test "$enable_acctpolicy" = yes ; then
  195. AC_MSG_RESULT(yes)
  196. AC_DEFINE([ENABLE_ACCTPOLICY], [1], [enable the account policy plugin])
  197. else
  198. AC_MSG_RESULT(no)
  199. fi
  200. AM_CONDITIONAL(enable_acctpolicy,test "$enable_acctpolicy" = "yes")
  201. if test -z "$enable_posix_winsync" ; then
  202. enable_posix_winsync=yes # if not set on cmdline, set default
  203. fi
  204. AC_MSG_CHECKING(for --enable-posix-winsync)
  205. AC_ARG_ENABLE(posix_winsync,
  206. AS_HELP_STRING([--enable-posix-winsync],
  207. [enable support for POSIX user/group attributes in winsync (default: yes)]))
  208. if test "$enable_posix_winsync" = yes ; then
  209. AC_MSG_RESULT(yes)
  210. AC_DEFINE([ENABLE_POSIX_WINSYNC], [1], [enable support for POSIX user/group attributes in winsync])
  211. else
  212. AC_MSG_RESULT(no)
  213. fi
  214. AM_CONDITIONAL(enable_posix_winsync,test "$enable_posix_winsync" = "yes")
  215. AC_MSG_CHECKING(for --enable-nunc-stans)
  216. AC_ARG_ENABLE(nunc_stans,
  217. AS_HELP_STRING([--enable-nunc-stans],
  218. [enable support for nunc-stans event framework (default: no)]))
  219. if test "$enable_nunc_stans" = yes ; then
  220. AC_MSG_RESULT(yes)
  221. AC_DEFINE([ENABLE_NUNC_STANS], [1], [enable support for nunc-stans event framework])
  222. else
  223. AC_MSG_RESULT(no)
  224. fi
  225. AM_CONDITIONAL(enable_nunc_stans,test "$enable_nunc_stans" = "yes")
  226. # the default prefix - override with --prefix or --with-fhs
  227. AC_PREFIX_DEFAULT([/opt/$PACKAGE_NAME])
  228. m4_include(m4/fhs.m4)
  229. localrundir='/run'
  230. # installation paths - by default, we store everything
  231. # under the prefix. The with-fhs option will use /usr,
  232. # /etc, and /var. The with-fhs-opt option will use the
  233. # prefix, but it's sysconfdir and localstatedir will be
  234. # /etc/opt, and /var/opt.
  235. if test "$with_fhs_opt" = "yes"; then
  236. # Override sysconfdir and localstatedir if FHS optional
  237. # package was requested.
  238. sysconfdir='/etc/opt'
  239. localstatedir='/var/opt'
  240. localrundir='/var/opt/run'
  241. # relative to datadir
  242. sampledatadir=/data
  243. # relative to datadir
  244. scripttemplatedir=/script-templates
  245. # relative to datadir
  246. updatedir=/updates
  247. # relative to libdir
  248. serverdir=
  249. # relative to includedir
  250. serverincdir=
  251. # relative to libdir
  252. serverplugindir=/plugins
  253. # relative to datadir
  254. infdir=/inf
  255. # relative to datadir
  256. mibdir=/mibs
  257. # location of property/resource files, relative to datadir
  258. propertydir=/properties
  259. # relative to libdir
  260. perldir=/perl
  261. # relative to libdir
  262. pythondir=/python
  263. else
  264. if test "$with_fhs" = "yes"; then
  265. ac_default_prefix=/usr
  266. prefix=$ac_default_prefix
  267. exec_prefix=$prefix
  268. dnl as opposed to the default /usr/etc
  269. sysconfdir='/etc'
  270. dnl as opposed to the default /usr/var
  271. localstatedir='/var'
  272. localrundir='/run'
  273. fi
  274. # relative to datadir
  275. sampledatadir=/$PACKAGE_NAME/data
  276. # relative to datadir
  277. scripttemplatedir=/$PACKAGE_NAME/script-templates
  278. # relative to datadir
  279. updatedir=/$PACKAGE_NAME/updates
  280. # relative to libdir
  281. serverdir=/$PACKAGE_NAME
  282. # relative to includedir
  283. serverincdir=/$PACKAGE_NAME
  284. # relative to libdir
  285. serverplugindir=/$PACKAGE_NAME/plugins
  286. # relative to datadir
  287. infdir=/$PACKAGE_NAME/inf
  288. # relative to datadir
  289. mibdir=/$PACKAGE_NAME/mibs
  290. # location of property/resource files, relative to datadir
  291. propertydir=/$PACKAGE_NAME/properties
  292. # relative to libdir
  293. perldir=/$PACKAGE_NAME/perl
  294. # relative to libdir
  295. pythondir=/$PACKAGE_NAME/python
  296. fi
  297. # if mandir is the default value, override it
  298. # otherwise, the user must have set it - just use it
  299. if test X"$mandir" = X'${prefix}/man' ; then
  300. mandir='$(datadir)/man'
  301. fi
  302. # Shared paths for all layouts
  303. # relative to sysconfdir
  304. configdir=/$PACKAGE_NAME/config
  305. # relative to sysconfdir
  306. schemadir=/$PACKAGE_NAME/schema
  307. # default user, group
  308. defaultuser=dirsrv
  309. defaultgroup=dirsrv
  310. if test -z "$with_tmpfiles_d" ; then
  311. if test -d $sysconfdir/tmpfiles.d ; then
  312. with_tmpfiles_d='$(sysconfdir)/tmpfiles.d'
  313. fi
  314. fi
  315. AC_MSG_CHECKING(for --with-tmpfiles-d)
  316. AC_ARG_WITH(tmpfiles-d,
  317. AS_HELP_STRING([--with-tmpfiles-d=PATH],
  318. [system uses tmpfiles.d to handle temp files/dirs (default: $with_tmpfiles_d)])
  319. )
  320. if test "$with_tmpfiles_d" = yes ; then
  321. AC_MSG_ERROR([You must specify --with-tmpfiles-d=/full/path/to/tmpfiles.d directory])
  322. elif test "$with_tmpfiles_d" = no ; then
  323. with_tmpfiles_d=
  324. else
  325. AC_MSG_RESULT([$with_tmpfiles_d])
  326. fi
  327. AC_SUBST(with_tmpfiles_d)
  328. PKG_PROG_PKG_CONFIG
  329. if test -n "$PKG_CONFIG" ; then
  330. default_systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd`
  331. default_systemdsystemconfdir=`$PKG_CONFIG --variable=systemdsystemconfdir systemd`
  332. fi
  333. AC_MSG_CHECKING(for --with-perldir)
  334. AC_ARG_WITH([perldir],
  335. AS_HELP_STRING([--with-perldir=PATH],
  336. [Directory for perl)])
  337. )
  338. if test -n "$with_perldir"; then
  339. if test "$with_perldir" = yes ; then
  340. AC_MSG_ERROR([You must specify --with-perldir=/full/path/to/perl])
  341. elif test "$with_perldir" = no ; then
  342. with_perldir=
  343. else
  344. AC_MSG_RESULT([$with_perldir])
  345. fi
  346. else
  347. with_perldir=
  348. fi
  349. AC_MSG_CHECKING(for --with-pythondir)
  350. AC_ARG_WITH([pythondir],
  351. AS_HELP_STRING([--with-pythondir=PATH],
  352. [Directory for python)])
  353. )
  354. if test -n "$with_pythondir"; then
  355. if test "$with_pythondir" = yes ; then
  356. AC_MSG_ERROR([You must specify --with-pythondir=/full/path/to/python])
  357. elif test "$with_pythondir" = no ; then
  358. with_pythondir=
  359. else
  360. AC_MSG_RESULT([$with_pythondir])
  361. fi
  362. else
  363. with_pythondir=
  364. fi
  365. AC_MSG_CHECKING(for --with-systemdsystemunitdir)
  366. AC_ARG_WITH([systemdsystemunitdir],
  367. AS_HELP_STRING([--with-systemdsystemunitdir=PATH],
  368. [Directory for systemd service files (default: $with_systemdsystemunitdir)])
  369. )
  370. if test "$with_systemdsystemunitdir" = yes ; then
  371. if test -n "$default_systemdsystemunitdir" ; then
  372. with_systemdsystemunitdir=$default_systemdsystemunitdir
  373. AC_MSG_RESULT([$with_systemdsystemunitdir])
  374. else
  375. AC_MSG_ERROR([You must specify --with-systemdsystemconfdir=/full/path/to/systemd/system directory])
  376. fi
  377. elif test "$with_systemdsystemunitdir" = no ; then
  378. with_systemdsystemunitdir=
  379. else
  380. AC_MSG_RESULT([$with_systemdsystemunitdir])
  381. fi
  382. AC_SUBST(with_systemdsystemunitdir)
  383. AC_MSG_CHECKING(for --with-systemdsystemconfdir)
  384. AC_ARG_WITH([systemdsystemconfdir],
  385. AS_HELP_STRING([--with-systemdsystemconfdir=PATH],
  386. [Directory for systemd service files (default: $with_systemdsystemconfdir)])
  387. )
  388. if test "$with_systemdsystemconfdir" = yes ; then
  389. if test -n "$default_systemdsystemconfdir" ; then
  390. with_systemdsystemconfdir=$default_systemdsystemconfdir
  391. AC_MSG_RESULT([$with_systemdsystemconfdir])
  392. else
  393. AC_MSG_ERROR([You must specify --with-systemdsystemconfdir=/full/path/to/systemd/system directory])
  394. fi
  395. elif test "$with_systemdsystemconfdir" = no ; then
  396. with_systemdsystemconfdir=
  397. else
  398. AC_MSG_RESULT([$with_systemdsystemconfdir])
  399. fi
  400. AC_SUBST(with_systemdsystemconfdir)
  401. if test -n "$with_systemdsystemunitdir" -o -n "$with_systemdsystemconfdir" ; then
  402. if test -z "$with_systemdgroupname" ; then
  403. with_systemdgroupname=$PACKAGE_NAME.target
  404. fi
  405. AC_MSG_CHECKING(for --with-systemdgroupname)
  406. AC_ARG_WITH([systemdgroupname],
  407. AS_HELP_STRING([--with-systemdgroupname=NAME],
  408. [Name of group target for all instances (default: $with_systemdgroupname)])
  409. )
  410. if test "$with_systemdgroupname" = yes ; then
  411. AC_MSG_ERROR([You must specify --with-systemdgroupname=name.of.group])
  412. elif test "$with_systemdgroupname" = no ; then
  413. AC_MSG_ERROR([You must specify --with-systemdgroupname=name.of.group])
  414. else
  415. AC_MSG_RESULT([$with_systemdgroupname])
  416. fi
  417. AC_SUBST(with_systemdgroupname)
  418. fi
  419. AC_SUBST(configdir)
  420. AC_SUBST(sampledatadir)
  421. AC_SUBST(propertydir)
  422. AC_SUBST(schemadir)
  423. AC_SUBST(serverdir)
  424. AC_SUBST(serverincdir)
  425. AC_SUBST(serverplugindir)
  426. AC_SUBST(scripttemplatedir)
  427. AC_SUBST(perldir)
  428. AC_SUBST(pythondir)
  429. AC_SUBST(infdir)
  430. AC_SUBST(mibdir)
  431. AC_SUBST(mandir)
  432. AC_SUBST(updatedir)
  433. AC_SUBST(defaultuser)
  434. AC_SUBST(defaultgroup)
  435. # check for --with-instconfigdir
  436. AC_MSG_CHECKING(for --with-instconfigdir)
  437. AC_ARG_WITH(instconfigdir,
  438. AS_HELP_STRING([--with-instconfigdir=/path],
  439. [Base directory for instance specific writable configuration directories (default $sysconfdir/$PACKAGE_NAME)]),
  440. [
  441. if test $withval = yes ; then
  442. AC_ERROR([Please specify a full path with --with-instconfigdir])
  443. fi
  444. instconfigdir="$withval"
  445. AC_MSG_RESULT($withval)
  446. ],
  447. [
  448. dnl this value is expanded out in Makefile.am
  449. instconfigdir='$(sysconfdir)/$(PACKAGE_NAME)'
  450. AC_MSG_RESULT(no)
  451. ])
  452. AC_SUBST(instconfigdir)
  453. # WINNT should be true if building on Windows system not using
  454. # cygnus, mingw, or the like and using cmd.exe as the shell
  455. AM_CONDITIONAL([WINNT], false)
  456. # Deal with platform dependent defines
  457. # initdir is the location for the SysV init scripts - very heavily platform
  458. # dependent and not specified in fhs or lsb
  459. # and not used if systemd is used
  460. initdir='$(sysconfdir)/rc.d'
  461. AC_MSG_CHECKING(for --with-initddir)
  462. AC_ARG_WITH(initddir,
  463. AS_HELP_STRING([--with-initddir=/path],
  464. [Absolute path (not relative like some of the other options) that should contain the SysV init scripts (default '$(sysconfdir)/rc.d')]),
  465. [
  466. if test "$withval" = yes -o "$withval" = no ; then
  467. AC_ERROR([Please specify a full path with --with-initddir])
  468. fi
  469. AC_MSG_RESULT($withval)
  470. ],
  471. [
  472. AC_MSG_RESULT(no)
  473. ])
  474. # on most platforms, we will just use perl from PATH
  475. # On some platforms, we cannot. Why not just use any old
  476. # perl? Because of perldap. We use a perldap that is
  477. # compiled to either 32bit or 64bit, so we must use a native
  478. # perl binary compiled with the same bitsize. On Solaris
  479. # and HP-UX, /usr/bin/perl is 32 bit, so we cannot use
  480. # those with our 64 bit compiled product.
  481. if test -n "$with_perldir"; then
  482. perlexec="$with_perldir/perl"
  483. else
  484. perlexec='/usr/bin/env perl'
  485. fi
  486. # we use stty in perl scripts to disable password echo
  487. # this doesn't work unless the full absolute path of the
  488. # stty command is used e.g. system("stty -echo") does not
  489. # work but system("/bin/stty -echo") does work
  490. # since the path of stty may not be the same on all
  491. # platforms, we set the default here to /bin/stty and
  492. # allow that value to be overridden in the platform
  493. # specific section below
  494. sttyexec=/bin/stty
  495. case $host in
  496. *-*-linux*)
  497. AC_DEFINE([Linux], [1], [Linux])
  498. AC_DEFINE([LINUX], [1], [Linux])
  499. AC_DEFINE([LINUX2_0], [1], [Linux 2.0])
  500. AC_DEFINE([LINUX2_2], [1], [Linux 2.2])
  501. AC_DEFINE([LINUX2_4], [1], [Linux 2.4])
  502. AC_DEFINE([_GNU_SOURCE], [1], [GNU Source])
  503. platform="linux"
  504. initdir='$(sysconfdir)/rc.d/init.d'
  505. # do arch specific linux stuff here
  506. case $host in
  507. i*86-*-linux*)
  508. AC_DEFINE([CPU_x86], [], [cpu type x86])
  509. AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
  510. ;;
  511. x86_64-*-linux*)
  512. AC_DEFINE([CPU_x86_64], [], [cpu type x86_64])
  513. AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
  514. ;;
  515. aarch64-*-linux*)
  516. AC_DEFINE([CPU_arm], [], [cpu type arm])
  517. ;;
  518. arm*-linux*)
  519. AC_DEFINE([CPU_arm], [], [cpu type arm])
  520. ;;
  521. esac
  522. AC_MSG_CHECKING([for GCC provided 64-bit atomic bool cas function ...])
  523. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
  524. [[long long ptrval = 0, val = 0, newval = 1; (void)__sync_bool_compare_and_swap_8(&ptrval, val, newval);]])],
  525. [AC_DEFINE([HAVE_64BIT_ATOMIC_CAS_FUNC], [1], [have 64-bit atomic bool compare and swap function provided by gcc])AC_MSG_RESULT([yes])],
  526. [AC_MSG_RESULT([no])])
  527. AC_MSG_CHECKING([for GCC provided 64-bit atomic ops functions ...])
  528. AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
  529. [[long long ptrval = 0, val = 0; (void)__sync_add_and_fetch_8(&ptrval, val);]])],
  530. [AC_DEFINE([HAVE_64BIT_ATOMIC_OP_FUNCS], [1], [have 64-bit atomic operation functions provided by gcc])AC_MSG_RESULT([yes])],
  531. [AC_MSG_RESULT([no])])
  532. # some programs use the native thread library directly
  533. THREADLIB=-lpthread
  534. AC_SUBST([THREADLIB], [$THREADLIB])
  535. LIBCRYPT=-lcrypt
  536. AC_SUBST([LIBCRYPT], [$LIBCRYPT])
  537. AC_DEFINE([USE_POSIX_RWLOCKS], [1], [POSIX rwlocks])
  538. ;;
  539. ia64-hp-hpux*)
  540. AC_DEFINE([hpux], [1], [HP-UX])
  541. AC_DEFINE([HPUX], [1], [HP-UX])
  542. AC_DEFINE([HPUX11], [1], [HP-UX 11])
  543. AC_DEFINE([HPUX11_23], [1], [HP-UX 11.23])
  544. AC_DEFINE([CPU_ia64], [], [cpu type ia64])
  545. AC_DEFINE([OS_hpux], [1], [OS HP-UX])
  546. AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
  547. AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
  548. AC_DEFINE([_INCLUDE_STDC__SOURCE_199901], [1], [to pick up all of the printf format macros in inttypes.h])
  549. # assume 64 bit
  550. perlexec='/opt/perl_64/bin/perl'
  551. platform="hpux"
  552. initconfigdir="/$PACKAGE_NAME/config"
  553. # HPUX doesn't use /etc for this
  554. initdir=/init.d
  555. ;;
  556. hppa*-hp-hpux*)
  557. AC_DEFINE([hpux], [1], [HP-UX])
  558. AC_DEFINE([HPUX], [1], [HP-UX])
  559. AC_DEFINE([HPUX11], [1], [HP-UX 11])
  560. AC_DEFINE([HPUX11_11], [1], [HP-UX 11.11])
  561. AC_DEFINE([CPU_hppa], [], [cpu type pa-risc])
  562. AC_DEFINE([OS_hpux], [1], [OS HP-UX])
  563. AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
  564. AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
  565. AC_DEFINE([_INCLUDE_STDC__SOURCE_199901], [1], [to pick up all of the printf format macros in inttypes.h])
  566. AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
  567. # assume 64 bit
  568. initconfigdir="/$PACKAGE_NAME/config"
  569. perlexec='/opt/perl_64/bin/perl'
  570. platform="hpux"
  571. # HPUX doesn't use /etc for this
  572. initdir=/init.d
  573. ;;
  574. *-*-solaris*)
  575. AC_DEFINE([SVR4], [1], [SVR4])
  576. AC_DEFINE([__svr4], [1], [SVR4])
  577. AC_DEFINE([__svr4__], [1], [SVR4])
  578. AC_DEFINE([_SVID_GETTOD], [1], [SVID_GETTOD])
  579. AC_DEFINE([SOLARIS], [1], [SOLARIS])
  580. AC_DEFINE([OS_solaris], [1], [OS SOLARIS])
  581. AC_DEFINE([sunos5], [1], [SunOS5])
  582. AC_DEFINE([OSVERSION], [509], [OS version])
  583. AC_DEFINE([_REENTRANT], [1], [_REENTRANT])
  584. AC_DEFINE([NO_DOMAINNAME], [1], [no getdomainname])
  585. dnl socket nsl and dl are required to link several programs and libdb
  586. LIBSOCKET=-lsocket
  587. AC_SUBST([LIBSOCKET], [$LIBSOCKET])
  588. LIBNSL=-lnsl
  589. AC_SUBST([LIBNSL], [$LIBNSL])
  590. LIBDL=-ldl
  591. AC_SUBST([LIBDL], [$LIBDL])
  592. dnl Cstd and Crun are required to link any C++ related code
  593. LIBCSTD=-lCstd
  594. AC_SUBST([LIBCSTD], [$LIBCSTD])
  595. LIBCRUN=-lCrun
  596. AC_SUBST([LIBCRUN], [$LIBCRUN])
  597. platform="solaris"
  598. initdir='$(sysconfdir)/init.d'
  599. case $host in
  600. i?86-*-solaris2.1[[0-9]]*)
  601. dnl I dont know why i386 need this explicit
  602. AC_DEFINE([HAVE_GETPEERUCRED], [1], [have getpeerucred])
  603. ;;
  604. sparc-*-solaris*)
  605. dnl includes some assembler stuff in counter.o
  606. AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
  607. AC_DEFINE([CPU_sparc], [], [cpu type sparc])
  608. TARGET='SPARC'
  609. ;;
  610. esac
  611. ;;
  612. *)
  613. platform=""
  614. ;;
  615. esac
  616. # cmd line overrides default setting above
  617. if test -n "$with_initddir" ; then
  618. initdir="$with_initddir"
  619. fi
  620. # sysv init scripts not used when systemd is used
  621. AC_SUBST(initdir)
  622. AC_SUBST(perlexec)
  623. AC_SUBST(sttyexec)
  624. # set default initconfigdir if not already set
  625. # value will be set so as to be relative to $(sysconfdir)
  626. if test -z "$initconfigdir" ; then
  627. if test -d /etc/sysconfig ; then
  628. initconfigdir=/sysconfig
  629. elif test -d /etc/default ; then
  630. initconfigdir=/default
  631. else
  632. initconfigdir="/$PACKAGE_NAME/config"
  633. fi
  634. fi
  635. AC_SUBST(initconfigdir)
  636. AM_CONDITIONAL([HPUX],[test "$platform" = "hpux"])
  637. AM_CONDITIONAL([SOLARIS],[test "$platform" = "solaris"])
  638. AM_CONDITIONAL([SYSTEMD],[test -n "$with_systemdsystemunitdir" -o -n "$with_systemdsystemconfdir"])
  639. # Check for library dependencies
  640. m4_include(m4/nspr.m4)
  641. m4_include(m4/nss.m4)
  642. m4_include(m4/openldap.m4)
  643. m4_include(m4/mozldap.m4)
  644. m4_include(m4/db.m4)
  645. m4_include(m4/sasl.m4)
  646. m4_include(m4/svrcore.m4)
  647. m4_include(m4/icu.m4)
  648. m4_include(m4/netsnmp.m4)
  649. m4_include(m4/kerberos.m4)
  650. m4_include(m4/pcre.m4)
  651. m4_include(m4/selinux.m4)
  652. m4_include(m4/nunc-stans.m4)
  653. PACKAGE_BASE_VERSION=`echo $PACKAGE_VERSION | awk -F\. '{print $1"."$2}'`
  654. AC_SUBST(PACKAGE_BASE_VERSION)
  655. # set sasl_path for wrapper scripts
  656. if test -z "$sasl_libdir" ; then
  657. sasl_path="$libdir/sasl2"
  658. else
  659. sasl_path="$sasl_libdir/sasl2"
  660. fi
  661. AM_CONDITIONAL(SELINUX,test "$with_selinux" = "yes")
  662. AM_CONDITIONAL(OPENLDAP,test "$with_openldap" = "yes")
  663. AM_CONDITIONAL(SOLARIS,test "$platform" = "solaris")
  664. AM_CONDITIONAL(SPARC,test "x$TARGET" = xSPARC)
  665. # write out paths for binary components
  666. AC_SUBST(nspr_inc)
  667. AC_SUBST(nspr_lib)
  668. AC_SUBST(nspr_libdir)
  669. AC_SUBST(nss_inc)
  670. AC_SUBST(nss_lib)
  671. AC_SUBST(nss_libdir)
  672. AC_SUBST(ldapsdk_inc)
  673. AC_SUBST(ldapsdk_lib)
  674. AC_SUBST(ldapsdk_libdir)
  675. AC_SUBST(ldapsdk_bindir)
  676. AC_SUBST(openldap_inc)
  677. AC_SUBST(openldap_lib)
  678. AC_SUBST(openldap_libdir)
  679. AC_SUBST(openldap_bindir)
  680. AC_SUBST(ldaptool_bindir)
  681. AC_SUBST(ldaptool_opts)
  682. AC_SUBST(plainldif_opts)
  683. AC_SUBST(ol_libver)
  684. AC_SUBST(db_inc)
  685. AC_SUBST(db_incdir)
  686. AC_SUBST(db_lib)
  687. AC_SUBST(db_libdir)
  688. AC_SUBST(db_bindir)
  689. AC_SUBST(db_libver)
  690. AC_SUBST(sasl_inc)
  691. AC_SUBST(sasl_lib)
  692. AC_SUBST(sasl_libdir)
  693. AC_SUBST(sasl_path)
  694. AC_SUBST(svrcore_inc)
  695. AC_SUBST(svrcore_lib)
  696. AC_SUBST(icu_lib)
  697. AC_SUBST(icu_inc)
  698. AC_SUBST(icu_bin)
  699. AC_SUBST(netsnmp_inc)
  700. AC_SUBST(netsnmp_lib)
  701. AC_SUBST(netsnmp_libdir)
  702. AC_SUBST(netsnmp_link)
  703. AC_SUBST(pcre_inc)
  704. AC_SUBST(pcre_lib)
  705. AC_SUBST(pcre_libdir)
  706. AC_SUBST(nunc_stans_inc)
  707. AC_SUBST(nunc_stans_lib)
  708. AC_SUBST(nunc_stans_libdir)
  709. AC_SUBST(localrundir)
  710. AC_SUBST(brand)
  711. AC_SUBST(capbrand)
  712. AC_SUBST(vendor)
  713. # AC_DEFINE([USE_OLD_UNHASHED], [], [Use old unhashed code])
  714. AC_DEFINE([LDAP_DEBUG], [1], [LDAP debug flag])
  715. AC_DEFINE([LDAP_DONT_USE_SMARTHEAP], [1], [Don't use smartheap])
  716. # libtool on fedora/rhel contains some gcc-isms which cause problems
  717. # if not using gcc (e.g. Forte on Solaris, aCC on HP-UX)
  718. # we remove them here
  719. if test "$GCC" != yes ; then
  720. AC_MSG_NOTICE([Not using gcc - fixing libtool to remove gcc-isms . . .])
  721. cp -p libtool libtool.orig
  722. cp -p libtool libtool.tmp
  723. # dnl note the special chars @<:@ and @:>@ - since m4 treats [ and ] specially,
  724. # we have to use the quadrigraph @<:@ for [ and @:>@ for ] - and you thought
  725. # perl produced write-only code . . .
  726. sed -e '/^gcc_dir/ d' \
  727. -e '/^gcc_ver/ d' \
  728. -e 's/^predep_objects=.*echo \("@<:@^"@:>@*"\).*$/predep_objects=\1/' \
  729. -e 's/^postdep_objects=.*echo \("@<:@^"@:>@*"\).*$/postdep_objects=\1/' \
  730. -e 's/^compiler_lib_search_path=.*echo \("@<:@^"@:>@*"\).*$/compiler_lib_search_path=\1/' \
  731. -e 's/^sys_lib_search_path_spec=.*echo \("@<:@^"@:>@*"\).*$/sys_lib_search_path_spec=\1/' \
  732. libtool > libtool.tmp
  733. cp -p libtool.tmp libtool
  734. rm -f libtool.tmp
  735. fi
  736. AC_CONFIG_FILES([Makefile rpm/389-ds-base.spec])
  737. AC_OUTPUT