Commit 490bb72f authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Remove DEFS variables from Makefiles, remove bridge.h.

Rely on portable.h.
parent 76ed17f7
......@@ -9,14 +9,11 @@
#undef DECL_SYS_ERRLIST
/* define if you have berkeley db */
#undef HAVE_BERKELEY_DB2
#undef HAVE_BERKELEY_DB
/* define if you have berkeley db2 */
#undef HAVE_BERKELEY_DB2
/* define if you have Mach CThreads */
#undef HAVE_CTHREADS
/* define if you have crypt */
#undef HAVE_CRYPT
......@@ -44,6 +41,9 @@
/* define if you have NDBM */
#undef HAVE_NDBM
/* define if you have Mach CThreads */
#undef HAVE_MACH_CTHREADS
/* define if you have a preemptive POSIX Threads implementation */
#undef HAVE_PREEMPTIVE_PTHREADS
......@@ -56,44 +56,80 @@
/* define if you have -ltermcap */
#undef HAVE_TERMCAP
/* define if you have -lwrap */
#undef HAVE_TCPD
/* define this for connectionless LDAP support */
#undef LDAP_CONNECTIONLESS
/* define this to add debugging code */
#undef LDAP_DEBUG
/* define this for LDAP DNS support */
#undef LDAP_DNS
/* define this to remove -lldap cache support */
#undef LDAP_NOCACHE
/* define this for LDAP referrals support */
#undef LDAP_REFERRALS
/* define this for LDAP User Interface support */
#undef LDAP_LIBUI
/* define this for ACL Group support */
#undef SLAPD_ACLGROUPS
/* define this for Reverse Lookup support */
#undef SLAPD_RLOOKUPS
/* define this for crypt(3) password support */
#undef SLAPD_CRYPT
/* define this to use SLAPD LDBM backend */
#undef SLAPD_LDBM
/* define this for MD5 password support */
#undef SLAPD_MD5
/* define this to use SLAPD passwd backend */
#undef SLAPD_PASSWD
/* define this for phonetic support */
#undef SLAPD_PHONETIC
/* define this for Reverse Lookup support */
#undef SLAPD_RLOOKUPS
/* define this for SHA1 password support */
#undef SLAPD_SHA1
/* define this to use SLAPD shell backend */
/* #undef SLAPD_SHELL */
#undef SLAPD_SHELL
/* define this to use SLAPD passwd backend */
/* #undef SLAPD_PASSWD */
/* define this to use DB2 in native mode */
#undef LDBM_USE_DB2
/* define this to use SLAPD LDBM backend */
/* #undef SLAPD_LDBM */
/* define this to use DB2 in compat185 mode */
#undef LDBM_USE_DB2_COMPAT185
/* define this to use DBBTREE w/ LDBM backend */
/* #undef LDBM_USE_DBBTREE */
#undef LDBM_USE_DBBTREE
/* define this to use DBHASH w/ LDBM backend */
/* #undef LDBM_USE_DBHASH */
#undef LDBM_USE_DBHASH
/* define this to use GDBM w/ LDBM backend */
/* #undef LDBM_USE_GDBM */
#undef LDBM_USE_GDBM
/* define this to use NDBM w/ LDBM backend */
/* #undef LDBM_USE_NDBM */
#undef LDBM_USE_NDBM
/* define this if you want no termcap support */
#undef NO_TERMCAP
/* define this if you want no thread support */
#undef NO_THREADS
/* define this if the thread package is preemptive */
#undef THREAD_PREEMPTIVE
/* Leave that blank line there!! Autoheader needs it. */
......@@ -69,19 +69,17 @@ LDAP_LIBDEPEND = $(LDAP_LIBDIR)/libldif.a $(LDAP_LIBDIR)/libldap.a $(LDAP_LIBDIR
# AutoConfig generated
AC_CC = @CC@
AC_DEFS = @CPPFLAGS@ @DEFS@ @LDAP_DEFS@
AC_DEFS = @CPPFLAGS@ @DEFS@
AC_LIBS = @LDFLAGS@ @LIBS@
AC_CFLAGS = @CFLAGS@
AC_LDFLAGS =
KRB_DEFS = @KRB_DEFS@
KRB_LIBS = @KRB_LIBS@
TERMCAP_DEFS = @TERMCAP_DEFS@
TERMCAP_LIBS = @TERMCAP_LIBS@
# Our Defaults
CC = $(AC_CC)
DEFS = $(LDAP_DEFS) $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS)
DEFS = $(LDAP_INCPATH) $(XINCPATH) $(XDEFS) $(AC_DEFS)
LIBS = $(LDAP_LIBS) $(XLIBS) $(AC_LIBS)
CFLAGS = $(AC_CFLAGS) $(DEFS) $(DEFINES)
......
......@@ -9,7 +9,6 @@ PROGRAMS= ud
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XDEFS = $(TERMCAP_DEFS)
XLIBS = $(TERMCAP_LIBS)
ud : version.o
......
This diff is collapsed.
......@@ -164,20 +164,13 @@ fi
AC_MSG_RESULT(done)
## Initialize vars
LDAP_DEFS=
LDAP_LIBS=
LDBM_DEFS=
LDBM_LIBS=
LTHREAD_DEFS=
LTHREAD_LIBS=
LUTIL_DEFS=
LUTIL_LIBS=
LDAPD_DEFS=
LDAPD_LIBS=
SLAPD_DEFS=
SLAPD_LIBS=
SLURPD_DEFS=
SLURPD_LIBS=
BUILD_LDAPD=no
......@@ -188,9 +181,7 @@ BUILD_LDBM=no
BUILD_PASSWD=no
BUILD_SHELL=no
KRB_DEFS=
KRB_LIBS=
TERMCAP_DEFS=
TERMCAP_LIBS=
dnl ----------------------------------------------------------------
......@@ -250,7 +241,6 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
AC_DEFINE(HAVE_KERBEROS)
KRB_DEFS="-DKERBEROS"
KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
fi
fi
......@@ -267,7 +257,6 @@ if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
AC_DEFINE(HAVE_KERBEROS)
KRB_DEFS="-DKERBEROS"
KRB_LIBS="-lkrb -ldes"
fi
fi
......@@ -282,10 +271,9 @@ if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
OL_POSIX_THREAD_VERSION
if test $ol_cv_pthread_version = final ; then
LTHREAD_DEFS="$LTHREAD_DEFS -DPOSIX_THREADS"
dnl AC_DEFINE(HAVE_PTHREADS_FINAL)
elif test $ol_cv_pthread_version = draft4 ; then
AC_DEFINE(HAVE_PTHREADS_D4)
LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_MIT_PTHREADS"
else
AC_MSG_ERROR([unknown pthread version])
fi
......@@ -297,7 +285,6 @@ if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
if test $ol_cv_linux_threads = yes ; then
AC_DEFINE(HAVE_LINUX_THREADS,1)
LTHREAD_DEFS="$LTHREAD_DEFS -DLINUX_THREADS"
fi
dnl Now the hard part, how to link
......@@ -350,7 +337,6 @@ if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
AC_CHECK_LIB(pthread, pthread_create, [
AC_DEFINE(HAVE_DCE)
ol_link_threads=posix
LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_DCE_THREADS"
LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc"],,
if test $with_preemptive = auto ; then
ol_with_preemptive=yes
......@@ -365,7 +351,6 @@ if test $ol_with_threads = auto -o $ol_with_threads = posix ; then
dnl save DEFS/LIBS
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
CPPFLAGS="$LTHREAD_DEFS $CPPFLAGS"
LIBS="$LTHREAD_LIBS $LIBS"
dnl All POSIX Thread (final) implementations should have
......@@ -461,8 +446,7 @@ if test $ol_with_threads = auto -o $ol_with_threads = cthreads ; then
AC_CHECK_LIB(lwp, cthread_fork, [have_cthreads=yes], [have_cthreads=no])
if test $have_cthreads = yes ; then
AC_DEFINE(HAVE_CTHREADS)
LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_NEXT_CTHREADS"
AC_DEFINE(HAVE_MACH_CTHREADS)
LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
fi
fi
......@@ -477,7 +461,6 @@ if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
if test $have_lwp = yes ; then
AC_DEFINE(HAVE_LWP)
AC_DEFINE(HAVE_LWP_THR)
LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_SUNOS5_LWP"
LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
fi
fi
......@@ -489,7 +472,6 @@ if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
if test $have_lwp = yes ; then
AC_DEFINE(HAVE_LWP)
LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_SUNOS4_LWP"
LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
if test $with_preemptive = auto ; then
......@@ -500,7 +482,7 @@ if test $ol_with_threads = auto -o $ol_with_threads = lwp ; then
fi
if test $ol_with_preemptive = yes ; then
LTHREAD_DEFS="$LTHREAD_DEFS -DTHREAD_PREEMPTIVE"
AC_DEFINE(THREAD_PREEMPTIVE,1)
fi
if test $ol_with_threads = manual ; then
......@@ -528,7 +510,7 @@ if test $ol_link_threads = no ; then
$ol_with_threads = no
fi
LTHREAD_DEFS="-DNO_THREADS"
AC_DEFINE(NO_THREADS,1)
LTHREAD_LIBS=""
fi
......@@ -540,12 +522,10 @@ if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
ol_link_ldbm=db2
ol_with_ldbm_api=db2
LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2"
if test $ol_with_ldbm_type = hash ; then
LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBHASH"
AC_DEFINE(LDBM_USE_DBHASH,1)
else
LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBBTREE"
AC_DEFINE(LDBM_USE_DBBTREE,1)
fi
dnl $ol_cv_lib_db2 should be yes or -ldb
......@@ -563,14 +543,10 @@ if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
ol_link_ldbm=db
ol_with_ldbm_api=db
if test $ac_cv_header_db_185_h = yes ; then
LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DB2_COMPAT185"
fi
if test $ol_with_ldbm_type = hash ; then
LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBHASH"
AC_DEFINE(LDBM_USE_DBHASH,1)
else
LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_DBBTREE"
AC_DEFINE(LDBM_USE_DBBTREE,1)
fi
dnl $ol_cv_lib_db should be yes or -ldb
......@@ -602,8 +578,6 @@ if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
ol_link_ldbm=gdbm
ol_with_ldbm_api=gdbm
LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_GDBM"
if test $ol_cv_lib_gdbm != yes ; then
LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
fi
......@@ -621,8 +595,6 @@ if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = ndbm ; then
AC_WARN([Attempting to use NDBM. Functionality will be limited.])
fi
LDBM_DEFS="$LDBM_DEFS -DLDBM_USE_NDBM"
if test $ol_cv_lib_ndbm != yes ; then
LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
fi
......@@ -644,8 +616,7 @@ if test $ol_enable_wrappers = yes ; then
[have_wrappers=yes], [have_wrappers=no])
if test $have_wrappers = yes ; then
dnl AC_DEFINE(HAVE_TCPD)
SLAPD_DEFS="$SLAPD_DEFS -DTCP_WRAPPERS"
AC_DEFINE(HAVE_TCPD)
SLAPD_LIBS="$SLAPD_LIBS -lwrap"
else
AC_MSG_WARN(could not find -lwrap)
......@@ -682,7 +653,7 @@ if test $ol_link_termcap = no ; then
fi
if test $ol_link_termcap = no ; then
TERMCAP_DEFS="-DNOTERMCAP"
AC_DEFINE(NO_TERMCAP,1)
TERMCAP_LIBS=
fi
......@@ -693,8 +664,7 @@ if test $ol_enable_crypt != no ; then
have_crypt=yes], [have_crypt=no])])
if test $have_crypt = yes ; then
dnl AC_DEFINE(HAVE_CRYPT)
LUTIL_DEFS="$LUTIL_DEFS -DLDAP_CRYPT"
AC_DEFINE(HAVE_CRYPT)
else
AC_MSG_WARN(could not find crypt)
if test $ol_enable_crypt = yes ; then
......@@ -789,71 +759,67 @@ dnl ----------------------------------------------------------------
dnl Sort out defines
if test $ol_enable_debug != no ; then
LDAP_DEFS="$LDAP_DEFS -DLDAP_DEBUG"
AC_DEFINE(LDAP_DEBUG,1)
fi
dnl if test $ol_enable_syslog != no ; then
dnl LDAP_DEFS="$LDAP_DEFS -DLDAP_SYSLOG"
dnl AC_DEFINE(LDAP_SYSLOG,1)
dnl fi
if test $ol_enable_libui = yes ; then
LDAP_DEFS="$LDAP_DEFS -DLDAP_LIBUI"
AC_DEFINE(LDAP_LIBUI,1)
fi
if test $ol_enable_cache = no ; then
LDAP_DEFS="$LDAP_DEFS -DNO_CACHE"
AC_DEFINE(LDAP_NOCACHE,1)
fi
if test $ol_enable_dns != no ; then
LDAP_DEFS="$LDAP_DEFS -DLDAP_DNS"
AC_DEFINE(LDAP_DNS,1)
fi
if test $ol_enable_referrals != no ; then
LDAP_DEFS="$LDAP_DEFS -DLDAP_REFERRALS"
AC_DEFINE(LDAP_REFERRALS,1)
fi
if test $ol_enable_cldap != no ; then
LDAP_DEFS="$LDAP_DEFS -DCLDAP"
AC_DEFINE(LDAP_CONNECTIONLESS,1)
fi
if test $ol_enable_aclgroup != no ; then
AC_DEFINE(SLAPD_ACLGROUP,1)
SLAPD_DEFS="$SLAPD_DEFS -DACLGROUP"
fi
if test $ol_enable_crypt != no ; then
AC_DEFINE(SLAPD_CRYPT,1)
fi
if test $ol_enable_md5 != no ; then
dnl AC_DEFINE(SLAPD_MD5,1)
LUTIL_DEFS="$LUTIL_DEFS -DLDAP_MD5"
AC_DEFINE(SLAPD_MD5,1)
fi
if test $ol_enable_sha1 != no ; then
dnl AC_DEFINE(SLAPD_SHA1,1)
LUTIL_DEFS="$LUTIL_DEFS -DLDAP_SHA1"
AC_DEFINE(SLAPD_SHA1,1)
fi
if test $ol_enable_phonetic != no ; then
AC_DEFINE(SLAPD_PHONETIC,1)
SLAPD_DEFS="$SLAPD_DEFS -DSOUNDEX"
fi
if test $ol_enable_rlookups != no ; then
AC_DEFINE(SLAPD_RLOOKUPS,1)
SLAPD_DEFS="$SLAPD_DEFS -DREVERSE_LOOKUPS"
fi
if test $ol_link_ldbm != no ; then
dnl AC_DEFINE(SLAPD_LDBM,1)
AC_DEFINE(SLAPD_LDBM,1)
BUILD_SLAPD=yes
BUILD_LDBM=yes
LDBM_DEFS="-DLDAP_LDBM $LDBM_DEFS"
fi
if test $ol_enable_passwd != no ; then
dnl AC_DEFINE(SLAPD_PASSWD,1)
AC_DEFINE(SLAPD_PASSWD,1)
BUILD_SLAPD=yes
BUILD_PASSWD=yes
SLAPD_DEFS="-DLDAP_PASSWD $SLAPD_DEFS"
fi
if test $ol_enable_shell != no ; then
dnl AC_DEFINE(SLAPD_SHELL,1)
AC_DEFINE(SLAPD_SHELL,1)
BUILD_SLAPD=yes
BUILD_SHELL=yes
SLAPD_DEFS="-DLDAP_SHELL $SLAPD_DEFS"
fi
if test $ol_enable_slurpd != no -a $ol_link_threads != no -a \
......@@ -871,24 +837,15 @@ AC_SUBST(BUILD_SLAPD)
AC_SUBST(BUILD_SLURPD)
AC_SUBST(LDAP_DEFS)
AC_SUBST(LDAP_LIBS)
AC_SUBST(LDAPD_DEFS)
AC_SUBST(LDAPD_LIBS)
AC_SUBST(SLAPD_DEFS)
AC_SUBST(SLAPD_LIBS)
AC_SUBST(SLURPD_DEFS)
AC_SUBST(SLURPD_LIBS)
AC_SUBST(LDBM_DEFS)
AC_SUBST(LDBM_LIBS)
AC_SUBST(LTHREAD_DEFS)
AC_SUBST(LTHREAD_LIBS)
AC_SUBST(LUTIL_DEFS)
AC_SUBST(LUTIL_LIBS)
AC_SUBST(KRB_DEFS)
AC_SUBST(KRB_LIBS)
AC_SUBST(TERMCAP_DEFS)
AC_SUBST(TERMCAP_LIBS)
dnl ----------------------------------------------------------------
......
......@@ -21,6 +21,8 @@
* this structure represents a generic avl tree node.
*/
LDAP_BEGIN_DECL
typedef struct avlnode {
caddr_t avl_data;
signed char avl_bf;
......@@ -76,4 +78,6 @@ avl_apply LDAP_P((Avlnode *, IFP, caddr_t, int, int));
/* what apply returns if it ran out of nodes */
#define AVL_NOMORE -6
LDAP_END_DECL
#endif /* _AVL */
/*
* Copyright (c) 1994 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of Michigan at Ann Arbor. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
/* This file SHOULD go away !!! */
#ifndef _LDAP_BRIDGE_H
#define _LDAP_BRIDGE_H
/*
* portable.h for LDAP -- this is where we define common stuff to make
* life easier on various Unix systems.
*
* Unless you are porting LDAP to a new platform, you should not need to
* edit this file.
*/
#ifndef LDAP_LIBUI
#ifndef NO_USERINTERFACE
#define NO_USERINTERFACE
#endif
#endif
#ifndef SYSV
#if defined( hpux ) || defined( sunos5 ) || defined ( sgi ) || defined( SVR4 )
# define SYSV
#endif
#endif
/*
* under System V, use sysconf() instead of getdtablesize
*/
#if defined( HAVE_SYSCONF ) && !defined( HAVE_GETDTABLESIZE )
#define USE_SYSCONF
#endif
/*
* under System V, daemons should use setsid() instead of detaching from their
* tty themselves
*/
#if defined( HAVE_SETSID )
#define USE_SETSID
#endif
/*
* System V has socket options in filio.h
*/
#if defined( HAVE_FILIO_H )
#define NEED_FILIO
#endif
/*
* use lockf() under System V
*/
#if !defined( HAVE_LOCKF ) && !defined( HAVE_FLOCK )
#define USE_LOCKF
#endif
/*
* on most systems, we should use waitpid() instead of waitN()
*/
#if defined( HAVE_WAITPID ) && !defined( nextstep )
#define USE_WAITPID
#endif
/*
* define the wait status argument type
*/
#if !defined( WAITSTATUSTYPE )
#if !defined( HAVE_SYS_WAIT_H )
#define WAITSTATUSTYPE union wait
#else
#define WAITSTATUSTYPE int
#endif
#endif
/*
* define the flags for wait
*/
#if !defined( WAIT_FLAGS )
#ifdef sunos5
#define WAIT_FLAGS ( WNOHANG | WUNTRACED | WCONTINUED )
#else
#define WAIT_FLAGS ( WNOHANG | WUNTRACED )
#endif
#endif
/*
* defined the options for openlog (syslog)
*/
#if !defined( OPENLOG_OPTIONS )
#ifdef ultrix
#define OPENLOG_OPTIONS LOG_PID
#else
#define OPENLOG_OPTIONS ( LOG_PID | LOG_NOWAIT )
#endif
#endif
/*
* many systems do not have the setpwfile() library routine... we just
* enable use for those systems we know have it.
*/
#ifdef NOTDEF
#ifndef HAVE_SETPWFILE
#if defined( sunos4 ) || defined( ultrix ) || defined( __osf__ )
#define HAVE_SETPWFILE
#endif
#endif
#endif NOTDEF
#ifndef DISABLE_BRIDGE
/*
* Are sys_errlist and sys_nerr declared in stdio.h?
*/
#ifndef SYSERRLIST_IN_STDIO
#if !defined( DECL_SYS_ERRLIST )
#define SYSERRLIST_IN_STDIO
#endif
#endif
/*
* for select()
*/
#if !defined(FD_SET) && !defined(WINSOCK)
#define NFDBITS 32
#define FD_SETSIZE 32
#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))
#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))
#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))
#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))
#endif /* FD_SET */
#endif
#if defined( hpux ) && defined( __STDC__ )
/*
* Under HP/UX, select seems to want (int *) instead of fd_set. Non-ANSI
* compilers don't like recursive macros, so ignore the problem if __STDC__
* is not defined.
*/
#define select(a,b,c,d,e) select(a, (int *)b, (int *)c, (int *)d, e)
#endif /* hpux && __STDC__ */
/*
* for signal() -- what do signal handling functions return?
*/
#ifdef RETSIGTYPE
#define SIG_FN RETSIGTYPE
#endif
/*
* call signal or sigset (signal does not block the signal while
* in the handler on sys v and sigset does not exist on bsd)
*/
#ifndef SIGNAL
#ifdef HAVE_SIGSET
#define SIGNAL sigset
#else
#define SIGNAL signal
#endif
#endif
/*
* toupper and tolower macros are different under bsd and sys v
*/
#if defined( SYSV ) && !defined( hpux )
#define TOUPPER(c) (isascii(c) && islower(c) ? _toupper(c) : c)
#define TOLOWER(c) (isascii(c) && isupper(c) ? _tolower(c) : c)
#else
#define TOUPPER(c) (isascii(c) && islower(c) ? toupper(c) : c)
#define TOLOWER(c) (isascii(c) && isupper(c) ? tolower(c) : c)
#endif
/*
* put a cover on the tty-related ioctl calls we need to use
*/
#if !defined( HAVE_TERMIOS_H )