From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1141 invoked by alias); 14 Aug 2014 22:21:24 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 1128 invoked by uid 89); 14 Aug 2014 22:21:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: mx.rtems.org Received: from mx.rtems.org (HELO mx.rtems.org) (140.211.10.141) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 14 Aug 2014 22:21:13 +0000 Received: from rtems.org (rtems.org [67.63.146.250]) by mx.rtems.org (Postfix) with ESMTP id 1063F35FD22; Thu, 14 Aug 2014 22:21:11 +0000 (UTC) Received: from rtbf64a.rtems.org (rtbf64a.rtems.org [192.168.1.92]) by rtems.org (Postfix) with ESMTP id 5ACD04D06B7; Thu, 14 Aug 2014 17:21:10 -0500 (CDT) Received: from rtbf64a.rtems.org (localhost [127.0.0.1]) by rtbf64a.rtems.org (8.14.8/8.14.8) with ESMTP id s7EML9wT009942; Thu, 14 Aug 2014 17:21:09 -0500 Received: (from joel@localhost) by rtbf64a.rtems.org (8.14.8/8.14.8/Submit) id s7EML80k009941; Thu, 14 Aug 2014 17:21:08 -0500 From: Joel Sherrill To: gdb@sourceware.org Cc: Joel Sherrill Subject: [PATCH 1/1] erc32 sim: Add libdl to build of sis Date: Thu, 14 Aug 2014 22:21:00 -0000 Message-Id: <1408054866-9877-1-git-send-email-joel.sherrill@oarcorp.com> X-IsSubscribed: yes X-SW-Source: 2014-08/txt/msg00043.txt.bz2 sis failed to link on Fedora 20 because it was not linking against libdl. There may be a better way but this does work. 2013-08-14 Joel Sherrill * Makefile.in, configure.ac: Probe for libdl and use if available. * configure: Regenerated --- sim/erc32/Makefile.in | 3 +- sim/erc32/configure | 94 +++++++++++++++++++++++++++++++++++++++++++++----- sim/erc32/configure.ac | 3 ++ 3 files changed, 90 insertions(+), 10 deletions(-) diff --git a/sim/erc32/Makefile.in b/sim/erc32/Makefile.in index 0ce58a6..b5a6c4b 100644 --- a/sim/erc32/Makefile.in +++ b/sim/erc32/Makefile.in @@ -20,9 +20,10 @@ TERMCAP_LIB = @TERMCAP@ READLINE_LIB = @READLINE@ +DL_LIB = @DLLIB@ SIM_OBJS = exec.o erc32.o func.o help.o float.o interf.o -SIM_EXTRA_LIBS = $(READLINE_LIB) $(TERMCAP_LIB) -lm +SIM_EXTRA_LIBS = $(READLINE_LIB) $(TERMCAP_LIB) $(DL_LIB) -lm SIM_EXTRA_ALL = sis SIM_EXTRA_INSTALL = install-sis SIM_EXTRA_CLEAN = clean-sis diff --git a/sim/erc32/configure b/sim/erc32/configure index b8fd852..dd9882e 100755 --- a/sim/erc32/configure +++ b/sim/erc32/configure @@ -601,6 +601,7 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS cgen_breaks +DLLIB READLINE TERMCAP REPORT_BUGS_TEXI @@ -1389,7 +1390,7 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-plugins Enable support for plugins (defaults no) + --enable-plugins Enable support for plugins --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -8768,15 +8769,46 @@ fi # BFD uses libdl when when plugins enabled. -# Check whether --enable-plugins was given. + maybe_plugins=no + for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 1 +_ACEOF + maybe_plugins=yes +fi + +done + + for ac_header in windows.h +do : + ac_fn_c_check_header_compile "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default +" +if test "x$ac_cv_header_windows_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + maybe_plugins=yes +fi + +done + + + # Check whether --enable-plugins was given. if test "${enable_plugins+set}" = set; then : enableval=$enable_plugins; case "${enableval}" in - yes | "") plugins=yes ;; - no) plugins=no ;; - *) plugins=yes ;; - esac + no) plugins=no ;; + *) plugins=yes + if test "$maybe_plugins" != "yes" ; then + as_fn_error "Building with plugin support requires a host that supports dlopen." "$LINENO" 5 + fi ;; + esac else - plugins=no + plugins=$maybe_plugins + fi @@ -12265,7 +12297,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12268 "configure" +#line 12300 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12371,7 +12403,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12374 "configure" +#line 12406 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13022,6 +13054,50 @@ fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dl in -ldl" >&5 +$as_echo_n "checking for dl in -ldl... " >&6; } +if test "${ac_cv_lib_dl_dl+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dl (); +int +main () +{ +return dl (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dl=yes +else + ac_cv_lib_dl_dl=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dl" >&5 +$as_echo "$ac_cv_lib_dl_dl" >&6; } +if test "x$ac_cv_lib_dl_dl" = x""yes; then : + DLLIB=-ldl +else + : +fi + + + ac_sources="$sim_link_files" ac_dests="$sim_link_links" while test -n "$ac_sources"; do diff --git a/sim/erc32/configure.ac b/sim/erc32/configure.ac index bc46091..21e5813 100644 --- a/sim/erc32/configure.ac +++ b/sim/erc32/configure.ac @@ -32,4 +32,7 @@ else AC_ERROR([the required "readline" library is missing]), $TERMCAP) fi AC_SUBST(READLINE) + +AC_CHECK_LIB(dl, dl, DLLIB=-ldl, :, ) +AC_SUBST(DLLIB) SIM_AC_OUTPUT -- 1.9.3