public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD
@ 2020-08-20  6:22 Sebastian Huber
  2020-08-20  6:45 ` Sebastian Huber
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Huber @ 2020-08-20  6:22 UTC (permalink / raw)
  To: gdb; +Cc: Simon Marchi

Hello,

this commit

commit f693213d126a823f7c81e61f3ef05b501b862bce
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Wed Jul 29 16:02:57 2020 -0400

     Run `autoreconf -vf` throughout

includes this change in "sim/bfin/configure":

-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-
+PKG_PROG_PKG_CONFIG
+PKG_CHECK_MODULES(SDL, sdl,
+       AC_CHECK_LIB(dl, dlopen, [
                 SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL"
                 SDL_LIBS="-ldl"
-
-else
-  SDL_CFLAGS= SDL_LIBS=
-fi
-
-
-fi
+               ], [SDL_CFLAGS= SDL_LIBS=])
+       , :)

This looks like an incomplete macro expansion. It cases a shell syntax 
error on FreeBSD:

checking for /usr/bin/cc -O2 -pipe -fbracket-depth=1024 
-I/usr/home/user/rtems-source-builder/rtems/build/tmp/sb-1001/6/rtems-bfin/usr/local/rtems/6/include 
option to produce PIC... -fPIC -DPIC
../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: 
PKG_PROG_PKG_CONFIG: not found
../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: 
13930: Syntax error: word unexpected (expecting ")")


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD
  2020-08-20  6:22 Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD Sebastian Huber
@ 2020-08-20  6:45 ` Sebastian Huber
  2020-08-20 13:16   ` Simon Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Sebastian Huber @ 2020-08-20  6:45 UTC (permalink / raw)
  To: gdb; +Cc: Simon Marchi

On 20/08/2020 08:22, Sebastian Huber wrote:

> Hello,
>
> this commit
>
> commit f693213d126a823f7c81e61f3ef05b501b862bce
> Author: Simon Marchi <simon.marchi@efficios.com>
> Date:   Wed Jul 29 16:02:57 2020 -0400
>
>     Run `autoreconf -vf` throughout
>
> includes this change in "sim/bfin/configure":
>
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 
> $ac_cv_lib_dl_dlopen" >&5
> -$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
> -if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
> -
> +PKG_PROG_PKG_CONFIG
> +PKG_CHECK_MODULES(SDL, sdl,
> +       AC_CHECK_LIB(dl, dlopen, [
>                 SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL"
>                 SDL_LIBS="-ldl"
> -
> -else
> -  SDL_CFLAGS= SDL_LIBS=
> -fi
> -
> -
> -fi
> +               ], [SDL_CFLAGS= SDL_LIBS=])
> +       , :)
>
> This looks like an incomplete macro expansion. It cases a shell syntax 
> error on FreeBSD:
>
> checking for /usr/bin/cc -O2 -pipe -fbracket-depth=1024 
> -I/usr/home/user/rtems-source-builder/rtems/build/tmp/sb-1001/6/rtems-bfin/usr/local/rtems/6/include 
> option to produce PIC... -fPIC -DPIC
> ../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: 
> PKG_PROG_PKG_CONFIG: not found
> ../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: 
> 13930: Syntax error: word unexpected (expecting ")")

It fails also on Linux:

../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: line 
13929: PKG_PROG_PKG_CONFIG: command not found
../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: line 
13930: syntax error near unexpected token `SDL,'
../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: line 
13930: `PKG_CHECK_MODULES(SDL, sdl,'
configure: creating ./config.status
configure: error: 
../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure 
failed for bfin


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD
  2020-08-20  6:45 ` Sebastian Huber
@ 2020-08-20 13:16   ` Simon Marchi
  2020-08-20 13:43     ` Andreas Schwab
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Marchi @ 2020-08-20 13:16 UTC (permalink / raw)
  To: Sebastian Huber, gdb; +Cc: Simon Marchi

