configure.ac 24 KB

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