Update build tools based upon OPENLDAP_AC work

This commit is contained in:
Kurt Zeilenga 2005-08-25 20:09:26 +00:00
commit f07015dad2
20 changed files with 51134 additions and 18016 deletions

View file

@ -1,124 +0,0 @@
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
* Copyright 1998-2005 The OpenLDAP Foundation
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*
* A copy of this license is available in the file LICENSE in the
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
#ifndef _LDAP_PORTABLE_H
#define _LDAP_PORTABLE_H
/* end of preamble */
@TOP@
/* define this if needed to get reentrant functions */
#ifndef REENTRANT
#undef REENTRANT
#endif
#ifndef _REENTRANT
#undef _REENTRANT
#endif
/* define this if needed to get threadsafe functions */
#ifndef THREADSAFE
#undef THREADSAFE
#endif
#ifndef _THREADSAFE
#undef _THREADSAFE
#endif
#ifndef THREAD_SAFE
#undef THREAD_SAFE
#endif
#ifndef _THREAD_SAFE
#undef _THREAD_SAFE
#endif
#ifndef _SGI_MP_SOURCE
#undef _SGI_MP_SOURCE
#endif
/* define this if TIOCGWINSZ is defined in sys/ioctl.h */
#undef GWINSZ_IN_SYS_IOCTL
/* These are defined in ldap_features.h */
/*
LDAP_API_FEATURE_X_OPENLDAP_REENTRANT
LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE
LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
*/
/* These are defined in lber_types.h */
/*
LBER_INT_T
LBER_LEN_T
LBER_SOCKET_T
LBER_TAG_T
*/
/* define to character address type */
#undef caddr_t
/* define to signed size type */
#undef ssize_t
/* Leave that blank line there!! Autoheader needs it. */
@BOTTOM@
/* begin of postamble */
#ifdef _WIN32
/* don't suck in all of the win32 api */
# define WIN32_LEAN_AND_MEAN 1
#endif
#ifndef LDAP_NEEDS_PROTOTYPES
/* force LDAP_P to always include prototypes */
#define LDAP_NEEDS_PROTOTYPES 1
#endif
#ifndef LDAP_REL_ENG
#if (LDAP_VENDOR_VERSION == 000000) && !defined(LDAP_DEVEL)
#define LDAP_DEVEL
#endif
#if defined(LDAP_DEVEL) && !defined(LDAP_TEST)
#define LDAP_TEST
#endif
#endif
#ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
#ifdef HAVE_EBCDIC
/* ASCII/EBCDIC converting replacements for stdio funcs
* vsnprintf and snprintf are used too, but they are already
* checked by the configure script
*/
#define fputs ber_pvt_fputs
#define fgets ber_pvt_fgets
#define printf ber_pvt_printf
#define fprintf ber_pvt_fprintf
#define vfprintf ber_pvt_vfprintf
#define vsprintf ber_pvt_vsprintf
#endif
#include "ac/fdset.h"
#include "ldap_cdefs.h"
#include "ldap_features.h"
#include "ac/assert.h"
#include "ac/localize.h"
#endif /* _LDAP_PORTABLE_H */

View file

@ -1,16 +0,0 @@
dnl OpenLDAP Autoconf Macros
dnl $OpenLDAP$
dnl This work is part of OpenLDAP Software <http://www.openldap.org/>.
dnl
dnl Copyright 1998-2005 The OpenLDAP Foundation.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted only as authorized by the OpenLDAP
dnl Public License.
dnl
dnl A copy of this license is available in the file LICENSE in the
dnl top-level directory of the distribution or, alternatively, at
dnl <http://www.OpenLDAP.org/license.html>.
divert(-1)
builtin(include, build/openldap.m4)dnl