On 2020-08-20 2:45 a.m., Sebastian Huber wrote:
> It fails also on Linux:
> 
> ../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: line 
> 13929: PKG_PROG_PKG_CONFIG: command not found
> ../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: line 
> 13930: syntax error near unexpected token `SDL,'
> ../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure: line 
> 13930: `PKG_CHECK_MODULES(SDL, sdl,'
> configure: creating ./config.status
> configure: error: 
> ../../../sourceware-mirror-binutils-gdb-c2fd7fa/sim/bfin/configure 
> failed for bfin
> 

Indeed, I see this.  When I run `autoreconf -vf` in this directory, I get:

$ autoreconf -vf
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
autoreconf: configure.ac: not running libtoolize: --install not given
autoreconf: running: /opt/autostuff/bin/autoconf --force
configure.ac:57: error: possibly undefined macro: AC_CHECK_LIB
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /opt/autostuff/bin/autoconf failed with exit status: 1

So the command must have failed when I ran it and I didn't notice, my bad.

I searched a bit, and I am a bit clueless as for why AC_CHECK_LIB is not found.  If
anybody has any idea, help would be appreciated.

Thanks,

Simon

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD
  2020-08-20 13:16   ` Simon Marchi
@ 2020-08-20 13:43     ` Andreas Schwab
  2020-08-20 13:45       ` Simon Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Schwab @ 2020-08-20 13:43 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Sebastian Huber, gdb, Simon Marchi

On Aug 20 2020, Simon Marchi wrote:

> Indeed, I see this.  When I run `autoreconf -vf` in this directory, I get:
>
> $ autoreconf -vf
> autoreconf: Entering directory `.'
> autoreconf: configure.ac: not using Gettext
> autoreconf: running: aclocal --force
> autoreconf: configure.ac: tracing
> autoreconf: configure.ac: not running libtoolize: --install not given
> autoreconf: running: /opt/autostuff/bin/autoconf --force
> configure.ac:57: error: possibly undefined macro: AC_CHECK_LIB
>       If this token and others are legitimate, please use m4_pattern_allow.
>       See the Autoconf documentation.
> autoreconf: /opt/autostuff/bin/autoconf failed with exit status: 1
>
> So the command must have failed when I ran it and I didn't notice, my bad.
>
> I searched a bit, and I am a bit clueless as for why AC_CHECK_LIB is not found.  If
> anybody has any idea, help would be appreciated.

That's because aclocal cannot find a definition of PKG_CHECK_MODULES.
You need to run autoreconf with -I ../../config.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD
  2020-08-20 13:43     ` Andreas Schwab
@ 2020-08-20 13:45       ` Simon Marchi
  2020-08-20 14:04         ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac (was: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD) Simon Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Marchi @ 2020-08-20 13:45 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Sebastian Huber, gdb, Simon Marchi

On 2020-08-20 9:43 a.m., Andreas Schwab wrote:
> That's because aclocal cannot find a definition of PKG_CHECK_MODULES.
> You need to run autoreconf with -I ../../config.

Indeed, that's what I found in the end.  Though I'll propose a patch that
adds the required include to configure.ac.

Simon

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH] sim/bfin: include config/pkg.m4 in configure.ac (was: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD)
  2020-08-20 13:45       ` Simon Marchi
@ 2020-08-20 14:04         ` Simon Marchi
  2020-08-21  7:30           ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac Sebastian Huber
  2020-08-21 13:07           ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac (was: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD) Andrew Burgess
  0 siblings, 2 replies; 9+ messages in thread
From: Simon Marchi @ 2020-08-20 14:04 UTC (permalink / raw)
  To: Simon Marchi, Andreas Schwab; +Cc: Sebastian Huber, gdb, Andrew Burgess

On 2020-08-20 9:45 a.m., Simon Marchi wrote:
> On 2020-08-20 9:43 a.m., Andreas Schwab wrote:
>> That's because aclocal cannot find a definition of PKG_CHECK_MODULES.
>> You need to run autoreconf with -I ../../config.
> 
> Indeed, that's what I found in the end.  Though I'll propose a patch that
> adds the required include to configure.ac.

