configure.ac 24 KB

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