diff mbox series

libgm2: Define missing configure macros [PR113888]

Message ID yddo7clzwx6.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show
Series libgm2: Define missing configure macros [PR113888] | expand

Commit Message

Rainer Orth Feb. 12, 2024, 12:31 p.m. UTC
As detailed in PR modula2/113888, the 32-bit libm2pim/target.c doesn't
assemble in a Linux/sparc64 multilib build.  However, the root cause is
that the HAVE_EXP10* macros are never defined.  While I was at it, I
checked for other cases where the code uses HAVE_* macros that are
missing from config.h.in.

This patch adds the missing checks, changes the configure checks where
the names don't match what's used in the code, or corrects the code to
use the right names.

So far tested on sparc64-unknown-linux-gnu by building libgm2 (32 and
64-bit) and running the gm2 tests.

Ok for trunk?

	Rainer

Comments

Gaius Mulley Feb. 12, 2024, 12:57 p.m. UTC | #1
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> As detailed in PR modula2/113888, the 32-bit libm2pim/target.c doesn't
> assemble in a Linux/sparc64 multilib build.  However, the root cause is
> that the HAVE_EXP10* macros are never defined.  While I was at it, I
> checked for other cases where the code uses HAVE_* macros that are
> missing from config.h.in.
>
> This patch adds the missing checks, changes the configure checks where
> the names don't match what's used in the code, or corrects the code to
> use the right names.
>
> So far tested on sparc64-unknown-linux-gnu by building libgm2 (32 and
> 64-bit) and running the gm2 tests.
>
> Ok for trunk?

yes lgtm and thanks for the patch,

regards,
Gaius
diff mbox series

Patch

# HG changeset patch
# Parent  4f9cde8a5ed4b67cc625923887c1fcf610e8234c
libgm2: Define missing configure macros [PR113888]

diff --git a/libgm2/configure.ac b/libgm2/configure.ac
--- a/libgm2/configure.ac
+++ b/libgm2/configure.ac
@@ -297,7 +297,7 @@  GM2_CHECK_LIB([c],[getgid],[GETGID])
 GM2_CHECK_LIB([c],[getopt_long],[GETOPT_LONG])
 GM2_CHECK_LIB([c],[getopt_long_only],[GETOPT_LONG_ONLY])
 GM2_CHECK_LIB([c],[getpid],[GETPID])
-GM2_CHECK_LIB([c],[gettimeofday],[GETTIMEOFD])
+GM2_CHECK_LIB([c],[gettimeofday],[GETTIMEOFDAY])
 GM2_CHECK_LIB([c],[getuid],[GETUID])
 GM2_CHECK_LIB([c],[ioctl],[IOCTL])
 GM2_CHECK_LIB([c],[kill],[KILL])
@@ -311,6 +311,7 @@  GM2_CHECK_LIB([c],[read],[READ])
 GM2_CHECK_LIB([c],[select],[SELECT])
 GM2_CHECK_LIB([c],[setitimer],[SETITIMER])
 GM2_CHECK_LIB([c],[setgid],[SETGID])
+GM2_CHECK_LIB([c],[settimeofday],[SETTIMEOFDAY])
 GM2_CHECK_LIB([c],[setuid],[SETUID])
 GM2_CHECK_LIB([c],[stat],[STAT])
 GM2_CHECK_LIB([c],[strsignal],[STRSIGNAL])
@@ -323,10 +324,15 @@  GM2_CHECK_LIB([c],[unlink],[UNLINK])
 GM2_CHECK_LIB([c],[wait],[WAIT])
 GM2_CHECK_LIB([c],[write],[WRITE])
 
+GM2_CHECK_LIB([m],[exp10],[EXP10])
+GM2_CHECK_LIB([m],[exp10f],[EXP10F])
+GM2_CHECK_LIB([m],[exp10l],[EXP10L])
 GM2_CHECK_LIB([m],[signbit],[SIGNBIT])
 GM2_CHECK_LIB([m],[signbitf],[SIGNBITF])
 GM2_CHECK_LIB([m],[signbitl],[SIGNBITL])
 
+AC_CHECK_DECLS([getenv])
+
 AC_MSG_NOTICE([libgm2 has finished checking target libc and libm contents.])
 
 # We test the host here and later on check the target.
diff --git a/libgm2/libm2pim/dtoa.cc b/libgm2/libm2pim/dtoa.cc
--- a/libgm2/libm2pim/dtoa.cc
+++ b/libgm2/libm2pim/dtoa.cc
@@ -33,11 +33,11 @@  see the files COPYING3 and COPYING.RUNTI
 #define M2EXPORT(FUNC) m2pim ## _M2_dtoa_ ## FUNC
 #define M2LIBNAME "m2pim"
 
-#if defined(HAVE_STRINGS)
+#if defined(HAVE_STRINGS_H)
 #include <strings.h>
 #endif
 
-#if defined(HAVE_STRING)
+#if defined(HAVE_STRING_H)
 #include <string.h>
 #endif
 
diff --git a/libgm2/libm2pim/ldtoa.cc b/libgm2/libm2pim/ldtoa.cc
--- a/libgm2/libm2pim/ldtoa.cc
+++ b/libgm2/libm2pim/ldtoa.cc
@@ -34,11 +34,11 @@  see the files COPYING3 and COPYING.RUNTI
 #define M2EXPORT(FUNC) m2pim ## _M2_ldtoa_ ## FUNC
 #define M2LIBNAME "m2pim"
 
-#if defined(HAVE_STRINGS)
+#if defined(HAVE_STRINGS_H)
 #include <strings.h>
 #endif
 
-#if defined(HAVE_STRING)
+#if defined(HAVE_STRING_H)
 #include <string.h>
 #endif