Here's the patch:

From 45dce782e0a999efb892588885fc4c7f7e2e0868 Mon Sep 17 00:00:00 2001
From: Simon Marchi <simon.marchi@polymtl.ca>
Date: Thu, 20 Aug 2020 09:31:49 -0400
Subject: [PATCH] sim/bfin: include config/pkg.m4 in configure.ac

When trying to re-generate configure in sim/bfin, I get:

    $ autoreconf -vf
    autoreconf: Entering directory `.'
    autoreconf: configure.ac: not using Gettext
    autoreconf: running: aclocal --force
    autoreconf: configure.ac: tracing
    autoreconf: configure.ac: not running libtoolize: --install not given
    autoreconf: running: /opt/autostuff/bin/autoconf --force
    configure.ac:57: error: possibly undefined macro: AC_CHECK_LIB
          If this token and others are legitimate, please use m4_pattern_allow.
          See the Autoconf documentation.
    autoreconf: /opt/autostuff/bin/autoconf failed with exit status: 1

This happens since commit f693213d126a ("Run `autoreconf -vf` throughout").

The problem (not clear from the error message) is that the
PKG_CHECK_MODULES macro used in configure.ac is undefined.  In the past, I
suppose that it relied on the person running autoconf having pkg.m4 (from
pkg-config) in their include path.  That's not my case.

Since we recently added a local version of PKG_CHECK_MODULES to our tree,
we can just make sim/bfin/configure.ac use it.  This patch makes
configure.ac include config/pkg.m4, and re-generates configure.  With this,
the configure script appears to be generated correctly, I am able to
configure and build the bfin simulator.

Note: using sinclude to include the required m4 files makes no sense to
me.  These files contain macros we need, if they are not defined then
the resulting file is unusable.  And sinclude fails silently if the file
is not found.  So, better use include/m4_include.

sim/bfin/ChangeLog:

	* configure.ac: Include config/pkg.m4.

Change-Id: I7d8012e5ed510cd7746b94e918f0feb1c701cd83
---
 sim/bfin/configure    | 305 ++++++++++++++++++++++++++++++++++++++++--
 sim/bfin/configure.ac |   1 +
 2 files changed, 298 insertions(+), 8 deletions(-)

diff --git a/sim/bfin/configure b/sim/bfin/configure
index d3aed28eaca2..9f0b46e11110 100755
--- a/sim/bfin/configure
+++ b/sim/bfin/configure
@@ -634,6 +634,9 @@ LIBOBJS
 cgen_breaks
 SDL_LIBS
 SDL_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
 REPORT_BUGS_TEXI
 REPORT_BUGS_TO
 PKGVERSION
@@ -797,7 +800,12 @@ CFLAGS
 LDFLAGS
 LIBS
 CPPFLAGS
-CPP'
+CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+SDL_CFLAGS
+SDL_LIBS'


 # Initialize some variables set by options.
@@ -1471,6 +1479,13 @@ Some influential environment variables:
   CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  PKG_CONFIG  path to pkg-config utility
+  PKG_CONFIG_PATH
+              directories to add to pkg-config's search path
+  PKG_CONFIG_LIBDIR
+              path overriding pkg-config's built-in search path
+  SDL_CFLAGS  C compiler flags for SDL, overriding pkg-config
+  SDL_LIBS    linker flags for SDL, overriding pkg-config

 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -4171,6 +4186,26 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu



+
+
+
+
+# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+# serial 12 (pkg-config-0.29.2)
+
+
+
+
+
+
+
+
+
+
+
+
+
+



@@ -12887,7 +12922,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12890 "configure"
+#line 12925 "configure"
 #include "confdefs.h"

 #if HAVE_DLFCN_H
@@ -12993,7 +13028,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12996 "configure"
+#line 13031 "configure"
 #include "confdefs.h"

 #if HAVE_DLFCN_H
@@ -13926,13 +13961,267 @@ fi
 done


-PKG_PROG_PKG_CONFIG
-PKG_CHECK_MODULES(SDL, sdl,
-	AC_CHECK_LIB(dl, dlopen, [
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.9.0
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdl" >&5
+$as_echo_n "checking for sdl... " >&6; }
+
+if test -n "$SDL_CFLAGS"; then
+    pkg_cv_SDL_CFLAGS="$SDL_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "sdl") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$SDL_LIBS"; then
+    pkg_cv_SDL_LIBS="$SDL_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "sdl") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl" 2>/dev/null`
+		      test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+if test $pkg_failed = no; then
+  pkg_save_LDFLAGS="$LDFLAGS"
+  LDFLAGS="$LDFLAGS $pkg_cv_SDL_LIBS"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+else
+  pkg_failed=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  LDFLAGS=$pkg_save_LDFLAGS
+fi
+
+
+
+if test $pkg_failed = yes; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl" 2>&1`
+        else
+	        SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl" 2>&1`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$SDL_PKG_ERRORS" >&5
+
+	:
+elif test $pkg_failed = untried; then
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+	:
+else
+	SDL_CFLAGS=$pkg_cv_SDL_CFLAGS
+	SDL_LIBS=$pkg_cv_SDL_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; 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 dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=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_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+
 		SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL"
 		SDL_LIBS="-ldl"
