| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783 |
- # -*- Autoconf -*-
- # Process this file with autoconf to produce a configure script.
- AC_PREREQ(2.59)
- AC_INIT([dirsrv],[1.0],[http://bugzilla.redhat.com/])
- # AC_CONFIG_HEADER must be called right after AC_INIT.
- AC_CONFIG_HEADERS([config.h])
- # include the version information
- . $srcdir/VERSION.sh
- AC_MSG_NOTICE(This is configure for $PACKAGE_TARNAME $PACKAGE_VERSION)
- AC_DEFINE_UNQUOTED([DS_PACKAGE_VERSION], "$PACKAGE_VERSION", [package version])
- AC_DEFINE_UNQUOTED([DS_PACKAGE_TARNAME], "$PACKAGE_TARNAME", [package tarball name])
- AC_DEFINE_UNQUOTED([DS_PACKAGE_BUGREPORT], "$PACKAGE_BUGREPORT", [package bug report url])
- AC_DEFINE_UNQUOTED([DS_PACKAGE_STRING], "$PACKAGE_STRING", [package string])
- AM_INIT_AUTOMAKE([1.9 foreign subdir-objects dist-bzip2 no-dist-gzip no-define tar-pax])
- # define these for automake distdir
- VERSION=$PACKAGE_VERSION
- PACKAGE=$PACKAGE_TARNAME
- AC_DEFINE_UNQUOTED([VERSION], "$VERSION", [package version])
- AC_DEFINE_UNQUOTED([PACKAGE], "$PACKAGE", [package tar name])
- AC_SUBST([RPM_VERSION])
- AC_SUBST([RPM_RELEASE])
- AC_SUBST([VERSION_PREREL])
- AC_SUBST([CONSOLE_VERSION])
- AM_MAINTAINER_MODE
- AC_CANONICAL_HOST
- # Checks for programs.
- AC_PROG_CXX
- AC_PROG_CC
- AM_PROG_CC_C_O
- AM_PROG_AS
- AC_PROG_CC_STDC
- # disable static libs by default - we only use a couple
- AC_DISABLE_STATIC
- AC_PROG_LIBTOOL
- # Checks for header files.
- AC_HEADER_DIRENT
- AC_HEADER_STDC
- AC_HEADER_SYS_WAIT
- 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])
- # Checks for typedefs, structures, and compiler characteristics.
- AC_HEADER_STAT
- AC_C_CONST
- AC_HEADER_STDBOOL
- AC_TYPE_UID_T
- AC_TYPE_PID_T
- AC_TYPE_SIZE_T
- AC_HEADER_TIME
- AC_STRUCT_TM
- # Checks for library functions.
- AC_FUNC_CHOWN
- AC_FUNC_CLOSEDIR_VOID
- AC_FUNC_ERROR_AT_LINE
- AC_FUNC_FORK
- AC_FUNC_LSTAT
- AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
- AC_FUNC_MALLOC
- AC_FUNC_MEMCMP
- AC_FUNC_MMAP
- AC_TYPE_SIGNAL
- AC_FUNC_STAT
- AC_FUNC_STRERROR_R
- AC_FUNC_STRFTIME
- AC_FUNC_VPRINTF
- 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])
- AC_MSG_CHECKING(for --enable-debug)
- AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [Enable debug features (default: no)]),
- [
- AC_MSG_RESULT(yes)
- debug_defs="-g3 -DDEBUG -DMCC_DEBUG -O0"
- ],
- [
- AC_MSG_RESULT(no)
- debug_defs=""
- ])
- AC_SUBST([debug_defs])
- AC_MSG_CHECKING(for --enable-asan)
- AC_ARG_ENABLE(asan, AS_HELP_STRING([--enable-asan], [Enable gcc address sanitizer options (default: no)]),
- [
- AC_MSG_RESULT(yes)
- asan_defs="-fsanitize=address -fno-omit-frame-pointer"
- ],
- [
- AC_MSG_RESULT(no)
- asan_defs=""
- ])
- AC_SUBST([asan_defs])
- AM_CONDITIONAL(enable_asan,test "$enable_asan" = "yes")
- AM_CONDITIONAL([RPM_HARDEND_CC], [test -f /usr/lib/rpm/redhat/redhat-hardened-cc1])
- AC_MSG_CHECKING(for --enable-gcc-security)
- AC_ARG_ENABLE(gcc-security, AS_HELP_STRING([--enable-gcc-security], [Enable gcc secure compilation options (default: no)]),
- [
- AC_MSG_RESULT(yes)
- AM_COND_IF([RPM_HARDEND_CC],
- [ 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 " ],
- [ gccsec_defs="-Wall -Wp,-D_FORITY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -Werror=format-security" ]
- )
- ],
- [
- AC_MSG_RESULT(no)
- gccsec_defs=""
- ])
- AC_SUBST([gccsec_defs])
- # Used for legacy style packaging where we bundle all of the dependencies.
- AC_MSG_CHECKING(for --enable-bundle)
- AC_ARG_ENABLE(bundle, AS_HELP_STRING([--enable-bundle], [Enable bundled dependencies (default: no)]),
- [
- AC_MSG_RESULT(yes)
- bundle="1";
- ],
- [
- AC_MSG_RESULT(no)
- bundle="";
- ])
- AM_CONDITIONAL(BUNDLE,test "$bundle" = "1")
- # these enables are for optional or experimental features
- if test -z "$enable_pam_passthru" ; then
- enable_pam_passthru=yes # if not set on cmdline, set default
- fi
- AC_MSG_CHECKING(for --enable-pam-passthru)
- AC_ARG_ENABLE(pam-passthru,
- AS_HELP_STRING([--enable-pam-passthru],
- [enable the PAM passthrough auth plugin (default: yes)]))
- if test "$enable_pam_passthru" = yes ; then
- # check for pam header file used by plugins/pass_passthru/pam_ptimpl.c
- AC_CHECK_HEADER([security/pam_appl.h], [], [AC_MSG_ERROR([Missing header file security/pam_appl.h])])
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_PAM_PASSTHRU], [1], [enable the pam passthru auth plugin])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_pam_passthru,test "$enable_pam_passthru" = "yes")
- if test -z "$enable_dna" ; then
- enable_dna=yes # if not set on cmdline, set default
- fi
- AC_MSG_CHECKING(for --enable-dna)
- AC_ARG_ENABLE(dna,
- AS_HELP_STRING([--enable-dna],
- [enable the Distributed Numeric Assignment (DNA) plugin (default: yes)]))
- if test "$enable_dna" = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_DNA], [1], [enable the dna plugin])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_dna,test "$enable_dna" = "yes")
- if test -z "$enable_ldapi" ; then
- enable_ldapi=yes # if not set on cmdline, set default
- fi
- AC_MSG_CHECKING(for --enable-ldapi)
- AC_ARG_ENABLE(ldapi,
- AS_HELP_STRING([--enable-ldapi],
- [enable LDAP over unix domain socket (LDAPI) support (default: yes)]))
- if test "$enable_ldapi" = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_LDAPI], [1], [enable ldapi support in the server])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_ldapi,test "$enable_ldapi" = "yes")
- if test -z "$enable_autobind" ; then
- enable_autobind=no # if not set on cmdline, set default
- fi
- AC_MSG_CHECKING(for --enable-autobind)
- AC_ARG_ENABLE(autobind,
- AS_HELP_STRING([--enable-autobind],
- [enable auto bind over unix domain socket (LDAPI) support (default: no)]))
- if test "$enable_ldapi" = yes -a "$enable_autobind" = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_AUTOBIND], [1], [enable ldapi auto bind support in the server])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_autobind,test "$enable_autobind" = "yes")
- if test -z "$enable_auto_dn_suffix" ; then
- enable_auto_dn_suffix=no # if not set on cmdline, set default
- fi
- AC_MSG_CHECKING(for --enable-auto-dn-suffix)
- AC_ARG_ENABLE(auto-dn-suffix,
- AS_HELP_STRING([--enable-auto-dn-suffix],
- [enable auto bind with auto dn suffix over unix domain socket (LDAPI) support (default: no)]))
- if test "$enable_ldapi" = yes -a "$enable_autobind" = yes -a "$enable_auto_dn_suffix" = "yes"; then
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_AUTO_DN_SUFFIX], [1], [enable ldapi auto bind with auto dn suffix support in the server])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_auto_dn_suffix,test "$enable_auto_dn_suffix" = "yes")
- if test -z "$enable_bitwise" ; then
- enable_bitwise=yes # if not set on cmdline, set default
- fi
- AC_MSG_CHECKING(for --enable-bitwise)
- AC_ARG_ENABLE(bitwise,
- AS_HELP_STRING([--enable-bitwise],
- [enable the bitwise matching rule plugin (default: yes)]))
- if test "$enable_bitwise" = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_BITWISE], [1], [enable the bitwise plugin])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_bitwise,test "$enable_bitwise" = "yes")
- if test -z "$enable_presence" ; then
- enable_presence=no # if not set on cmdline, set default
- fi
- AC_MSG_CHECKING(for --enable-presence)
- AC_ARG_ENABLE(presence,
- AS_HELP_STRING([--enable-presence],
- [enable the presence plugin (default: no)]))
- if test "$enable_presence" = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_PRESENCE], [1], [enable the presence plugin])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_presence,test "$enable_presence" = "yes")
- if test -z "$enable_acctpolicy" ; then
- enable_acctpolicy=yes # if not set on cmdline, set default
- fi
- AC_MSG_CHECKING(for --enable-acctpolicy)
- AC_ARG_ENABLE(acctpolicy,
- AS_HELP_STRING([--enable-acctpolicy],
- [enable the account policy plugin (default: yes)]))
- if test "$enable_acctpolicy" = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_ACCTPOLICY], [1], [enable the account policy plugin])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_acctpolicy,test "$enable_acctpolicy" = "yes")
- if test -z "$enable_posix_winsync" ; then
- enable_posix_winsync=yes # if not set on cmdline, set default
- fi
- AC_MSG_CHECKING(for --enable-posix-winsync)
- AC_ARG_ENABLE(posix_winsync,
- AS_HELP_STRING([--enable-posix-winsync],
- [enable support for POSIX user/group attributes in winsync (default: yes)]))
- if test "$enable_posix_winsync" = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_POSIX_WINSYNC], [1], [enable support for POSIX user/group attributes in winsync])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_posix_winsync,test "$enable_posix_winsync" = "yes")
- AC_MSG_CHECKING(for --enable-nunc-stans)
- AC_ARG_ENABLE(nunc_stans,
- AS_HELP_STRING([--enable-nunc-stans],
- [enable support for nunc-stans event framework (default: no)]))
- if test "$enable_nunc_stans" = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE([ENABLE_NUNC_STANS], [1], [enable support for nunc-stans event framework])
- else
- AC_MSG_RESULT(no)
- fi
- AM_CONDITIONAL(enable_nunc_stans,test "$enable_nunc_stans" = "yes")
- # the default prefix - override with --prefix or --with-fhs
- AC_PREFIX_DEFAULT([/opt/$PACKAGE_NAME])
- m4_include(m4/fhs.m4)
- localrundir='/run'
- # installation paths - by default, we store everything
- # under the prefix. The with-fhs option will use /usr,
- # /etc, and /var. The with-fhs-opt option will use the
- # prefix, but it's sysconfdir and localstatedir will be
- # /etc/opt, and /var/opt.
- if test "$with_fhs_opt" = "yes"; then
- # Override sysconfdir and localstatedir if FHS optional
- # package was requested.
- prefixdir=$prefix
- sysconfdir='/etc/opt'
- localstatedir='/var/opt'
- localrundir='/var/opt/run'
- # relative to datadir
- sampledatadir=/data
- # relative to datadir
- scripttemplatedir=/script-templates
- # relative to datadir
- updatedir=/updates
- # relative to libdir
- serverdir=
- # relative to includedir
- serverincdir=
- # relative to libdir
- serverplugindir=/plugins
- # relative to datadir
- infdir=/inf
- # relative to datadir
- mibdir=/mibs
- # location of property/resource files, relative to datadir
- propertydir=/properties
- # relative to libdir
- perldir=/perl
- # relative to libdir
- pythondir=/python
- else
- if test "$with_fhs" = "yes"; then
- ac_default_prefix=/usr
- prefix=$ac_default_prefix
- exec_prefix=$prefix
- dnl as opposed to the default /usr/etc
- sysconfdir='/etc'
- dnl as opposed to the default /usr/var
- localstatedir='/var'
- localrundir='/run'
- fi
- prefixdir=$prefix
- # relative to datadir
- sampledatadir=/$PACKAGE_NAME/data
- # relative to datadir
- scripttemplatedir=/$PACKAGE_NAME/script-templates
- # relative to datadir
- updatedir=/$PACKAGE_NAME/updates
- # relative to libdir
- serverdir=/$PACKAGE_NAME
- # relative to includedir
- serverincdir=/$PACKAGE_NAME
- # relative to libdir
- serverplugindir=/$PACKAGE_NAME/plugins
- # relative to datadir
- infdir=/$PACKAGE_NAME/inf
- # relative to datadir
- mibdir=/$PACKAGE_NAME/mibs
- # location of property/resource files, relative to datadir
- propertydir=/$PACKAGE_NAME/properties
- # relative to libdir
- perldir=/$PACKAGE_NAME/perl
- # relative to libdir
- pythondir=/$PACKAGE_NAME/python
- fi
- # if mandir is the default value, override it
- # otherwise, the user must have set it - just use it
- if test X"$mandir" = X'${prefix}/man' ; then
- mandir='$(datadir)/man'
- fi
- # Shared paths for all layouts
- # relative to sysconfdir
- configdir=/$PACKAGE_NAME/config
- # relative to sysconfdir
- schemadir=/$PACKAGE_NAME/schema
- # default user, group
- defaultuser=dirsrv
- defaultgroup=dirsrv
- if test -z "$with_tmpfiles_d" ; then
- if test -d $sysconfdir/tmpfiles.d ; then
- with_tmpfiles_d='$(sysconfdir)/tmpfiles.d'
- fi
- fi
- AC_MSG_CHECKING(for --with-tmpfiles-d)
- AC_ARG_WITH(tmpfiles-d,
- AS_HELP_STRING([--with-tmpfiles-d=PATH],
- [system uses tmpfiles.d to handle temp files/dirs (default: $with_tmpfiles_d)])
- )
- if test "$with_tmpfiles_d" = yes ; then
- AC_MSG_ERROR([You must specify --with-tmpfiles-d=/full/path/to/tmpfiles.d directory])
- elif test "$with_tmpfiles_d" = no ; then
- with_tmpfiles_d=
- else
- AC_MSG_RESULT([$with_tmpfiles_d])
- fi
- AC_SUBST(with_tmpfiles_d)
- AC_MSG_CHECKING(for --with-perldir)
- AC_ARG_WITH([perldir],
- AS_HELP_STRING([--with-perldir=PATH],
- [Directory for perl)])
- )
- if test -n "$with_perldir"; then
- if test "$with_perldir" = yes ; then
- AC_MSG_ERROR([You must specify --with-perldir=/full/path/to/perl])
- elif test "$with_perldir" = no ; then
- with_perldir=
- else
- AC_MSG_RESULT([$with_perldir])
- fi
- else
- with_perldir=
- fi
- AC_MSG_CHECKING(for --with-pythonexec)
- AC_ARG_WITH([pythonexec],
- AS_HELP_STRING([--with-pythonexec=PATH],
- [Path to executable for python)])
- )
- if test -n "$with_pythonexec"; then
- if test "$with_pythonexec" = yes ; then
- AC_MSG_ERROR([You must specify --with-pythonexec=/full/path/to/python])
- elif test "$with_pythonexec" = no ; then
- with_pythonexec=/usr/bin/python2
- else
- AC_MSG_RESULT([$with_pythonexec])
- fi
- else
- with_pythonexec=/usr/bin/python2
- fi
- AC_SUBST(prefixdir)
- AC_SUBST(configdir)
- AC_SUBST(sampledatadir)
- AC_SUBST(propertydir)
- AC_SUBST(schemadir)
- AC_SUBST(serverdir)
- AC_SUBST(serverincdir)
- AC_SUBST(serverplugindir)
- AC_SUBST(scripttemplatedir)
- AC_SUBST(perldir)
- AC_SUBST(pythondir)
- AC_SUBST(infdir)
- AC_SUBST(mibdir)
- AC_SUBST(mandir)
- AC_SUBST(updatedir)
- AC_SUBST(defaultuser)
- AC_SUBST(defaultgroup)
- # check for --with-instconfigdir
- AC_MSG_CHECKING(for --with-instconfigdir)
- AC_ARG_WITH(instconfigdir,
- AS_HELP_STRING([--with-instconfigdir=/path],
- [Base directory for instance specific writable configuration directories (default $sysconfdir/$PACKAGE_NAME)]),
- [
- if test $withval = yes ; then
- AC_ERROR([Please specify a full path with --with-instconfigdir])
- fi
- instconfigdir="$withval"
- AC_MSG_RESULT($withval)
- ],
- [
- dnl this value is expanded out in Makefile.am
- instconfigdir='$(sysconfdir)/$(PACKAGE_NAME)'
- AC_MSG_RESULT(no)
- ])
- AC_SUBST(instconfigdir)
- # WINNT should be true if building on Windows system not using
- # cygnus, mingw, or the like and using cmd.exe as the shell
- AM_CONDITIONAL([WINNT], false)
- # Deal with platform dependent defines
- # initdir is the location for the SysV init scripts - very heavily platform
- # dependent and not specified in fhs or lsb
- # and not used if systemd is used
- initdir='$(sysconfdir)/rc.d'
- AC_MSG_CHECKING(for --with-initddir)
- AC_ARG_WITH(initddir,
- AS_HELP_STRING([--with-initddir=/path],
- [Absolute path (not relative like some of the other options) that should contain the SysV init scripts (default '$(sysconfdir)/rc.d')]),
- [
- AC_MSG_RESULT($withval)
- ],
- [
- AC_MSG_RESULT(no)
- ])
- AM_CONDITIONAL([INITDDIR], [test -n "$with_initddir" -a "$with_initddir" != "no"])
- # on most platforms, we will just use perl from PATH
- # On some platforms, we cannot. Why not just use any old
- # perl? Because of perldap. We use a perldap that is
- # compiled to either 32bit or 64bit, so we must use a native
- # perl binary compiled with the same bitsize. On Solaris
- # and HP-UX, /usr/bin/perl is 32 bit, so we cannot use
- # those with our 64 bit compiled product.
- if test -n "$with_perldir"; then
- perlexec="$with_perldir/perl"
- else
- perlexec='/usr/bin/env perl'
- fi
- # This will let us change over the python version easier in the future.
- if test -n "$with_pythonexec"; then
- pythonexec="$with_pythonexec"
- else
- pythonexec='/usr/bin/env python2'
- fi
- # we use stty in perl scripts to disable password echo
- # this doesn't work unless the full absolute path of the
- # stty command is used e.g. system("stty -echo") does not
- # work but system("/bin/stty -echo") does work
- # since the path of stty may not be the same on all
- # platforms, we set the default here to /bin/stty and
- # allow that value to be overridden in the platform
- # specific section below
- sttyexec=/bin/stty
- case $host in
- *-*-linux*)
- AC_DEFINE([Linux], [1], [Linux])
- AC_DEFINE([LINUX], [1], [Linux])
- AC_DEFINE([LINUX2_0], [1], [Linux 2.0])
- AC_DEFINE([LINUX2_2], [1], [Linux 2.2])
- AC_DEFINE([LINUX2_4], [1], [Linux 2.4])
- AC_DEFINE([_GNU_SOURCE], [1], [GNU Source])
- platform="linux"
- initdir='$(sysconfdir)/rc.d/init.d'
- # do arch specific linux stuff here
- case $host in
- i*86-*-linux*)
- AC_DEFINE([CPU_x86], [], [cpu type x86])
- ;;
- x86_64-*-linux*)
- AC_DEFINE([CPU_x86_64], [1], [cpu type x86_64])
- # This turns on and off LFDS inside of libsds
- # wibrown -- 2017-02-21 disabled temporarily
- # with_atomic_queue="yes"
- # AC_DEFINE([ATOMIC_QUEUE_OPERATIONS], [1], [enabling atomic queue operations])
- ;;
- aarch64-*-linux*)
- AC_DEFINE([CPU_arm], [], [cpu type arm])
- ;;
- arm*-linux*)
- AC_DEFINE([CPU_arm], [], [cpu type arm])
- ;;
- esac
- # some programs use the native thread library directly
- THREADLIB=-lpthread
- AC_SUBST([THREADLIB], [$THREADLIB])
- LIBCRYPT=-lcrypt
- AC_SUBST([LIBCRYPT], [$LIBCRYPT])
- AC_DEFINE([USE_POSIX_RWLOCKS], [1], [POSIX rwlocks])
- ;;
- ia64-hp-hpux*)
- AC_DEFINE([hpux], [1], [HP-UX])
- AC_DEFINE([HPUX], [1], [HP-UX])
- AC_DEFINE([HPUX11], [1], [HP-UX 11])
- AC_DEFINE([HPUX11_23], [1], [HP-UX 11.23])
- AC_DEFINE([CPU_ia64], [], [cpu type ia64])
- AC_DEFINE([OS_hpux], [1], [OS HP-UX])
- AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
- AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
- AC_DEFINE([_INCLUDE_STDC__SOURCE_199901], [1], [to pick up all of the printf format macros in inttypes.h])
- # assume 64 bit
- perlexec='/opt/perl_64/bin/perl'
- platform="hpux"
- initconfigdir="/$PACKAGE_NAME/config"
- # HPUX doesn't use /etc for this
- initdir=/init.d
- ;;
- hppa*-hp-hpux*)
- AC_DEFINE([hpux], [1], [HP-UX])
- AC_DEFINE([HPUX], [1], [HP-UX])
- AC_DEFINE([HPUX11], [1], [HP-UX 11])
- AC_DEFINE([HPUX11_11], [1], [HP-UX 11.11])
- AC_DEFINE([CPU_hppa], [], [cpu type pa-risc])
- AC_DEFINE([OS_hpux], [1], [OS HP-UX])
- AC_DEFINE([_POSIX_C_SOURCE], [199506L], [POSIX revision])
- AC_DEFINE([_HPUX_SOURCE], [1], [Source namespace])
- AC_DEFINE([_INCLUDE_STDC__SOURCE_199901], [1], [to pick up all of the printf format macros in inttypes.h])
- # assume 64 bit
- initconfigdir="/$PACKAGE_NAME/config"
- perlexec='/opt/perl_64/bin/perl'
- platform="hpux"
- # HPUX doesn't use /etc for this
- initdir=/init.d
- ;;
- *-*-solaris*)
- AC_DEFINE([SVR4], [1], [SVR4])
- AC_DEFINE([__svr4], [1], [SVR4])
- AC_DEFINE([__svr4__], [1], [SVR4])
- AC_DEFINE([_SVID_GETTOD], [1], [SVID_GETTOD])
- AC_DEFINE([SOLARIS], [1], [SOLARIS])
- AC_DEFINE([OS_solaris], [1], [OS SOLARIS])
- AC_DEFINE([sunos5], [1], [SunOS5])
- AC_DEFINE([OSVERSION], [509], [OS version])
- AC_DEFINE([_REENTRANT], [1], [_REENTRANT])
- AC_DEFINE([NO_DOMAINNAME], [1], [no getdomainname])
- dnl socket nsl and dl are required to link several programs and libdb
- LIBSOCKET=-lsocket
- AC_SUBST([LIBSOCKET], [$LIBSOCKET])
- LIBNSL=-lnsl
- AC_SUBST([LIBNSL], [$LIBNSL])
- LIBDL=-ldl
- AC_SUBST([LIBDL], [$LIBDL])
- dnl Cstd and Crun are required to link any C++ related code
- LIBCSTD=-lCstd
- AC_SUBST([LIBCSTD], [$LIBCSTD])
- LIBCRUN=-lCrun
- AC_SUBST([LIBCRUN], [$LIBCRUN])
- platform="solaris"
- initdir='$(sysconfdir)/init.d'
- case $host in
- i?86-*-solaris2.1[[0-9]]*)
- dnl I dont know why i386 need this explicit
- AC_DEFINE([HAVE_GETPEERUCRED], [1], [have getpeerucred])
- ;;
- sparc-*-solaris*)
- dnl includes some assembler stuff in counter.o
- AC_DEFINE([CPU_sparc], [], [cpu type sparc])
- TARGET='SPARC'
- ;;
- esac
- ;;
- *)
- platform=""
- ;;
- esac
- AC_MSG_CHECKING([for GCC provided 64-bit atomic operations])
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- #include <inttypes.h>
- ]],
- [[
- uint64_t t_counter = 0;
- uint64_t t_oldval = 0;
- uint64_t t_newval = 1;
- __atomic_compare_exchange_8(&t_counter, &t_oldval, t_newval, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
- __atomic_add_fetch_8(&t_counter, t_newval, __ATOMIC_SEQ_CST);
- __atomic_sub_fetch_8(&t_counter, t_newval, __ATOMIC_SEQ_CST);
- __atomic_load(&t_counter, &t_oldval, __ATOMIC_SEQ_CST);
- return 0;
- ]])],
- [
- AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [have 64-bit atomic operation functions provided by gcc])
- AC_MSG_RESULT([yes])
- ],
- [
- AC_MSG_RESULT([no])
- ]
- )
- # cmd line overrides default setting above
- if test -n "$with_initddir" ; then
- initdir="$with_initddir"
- fi
- # sysv init scripts not used when systemd is used
- AC_SUBST(initdir)
- AC_SUBST(perlexec)
- AC_SUBST(pythonexec)
- AC_SUBST(sttyexec)
- # set default initconfigdir if not already set
- # value will be set so as to be relative to $(sysconfdir)
- if test -z "$initconfigdir" ; then
- if test -d /etc/sysconfig ; then
- initconfigdir=/sysconfig
- elif test -d /etc/default ; then
- initconfigdir=/default
- else
- initconfigdir="/$PACKAGE_NAME/config"
- fi
- fi
- AC_SUBST(initconfigdir)
- AM_CONDITIONAL([HPUX],[test "$platform" = "hpux"])
- AM_CONDITIONAL([SOLARIS],[test "$platform" = "solaris"])
- # Check for library dependencies
- m4_include(m4/nspr.m4)
- m4_include(m4/nss.m4)
- m4_include(m4/openldap.m4)
- m4_include(m4/mozldap.m4)
- m4_include(m4/db.m4)
- m4_include(m4/sasl.m4)
- m4_include(m4/svrcore.m4)
- m4_include(m4/icu.m4)
- m4_include(m4/netsnmp.m4)
- m4_include(m4/kerberos.m4)
- m4_include(m4/pcre.m4)
- m4_include(m4/selinux.m4)
- m4_include(m4/nunc-stans.m4)
- m4_include(m4/systemd.m4)
- PACKAGE_BASE_VERSION=`echo $PACKAGE_VERSION | awk -F\. '{print $1"."$2}'`
- AC_SUBST(PACKAGE_BASE_VERSION)
- # set sasl_path for wrapper scripts
- if test -z "$sasl_libdir" ; then
- sasl_path="$libdir/sasl2"
- else
- sasl_path="$sasl_libdir/sasl2"
- fi
- AM_CONDITIONAL(SELINUX,test "$with_selinux" = "yes")
- AM_CONDITIONAL(OPENLDAP,test "$with_openldap" = "yes")
- AM_CONDITIONAL(SOLARIS,test "$platform" = "solaris")
- AM_CONDITIONAL(SPARC,test "x$TARGET" = xSPARC)
- # write out paths for binary components
- AC_SUBST(nspr_inc)
- AC_SUBST(nspr_lib)
- AC_SUBST(nspr_libdir)
- AC_SUBST(nss_inc)
- AC_SUBST(nss_lib)
- AC_SUBST(nss_libdir)
- AC_SUBST(ldapsdk_inc)
- AC_SUBST(ldapsdk_lib)
- AC_SUBST(ldapsdk_libdir)
- AC_SUBST(ldapsdk_bindir)
- AC_SUBST(openldap_inc)
- AC_SUBST(openldap_lib)
- AC_SUBST(openldap_libdir)
- AC_SUBST(openldap_bindir)
- AC_SUBST(ldaptool_bindir)
- AC_SUBST(ldaptool_opts)
- AC_SUBST(plainldif_opts)
- AC_SUBST(ol_libver)
- AC_SUBST(db_inc)
- AC_SUBST(db_incdir)
- AC_SUBST(db_lib)
- AC_SUBST(db_libdir)
- AC_SUBST(db_bindir)
- AC_SUBST(db_libver)
- AC_SUBST(sasl_inc)
- AC_SUBST(sasl_lib)
- AC_SUBST(sasl_libdir)
- AC_SUBST(sasl_path)
- AC_SUBST(svrcore_inc)
- AC_SUBST(svrcore_lib)
- AC_SUBST(icu_lib)
- AC_SUBST(icu_inc)
- AC_SUBST(icu_bin)
- AC_SUBST(netsnmp_inc)
- AC_SUBST(netsnmp_lib)
- AC_SUBST(netsnmp_libdir)
- AC_SUBST(netsnmp_link)
- AC_SUBST(pcre_inc)
- AC_SUBST(pcre_lib)
- AC_SUBST(pcre_libdir)
- AC_SUBST(nunc_stans_inc)
- AC_SUBST(nunc_stans_lib)
- AC_SUBST(nunc_stans_libdir)
- AC_SUBST(localrundir)
- AC_SUBST(systemd_inc)
- AC_SUBST(systemd_lib)
- AC_SUBST(systemd_defs)
- AC_SUBST(brand)
- AC_SUBST(capbrand)
- AC_SUBST(vendor)
- # AC_DEFINE([USE_OLD_UNHASHED], [], [Use old unhashed code])
- AC_DEFINE([LDAP_DEBUG], [1], [LDAP debug flag])
- AC_DEFINE([LDAP_DONT_USE_SMARTHEAP], [1], [Don't use smartheap])
- # libtool on fedora/rhel contains some gcc-isms which cause problems
- # if not using gcc (e.g. Forte on Solaris, aCC on HP-UX)
- # we remove them here
- if test "$GCC" != yes ; then
- AC_MSG_NOTICE([Not using gcc - fixing libtool to remove gcc-isms . . .])
- cp -p libtool libtool.orig
- cp -p libtool libtool.tmp
- # dnl note the special chars @<:@ and @:>@ - since m4 treats [ and ] specially,
- # we have to use the quadrigraph @<:@ for [ and @:>@ for ] - and you thought
- # perl produced write-only code . . .
- sed -e '/^gcc_dir/ d' \
- -e '/^gcc_ver/ d' \
- -e 's/^predep_objects=.*echo \("@<:@^"@:>@*"\).*$/predep_objects=\1/' \
- -e 's/^postdep_objects=.*echo \("@<:@^"@:>@*"\).*$/postdep_objects=\1/' \
- -e 's/^compiler_lib_search_path=.*echo \("@<:@^"@:>@*"\).*$/compiler_lib_search_path=\1/' \
- -e 's/^sys_lib_search_path_spec=.*echo \("@<:@^"@:>@*"\).*$/sys_lib_search_path_spec=\1/' \
- libtool > libtool.tmp
- cp -p libtool.tmp libtool
- rm -f libtool.tmp
- fi
- AC_CONFIG_FILES([Makefile rpm/389-ds-base.spec])
- AC_OUTPUT
|