From owner-trustedbsd-cvs@FreeBSD.ORG Tue Mar 28 11:56:20 2006 Return-Path: X-Original-To: trustedbsd-cvs@freebsd.org Delivered-To: trustedbsd-cvs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BD2D16A482 for ; Tue, 28 Mar 2006 11:56:20 +0000 (UTC) (envelope-from owner-perforce@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D6A943D46 for ; Tue, 28 Mar 2006 11:56:18 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by cyrus.watson.org (Postfix) with ESMTP id CAFEF46BB0 for ; Tue, 28 Mar 2006 06:56:14 -0500 (EST) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 10751557C9; Tue, 28 Mar 2006 11:56:13 +0000 (GMT) (envelope-from owner-perforce@freebsd.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 0B03516A420; Tue, 28 Mar 2006 11:56:13 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C67A816A400 for ; Tue, 28 Mar 2006 11:56:12 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7FF8F43D46 for ; Tue, 28 Mar 2006 11:56:12 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k2SBuC0U016287 for ; Tue, 28 Mar 2006 11:56:12 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k2SBuC2C016273 for perforce@freebsd.org; Tue, 28 Mar 2006 11:56:12 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Tue, 28 Mar 2006 11:56:12 GMT Message-Id: <200603281156.k2SBuC2C016273@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 94156 for review X-BeenThere: trustedbsd-cvs@FreeBSD.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: TrustedBSD CVS and Perforce commit message list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2006 11:56:20 -0000 http://perforce.freebsd.org/chv.cgi?CH=94156 Change 94156 by rwatson@rwatson_zoo on 2006/03/28 11:56:08 Don't test for -lbsm, since we're going to use our own copy anyway. Do test for dlsym() in libc, then libdl, since that's required on Linux. Affected files ... .. //depot/projects/trustedbsd/openbsm/config/config.h.in#7 edit .. //depot/projects/trustedbsd/openbsm/configure#17 edit .. //depot/projects/trustedbsd/openbsm/configure.ac#19 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/config/config.h.in#7 (text+ko) ==== @@ -42,9 +42,6 @@ /* Define if ipc_perm.__seq instead of seq */ #undef HAVE_IPC_PERM___SEQ -/* Define to 1 if you have the `bsm' library (-lbsm). */ -#undef HAVE_LIBBSM - /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_ENDIAN_H ==== //depot/projects/trustedbsd/openbsm/configure#17 (xtext) ==== @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#17 . +# From configure.ac P4: //depot/projects/trustedbsd/openbsm/configure.ac#18 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for OpenBSM 1.0a5. # @@ -19627,16 +19627,13 @@ -# Checks for libraries. -# FIXME: Replace `main' with a function in `-lbsm': - -echo "$as_me:$LINENO: checking for main in -lbsm" >&5 -echo $ECHO_N "checking for main in -lbsm... $ECHO_C" >&6 -if test "${ac_cv_lib_bsm_main+set}" = set; then +echo "$as_me:$LINENO: checking for library containing dlsym" >&5 +echo $ECHO_N "checking for library containing dlsym... $ECHO_C" >&6 +if test "${ac_cv_search_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsm $LIBS" + ac_func_search_save_LIBS=$LIBS +ac_cv_search_dlsym=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19644,11 +19641,72 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlsym (); +int +main () +{ +dlsym (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_dlsym="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_dlsym" = no; then + for ac_lib in -ldl; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dlsym (); int main () { -main (); +dlsym (); ; return 0; } @@ -19675,25 +19733,23 @@ ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_cv_lib_bsm_main=yes + ac_cv_search_dlsym="-l$ac_lib" +break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_bsm_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + done +fi +LIBS=$ac_func_search_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bsm_main" >&5 -echo "${ECHO_T}$ac_cv_lib_bsm_main" >&6 -if test $ac_cv_lib_bsm_main = yes; then - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBBSM 1 -_ACEOF - - LIBS="-lbsm $LIBS" +echo "$as_me:$LINENO: result: $ac_cv_search_dlsym" >&5 +echo "${ECHO_T}$ac_cv_search_dlsym" >&6 +if test "$ac_cv_search_dlsym" != no; then + test "$ac_cv_search_dlsym" = "none required" || LIBS="$ac_cv_search_dlsym $LIBS" fi ==== //depot/projects/trustedbsd/openbsm/configure.ac#19 (text+ko) ==== @@ -3,7 +3,7 @@ AC_PREREQ(2.59) AC_INIT([OpenBSM], [1.0a5], [trustedbsd-audit@TrustesdBSD.org],[openbsm]) -AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#18 $]) +AC_REVISION([$P4: //depot/projects/trustedbsd/openbsm/configure.ac#19 $]) AC_CONFIG_SRCDIR([bin/auditreduce/auditreduce.c]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER([config/config.h]) @@ -16,9 +16,7 @@ AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) -# Checks for libraries. -# FIXME: Replace `main' with a function in `-lbsm': -AC_CHECK_LIB([bsm], [main]) +AC_SEARCH_LIBS(dlsym, -ldl,,) # Checks for header files. AC_HEADER_STDC