-		], [SDL_CFLAGS= SDL_LIBS=])
-	, :)
+
+else
+  SDL_CFLAGS= SDL_LIBS=
+fi
+
+
+fi



diff --git a/sim/bfin/configure.ac b/sim/bfin/configure.ac
index 44b9952c75b8..47bacb1c0d2e 100644
--- a/sim/bfin/configure.ac
+++ b/sim/bfin/configure.ac
@@ -1,6 +1,7 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_INIT(Makefile.in)
 sinclude(../common/acinclude.m4)
+m4_include([../../config/pkg.m4])

 SIM_AC_COMMON

-- 
2.28.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] sim/bfin: include config/pkg.m4 in configure.ac
  2020-08-20 14:04         ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac (was: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD) Simon Marchi
@ 2020-08-21  7:30           ` Sebastian Huber
  2020-08-21 15:56             ` Simon Marchi
  2020-08-21 13:07           ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac (was: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD) Andrew Burgess
  1 sibling, 1 reply; 9+ messages in thread
From: Sebastian Huber @ 2020-08-21  7:30 UTC (permalink / raw)
  To: Simon Marchi, Simon Marchi, Andreas Schwab; +Cc: gdb, Andrew Burgess

Hello Simon,

On 20/08/2020 16:04, Simon Marchi wrote:

> On 2020-08-20 9:45 a.m., Simon Marchi wrote:
>> On 2020-08-20 9:43 a.m., Andreas Schwab wrote:
>>> That's because aclocal cannot find a definition of PKG_CHECK_MODULES.
>>> You need to run autoreconf with -I ../../config.
>> Indeed, that's what I found in the end.  Though I'll propose a patch that
>> adds the required include to configure.ac.
> Here's the patch:
>
>  From 45dce782e0a999efb892588885fc4c7f7e2e0868 Mon Sep 17 00:00:00 2001
> From: Simon Marchi<simon.marchi@polymtl.ca>
> Date: Thu, 20 Aug 2020 09:31:49 -0400
> Subject: [PATCH] sim/bfin: include config/pkg.m4 in configure.ac

thanks for the patch. I tried it out on Linux and it fixes the build issue.

GNU gdb (GDB) 10.0.50.20200821-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu 
--target=bfin-rtems5".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
     <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
No symbol table is loaded.  Use the "file" command.
(gdb) tar sim
Connected to the simulator.
(gdb) quit



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] sim/bfin: include config/pkg.m4 in configure.ac (was: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD)
  2020-08-20 14:04         ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac (was: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD) Simon Marchi
  2020-08-21  7:30           ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac Sebastian Huber
@ 2020-08-21 13:07           ` Andrew Burgess
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Burgess @ 2020-08-21 13:07 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Simon Marchi, Andreas Schwab, Sebastian Huber, gdb

* Simon Marchi <simon.marchi@efficios.com> [2020-08-20 10:04:33 -0400]:

> On 2020-08-20 9:45 a.m., Simon Marchi wrote:
> > On 2020-08-20 9:43 a.m., Andreas Schwab wrote:
> >> That's because aclocal cannot find a definition of PKG_CHECK_MODULES.
> >> You need to run autoreconf with -I ../../config.
> > 
> > Indeed, that's what I found in the end.  Though I'll propose a patch that
> > adds the required include to configure.ac.
> 
> Here's the patch:
> 
> From 45dce782e0a999efb892588885fc4c7f7e2e0868 Mon Sep 17 00:00:00 2001
> From: Simon Marchi <simon.marchi@polymtl.ca>
> Date: Thu, 20 Aug 2020 09:31:49 -0400
> Subject: [PATCH] sim/bfin: include config/pkg.m4 in configure.ac
> 
> When trying to re-generate configure in sim/bfin, I get:
> 
>     $ autoreconf -vf
>     autoreconf: Entering directory `.'
>     autoreconf: configure.ac: not using Gettext
>     autoreconf: running: aclocal --force
>     autoreconf: configure.ac: tracing
>     autoreconf: configure.ac: not running libtoolize: --install not given
>     autoreconf: running: /opt/autostuff/bin/autoconf --force
>     configure.ac:57: error: possibly undefined macro: AC_CHECK_LIB
>           If this token and others are legitimate, please use m4_pattern_allow.
>           See the Autoconf documentation.
>     autoreconf: /opt/autostuff/bin/autoconf failed with exit status: 1
> 
> This happens since commit f693213d126a ("Run `autoreconf -vf` throughout").
> 
> The problem (not clear from the error message) is that the
> PKG_CHECK_MODULES macro used in configure.ac is undefined.  In the past, I
> suppose that it relied on the person running autoconf having pkg.m4 (from
> pkg-config) in their include path.  That's not my case.
> 
> Since we recently added a local version of PKG_CHECK_MODULES to our tree,
> we can just make sim/bfin/configure.ac use it.  This patch makes
> configure.ac include config/pkg.m4, and re-generates configure.  With this,
> the configure script appears to be generated correctly, I am able to
> configure and build the bfin simulator.
> 
> Note: using sinclude to include the required m4 files makes no sense to
> me.  These files contain macros we need, if they are not defined then
> the resulting file is unusable.  And sinclude fails silently if the file
> is not found.  So, better use include/m4_include.
> 
> sim/bfin/ChangeLog:
> 
> 	* configure.ac: Include config/pkg.m4.
> 
> Change-Id: I7d8012e5ed510cd7746b94e918f0feb1c701cd83
> ---
>  sim/bfin/configure    | 305 ++++++++++++++++++++++++++++++++++++++++--
>  sim/bfin/configure.ac |   1 +
>  2 files changed, 298 insertions(+), 8 deletions(-)

I'm no autoconf expert, but it looks reasonable to me.

Thanks,
Andrew


