Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: add ../config/pkg.m4 in acinclude.m4
Date: Sun, 9 May 2021 21:32:42 -0400	[thread overview]
Message-ID: <7955e847-2307-48ad-d436-adf3280db586@polymtl.ca> (raw)
In-Reply-To: <YJiJCid0EP+R0C8D@vapier>



On 2021-05-09 9:14 p.m., Mike Frysinger wrote:
> On 09 May 2021 20:16, Simon Marchi via Gdb-patches wrote:
>> On 2021-05-09 4:00 p.m., Mike Frysinger wrote:
>>> On 08 May 2021 21:24, Simon Marchi via Gdb-patches wrote:
>>>> Since commit adeab0c5b33f ("config/debuginfod: do not include pkg.m4
>>>> directly"), it no longer works to re-generate the autoconf stuff in GDB
>>>> without passing "-I ../config":
>>>>
>>>>     $ autoreconf -f
>>>>     configure.ac:161: error: possibly undefined macro: AC_MSG_ERROR
>>>>           If this token and others are legitimate, please use m4_pattern_allow.
>>>>           See the Autoconf documentation.
>>>>     configure.ac:329: error: possibly undefined macro: AC_MSG_WARN
>>>>     configure.ac:409: error: possibly undefined macro: AC_DEFINE
>>>>     autoreconf: /opt/autostuff/2.69/bin/autoconf failed with exit status: 1
>>>>
>>>> The reason is: since that commit, the PKG_CHECK_MODULES macro is not
>>>> found.  When passing "-I ../config" to the autoconf tools, then it's
>>>> found.  But if I understand correctly, the reason why we have all these
>>>> includes in acinclude.m4 is to avoid having to specify that, to make the
>>>> default invocation without special arguments "just work".
>>>
>>> how about this instead ?  i can run `aclocal && autoconf` with this.
>>>
>>> --- a/gdb/configure.ac
>>> +++ b/gdb/configure.ac
>>> @@ -18,9 +18,8 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
>>>  
>>>  dnl Process this file with autoconf to produce a configure script.
>>>  
>>> -m4_include(../config/debuginfod.m4)
>>> -
>>>  AC_INIT
>>> +AC_CONFIG_MACRO_DIRS([../config])
>>>  AC_CONFIG_SRCDIR([main.c])
>>>  AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
>>>  AM_MAINTAINER_MODE
>>
>> Ah yes, that sounds much better.  If we have this, could we remove all
>> lines in acinclude.m4 that refer to a file in ../config?
> 
> we can remove most, but not all.  there seems to be some bugs in aclocal where
> it warns about not finding a few of the macros, but it actually does.  probably
> worth leaving the explicit includes so as to not confuse devs.
> 
> updated patch below
> -mike
> 
> --- a/gdb/acinclude.m4
> +++ b/gdb/acinclude.m4
> @@ -21,49 +21,12 @@ m4_include(../gdbsupport/selftest.m4)
>  dnl gdb/configure.in uses BFD_NEED_DECLARATION, so get its definition.
>  m4_include(../bfd/bfd.m4)
>  
> -dnl This gets the standard macros.
> -m4_include(../config/acinclude.m4)
> -
> -dnl This gets GCC_ENABLE.
> -sinclude(../config/enable.m4)
> -
> -dnl This gets AC_PLUGINS, needed by ACX_LARGEFILE.
> -m4_include(../config/plugins.m4)
> -
> -dnl For ACX_LARGEFILE.
> -m4_include(../config/largefile.m4)
> -
> -dnl For AM_SET_LEADING_DOT.
> -m4_include(../config/lead-dot.m4)
> -
> -dnl This gets autoconf bugfixes.
> -m4_include(../config/override.m4)
> -
> -dnl For ZW_GNU_GETTEXT_SISTER_DIR.
> -m4_include(../config/gettext-sister.m4)
> -
> -dnl For AC_LIB_HAVE_LINKFLAGS.
> -m4_include(../config/lib-ld.m4)
> -m4_include(../config/lib-prefix.m4)
> -m4_include(../config/lib-link.m4)
> -
> -dnl For ACX_PKGVERSION and ACX_BUGURL.
> -m4_include(../config/acx.m4)
> -
> -dnl for TCL definitions
> -m4_include(../config/tcl.m4)
> -
> -dnl For dependency tracking macros.
> -m4_include([../config/depstand.m4])
> -
>  dnl For AM_LC_MESSAGES
>  m4_include([../config/lcmessage.m4])
>  
>  dnl For AM_LANGINFO_CODESET.
>  m4_include([../config/codeset.m4])
>  
> -m4_include([../config/iconv.m4])
> -
>  m4_include([../config/zlib.m4])
>  
>  m4_include([../gdbsupport/common.m4])
> @@ -76,8 +39,6 @@ m4_include(../gdbsupport/ptrace.m4)
>  
>  m4_include(ax_cxx_compile_stdcxx.m4)
>  
> -m4_include([../config/ax_pthread.m4])
> -
>  dnl written by Guido Draheim <guidod@gmx.de>, original by Alexandre Oliva 
>  dnl Version 1.3 (2001/03/02)
>  dnl source http://www.gnu.org/software/ac-archive/Miscellaneous/ac_define_dir.html
> --- a/gdb/aclocal.m4
> +++ b/gdb/aclocal.m4
> @@ -199,5 +199,20 @@ AC_DEFUN([_AM_SUBST_NOTMAKE])
>  # Public sister of _AM_SUBST_NOTMAKE.
>  AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
>  
> +m4_include([../config/acx.m4])
> +m4_include([../config/ax_pthread.m4])
> +m4_include([../config/debuginfod.m4])
> +m4_include([../config/depstand.m4])
> +m4_include([../config/enable.m4])
> +m4_include([../config/gettext-sister.m4])
> +m4_include([../config/iconv.m4])
> +m4_include([../config/largefile.m4])
> +m4_include([../config/lead-dot.m4])
> +m4_include([../config/lib-ld.m4])
> +m4_include([../config/lib-link.m4])
> +m4_include([../config/lib-prefix.m4])
> +m4_include([../config/override.m4])
>  m4_include([../config/pkg.m4])
> +m4_include([../config/plugins.m4])
> +m4_include([../config/tcl.m4])
>  m4_include([acinclude.m4])
> --- a/gdb/configure
> +++ b/gdb/configure
> @@ -2990,6 +2990,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
>  
>  
>  
> +
>  ac_config_headers="$ac_config_headers config.h:config.in"
>  
>  
> --- a/gdb/configure.ac
> +++ b/gdb/configure.ac
> @@ -18,9 +18,8 @@ dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
>  
>  dnl Process this file with autoconf to produce a configure script.
>  
> -m4_include(../config/debuginfod.m4)
> -
>  AC_INIT
> +AC_CONFIG_MACRO_DIRS([../config])
>  AC_CONFIG_SRCDIR([main.c])
>  AC_CONFIG_HEADERS(config.h:config.in, [echo > stamp-h])
>  AM_MAINTAINER_MODE
> 

Seeing that there is no significant change to the generated configure,
that LGTM.  However, it would be good to maybe wait for Tom Tromey's
approval, he has more experience with this.

Also, the same should be applied to gdbsupport and gdbserver.

Simon

  reply	other threads:[~2021-05-10  1:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-09  1:24 Simon Marchi via Gdb-patches
2021-05-09 20:00 ` Mike Frysinger via Gdb-patches
2021-05-10  0:16   ` Simon Marchi via Gdb-patches
2021-05-10  1:14     ` Mike Frysinger via Gdb-patches
2021-05-10  1:32       ` Simon Marchi via Gdb-patches [this message]
2021-05-10 13:25         ` Tom Tromey
2021-05-10 22:36         ` Mike Frysinger via Gdb-patches
2021-06-15  5:44           ` [PATCH] gdb/gdbserver: switch to AC_CONFIG_MACRO_DIRS Mike Frysinger via Gdb-patches
2021-06-17  2:30             ` Simon Marchi via Gdb-patches
2021-06-17  4:21               ` Mike Frysinger via Gdb-patches
2021-06-17 14:43                 ` Simon Marchi via Gdb-patches
2021-06-18  4:38                   ` Mike Frysinger via Gdb-patches
2021-06-18 13:22                     ` Simon Marchi via Gdb-patches
2021-06-23  9:38                     ` Pedro Alves
2021-06-23 22:26                       ` Mike Frysinger via Gdb-patches
2021-06-24 18:45                         ` Pedro Alves
2021-06-18 14:03             ` [PATCH v2] " Mike Frysinger via Gdb-patches
2021-06-20  0:48               ` Simon Marchi via Gdb-patches
2021-06-20  2:10                 ` Mike Frysinger via Gdb-patches
2021-06-20  2:17                   ` Simon Marchi via Gdb-patches
2021-06-20  2:22               ` [PATCH v3] " Mike Frysinger via Gdb-patches
2021-06-20  2:46                 ` Simon Marchi via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7955e847-2307-48ad-d436-adf3280db586@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox