configure.ac 24 KB

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