> 
> diff --git a/sim/bfin/configure b/sim/bfin/configure
> index d3aed28eaca2..9f0b46e11110 100755
> --- a/sim/bfin/configure
> +++ b/sim/bfin/configure
> @@ -634,6 +634,9 @@ LIBOBJS
>  cgen_breaks
>  SDL_LIBS
>  SDL_CFLAGS
> +PKG_CONFIG_LIBDIR
> +PKG_CONFIG_PATH
> +PKG_CONFIG
>  REPORT_BUGS_TEXI
>  REPORT_BUGS_TO
>  PKGVERSION
> @@ -797,7 +800,12 @@ CFLAGS
>  LDFLAGS
>  LIBS
>  CPPFLAGS
> -CPP'
> +CPP
> +PKG_CONFIG
> +PKG_CONFIG_PATH
> +PKG_CONFIG_LIBDIR
> +SDL_CFLAGS
> +SDL_LIBS'
> 
> 
>  # Initialize some variables set by options.
> @@ -1471,6 +1479,13 @@ Some influential environment variables:
>    CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
>                you have headers in a nonstandard directory <include dir>
>    CPP         C preprocessor
> +  PKG_CONFIG  path to pkg-config utility
> +  PKG_CONFIG_PATH
> +              directories to add to pkg-config's search path
> +  PKG_CONFIG_LIBDIR
> +              path overriding pkg-config's built-in search path
> +  SDL_CFLAGS  C compiler flags for SDL, overriding pkg-config
> +  SDL_LIBS    linker flags for SDL, overriding pkg-config
> 
>  Use these variables to override the choices made by `configure' or to help
>  it to find libraries and programs with nonstandard names/locations.
> @@ -4171,6 +4186,26 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
> 
> 
> 
> +
> +
> +
> +
> +# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
> +# serial 12 (pkg-config-0.29.2)
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> +
> 
> 
> 
> @@ -12887,7 +12922,7 @@ else
>    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>    lt_status=$lt_dlunknown
>    cat > conftest.$ac_ext <<_LT_EOF
> -#line 12890 "configure"
> +#line 12925 "configure"
>  #include "confdefs.h"
> 
>  #if HAVE_DLFCN_H
> @@ -12993,7 +13028,7 @@ else
>    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
>    lt_status=$lt_dlunknown
>    cat > conftest.$ac_ext <<_LT_EOF
> -#line 12996 "configure"
> +#line 13031 "configure"
>  #include "confdefs.h"
> 
>  #if HAVE_DLFCN_H
> @@ -13926,13 +13961,267 @@ fi
>  done
> 
> 
> -PKG_PROG_PKG_CONFIG
> -PKG_CHECK_MODULES(SDL, sdl,
> -	AC_CHECK_LIB(dl, dlopen, [
> +
> +
> +
> +
> +
> +
> +
> +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
> +	if test -n "$ac_tool_prefix"; then
> +  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
> +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> +$as_echo_n "checking for $ac_word... " >&6; }
> +if ${ac_cv_path_PKG_CONFIG+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  case $PKG_CONFIG in
> +  [\\/]* | ?:[\\/]*)
> +  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
> +  ;;
> +  *)
> +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> +for as_dir in $PATH
> +do
> +  IFS=$as_save_IFS
> +  test -z "$as_dir" && as_dir=.
> +    for ac_exec_ext in '' $ac_executable_extensions; do
> +  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
> +    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
> +    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
> +    break 2
> +  fi
> +done
> +  done
> +IFS=$as_save_IFS
> +
> +  ;;
> +esac
> +fi
> +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
> +if test -n "$PKG_CONFIG"; then
> +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
> +$as_echo "$PKG_CONFIG" >&6; }
> +else
> +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +fi
> +
> +
> +fi
> +if test -z "$ac_cv_path_PKG_CONFIG"; then
> +  ac_pt_PKG_CONFIG=$PKG_CONFIG
> +  # Extract the first word of "pkg-config", so it can be a program name with args.
> +set dummy pkg-config; ac_word=$2
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> +$as_echo_n "checking for $ac_word... " >&6; }
> +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
> +  $as_echo_n "(cached) " >&6
> +else
> +  case $ac_pt_PKG_CONFIG in
> +  [\\/]* | ?:[\\/]*)
> +  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
> +  ;;
> +  *)
> +  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> +for as_dir in $PATH
> +do
> +  IFS=$as_save_IFS
> +  test -z "$as_dir" && as_dir=.
> +    for ac_exec_ext in '' $ac_executable_extensions; do
> +  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
> +    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
> +    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
> +    break 2
> +  fi
> +done
> +  done
> +IFS=$as_save_IFS
> +
> +  ;;
> +esac
> +fi
> +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
> +if test -n "$ac_pt_PKG_CONFIG"; then
> +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
> +$as_echo "$ac_pt_PKG_CONFIG" >&6; }
> +else
> +  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +fi
> +
> +  if test "x$ac_pt_PKG_CONFIG" = x; then
> +    PKG_CONFIG=""
> +  else
> +    case $cross_compiling:$ac_tool_warned in
> +yes:)
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
> +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
> +ac_tool_warned=yes ;;
> +esac
> +    PKG_CONFIG=$ac_pt_PKG_CONFIG
> +  fi
> +else
> +  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
> +fi
> +
> +fi
> +if test -n "$PKG_CONFIG"; then
> +	_pkg_min_version=0.9.0
> +	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
> +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
> +	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
> +		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> +$as_echo "yes" >&6; }
> +	else
> +		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +		PKG_CONFIG=""
> +	fi
> +fi
> +
> +pkg_failed=no
> +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdl" >&5
> +$as_echo_n "checking for sdl... " >&6; }
> +
> +if test -n "$SDL_CFLAGS"; then
> +    pkg_cv_SDL_CFLAGS="$SDL_CFLAGS"
> + elif test -n "$PKG_CONFIG"; then
> +    if test -n "$PKG_CONFIG" && \
> +    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5
> +  ($PKG_CONFIG --exists --print-errors "sdl") 2>&5
> +  ac_status=$?
> +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> +  test $ac_status = 0; }; then
> +  pkg_cv_SDL_CFLAGS=`$PKG_CONFIG --cflags "sdl" 2>/dev/null`
> +		      test "x$?" != "x0" && pkg_failed=yes
> +else
> +  pkg_failed=yes
> +fi
> + else
> +    pkg_failed=untried
> +fi
> +if test -n "$SDL_LIBS"; then
> +    pkg_cv_SDL_LIBS="$SDL_LIBS"
> + elif test -n "$PKG_CONFIG"; then
> +    if test -n "$PKG_CONFIG" && \
> +    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"sdl\""; } >&5
> +  ($PKG_CONFIG --exists --print-errors "sdl") 2>&5
> +  ac_status=$?
> +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> +  test $ac_status = 0; }; then
> +  pkg_cv_SDL_LIBS=`$PKG_CONFIG --libs "sdl" 2>/dev/null`
> +		      test "x$?" != "x0" && pkg_failed=yes
> +else
> +  pkg_failed=yes
> +fi
> + else
> +    pkg_failed=untried
> +fi
> +
> +if test $pkg_failed = no; then
> +  pkg_save_LDFLAGS="$LDFLAGS"
> +  LDFLAGS="$LDFLAGS $pkg_cv_SDL_LIBS"
> +  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h.  */
> +
> +int
> +main ()
> +{
> +
> +  ;
> +  return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> +
> +else
> +  pkg_failed=yes
> +fi
> +rm -f core conftest.err conftest.$ac_objext \
> +    conftest$ac_exeext conftest.$ac_ext
> +  LDFLAGS=$pkg_save_LDFLAGS
> +fi
> +
> +
> +
> +if test $pkg_failed = yes; then
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +
> +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
> +        _pkg_short_errors_supported=yes
> +else
> +        _pkg_short_errors_supported=no
> +fi
> +        if test $_pkg_short_errors_supported = yes; then
> +	        SDL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "sdl" 2>&1`
> +        else
> +	        SDL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "sdl" 2>&1`
> +        fi
> +	# Put the nasty error message in config.log where it belongs
> +	echo "$SDL_PKG_ERRORS" >&5
> +
> +	:
> +elif test $pkg_failed = untried; then
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
> +$as_echo "no" >&6; }
> +	:
> +else
> +	SDL_CFLAGS=$pkg_cv_SDL_CFLAGS
> +	SDL_LIBS=$pkg_cv_SDL_LIBS
> +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
> +$as_echo "yes" >&6; }
> +
> +	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
> +$as_echo_n "checking for dlopen in -ldl... " >&6; }
> +if ${ac_cv_lib_dl_dlopen+:} false; 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 dlopen ();
> +int
> +main ()
> +{
> +return dlopen ();
> +  ;
> +  return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_link "$LINENO"; then :
> +  ac_cv_lib_dl_dlopen=yes
> +else
> +  ac_cv_lib_dl_dlopen=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_dlopen" >&5
> +$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
> +if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
> +
>  		SDL_CFLAGS="${SDL_CFLAGS} -DHAVE_SDL"
>  		SDL_LIBS="-ldl"
> -		], [SDL_CFLAGS= SDL_LIBS=])
> -	, :)
> +
> +else
> +  SDL_CFLAGS= SDL_LIBS=
> +fi
> +
> +
> +fi
> 
> 
> 
> diff --git a/sim/bfin/configure.ac b/sim/bfin/configure.ac
> index 44b9952c75b8..47bacb1c0d2e 100644
> --- a/sim/bfin/configure.ac
> +++ b/sim/bfin/configure.ac
> @@ -1,6 +1,7 @@
>  dnl Process this file with autoconf to produce a configure script.
>  AC_INIT(Makefile.in)
>  sinclude(../common/acinclude.m4)
> +m4_include([../../config/pkg.m4])
> 
>  SIM_AC_COMMON
> 
> -- 
> 2.28.0
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] sim/bfin: include config/pkg.m4 in configure.ac
  2020-08-21  7:30           ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac Sebastian Huber
@ 2020-08-21 15:56             ` Simon Marchi
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Marchi @ 2020-08-21 15:56 UTC (permalink / raw)
  To: Sebastian Huber, Simon Marchi, Andreas Schwab; +Cc: gdb, Andrew Burgess

