Re: [PATCH] modula2/108144 - Fix multilib install of libgm2

2023-01-22 Thread Richard Biener via Gcc-patches
On Fri, 20 Jan 2023, NightStrike wrote:

> On Fri, Jan 20, 2023 at 1:40 PM Gaius Mulley via Gcc-patches
>  wrote:
> >
> > Richard Biener  writes:
> >
> > > The following adjusts libgm2 to properly use the multilib build
> > > infrastructure, thereby fixing the install with
> > > --enable-version-specific-runtime-libs
> > >
> > > In particular config-ml.pl needs to be applied to generated Makefiles
> > > as documented in the manual and we have to avoid clobbering the
> > > variables via make arguments.  The explicit install rules used different
> > > ways to construct the multilib dir which isn't necessary and breaks
> > > when MUTLIDIR is now finally set correctly.  Instead use
> > > $(toolexeclibdir).
> > >
> > > This results in some dead variables in the Makefile.am (and there were
> > > some before), I refrained from doing even more changes here.
> > >
> > > Verified with an install with and without 
> > > --enable-version-specific-runtime-libs
> > > and checking the result.
> > >
> > > OK?
> > >
> > > Thanks,
> > > Richard.
> >
> > Many thanks for this fix - and the deep magic AC_FOREACH config-ml.in
> > recursion rhunes.  LGTM
> >
> > regards,
> > Gaius
> 
> AC_FOREACH is obsolete and shouldn't be used in new code.  It's been
> replaced with m4_foreach_w:
> https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

I've pushed with AC_FOREACH which I cut from elsewhere.  If
somebody feels like replacing all AC_FOREACH in the tree then that's
of course good.

Richard.


Re: [PATCH] modula2/108144 - Fix multilib install of libgm2

2023-01-20 Thread NightStrike via Gcc-patches
On Fri, Jan 20, 2023 at 1:40 PM Gaius Mulley via Gcc-patches
 wrote:
>
> Richard Biener  writes:
>
> > The following adjusts libgm2 to properly use the multilib build
> > infrastructure, thereby fixing the install with
> > --enable-version-specific-runtime-libs
> >
> > In particular config-ml.pl needs to be applied to generated Makefiles
> > as documented in the manual and we have to avoid clobbering the
> > variables via make arguments.  The explicit install rules used different
> > ways to construct the multilib dir which isn't necessary and breaks
> > when MUTLIDIR is now finally set correctly.  Instead use
> > $(toolexeclibdir).
> >
> > This results in some dead variables in the Makefile.am (and there were
> > some before), I refrained from doing even more changes here.
> >
> > Verified with an install with and without 
> > --enable-version-specific-runtime-libs
> > and checking the result.
> >
> > OK?
> >
> > Thanks,
> > Richard.
>
> Many thanks for this fix - and the deep magic AC_FOREACH config-ml.in
> recursion rhunes.  LGTM
>
> regards,
> Gaius

AC_FOREACH is obsolete and shouldn't be used in new code.  It's been
replaced with m4_foreach_w:
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html


Re: [PATCH] modula2/108144 - Fix multilib install of libgm2

2023-01-20 Thread Gaius Mulley via Gcc-patches
Richard Biener  writes:

> The following adjusts libgm2 to properly use the multilib build
> infrastructure, thereby fixing the install with
> --enable-version-specific-runtime-libs
>
> In particular config-ml.pl needs to be applied to generated Makefiles
> as documented in the manual and we have to avoid clobbering the
> variables via make arguments.  The explicit install rules used different
> ways to construct the multilib dir which isn't necessary and breaks
> when MUTLIDIR is now finally set correctly.  Instead use
> $(toolexeclibdir).
>
> This results in some dead variables in the Makefile.am (and there were
> some before), I refrained from doing even more changes here.
>
> Verified with an install with and without 
> --enable-version-specific-runtime-libs
> and checking the result.
>
> OK?
>
> Thanks,
> Richard.

Many thanks for this fix - and the deep magic AC_FOREACH config-ml.in
recursion rhunes.  LGTM

regards,
Gaius


[PATCH] modula2/108144 - Fix multilib install of libgm2

2023-01-20 Thread Richard Biener via Gcc-patches
The following adjusts libgm2 to properly use the multilib build
infrastructure, thereby fixing the install with
--enable-version-specific-runtime-libs

In particular config-ml.pl needs to be applied to generated Makefiles
as documented in the manual and we have to avoid clobbering the
variables via make arguments.  The explicit install rules used different
ways to construct the multilib dir which isn't necessary and breaks
when MUTLIDIR is now finally set correctly.  Instead use
$(toolexeclibdir).

