From: Kurt Zeilenga Date: Fri, 20 Sep 2002 19:07:59 +0000 (+0000) Subject: Fix getopt(3) detection X-Git-Tag: OPENLDAP_REL_ENG_2_0_27~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cb1293c347a00d753a5d23eaca98cc9b4b74e8c;p=thirdparty%2Fopenldap.git Fix getopt(3) detection --- diff --git a/CHANGES b/CHANGES index 7733dd938f..3c608091a0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ OpenLDAP 2.0 Change Log +OpenLDAP 2.0.27 Engineering + Build environment + Fix getopt(3) detection + OpenLDAP 2.0.26 Release Fixed slapd ACL buffer size bug (ITS#1963) Fixed slapd ACL filters w/substrings bug (ITS#2023, ITS#2027) diff --git a/build/version b/build/version index cbe0fb8872..a93b8c4783 100644 --- a/build/version +++ b/build/version @@ -1 +1 @@ -2.0.26-Release +2.0.27-Engineering diff --git a/configure b/configure index 8e65afdbe3..9fa22ec1ca 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # $OpenLDAP$ -# from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.40 2002/08/28 05:51:41 hyc Exp +# from OpenLDAP: pkg/ldap/configure.in,v 1.223.2.41 2002/09/12 19:40:49 kurt Exp # Copyright 1998-2002 The OpenLDAP Foundation. All Rights Reserved. # @@ -16964,19 +16964,78 @@ fi done +for ac_func in getopt +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:16971: checking for $ac_func" >&5 +if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); +char (*f)(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + +; return 0; } +EOF +if { (eval echo configure:17000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" +fi +done + + + if test "$ac_cv_func_getopt" != yes; then LIBSRCS="$LIBSRCS getopt.c" fi # Check Configuration echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6 -echo "configure:16974: checking declaration of sys_errlist" >&5 +echo "configure:17033: checking declaration of sys_errlist" >&5 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -16989,7 +17048,7 @@ int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:16993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:17052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ol_cv_dcl_sys_errlist=yes ol_cv_have_sys_errlist=yes @@ -17012,20 +17071,20 @@ EOF echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6 -echo "configure:17016: checking existence of sys_errlist" >&5 +echo "configure:17075: checking existence of sys_errlist" >&5 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *c = (char *) *sys_errlist ; return 0; } EOF -if { (eval echo configure:17029: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:17088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ol_cv_have_sys_errlist=yes else diff --git a/configure.in b/configure.in index 261554c763..423459ba20 100644 --- a/configure.in +++ b/configure.in @@ -2108,6 +2108,9 @@ AC_CHECK_FUNCS( \ sendto \ ) +dnl We actually may need to replace more than this. +AC_REPLACE_FUNCS(getopt) + if test "$ac_cv_func_getopt" != yes; then LIBSRCS="$LIBSRCS getopt.c" fi diff --git a/include/portable.h.in b/include/portable.h.in index 868fdc879f..47fadaac33 100644 --- a/include/portable.h.in +++ b/include/portable.h.in @@ -169,6 +169,9 @@ /* Define if you have the gethostname function. */ #undef HAVE_GETHOSTNAME +/* Define if you have the getopt function. */ +#undef HAVE_GETOPT + /* Define if you have the getpass function. */ #undef HAVE_GETPASS diff --git a/tests/progs/Makefile.in b/tests/progs/Makefile.in index 97cdcb64b8..ad4219d78a 100644 --- a/tests/progs/Makefile.in +++ b/tests/progs/Makefile.in @@ -12,7 +12,7 @@ SRCS = slapd-tester.c slapd-search.c slapd-read.c slapd-addel.c LDAP_INCDIR= ../../include LDAP_LIBDIR= ../../libraries -XLIBS = -lldap -llber +XLIBS = -lldap -llber -llutil XXLIBS = $(SECURITY_LIBS) $(LUTIL_LIBS) # build-tools: FORCE