On 2020-08-21 3:30 a.m., Sebastian Huber wrote:
> Hello Simon,
> 
> On 20/08/2020 16:04, Simon Marchi wrote:
> 
>> On 2020-08-20 9:45 a.m., Simon Marchi wrote:
>>> On 2020-08-20 9:43 a.m., Andreas Schwab wrote:
>>>> That's because aclocal cannot find a definition of PKG_CHECK_MODULES.
>>>> You need to run autoreconf with -I ../../config.
>>> Indeed, that's what I found in the end.  Though I'll propose a patch that
>>> adds the required include to configure.ac.
>> Here's the patch:
>>
>>  From 45dce782e0a999efb892588885fc4c7f7e2e0868 Mon Sep 17 00:00:00 2001
>> From: Simon Marchi<simon.marchi@polymtl.ca>
>> Date: Thu, 20 Aug 2020 09:31:49 -0400
>> Subject: [PATCH] sim/bfin: include config/pkg.m4 in configure.ac
> 
> thanks for the patch. I tried it out on Linux and it fixes the build issue.
> 
> GNU gdb (GDB) 10.0.50.20200821-git
> Copyright (C) 2020 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> Type "show copying" and "show warranty" for details.
> This GDB was configured as "--host=x86_64-pc-linux-gnu --target=bfin-rtems5".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <https://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
>     <http://www.gnu.org/software/gdb/documentation/>.
> 
> For help, type "help".
> Type "apropos word" to search for commands related to "word".
> No symbol table is loaded.  Use the "file" command.
> (gdb) tar sim
> Connected to the simulator.
> (gdb) quit
> 
> 

Ok, thanks for checking, I pushed it.

Simon

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-08-21 15:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20  6:22 Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD Sebastian Huber
2020-08-20  6:45 ` Sebastian Huber
2020-08-20 13:16   ` Simon Marchi
2020-08-20 13:43     ` Andreas Schwab
2020-08-20 13:45       ` Simon Marchi
2020-08-20 14:04         ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac (was: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD) Simon Marchi
2020-08-21  7:30           ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac Sebastian Huber
2020-08-21 15:56             ` Simon Marchi
2020-08-21 13:07           ` [PATCH] sim/bfin: include config/pkg.m4 in configure.ac (was: Patch "Run `autoreconf -vf` throughout" broke the rtems-bfin build on FreeBSD) Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).