This results in some dead variables in the Makefile.am (and there were
some before), I refrained from doing even more changes here.

Verified with an install with and without --enable-version-specific-runtime-libs
and checking the result.

OK?

Thanks,
Richard.

PR modula2/108144
libgm2/
* configure.ac: Apply config-ml.pl to the generated Makefiles.
Set multilib_arg, use AM_PROG_LIBTOOL.
* configure: Regenerate.
* Makefile.am (AM_MAKEFLAGS): Do not override MULTI* flags.
* Makefile.in: Regenerate.
* libm2cor/Makefile.am: Install to $(toolexeclibdir)$(M2LIBDIR)
rather than $(inst_libdir)/$(MULTIDIR)$(M2LIBDIR).
* libm2iso/Makefile.am: Likewise.
* libm2log/Makefile.am: Likewise.
* libm2min/Makefile.am: Likewise.
* libm2pim/Makefile.am: Likewise.
* libm2cor/Makefile.am: Regenerate.
* libm2iso/Makefile.am: Likewise.
* libm2log/Makefile.am: Likewise.
* libm2min/Makefile.am: Likewise.
* libm2pim/Makefile.am: Likewise.
---
 libgm2/Makefile.am  |  4 --
 libgm2/Makefile.in  |  4 --
 libgm2/configure| 79 -
 libgm2/configure.ac | 25 ++--
 libgm2/libm2cor/Makefile.am | 18 -
 libgm2/libm2cor/Makefile.in | 18 -
 libgm2/libm2iso/Makefile.am | 22 +--
 libgm2/libm2iso/Makefile.in | 22 +--
 libgm2/libm2log/Makefile.am | 18 -
 libgm2/libm2log/Makefile.in | 18 -
 libgm2/libm2min/Makefile.am | 18 -
 libgm2/libm2min/Makefile.in | 18 -
 libgm2/libm2pim/Makefile.am | 16 
 libgm2/libm2pim/Makefile.in | 16 
 14 files changed, 183 insertions(+), 113 deletions(-)

diff --git a/libgm2/Makefile.am b/libgm2/Makefile.am
index 524ea6c7124..0b593f6ff21 100644
--- a/libgm2/Makefile.am
+++ b/libgm2/Makefile.am
@@ -69,10 +69,6 @@ AM_MAKEFLAGS = \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
-"MULTIBUILDTOP=$(MULTIBUILDTOP)" \
-"MULTISUBDIR=$(MULTISUBDIR)" \
-"MULTIOSDIR=$(MULTIDIR)" \
-"MULTIFLAGS=$(MULTIFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
diff --git a/libgm2/Makefile.in b/libgm2/Makefile.in
index ac01eafe45c..da2ec7c2a09 100644
--- a/libgm2/Makefile.in
+++ b/libgm2/Makefile.in
@@ -368,10 +368,6 @@ AM_MAKEFLAGS = \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
-"MULTIBUILDTOP=$(MULTIBUILDTOP)" \
-"MULTISUBDIR=$(MULTISUBDIR)" \
-"MULTIOSDIR=$(MULTIDIR)" \
-"MULTIFLAGS=$(MULTIFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
diff --git a/libgm2/configure b/libgm2/configure
index 8b2c28cb163..8eb1bc81c66 100755
--- a/libgm2/configure
+++ b/libgm2/configure
@@ -6575,6 +6575,10 @@ fi
 
 
 
+enable_dlopen=yes
+
+
+
 case `pwd` in
   *\ * | *\*)
 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope 
well with whitespace in \`pwd\`" >&5
@@ -9193,8 +9197,6 @@ done
 
 
 
-enable_dlopen=no
-
 
   enable_win32_dll=no
 
@@ -12704,7 +12706,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12707 "configure"
+#line 12709 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12810,7 +12812,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 12813 "configure"
+#line 12815 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -16087,13 +16089,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 # Only expand once:
 
 
-enable_dlopen=yes
-
 
 
-# AM_PROG_LIBTOOL
-
 
+if test "${multilib}" = "yes"; then
+  multilib_arg="--enable-multilib"
+else
+  multilib_arg=
+fi
 
 ac_fn_c_check_type "$LINENO" "struct timezone" "ac_cv_type_struct_timezone" 
"$ac_includes_default"
 if test "x$ac_cv_type_struct_timezone" = xyes; then :
@@ -19716,7 +19719,10 @@ fi
 
 
 
-ac_config_files="$ac_config_files Makefile libm2min/Makefile libm2pim/Makefile 
libm2iso/Makefile libm2cor/Makefile libm2log/Makefile"
+ac_config_files="$ac_config_files Makefile"
+
+
+ac_config_files="$ac_config_files libm2min/Makefile