[PATCH] a68: revamp libga68/configure.ac
Jose E. Marchesi
jemarch@gnu.org
Mon Oct 27 09:37:22 GMT 2025
> Hi Jose,
>
>> On 26 Oct 2025, at 22:56, Jose E. Marchesi <jemarch@gnu.org> wrote:
>
>> So I did a little revamp of libga68/configure.ac, removing unused and
>> duplicated stuff, and adding some commentary.
>>
>> I would appreciate if someone could do a review of it and try it in
>> cross-compilation and multilib scenarios.
>>
>> Iain, this removes the GLIBCXX_IS_NATIVE handling for darwin, as I think
>> it is not really necessary. But I am not 100% sure..
>
> In general the comments are true;
>
> That is on 10.4..10.6 it is possible to build an i686 compiler natively
> on a powerpc platform and vice-versa (and other permutations on 10.5
> on a G5 or x86_64 machine).
>
> Then there’s a gap - because only x86 was supported (although one
> can also consider that it is possible to build an i686-darwin compiler
> natively on an x86_64 box - I do that regularly).
>
> Now we have AArch64/Arm64 boxes with an x86_64 slice in the system
> libraries - to support Rosetta2; so I can, indeed, configure and build an
> x86_64-darwin24 compiler on an aarch64-darwin24 box ( I do this almost
> every day ).
>
> However, I”m not sure what we’d be using GLIBCXX_IS_NATIVE for in
> the libga68 build - it looks like a C&P from somewhere else;
It comes from libstdc++v3. I have no idea why I got the stuff there.
> So no objection from me - if we need this facility we will probably have to
> introduce something specific for libga68.
Thanks for taking a look.
>
> thanks,
> Iain
>
>
>>
>> The test build is in progress.
>> Thanks!
>>
>> diff --git a/libga68/configure.ac b/libga68/configure.ac
>> index 8d8411c8c93..b82a7883565 100644
>> --- a/libga68/configure.ac
>> +++ b/libga68/configure.ac
>> @@ -15,72 +15,61 @@
>> # along with GCC; see the file COPYING3. If not see
>> # <http://www.gnu.org/licenses/>.
>>
>> -# Configure looks for the existence of this file to auto-config each language.
>> -# We define several parameters used by configure:
>> -
>> # Process this file with autoreconf to produce a configure script.
>>
>> AC_INIT(package-unused, version-unused,,libga68)
>> AC_CONFIG_SRCDIR(Makefile.am)
>> AC_CONFIG_HEADER(config.h)
>>
>> +# Add --enable-multilib to configure, which defaults to enable.
>> AM_ENABLE_MULTILIB(, ..)
>>
>> +if test "${multilib}" = "yes"; then
>> + multilib_arg="--enable-multilib"
>> +else
>> + multilib_arg=
>> +fi
>> +
>> +# Cope with compilers, in subsequent tests, that at this stage may not
>> +# be able to build executables.
>> GCC_NO_EXECUTABLES
>>
>> +# Enable extensions to C or POSIX on hosts that normally disable the
>> +# extensions. This should be called before any macros that run the C
>> +# compiler.
>> AC_USE_SYSTEM_EXTENSIONS
>>
>> -# Do not delete or change the following two lines. For why, see
>> +# Determine the system type and set output variabls to the names of
>> +# the canonical system types.
>> +#
>> +# Do not delete or change the following two lines. For why, and for
>> +# why we are using the obsolete AC_CANONICAL_SYSTEM as ell as the
>> +# recommended AC_CANONICAL_HOST, see
>> # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
>> AC_CANONICAL_SYSTEM
>> target_alias=${target_alias-$host_alias}
>> AC_SUBST(target_alias)
>> +AC_CANONICAL_HOST
>>
>> -if test "$build" != "$host"; then
>> - # We are being configured with some form of cross compiler.
>> - GLIBCXX_IS_NATIVE=false
>> - case "$host","$target" in
>> - # Darwin crosses can use the host system's libraries and headers,
>> - # because of the fat library support. Of course, it must be the
>> - # same version of Darwin on both sides. Allow the user to
>> - # just say --target=foo-darwin without a version number to mean
>> - # "the version on this system".
>> - *-*-darwin*,*-*-darwin*)
>> - hostos=`echo $host | sed 's/.*-darwin/darwin/'`
>> - targetos=`echo $target | sed 's/.*-darwin/darwin/'`
>> - if test $hostos = $targetos || test $targetos = darwin ; then
>> - GLIBCXX_IS_NATIVE=true
>> - fi
>> - ;;
>> -
>> - *)
>> - GCC_NO_EXECUTABLES
>> - ;;
>> - esac
>> -else
>> - GLIBCXX_IS_NATIVE=true
>> -fi
>> -
>> -# Runs configure.host, and assorted other critical bits. Sets
>> -# up critical shell variables.
>> -GLIBCXX_CONFIGURE
>> +# These macro are for supporting canadian crosses, in which build /=
>> +# host /= target.
>> +ACX_NONCANONICAL_HOST
>> +ACX_NONCANONICAL_TARGET
>> +GCC_TOPLEV_SUBDIRS
>>
>> +# Initialize Automake with proper options.
>> AM_INIT_AUTOMAKE([1.15.1 no-define foreign no-dist -Wall -Wno-portability])
>>
>> +# Tell Autoheader to include templates for PACKAGE and VERSION in
>> +# config.h.in.
>> AH_TEMPLATE(PACKAGE, [Name of package])
>> AH_TEMPLATE(VERSION, [Version number of package])
>>
>> +# Command-line options.
>> +
>> AC_ARG_WITH(cross-host,
>> [ --with-cross-host=HOST Configuring with a cross compiler])
>>
>> -# Checks for header files.
>> -AC_CHECK_HEADERS(malloc.h)
>> -
>> -AC_CANONICAL_HOST
>> -ACX_NONCANONICAL_HOST
>> -ACX_NONCANONICAL_TARGET
>> -GCC_TOPLEV_SUBDIRS
>> -
>> AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
>> AC_ARG_ENABLE(version-specific-runtime-libs,
>> [ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
>> @@ -104,26 +93,10 @@ else
>> fi)
>> AC_SUBST(slibdir)
>>
>> -# Command-line options.
>> -# Very limited version of AC_MAINTAINER_MODE.
>> -AC_ARG_ENABLE([maintainer-mode],
>> - [AC_HELP_STRING([--enable-maintainer-mode],
>> - [enable make rules and dependencies not useful (and
>> - sometimes confusing) to the casual installer])],
>> - [case ${enable_maintainer_mode} in
>> - yes) MAINT='' ;;
>> - no) MAINT='#' ;;
>> - *) AC_MSG_ERROR([--enable-maintainer-mode must be yes or no]) ;;
>> - esac
>> - maintainer_mode=${enableval}],
>> - [MAINT='#'])
>> -AC_SUBST([MAINT])dnl
>> -
>> -toolexecdir=no
>> -toolexeclibdir=no
>> -
>> # Calculate toolexeclibdir
>> # Also toolexecdir, though it's only used in toolexeclibdir
>> +toolexecdir=no
>> +toolexeclibdir=no
>> case ${version_specific_libs} in
>> yes)
>> # Need the gcc compiler version to know where to install libraries
>> @@ -149,28 +122,20 @@ case ${version_specific_libs} in
>> esac
>> ;;
>> esac
>> -
>> AC_SUBST(toolexecdir)
>> AC_SUBST(toolexeclibdir)
>>
>> -AH_TEMPLATE(PACKAGE, [Name of package])
>> -AH_TEMPLATE(VERSION, [Version number of package])
>> -
>> +# Add support for --enable-maintainer-mode={yes,no} to configure.
>> AM_MAINTAINER_MODE
>>
>> -# Check the compiler.
>> -# The same as in boehm-gc and libstdc++. Have to borrow it from there.
>> # We must force CC to /not/ be precious variables; otherwise
>> # the wrong, non-multilib-adjusted value will be used in multilibs.
>> # As a side effect, we have to subst CFLAGS ourselves.
>> -
>> m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
>> m4_define([_AC_ARG_VAR_PRECIOUS],[])
>> AC_PROG_CC
>> -AC_PROG_CXX
>> AM_PROG_AS
>> m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
>> -
>> AC_SUBST(CFLAGS)
>>
>> # In order to override CFLAGS_FOR_TARGET, all of our special flags go
>> @@ -185,6 +150,7 @@ AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
>> AC_PROG_MAKE_SET
>> AC_PROG_INSTALL
>>
>> +# Initialize libtool.
>> AM_PROG_LIBTOOL
>> LT_INIT
>> AC_LIBTOOL_DLOPEN
>> @@ -194,32 +160,19 @@ AM_CONDITIONAL([ENABLE_DARWIN_AT_RPATH], [test x$enable_darwin_at_rpath = xyes])
>> AC_SUBST(enable_shared)
>> AC_SUBST(enable_static)
>>
>> -if test "${multilib}" = "yes"; then
>> - multilib_arg="--enable-multilib"
>> -else
>> - multilib_arg=
>> -fi
>> -
>> +# Do compilation tests using the C compiler and preprocessor.
>> AC_LANG_C
>> -# Check the compiler.
>> -# The same as in boehm-gc and libstdc++. Have to borrow it from there.
>> -# We must force CC to /not/ be precious variables; otherwise
>> -# the wrong, non-multilib-adjusted value will be used in multilibs.
>> -# As a side effect, we have to subst CFLAGS ourselves.
>> -
>> -m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
>> -m4_define([_AC_ARG_VAR_PRECIOUS],[])
>> -AC_PROG_CC
>> -m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
>> -
>> -AC_SUBST(CFLAGS)
>>
>> +# Allow the user to set CC_FOR_BUILD in the environment.
>> CC_FOR_BUILD=${CC_FOR_BUILD:-gcc}
>> AC_SUBST(CC_FOR_BUILD)
>>
>> +# Search for needed functions in host libraries.
>> AC_SEARCH_LIBS([malloc], [c])
>> AC_SEARCH_LIBS([cosf], [m])
>> -AC_SEARCH_LIBS([clock_gettime], [rt])
>> +
>> +# Determine what GCC version number to use in filesystem paths.
>> +GCC_BASE_VER
>>
>> # Add dependencies for libga68.spec file
>> SPEC_LIBGA68_DEPS="$LIBS"
>> @@ -389,9 +342,6 @@ else
>> SPEC_LIBGA68_DEPS="$SPEC_LIBGA68_DEPS $BDW_GC_LIBS"
>> fi
>>
>> -# Determine what GCC version number to use in filesystem paths.
>> -GCC_BASE_VER
>> -
>> extra_darwin_ldflags_libga68=
>> case $host in
>> *-*-darwin*)
>> @@ -407,14 +357,14 @@ case $host in
>> esac
>> AC_SUBST(extra_darwin_ldflags_libga68)
>>
>> +# Subst some variables used in Makefile.am
>> AC_SUBST(LIBGA68_GCFLAGS)
>> AC_SUBST(LIBGA68_BOEHM_GC_INCLUDES)
>> AC_SUBST(LIBGA68_BOEHM_GC_LIBS)
>>
>> +# Output files and be done.
>> AC_CONFIG_SRCDIR([Makefile.am])
>> AC_CONFIG_FILES([Makefile])
>> AC_CONFIG_FILES(libga68.spec)
>> -
>> AC_MSG_NOTICE([libga68 has been configured.])
>> -
>> AC_OUTPUT
More information about the Algol68
mailing list