8628
aclocal.m4 vendored

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,9 @@
#! /bin/sh
# $OpenLDAP$
# This file is distributed with OpenLDAP Software but is an an
# independently licensed program.
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -19,15 +17,62 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# This file is distributed with OpenLDAP Software, which contains a
# configuration script generated by Autoconf, and is distributable
# under the same distributions terms as OpenLDAP itself.
## Copyright 1998-2005 The OpenLDAP Foundation.
## All rights reserved.
##
## Redistribution and use in source and binary forms, with or without
## modification, are permitted only as authorized by the OpenLDAP
## Public License.
##
## A copy of this license is available in the file LICENSE in the
## top-level directory of the distribution or, alternatively, at
##
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
msg="missing on your system"
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
# Exit code 63 means version mismatch. This often happens
# when the user try to use an ancient version of a tool on
# a file that requires a minimum version. In this case we
# we should proceed has if the program had been absent, or
# if --run hadn't been passed.
if test $? = 63; then
run=:
msg="probably too old"
fi
;;
-h|--h|--he|--hel|--help)
echo "\
@ -39,6 +84,7 @@ error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
@ -47,13 +93,19 @@ Supported PROGRAM values:
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing - GNU libit 0.0"
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
@ -62,29 +114,66 @@ Supported PROGRAM values:
exit 1
;;
aclocal)
esac
# Now exit if we have it, but it failed. Also exit now if we
# don't have it and --version was passed (most likely to detect
# the program).
case "$1" in
lex|yacc)
# Not GNU programs, they don't have --version.
;;
tar)
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
exit 1
fi
;;
*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
# Could not run --version or --help. This is probably someone
# running `$TOOL --version' or `$TOOL --help' to check whether
# $TOOL exists and not knowing $TOOL uses missing.
exit 1
fi
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
aclocal*)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`configure.in'. You might want
to install the \`Automake' and \`Perl' packages. See build/README."
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`configure.in'. You might want to install the
\`Autoconf' and \`GNU m4' packages. See build/README."
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. See
build/README."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
@ -97,10 +186,10 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $touch_files
;;
automake)
automake*)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
@ -108,9 +197,32 @@ WARNING: \`$1' is missing on your system. You should only need it if
while read f; do touch "$f"; done
;;
autom4te)
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
proper tools for further handling them.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
@ -140,7 +252,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
@ -161,33 +273,101 @@ WARNING: \`$1' is missing on your system. You should only need it if
fi
;;
help2man)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
# The file to touch is that specified with -o ...
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
# ... or it is the one specified with @setfilename ...
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
# ... or it is derived from the source name (dir/f.texi becomes f.info)
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
# If the file does not exist, the user really needs makeinfo;
# let's fail without touching anything.
test -f $file || exit 1
touch $file
;;
tar)
shift
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file
or build/README file, they often tells you about the needed
prerequirements for installing this package. You may also peek
at any GNU archive site, in case some other package would contain
this missing \`$1' program."
WARNING: \`$1' is needed, and is $msg.
You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-end: "$"
# End:

View file

@ -20,9 +20,10 @@ dnl $1 = option name
dnl $2 = help-string
dnl $3 = default value (auto). "--" means do not set it by default
dnl $4 = allowed values (auto yes no)
dnl $5 = overridden default
AC_DEFUN([OL_ARG_ENABLE], [# OpenLDAP --enable-$1
AC_ARG_ENABLE($1,ifelse($3,--,[$2],
[changequote(<,>)<$2 [>ifelse($3,,auto,$3)<]>changequote([,])]),[
pushdef([ol_DefVal],ifelse($3,,auto,$3))
AC_ARG_ENABLE($1,ifelse($4,,[$2],[$2] translit([$4],[ ],[|])) ifelse($3,--,,@<:@ol_DefVal@:>@),[
ol_arg=invalid
for ol_val in ifelse($4,,[auto yes no],[$4]) ; do
if test "$enableval" = "$ol_val" ; then
@ -34,8 +35,9 @@ AC_DEFUN([OL_ARG_ENABLE], [# OpenLDAP --enable-$1
fi
ol_enable_$1="$ol_arg"
]ifelse($3,--,,[,
[ ol_enable_$1=ifelse($3,,"auto","$3")]]))dnl
dnl AC_VERBOSE(OpenLDAP -enable-$1 $ol_enable_$1)
[ ol_enable_$1=ifelse($5,,ol_DefVal,[${]$5[:-]ol_DefVal[}])]]))dnl
dnl AC_MSG_RESULT([OpenLDAP -enable-$1 $ol_enable_$1])
popdef([ol_DefVal])
# end --enable-$1
])dnl
dnl
@ -47,7 +49,7 @@ dnl $2 = help-string
dnl $3 = default value (no)
dnl $4 = allowed values (yes or no)
AC_DEFUN([OL_ARG_WITH], [# OpenLDAP --with-$1
AC_ARG_WITH($1,changequote(<,>)<$2 [>ifelse($3,,yes,$3)<]>changequote([,]),[
AC_ARG_WITH($1,[$2 @<:@]ifelse($3,,yes,$3)@:>@,[
ol_arg=invalid
for ol_val in ifelse($4,,[yes no],[$4]) ; do
if test "$withval" = "$ol_val" ; then
@ -60,63 +62,9 @@ AC_DEFUN([OL_ARG_WITH], [# OpenLDAP --with-$1
ol_with_$1="$ol_arg"
],
[ ol_with_$1=ifelse($3,,"no","$3")])dnl
dnl AC_VERBOSE(OpenLDAP --with-$1 $ol_with_$1)
dnl AC_MSG_RESULT([OpenLDAP --with-$1 $ol_with_$1])
# end --with-$1
])dnl
dnl
dnl ====================================================================
dnl
AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
[changequote(<<, >>)dnl
dnl The name to #define.
define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
dnl The cache variable name.
define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
changequote([, ])dnl
AC_MSG_CHECKING(size of $1)
AC_CACHE_VAL(AC_CV_NAME,
[for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence.
AC_TRY_COMPILE([#include "confdefs.h"
#include <stdlib.h>
#include <sys/types.h>
$2
], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
if test x$AC_CV_NAME != x ; then break; fi
done
])
if test x$AC_CV_NAME = x ; then
AC_MSG_ERROR([cannot determine a size for $1])
fi
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])
dnl ====================================================================
dnl check if hard links are supported.
dnl
AC_DEFUN([OL_PROG_LN_H], [# test for ln hardlink support
AC_MSG_CHECKING(whether ln works)
AC_CACHE_VAL(ol_cv_prog_LN_H,
[rm -f conftest.src conftest.dst
echo "conftest" > conftest.src
if ln conftest.src conftest.dst 2>/dev/null
then
ol_cv_prog_LN_H="ln"
else
ol_cv_prog_LN_H="cp"
fi
rm -f conftest.src conftest.dst
])dnl
LN_H="$ol_cv_prog_LN_H"
if test "$ol_cv_prog_LN_H" = "ln"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AC_SUBST(LN_H)dnl
])dnl
dnl
dnl ====================================================================
dnl Check for dependency generation flag
AC_DEFUN([OL_MKDEPEND], [# test for make depend flag
@ -160,13 +108,11 @@ dnl ====================================================================
dnl Check if system uses EBCDIC instead of ASCII
AC_DEFUN([OL_CPP_EBCDIC], [# test for EBCDIC
AC_CACHE_CHECK([for EBCDIC],ol_cv_cpp_ebcdic,[
AC_TRY_CPP([
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
#if !('M' == 0xd4)
#include <__ASCII__/generate_error.h>
#endif
],
[ol_cv_cpp_ebcdic=yes],
[ol_cv_cpp_ebcdic=no])])
]])],[ol_cv_cpp_ebcdic=yes],[ol_cv_cpp_ebcdic=no])])
if test $ol_cv_cpp_ebcdic = yes ; then
AC_DEFINE(HAVE_EBCDIC,1, [define if system uses EBCDIC instead of ASCII])
fi
@ -178,10 +124,10 @@ AC_DEFUN([OL_HEADER_STDC],
[AC_REQUIRE_CPP()dnl
AC_REQUIRE([OL_CPP_EBCDIC])dnl
AC_CACHE_CHECK([for ANSI C header files], ol_cv_header_stdc,
[AC_TRY_CPP([#include <stdlib.h>
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>], ol_cv_header_stdc=yes, ol_cv_header_stdc=no)
#include <float.h>]])],[ol_cv_header_stdc=yes],[ol_cv_header_stdc=no])
if test $ol_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
@ -195,7 +141,7 @@ fi
if test $ol_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
AC_TRY_RUN([#include <ctype.h>
AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <ctype.h>
#ifndef HAVE_EBCDIC
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@ -209,7 +155,7 @@ AC_TRY_RUN([#include <ctype.h>
int main () { int i; for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
], , ol_cv_header_stdc=no, :)
]])],[],[ol_cv_header_stdc=no],[:])
fi])
if test $ol_cv_header_stdc = yes; then
AC_DEFINE(STDC_HEADERS)
@ -218,36 +164,6 @@ ac_cv_header_stdc=disable
])
dnl
dnl ====================================================================
dnl Check if struct passwd has pw_gecos
AC_DEFUN([OL_STRUCT_PASSWD_PW_GECOS], [# test for pw_gecos in struct passwd
AC_CACHE_CHECK([struct passwd for pw_gecos],ol_cv_struct_passwd_pw_gecos,[
AC_TRY_COMPILE([#include <pwd.h>],[
struct passwd pwd;
pwd.pw_gecos = pwd.pw_name;
],
[ol_cv_struct_passwd_pw_gecos=yes],
[ol_cv_struct_passwd_pw_gecos=no])])
if test $ol_cv_struct_passwd_pw_gecos = yes ; then
AC_DEFINE(HAVE_PW_GECOS,1, [define if struct passwd has pw_gecos])
fi
])
dnl
dnl --------------------------------------------------------------------
dnl Check if struct passwd has pw_passwd
AC_DEFUN([OL_STRUCT_PASSWD_PW_PASSWD], [# test for pw_passwd in struct passwd
AC_CACHE_CHECK([struct passwd for pw_passwd],ol_cv_struct_passwd_pw_passwd,[
AC_TRY_COMPILE([#include <pwd.h>],[
struct passwd pwd;
pwd.pw_passwd = pwd.pw_name;
],
[ol_cv_struct_passwd_pw_passwd=yes],
[ol_cv_struct_passwd_pw_passwd=no])])
if test $ol_cv_struct_passwd_pw_passwd = yes ; then
AC_DEFINE(HAVE_PW_PASSWD,1, [define if struct passwd has pw_passwd])
fi
])
dnl
dnl ====================================================================
dnl DNS resolver macros
AC_DEFUN([OL_RESOLVER_TRY],
[if test $ol_cv_lib_resolver = no ; then
@ -257,7 +173,7 @@ AC_DEFUN([OL_RESOLVER_TRY],
ol_LIBS=$LIBS
LIBS="$ol_RESOLVER_LIB $LIBS"
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
@ -268,7 +184,7 @@ AC_DEFUN([OL_RESOLVER_TRY],
#ifdef HAVE_RESOLV_H
# include <resolv.h>
#endif
],[{
]], [[{
int len, status;
char *request = NULL;
unsigned char reply[64*1024];
@ -297,7 +213,7 @@ AC_DEFUN([OL_RESOLVER_TRY],
p += sizeof(HEADER);
#endif
status = dn_expand( reply, reply+len, p, host, sizeof(host));
}],[$1=yes],[$1=no])
}]])],[$1=yes],[$1=no])
LIBS="$ol_LIBS"
])
@ -329,7 +245,7 @@ AC_DEFUN([OL_BERKELEY_DB_TRY],
ol_LIBS=$LIBS
LIBS="$ol_DB_LIB $LTHREAD_LIBS $LIBS"
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_DB_185_H
# include <db_185.h>
#else
@ -343,7 +259,7 @@ AC_DEFUN([OL_BERKELEY_DB_TRY],
#ifndef NULL
#define NULL ((void*)0)
#endif
],[
]], [[
#if DB_VERSION_MAJOR > 1
{
char *version;
@ -369,7 +285,7 @@ AC_DEFUN([OL_BERKELEY_DB_TRY],
#else
(void) dbopen( NULL, 0, 0, 0, NULL);
#endif
],[$1=yes],[$1=no])
]])],[$1=yes],[$1=no])
LIBS="$ol_LIBS"
])
@ -418,7 +334,7 @@ AC_DEFUN([OL_BERKELEY_DB_VERSION],
LIBS="$ol_cv_lib_db $LIBS"
fi
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_DB_185_H
choke me;
#else
@ -450,10 +366,7 @@ main()
#endif
return 0;
}],
[ol_cv_berkeley_db_version=yes],
[ol_cv_berkeley_db_version=no],
[ol_cv_berkeley_db_version=cross])
}]])],[ol_cv_berkeley_db_version=yes],[ol_cv_berkeley_db_version=no],[ol_cv_berkeley_db_version=cross])
LIBS="$ol_LIBS"
])
@ -473,7 +386,7 @@ AC_DEFUN([OL_BERKELEY_DB_THREAD],
LIBS="$ol_cv_lib_db $LIBS"
fi
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_DB_185_H
choke me;
#else
@ -536,10 +449,7 @@ main()
#endif
return rc;
}],
[ol_cv_berkeley_db_thread=yes],
[ol_cv_berkeley_db_thread=no],
[ol_cv_berkeley_db_thread=cross])
}]])],[ol_cv_berkeley_db_thread=yes],[ol_cv_berkeley_db_thread=no],[ol_cv_berkeley_db_thread=cross])
LIBS="$ol_LIBS"
])
@ -567,7 +477,7 @@ fi
dnl --------------------------------------------------------------------
dnl Check for version compatility with back-bdb
AC_DEFUN([OL_BDB_COMPAT],
[AC_CACHE_CHECK([Berkeley DB version for BDB backend], [ol_cv_bdb_compat],[
[AC_CACHE_CHECK([Berkeley DB version for BDB/HDB backends], [ol_cv_bdb_compat],[
AC_EGREP_CPP(__db_version_compat,[
#include <db.h>
@ -788,11 +698,11 @@ dnl Draft 9 and 10 are equivalent for our purposes.
dnl
AC_DEFUN([OL_POSIX_THREAD_VERSION],
[AC_CACHE_CHECK([POSIX thread version],[ol_cv_pthread_version],[
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
# include <pthread.h>
],[
]], [[
int i = PTHREAD_CREATE_JOINABLE;
],[
]])],[
AC_EGREP_HEADER(pthread_detach,pthread.h,
ol_cv_pthread_version=10, ol_cv_pthread_version=8)],[
AC_EGREP_CPP(draft7,[
@ -813,8 +723,8 @@ AC_DEFUN([OL_POSIX_THREAD_VERSION],
])dnl
dnl
dnl --------------------------------------------------------------------
AC_DEFUN([OL_PTHREAD_TEST_INCLUDES],
[/* pthread test headers */
AC_DEFUN([OL_PTHREAD_TEST_INCLUDES], [[
/* pthread test headers */
#include <pthread.h>
#if HAVE_PTHREADS < 7
#include <errno.h>
@ -828,8 +738,8 @@ static void *task(p)
{
return (void *) (p == NULL);
}
])
AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[
]])
AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[[
/* pthread test function */
#ifndef PTHREAD_CREATE_DETACHED
#define PTHREAD_CREATE_DETACHED 1
@ -875,10 +785,10 @@ AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[
#endif
return 0;
])
]])
AC_DEFUN([OL_PTHREAD_TEST_PROGRAM],
[OL_PTHREAD_TEST_INCLUDES
AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES
int main(argc, argv)
int argc;
@ -886,7 +796,7 @@ int main(argc, argv)
{
OL_PTHREAD_TEST_FUNCTION
}
])
]))
dnl --------------------------------------------------------------------
AC_DEFUN([OL_PTHREAD_TRY], [# Pthread try link: $1 ($2)
if test "$ol_link_threads" = no ; then
@ -896,9 +806,11 @@ if test "$ol_link_threads" = no ; then
ol_LIBS="$LIBS"
LIBS="$1 $LIBS"
AC_TRY_RUN(OL_PTHREAD_TEST_PROGRAM,
[$2=yes], [$2=no],
[AC_TRY_LINK(OL_PTHREAD_TEST_INCLUDES,OL_PTHREAD_TEST_FUNCTION,
AC_RUN_IFELSE([OL_PTHREAD_TEST_PROGRAM],
[$2=yes],
[$2=no],
[AC_LINK_IFELSE([AC_LANG_PROGRAM(OL_PTHREAD_TEST_INCLUDES,
OL_PTHREAD_TEST_FUNCTION)],
[$2=yes], [$2=no])])
# restore the LIBS
@ -998,7 +910,7 @@ dnl ====================================================================
dnl Check for POSIX Regex
AC_DEFUN([OL_POSIX_REGEX], [
AC_CACHE_CHECK([for compatible POSIX regex],ol_cv_c_posix_regex,[
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <sys/types.h>
#include <regex.h>
static char *pattern, *string;
@ -1020,17 +932,14 @@ main()
regfree(&re);
return rc;
}],
[ol_cv_c_posix_regex=yes],
[ol_cv_c_posix_regex=no],
[ol_cv_c_posix_regex=cross])])
}]])],[ol_cv_c_posix_regex=yes],[ol_cv_c_posix_regex=no],[ol_cv_c_posix_regex=cross])])
])
dnl
dnl ====================================================================
dnl Check if toupper() requires islower() to be called first
AC_DEFUN([OL_C_UPPER_LOWER],
[AC_CACHE_CHECK([if toupper() requires islower()],ol_cv_c_upper_lower,[
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <ctype.h>
main()
{
@ -1038,10 +947,7 @@ main()
exit(0);
else
exit(1);
}],
[ol_cv_c_upper_lower=no],
[ol_cv_c_upper_lower=yes],
[ol_cv_c_upper_lower=safe])])
}]])],[ol_cv_c_upper_lower=no],[ol_cv_c_upper_lower=yes],[ol_cv_c_upper_lower=safe])])
if test $ol_cv_c_upper_lower != no ; then
AC_DEFINE(C_UPPER_LOWER,1, [define if toupper() requires islower()])
fi
@ -1055,17 +961,14 @@ dnl Declaration of sys_errlist on BSD4.4 interferes with our declaration.
dnl Reported by Keith Bostic.
AC_DEFUN([OL_SYS_ERRLIST],
[AC_CACHE_CHECK([declaration of sys_errlist],ol_cv_dcl_sys_errlist,[
AC_TRY_COMPILE([
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
#ifdef WINNT
#include <stdlib.h>
#endif ],
[char *c = (char *) *sys_errlist],
[ol_cv_dcl_sys_errlist=yes
ol_cv_have_sys_errlist=yes],
[ol_cv_dcl_sys_errlist=no])])
#endif ]], [[char *c = (char *) *sys_errlist]])],[ol_cv_dcl_sys_errlist=yes
ol_cv_have_sys_errlist=yes],[ol_cv_dcl_sys_errlist=no])])
#
# It's possible (for near-UNIX clones) that sys_errlist doesn't exist
if test $ol_cv_dcl_sys_errlist = no ; then
@ -1073,10 +976,7 @@ if test $ol_cv_dcl_sys_errlist = no ; then
[define if sys_errlist is not declared in stdio.h or errno.h])
AC_CACHE_CHECK([existence of sys_errlist],ol_cv_have_sys_errlist,[
AC_TRY_LINK([#include <errno.h>],
[char *c = (char *) *sys_errlist],
[ol_cv_have_sys_errlist=yes],
[ol_cv_have_sys_errlist=no])])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <errno.h>]], [[char *c = (char *) *sys_errlist]])],[ol_cv_have_sys_errlist=yes],[ol_cv_have_sys_errlist=no])])
fi
if test $ol_cv_have_sys_errlist = yes ; then
AC_DEFINE(HAVE_SYS_ERRLIST,1,
@ -1089,21 +989,20 @@ AC_DEFUN([OL_NONPOSIX_STRERROR_R],
ol_decl_strerror_r=yes, ol_decl_strerror_r=no)dnl
if test $ol_decl_strerror_r = yes ; then
AC_TRY_COMPILE([#include <string.h>],
[ /* from autoconf 2.59 */
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[ /* from autoconf 2.59 */
char buf[100];
char x = *strerror_r (0, buf, sizeof buf);
char *p = strerror_r (0, buf, sizeof buf);
], ol_cv_nonposix_strerror_r=yes, ol_cv_nonposix_strerror_r=no)
]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror_r=no])
else
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
main() {
char buf[100];
buf[0] = 0;
strerror_r( 1, buf, sizeof buf );
exit( buf[0] == 0 );
}
], ol_cv_nonposix_strerror_r=yes, ol_cv_nonposix_strerror=no, ol_cv_nonposix_strerror=no)
]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror=no],[ol_cv_nonposix_strerror=no])
fi
])
if test $ol_cv_nonposix_strerror_r = yes ; then
@ -1128,10 +1027,9 @@ dnl "int x; int *volatile a = &x; *a = 0;"
dnl -- borrowed from PDKSH
AC_DEFUN([OL_C_VOLATILE],
[AC_CACHE_CHECK(if compiler understands volatile, ol_cv_c_volatile,
[AC_TRY_COMPILE([int x, y, z;],
[volatile int a; int * volatile b = x ? &y : &z;
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[int x, y, z;]], [[volatile int a; int * volatile b = x ? &y : &z;
/* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
*b = 0;], ol_cv_c_volatile=yes, ol_cv_c_volatile=no)])
*b = 0;]])],[ol_cv_c_volatile=yes],[ol_cv_c_volatile=no])])
if test $ol_cv_c_volatile = yes; then
:
else
@ -1145,13 +1043,10 @@ AC_DEFUN([OL_LIB_FETCH],
[ol_LIBS=$LIBS
LIBS="-lfetch -lcom_err $LIBS"
AC_CACHE_CHECK([fetch(3) library],ol_cv_lib_fetch,[
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/param.h>
#include <stdio.h>
#include <fetch.h>],
[struct url *u = fetchParseURL("file:///"); ],
[ol_cv_lib_fetch=yes],
[ol_cv_lib_fetch=no])])
#include <fetch.h>]], [[struct url *u = fetchParseURL("file:///"); ]])],[ol_cv_lib_fetch=yes],[ol_cv_lib_fetch=no])])
LIBS=$ol_LIBS
if test $ol_cv_lib_fetch != no ; then
ol_link_fetch="-lfetch -lcom_err"
@ -1161,41 +1056,10 @@ fi
])dnl
dnl
dnl ====================================================================
dnl Define sig_atomic_t if not defined in signal.h
AC_DEFUN([OL_TYPE_SIG_ATOMIC_T],
[AC_CACHE_CHECK(for sig_atomic_t, ol_cv_type_sig_atomic_t,
[AC_TRY_COMPILE([#include <signal.h>], [sig_atomic_t atomic;],
ol_cv_type_sig_atomic_t=yes, ol_cv_type_sig_atomic_t=no)])
if test $ol_cv_type_sig_atomic_t = no; then
AC_DEFINE(sig_atomic_t,int,
[define to atomic type if sig_atomic_t is not available])
fi
])dnl
dnl
dnl ====================================================================
dnl Define socklen_t if not defined in sys/types.h or sys/socket.h
AC_DEFUN([OL_TYPE_SOCKLEN_T],
[AC_CACHE_CHECK(for socklen_t, ol_cv_type_socklen_t,
[AC_TRY_COMPILE([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
], [socklen_t len;],
ol_cv_type_socklen_t=yes, ol_cv_type_socklen_t=no)])
if test $ol_cv_type_socklen_t = no; then
AC_DEFINE(socklen_t, int,
[define to int if socklen_t is not available])
fi
])dnl
dnl
dnl ====================================================================
dnl Define inet_aton is available
AC_DEFUN([OL_FUNC_INET_ATON],
[AC_CACHE_CHECK([for inet_aton()], ol_cv_func_inet_aton,
[AC_TRY_LINK([
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
@ -1209,9 +1073,8 @@ AC_DEFUN([OL_FUNC_INET_ATON],
# include <arpa/inet.h>
# endif
#endif
], [struct in_addr in;
int rc = inet_aton( "255.255.255.255", &in );],
ol_cv_func_inet_aton=yes, ol_cv_func_inet_aton=no)])
]], [[struct in_addr in;
int rc = inet_aton( "255.255.255.255", &in );]])],[ol_cv_func_inet_aton=yes],[ol_cv_func_inet_aton=no])])
if test $ol_cv_func_inet_aton != no; then
AC_DEFINE(HAVE_INET_ATON, 1,
[define to you inet_aton(3) is available])
@ -1222,15 +1085,9 @@ dnl ====================================================================
dnl check no of arguments for ctime_r
AC_DEFUN([OL_FUNC_CTIME_R_NARGS],
[AC_CACHE_CHECK(number of arguments of ctime_r, ol_cv_func_ctime_r_nargs,
[AC_TRY_COMPILE([#include <time.h>],
[time_t ti; char *buffer; ctime_r(&ti,buffer,32);],
ol_cv_func_ctime_r_nargs3=yes,
ol_cv_func_ctime_r_nargs3=no)
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer,32);]])],[ol_cv_func_ctime_r_nargs3=yes],[ol_cv_func_ctime_r_nargs3=no])
AC_TRY_COMPILE([#include <time.h>],
[time_t ti; char *buffer; ctime_r(&ti,buffer);],
ol_cv_func_ctime_r_nargs2=yes,
ol_cv_func_ctime_r_nargs2=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[time_t ti; char *buffer; ctime_r(&ti,buffer);]])],[ol_cv_func_ctime_r_nargs2=yes],[ol_cv_func_ctime_r_nargs2=no])
if test $ol_cv_func_ctime_r_nargs3 = yes -a \
$ol_cv_func_ctime_r_nargs2 = no ; then
@ -1257,9 +1114,7 @@ dnl --------------------------------------------------------------------
dnl check return type of ctime_r()
AC_DEFUN([OL_FUNC_CTIME_R_TYPE],
[AC_CACHE_CHECK(return type of ctime_r, ol_cv_func_ctime_r_type,
[AC_TRY_COMPILE([#include <time.h>],
[extern int (ctime_r)();],
ol_cv_func_ctime_r_type="int", ol_cv_func_ctime_r_type="charp")
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <time.h>]], [[extern int (ctime_r)();]])],[ol_cv_func_ctime_r_type="int"],[ol_cv_func_ctime_r_type="charp"])
])
if test $ol_cv_func_ctime_r_type = "int" ; then
AC_DEFINE(CTIME_R_RETURNS_INT,1, [define if ctime_r() returns int])
@ -1270,30 +1125,24 @@ dnl check no of arguments for gethostbyname_r
AC_DEFUN([OL_FUNC_GETHOSTBYNAME_R_NARGS],
[AC_CACHE_CHECK(number of arguments of gethostbyname_r,
ol_cv_func_gethostbyname_r_nargs,
[AC_TRY_COMPILE([#include <sys/types.h>
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)],
[struct hostent hent; char buffer[BUFSIZE];
#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE];
int bufsize=BUFSIZE;int h_errno;
(void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
buffer, bufsize, &h_errno);],
ol_cv_func_gethostbyname_r_nargs5=yes,
ol_cv_func_gethostbyname_r_nargs5=no)
buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs5=yes],[ol_cv_func_gethostbyname_r_nargs5=no])
AC_TRY_COMPILE([#include <sys/types.h>
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)],
[struct hostent hent;struct hostent *rhent;
#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;struct hostent *rhent;
char buffer[BUFSIZE];
int bufsize=BUFSIZE;int h_errno;
(void)gethostbyname_r("localhost", &hent, buffer, bufsize,
&rhent, &h_errno);],
ol_cv_func_gethostbyname_r_nargs6=yes,
ol_cv_func_gethostbyname_r_nargs6=no)
&rhent, &h_errno);]])],[ol_cv_func_gethostbyname_r_nargs6=yes],[ol_cv_func_gethostbyname_r_nargs6=no])
if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
$ol_cv_func_gethostbyname_r_nargs6 = no ; then
@ -1320,35 +1169,29 @@ dnl check no of arguments for gethostbyaddr_r
AC_DEFUN([OL_FUNC_GETHOSTBYADDR_R_NARGS],
[AC_CACHE_CHECK(number of arguments of gethostbyaddr_r,
[ol_cv_func_gethostbyaddr_r_nargs],
[AC_TRY_COMPILE([#include <sys/types.h>
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)],
[struct hostent hent; char buffer[BUFSIZE];
#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent; char buffer[BUFSIZE];
struct in_addr add;
size_t alen=sizeof(struct in_addr);
int bufsize=BUFSIZE;int h_errno;
(void)gethostbyaddr_r( (void *)&(add.s_addr),
alen, AF_INET, &hent, buffer, bufsize, &h_errno);],
ol_cv_func_gethostbyaddr_r_nargs7=yes,
ol_cv_func_gethostbyaddr_r_nargs7=no)
alen, AF_INET, &hent, buffer, bufsize, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs7=yes],[ol_cv_func_gethostbyaddr_r_nargs7=no])
AC_TRY_COMPILE([#include <sys/types.h>
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define BUFSIZE (sizeof(struct hostent)+10)],
[struct hostent hent;
#define BUFSIZE (sizeof(struct hostent)+10)]], [[struct hostent hent;
struct hostent *rhent; char buffer[BUFSIZE];
struct in_addr add;
size_t alen=sizeof(struct in_addr);
int bufsize=BUFSIZE;int h_errno;
(void)gethostbyaddr_r( (void *)&(add.s_addr),
alen, AF_INET, &hent, buffer, bufsize,
&rhent, &h_errno);],
ol_cv_func_gethostbyaddr_r_nargs8=yes,
ol_cv_func_gethostbyaddr_r_nargs8=no)
&rhent, &h_errno);]])],[ol_cv_func_gethostbyaddr_r_nargs8=yes],[ol_cv_func_gethostbyaddr_r_nargs8=no])
if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
$ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
@ -1392,31 +1235,7 @@ AC_DEFUN([OL_SASL_COMPAT],
], [ol_cv_sasl_compat=yes], [ol_cv_sasl_compat=no])])
])
dnl ====================================================================
dnl check for msg_accrights in msghdr
AC_DEFUN([OL_MSGHDR_MSG_ACCRIGHTS],
[AC_CACHE_CHECK(for msg_accrights in msghdr, ol_cv_msghdr_msg_accrights,
[AC_TRY_COMPILE([#include <sys/socket.h>],
[struct msghdr m; m.msg_accrightslen=0],
ol_cv_msghdr_msg_accrights=yes, ol_cv_msghdr_msg_accrights=no)
])
if test $ol_cv_msghdr_msg_accrights = "yes" ; then
AC_DEFINE(HAVE_MSGHDR_MSG_ACCRIGHTS,1,
[define if struct msghdr has msg_accrights])
fi
])dnl
dnl ====================================================================
dnl check for cmsghdr
AC_DEFUN([OL_MSGHDR_MSG_CONTROL],
[AC_CACHE_CHECK(for msg_control in msghdr, ol_cv_msghdr_msg_control,
[AC_TRY_COMPILE([#include <sys/socket.h>],
[struct msghdr m; m.msg_control=(struct cmsghdr *)0],
ol_cv_msghdr_msg_control=yes, ol_cv_msghdr_msg_control=no)
])
if test $ol_cv_msghdr_msg_control = "yes" ; then
AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL,1,
[define if struct msghdr has msg_control])
fi
])dnl
dnl check for SSL compatibility
AC_DEFUN([OL_SSL_COMPAT],
[AC_CACHE_CHECK([OpenSSL library version (CRL checking capability)], [ol_cv_ssl_crl_compat],[
AC_EGREP_CPP(__ssl_compat,[

53880
configure vendored

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -33,7 +33,7 @@ veryclean-local: clean-local FORCE
depend-local: ldap_config.h FORCE
LDAP_CONFIG=$(srcdir)/ldap_config.h.in
LDAP_CONFIG=$(srcdir)/ldap_config.hin
ldap_config.h: $(LDAP_CONFIG) Makefile
@$(RM) $@

File diff suppressed because it is too large Load diff

View file

@ -156,8 +156,8 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s)
#if !defined(HAVE_GETPEEREID) && \
!defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && \
defined(HAVE_SENDMSG) && (defined(HAVE_MSGHDR_MSG_ACCRIGHTS) || \
defined(HAVE_MSGHDR_MSG_CONTROL))
defined(HAVE_SENDMSG) && (defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS) || \
defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL))
#define DO_SENDMSG
static const char abandonPDU[] = {LDAP_TAG_MESSAGE, 6,
LDAP_TAG_MSGID, 1, 0, LDAP_REQ_ABANDON, 1, 0};
@ -195,7 +195,7 @@ sendcred:
/* Abandon, noop, has no reply */
struct iovec iov;
struct msghdr msg = {0};
# ifdef HAVE_MSGHDR_MSG_CONTROL
# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
# ifndef CMSG_SPACE
# define CMSG_SPACE(len) (_CMSG_ALIGN( sizeof(struct cmsghdr)) + _CMSG_ALIGN(len) )
# endif
@ -207,14 +207,14 @@ sendcred:
unsigned char control[CMSG_SPACE(sizeof(int))];
} control_un;
struct cmsghdr *cmsg;
# endif /* HAVE_MSGHDR_MSG_CONTROL */
# endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */
msg.msg_name = NULL;
msg.msg_namelen = 0;
iov.iov_base = (char *) abandonPDU;
iov.iov_len = sizeof abandonPDU;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
# ifdef HAVE_MSGHDR_MSG_CONTROL
# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof( control_un.control );
msg.msg_flags = 0;
@ -228,7 +228,7 @@ sendcred:
# else
msg.msg_accrights = (char *)fds;
msg.msg_accrightslen = sizeof(int);
# endif /* HAVE_MSGHDR_MSG_CONTROL */
# endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */
sendmsg( s, &msg, 0 );
close(fds[0]);
close(fds[1]);

View file

@ -32,8 +32,8 @@
#endif
#if !defined(SO_PEERCRED) && !defined(LOCAL_PEERCRED) && \
defined(HAVE_SENDMSG) && (defined(HAVE_MSGHDR_MSG_ACCRIGHTS) || \
defined(HAVE_MSGHDR_MSG_CONTROL))
defined(HAVE_SENDMSG) && (defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS) || \
defined(HAVE_STRUCT_MSGHDR_MSG_CONTROL))
#define DO_SENDMSG
#ifdef HAVE_SYS_UIO_H
#include <sys/uio.h>
@ -77,7 +77,7 @@ int getpeereid( int s, uid_t *euid, gid_t *egid )
int err, fd[2];
struct iovec iov;
struct msghdr msg = {0};
# ifdef HAVE_MSGHDR_MSG_CONTROL
# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
# ifndef CMSG_SPACE
# define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
# endif
@ -89,7 +89,7 @@ int getpeereid( int s, uid_t *euid, gid_t *egid )
unsigned char control[CMSG_SPACE(sizeof(int))];
} control_un;
struct cmsghdr *cmsg;
# endif /* HAVE_MSGHDR_MSG_CONTROL */
# endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL */
struct stat st;
msg.msg_name = NULL;
@ -99,7 +99,7 @@ int getpeereid( int s, uid_t *euid, gid_t *egid )
iov.iov_len = sizeof dummy;
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
# ifdef HAVE_MSGHDR_MSG_CONTROL
# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
msg.msg_control = control_un.control;
msg.msg_controllen = sizeof( control_un.control );
@ -118,12 +118,12 @@ int getpeereid( int s, uid_t *euid, gid_t *egid )
msg.msg_accrights = (char *)fd;
msg.msg_accrightslen = sizeof(fd);
if( recvmsg( s, &msg, MSG_PEEK) >= 0 && msg.msg_accrightslen == sizeof(int) )
# endif /* HAVE_MSGHDR_MSG_CONTROL*/
# endif /* HAVE_STRUCT_MSGHDR_MSG_CONTROL*/
{
/* We must receive a valid descriptor, it must be a pipe,
* and it must only be accessible by its owner.
*/
# ifdef HAVE_MSGHDR_MSG_CONTROL
# ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
fd[0] = (*(int *)CMSG_DATA( cmsg ));
# endif
err = fstat( fd[0], &st );

View file

@ -42,7 +42,7 @@
#ifdef SLAPD_CRYPT
# include <ac/crypt.h>
# if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD )
# if defined( HAVE_GETPWNAM ) && defined( HAVE_STRUCT_PASSWD_PW_PASSWD )
# ifdef HAVE_SHADOW_H
# include <shadow.h>
# endif
@ -110,7 +110,7 @@ static LUTIL_PASSWD_HASH_FUNC hash_lanman;
static LUTIL_PASSWD_CHK_FUNC chk_crypt;
static LUTIL_PASSWD_HASH_FUNC hash_crypt;
#if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD )
#if defined( HAVE_GETPWNAM ) && defined( HAVE_STRUCT_PASSWD_PW_PASSWD )
static LUTIL_PASSWD_CHK_FUNC chk_unix;
#endif
#endif
@ -140,7 +140,7 @@ static const struct pw_scheme pw_schemes_default[] =
#ifdef SLAPD_CRYPT
{ BER_BVC("{CRYPT}"), chk_crypt, hash_crypt },
# if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD )
# if defined( HAVE_GETPWNAM ) && defined( HAVE_STRUCT_PASSWD_PW_PASSWD )
{ BER_BVC("{UNIX}"), chk_unix, NULL },
# endif
#endif
@ -815,7 +815,7 @@ static int chk_crypt(
return lutil_cryptptr( cred->bv_val, passwd->bv_val, NULL );
}
# if defined( HAVE_GETPWNAM ) && defined( HAVE_PW_PASSWD )
# if defined( HAVE_GETPWNAM ) && defined( HAVE_STRUCT_PASSWD_PW_PASSWD )
static int chk_unix(
const struct berval *sc,
const struct berval * passwd,

View file

@ -263,7 +263,7 @@ rewrite_xmap_apply(
break;
}
#ifdef HAVE_PW_GECOS
#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
if ( pwd->pw_gecos != NULL && pwd->pw_gecos[0] != '\0' ) {
int l = strlen( pwd->pw_gecos );
@ -279,7 +279,7 @@ rewrite_xmap_apply(
}
val->bv_len = l;
} else
#endif /* HAVE_PW_GECOS */
#endif /* HAVE_STRUCT_PASSWD_PW_GECOS */
{
val->bv_val = strdup( key->bv_val );
val->bv_len = key->bv_len;

View file

@ -41,7 +41,7 @@ ldbm_cache_open(
int i, lru, empty;
time_t oldtime;
char buf[MAXPATHLEN];
#ifdef HAVE_ST_BLKSIZE
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
struct stat st;
#endif
@ -162,7 +162,7 @@ ldbm_cache_open(
li->li_dbcache[i].dbc_lastref = slap_get_time();
li->li_dbcache[i].dbc_flags = flags;
li->li_dbcache[i].dbc_dirty = 0;
#ifdef HAVE_ST_BLKSIZE
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
if ( stat( buf, &st ) == 0 ) {
li->li_dbcache[i].dbc_blksize = st.st_blksize;
} else

View file

@ -644,7 +644,7 @@ ldbm_errno( LDBM ldbm )
#elif defined( HAVE_GDBM )
#ifdef HAVE_ST_BLKSIZE
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
#include <sys/stat.h>
#endif
@ -658,7 +658,7 @@ LDBM
ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize )
{
LDBM db;
#ifdef HAVE_ST_BLKSIZE
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
struct stat st;
#endif
#ifdef HAVE_EBCDIC
@ -677,7 +677,7 @@ ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize )
return( NULL );
}
#ifdef HAVE_ST_BLKSIZE
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
if ( dbcachesize > 0 && stat( name, &st ) == 0 ) {
dbcachesize /= st.st_blksize;
if( dbcachesize == 0 ) dbcachesize = 1;

View file

@ -312,7 +312,7 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e )
attr_merge_normalize_one( e, slap_schema.si_ad_cn, &val, NULL ); /* required by person */
attr_merge_normalize_one( e, ad_sn, &val, NULL ); /* required by person */
#ifdef HAVE_PW_GECOS
#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
/*
* if gecos is present, add it as a cn. first process it
* according to standard BSD usage. If the processed cn has
@ -352,7 +352,7 @@ pw2entry( Backend *be, struct passwd *pw, Entry *e )
attr_merge_normalize_one( e, ad_sn, &val, NULL );
}
}
#endif /* HAVE_PW_GECOS */
#endif /* HAVE_STRUCT_PASSWD_PW_GECOS */
return( 0 );
}