configure.ac 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. AC_PREREQ(2.59)
  4. # This version is the version returned by ns-slapd -v
  5. AC_INIT([fedora-ds], [1.1.0a4], [http://bugzilla.redhat.com/])
  6. # AC_CONFIG_HEADER must be called right after AC_INIT.
  7. AC_CONFIG_HEADERS([config.h])
  8. AM_INIT_AUTOMAKE([1.9 foreign subdir-objects])
  9. AM_MAINTAINER_MODE
  10. AC_CANONICAL_HOST
  11. # Checks for programs.
  12. AC_PROG_CXX
  13. AC_PROG_CC
  14. AM_PROG_CC_C_O
  15. # disable static libs by default - we only use a couple
  16. AC_DISABLE_STATIC
  17. AC_PROG_LIBTOOL
  18. # Checks for header files.
  19. AC_HEADER_DIRENT
  20. AC_HEADER_STDC
  21. AC_HEADER_SYS_WAIT
  22. 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])
  23. # Checks for typedefs, structures, and compiler characteristics.
  24. AC_HEADER_STAT
  25. AC_C_CONST
  26. AC_HEADER_STDBOOL
  27. AC_TYPE_UID_T
  28. AC_TYPE_PID_T
  29. AC_TYPE_SIZE_T
  30. AC_HEADER_TIME
  31. AC_STRUCT_TM
  32. # Checks for library functions.
  33. AC_FUNC_CHOWN
  34. AC_FUNC_CLOSEDIR_VOID
  35. AC_FUNC_ERROR_AT_LINE
  36. AC_FUNC_FORK
  37. AC_FUNC_LSTAT
  38. AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
  39. AC_FUNC_MALLOC
  40. AC_FUNC_MEMCMP
  41. AC_FUNC_MMAP
  42. AC_TYPE_SIGNAL
  43. AC_FUNC_STAT
  44. AC_FUNC_STRERROR_R
  45. AC_FUNC_STRFTIME
  46. AC_FUNC_VPRINTF
  47. 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])
  48. AC_MSG_CHECKING(for --enable-debug)
  49. AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debug features (default: no)]),
  50. [
  51. AC_MSG_RESULT(yes)
  52. debug_defs="-DDEBUG -DMCC_DEBUG"
  53. ],
  54. [
  55. AC_MSG_RESULT(no)
  56. debug_defs=""
  57. ])
  58. AC_SUBST([debug_defs])
  59. # Used for legacy style packaging where we bundle all of the dependencies.
  60. AC_MSG_CHECKING(for --enable-bundle)
  61. AC_ARG_ENABLE(bundle, AS_HELP_STRING([--enable-bundle], [Enable bundled dependencies (default: no)]),
  62. [
  63. AC_MSG_RESULT(yes)
  64. bundle="1";
  65. ],
  66. [
  67. AC_MSG_RESULT(no)
  68. bundle="";
  69. ])
  70. AM_CONDITIONAL(BUNDLE,test "$bundle" = "1")
  71. # these enables are for optional or experimental features
  72. if test -z "$enable_pam_passthru" ; then
  73. enable_pam_passthru=yes # if not set on cmdline, set default
  74. fi
  75. AC_MSG_CHECKING(for --enable-pam-passthru)
  76. AC_ARG_ENABLE(pam-passthru,
  77. AS_HELP_STRING([--enable-pam-passthru],
  78. [enable the PAM passthrough auth plugin (default: yes)]))
  79. if test "$enable_pam_passthru" = yes ; then
  80. AC_MSG_RESULT(yes)
  81. AC_DEFINE([ENABLE_PAM_PASSTHRU], [1], [enable the pam passthru auth plugin])
  82. else
  83. AC_MSG_RESULT(no)
  84. fi
  85. AM_CONDITIONAL(enable_pam_passthru,test "$enable_pam_passthru" = "yes")
  86. if test -z "$enable_dna" ; then
  87. enable_dna=yes # if not set on cmdline, set default
  88. fi
  89. AC_MSG_CHECKING(for --enable-dna)
  90. AC_ARG_ENABLE(dna,
  91. AS_HELP_STRING([--enable-dna],
  92. [enable the Distributed Numeric Assignment (DNA) plugin (default: yes)]))
  93. if test "$enable_dna" = yes ; then
  94. AC_MSG_RESULT(yes)
  95. AC_DEFINE([ENABLE_DNA], [1], [enable the dna plugin])
  96. else
  97. AC_MSG_RESULT(no)
  98. fi
  99. AM_CONDITIONAL(enable_dna,test "$enable_dna" = "yes")
  100. if test -z "$enable_ldapi" ; then
  101. enable_ldapi=yes # if not set on cmdline, set default
  102. fi
  103. AC_MSG_CHECKING(for --enable-ldapi)
  104. AC_ARG_ENABLE(ldapi,
  105. AS_HELP_STRING([--enable-ldapi],
  106. [enable LDAP over unix domain socket (LDAPI) support (default: yes)]))
  107. if test "$enable_ldapi" = yes ; then
  108. AC_MSG_RESULT(yes)
  109. AC_DEFINE([ENABLE_LDAPI], [1], [enable ldapi support in the server])
  110. else
  111. AC_MSG_RESULT(no)
  112. fi
  113. AM_CONDITIONAL(enable_ldapi,test "$enable_ldapi" = "yes")
  114. if test -z "$enable_bitwise" ; then
  115. enable_bitwise=yes # if not set on cmdline, set default
  116. fi
  117. AC_MSG_CHECKING(for --enable-bitwise)
  118. AC_ARG_ENABLE(bitwise,
  119. AS_HELP_STRING([--enable-bitwise],
  120. [enable the bitwise matching rule plugin (default: yes)]))
  121. if test "$enable_bitwise" = yes ; then
  122. AC_MSG_RESULT(yes)
  123. AC_DEFINE([ENABLE_BITWISE], [1], [enable the bitwise plugin])
  124. else
  125. AC_MSG_RESULT(no)
  126. fi
  127. AM_CONDITIONAL(enable_bitwise,test "$enable_bitwise" = "yes")
  128. # the default prefix - override with --prefix or --with-fhs
  129. AC_PREFIX_DEFAULT([/opt/$PACKAGE_NAME])
  130. brand=fedora
  131. capbrand=Fedora
  132. vendor="Fedora Project"
  133. m4_include(m4/fhs.m4)
  134. # installation paths - by default, we store everything
  135. # under the prefix. The with-fhs option will use /usr,
  136. # /etc, and /var. The with-fhs-opt option will use the
  137. # prefix, but it's sysconfdir and localstatedir will be
  138. # /etc/opt, and /var/opt.
  139. if test "$with_fhs_opt" = "yes"; then
  140. # Override sysconfdir and localstatedir if FHS optional
  141. # package was requested.
  142. sysconfdir='/etc/opt'
  143. localstatedir='/var/opt'
  144. # relative to datadir
  145. sampledatadir=/data
  146. # relative to datadir
  147. scripttemplatedir=/script-templates
  148. # relative to libdir
  149. serverdir=
  150. # relative to libdir
  151. serverplugindir=/plugins
  152. # relative to datadir
  153. infdir=/inf
  154. else
  155. if test "$with_fhs" = "yes"; then
  156. ac_default_prefix=/usr
  157. prefix=$ac_default_prefix
  158. exec_prefix=$prefix
  159. dnl as opposed to the default /usr/etc
  160. sysconfdir='/etc'
  161. dnl as opposed to the default /usr/var
  162. localstatedir='/var'
  163. fi
  164. # relative to datadir
  165. sampledatadir=/$PACKAGE_NAME/data
  166. # relative to datadir
  167. scripttemplatedir=/$PACKAGE_NAME/script-templates
  168. # relative to libdir
  169. serverdir=/$PACKAGE_NAME
  170. # relative to libdir
  171. serverplugindir=/$PACKAGE_NAME/plugins
  172. # relative to datadir
  173. infdir=/$PACKAGE_NAME/inf
  174. fi
  175. # Shared paths for all layouts
  176. # relative to sysconfdir
  177. configdir=/$PACKAGE_NAME/config
  178. # location of property/resource files, relative to datadir
  179. propertydir=/$PACKAGE_NAME/properties
  180. # relative to sysconfdir
  181. schemadir=/$PACKAGE_NAME/schema
  182. # relative to libdir
  183. perldir=/$PACKAGE_NAME/perl
  184. # default user, group
  185. defaultuser=nobody
  186. defaultgroup=nobody
  187. AC_SUBST(configdir)
  188. AC_SUBST(sampledatadir)
  189. AC_SUBST(propertydir)
  190. AC_SUBST(schemadir)
  191. AC_SUBST(serverdir)
  192. AC_SUBST(serverplugindir)
  193. AC_SUBST(scripttemplatedir)
  194. AC_SUBST(perldir)
  195. AC_SUBST(infdir)
  196. AC_SUBST(defaultuser)
  197. AC_SUBST(defaultgroup)
  198. # check for --with-instconfigdir
  199. AC_MSG_CHECKING(for --with-instconfigdir)
  200. AC_ARG_WITH(instconfigdir,
  201. AS_HELP_STRING([--with-instconfigdir=/path],
  202. [Base directory for instance specific writable configuration directories (default $sysconfdir/$PACKAGE_NAME)]),
  203. [
  204. if test $withval = yes ; then
  205. AC_ERROR([Please specify a full path with --with-instconfigdir])
  206. fi
  207. instconfigdir="$withval"
  208. ],
  209. [
  210. dnl this value is expanded out in Makefile.am
  211. instconfigdir='$(sysconfdir)/$(PACKAGE_NAME)'
  212. ])
  213. AC_SUBST(instconfigdir)
  214. # WINNT should be true if building on Windows system not using
  215. # cygnus, mingw, or the like and using cmd.exe as the shell
  216. AM_CONDITIONAL([WINNT], false)
  217. # Deal with platform dependent defines
  218. # relative to sysconfdir
  219. initdir=/rc.d
  220. case $host in
  221. *-*-linux*)
  222. AC_DEFINE([XP_UNIX], [1], [UNIX])
  223. AC_DEFINE([Linux], [1], [Linux])
  224. AC_DEFINE([LINUX], [1], [Linux])
  225. AC_DEFINE([LINUX2_0], [1], [Linux 2.0])
  226. AC_DEFINE([LINUX2_2], [1], [Linux 2.2])
  227. AC_DEFINE([LINUX2_4], [1], [Linux 2.4])
  228. platform="linux"
  229. # relative to sysconfdir
  230. initdir=/rc.d/init.d
  231. ;;
  232. ia64-hp-hpux*)
  233. AC_DEFINE([XP_UNIX], [1], [UNIX])
  234. AC_DEFINE([hpux], [1], [HP-UX])
  235. AC_DEFINE([HPUX], [1], [HP-UX])
  236. AC_DEFINE([HPUX11], [1], [HP-UX 11])
  237. AC_DEFINE([HPUX11_23], [1], [HP-UX 11.23])
  238. AC_DEFINE([CPU_ia64], [], [cpu type ia64])
  239. AC_DEFINE([OS_hpux], [1], [OS HP-UX])
  240. AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
  241. AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
  242. platform="hpux"
  243. ;;
  244. hppa*-hp-hpux*)
  245. AC_DEFINE([XP_UNIX], [1], [UNIX])
  246. AC_DEFINE([hpux], [1], [HP-UX])
  247. AC_DEFINE([HPUX], [1], [HP-UX])
  248. AC_DEFINE([HPUX11], [1], [HP-UX 11])
  249. AC_DEFINE([HPUX11_11], [1], [HP-UX 11.11])
  250. AC_DEFINE([CPU_hppa], [], [cpu type pa-risc])
  251. AC_DEFINE([OS_hpux], [1], [OS HP-UX])
  252. AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
  253. AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
  254. platform="hpux"
  255. ;;
  256. sparc-sun-solaris*)
  257. AC_DEFINE([XP_UNIX], [1], [UNIX])
  258. AC_DEFINE([SVR4], [1], [SVR4])
  259. AC_DEFINE([__svr4], [1], [SVR4])
  260. AC_DEFINE([__svr4__], [1], [SVR4])
  261. AC_DEFINE([_SVID_GETTOD], [1], [SVID_GETTOD])
  262. AC_DEFINE([SOLARIS], [1], [SOLARIS])
  263. AC_DEFINE([CPU_sparc], [], [cpu type sparc])
  264. AC_DEFINE([OS_solaris], [1], [OS SOLARIS])
  265. AC_DEFINE([sunos5], [1], [SunOS5])
  266. AC_DEFINE([OSVERSION], [509], [OS version])
  267. AC_DEFINE([_REENTRANT], [1], [_REENTRANT])
  268. dnl socket nsl and dl are required to link several programs and libdb
  269. LIBSOCKET=-lsocket
  270. AC_SUBST([LIBSOCKET], [$LIBSOCKET])
  271. LIBNSL=-lnsl
  272. AC_SUBST([LIBNSL], [$LIBNSL])
  273. LIBDL=-ldl
  274. AC_SUBST([LIBDL], [$LIBDL])
  275. dnl Cstd and Crun are required to link any C++ related code
  276. LIBCSTD=-lCstd
  277. AC_SUBST([LIBCSTD], [$LIBCSTD])
  278. LIBCRUN=-lCrun
  279. AC_SUBST([LIBCRUN], [$LIBCRUN])
  280. platform="solaris"
  281. # relative to sysconfdir
  282. initdir=/init.d
  283. ;;
  284. *)
  285. platform=""
  286. ;;
  287. esac
  288. AC_SUBST(initdir)
  289. AM_CONDITIONAL(HPUX,test "$platform" = "hpux")
  290. AM_CONDITIONAL(SOLARIS,test "$platform" = "solaris")
  291. # Check for library dependencies
  292. m4_include(m4/nspr.m4)
  293. m4_include(m4/nss.m4)
  294. m4_include(m4/mozldap.m4)
  295. m4_include(m4/db.m4)
  296. m4_include(m4/sasl.m4)
  297. m4_include(m4/svrcore.m4)
  298. m4_include(m4/icu.m4)
  299. m4_include(m4/netsnmp.m4)
  300. PACKAGE_BASE_VERSION=`echo $PACKAGE_VERSION | awk -F\. '{print $1"."$2}'`
  301. AC_SUBST(PACKAGE_BASE_VERSION)
  302. # write out paths for binary components
  303. AC_SUBST(nspr_inc)
  304. AC_SUBST(nspr_lib)
  305. AC_SUBST(nspr_libdir)
  306. AC_SUBST(nss_inc)
  307. AC_SUBST(nss_lib)
  308. AC_SUBST(nss_libdir)
  309. AC_SUBST(ldapsdk_inc)
  310. AC_SUBST(ldapsdk_lib)
  311. AC_SUBST(ldapsdk_libdir)
  312. AC_SUBST(ldapsdk_bindir)
  313. AC_SUBST(db_inc)
  314. AC_SUBST(db_incdir)
  315. AC_SUBST(db_lib)
  316. AC_SUBST(db_libdir)
  317. AC_SUBST(db_bindir)
  318. AC_SUBST(db_libver)
  319. AC_SUBST(sasl_inc)
  320. AC_SUBST(sasl_lib)
  321. AC_SUBST(sasl_libdir)
  322. AC_SUBST(svrcore_inc)
  323. AC_SUBST(svrcore_lib)
  324. AC_SUBST(icu_lib)
  325. AC_SUBST(icu_inc)
  326. AC_SUBST(icu_bin)
  327. AC_SUBST(netsnmp_inc)
  328. AC_SUBST(netsnmp_lib)
  329. AC_SUBST(netsnmp_libdir)
  330. AC_SUBST(netsnmp_link)
  331. AC_SUBST(brand)
  332. AC_SUBST(capbrand)
  333. AC_SUBST(vendor)
  334. AC_DEFINE([LDAP_DEBUG], [1], [LDAP debug flag])
  335. AC_DEFINE([LDAP_DONT_USE_SMARTHEAP], [1], [Don't use smartheap])
  336. # libtool on fedora/rhel contains some gcc-isms which cause problems
  337. # if not using gcc (e.g. Forte on Solaris, aCC on HP-UX)
  338. # we remove them here
  339. if test "$GCC" != yes ; then
  340. AC_MSG_NOTICE([Not using gcc - fixing libtool to remove gcc-isms . . .])
  341. cp -p libtool libtool.orig
  342. cp -p libtool libtool.tmp
  343. # dnl note the special chars @<:@ and @:>@ - since m4 treats [ and ] specially,
  344. # we have to use the quadrigraph @<:@ for [ and @:>@ for ] - and you thought
  345. # perl produced write-only code . . .
  346. sed -e '/^gcc_dir/ d' \
  347. -e '/^gcc_ver/ d' \
  348. -e 's/^predep_objects=.*echo \("@<:@^"@:>@*"\).*$/predep_objects=\1/' \
  349. -e 's/^postdep_objects=.*echo \("@<:@^"@:>@*"\).*$/postdep_objects=\1/' \
  350. -e 's/^compiler_lib_search_path=.*echo \("@<:@^"@:>@*"\).*$/compiler_lib_search_path=\1/' \
  351. -e 's/^sys_lib_search_path_spec=.*echo \("@<:@^"@:>@*"\).*$/sys_lib_search_path_spec=\1/' \
  352. libtool > libtool.tmp
  353. cp -p libtool.tmp libtool
  354. rm -f libtool.tmp
  355. fi
  356. AC_CONFIG_FILES([Makefile])
  357. AC_OUTPUT