diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2023-08-12 18:17:41 +0100 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2023-08-12 18:17:41 +0100 |
commit | 63fb0bedb8077ac1e6b6337f198b4eae30813fbc (patch) | |
tree | 5a66a3f4f6f25ab7d12256efaa1afe1d2be13b13 /libgm2/configure | |
parent | 46905fcde00fd84eb06b6bd1a6e788171d32865b (diff) | |
download | gcc-63fb0bedb8077ac1e6b6337f198b4eae30813fbc.zip gcc-63fb0bedb8077ac1e6b6337f198b4eae30813fbc.tar.gz gcc-63fb0bedb8077ac1e6b6337f198b4eae30813fbc.tar.bz2 |
PR modula2/110779 SysClock can not read the clock (Darwin portability fixes)
This patch adds corrections to defensively check against glibc functions,
structures and contains fallbacks. These fixes were required under Darwin.
gcc/m2/ChangeLog:
PR modula2/110779
* gm2-libs-iso/SysClock.mod (EpochTime): New procedure.
(GetClock): Call EpochTime if the C time functions are
unavailable.
* gm2-libs-iso/wrapclock.def (istimezone): New function
definition.
libgm2/ChangeLog:
PR modula2/110779
* configure: Regenerate.
* configure.ac: Provide special case test for Darwin cross
configuration.
(GLIBCXX_CONFIGURE): New statement.
(GLIBCXX_CHECK_GETTIMEOFDAY): New statement.
(GLIBCXX_ENABLE_LIBSTDCXX_TIME): New statement.
* libm2iso/wrapclock.cc: New sys/time.h conditional include.
(sys/syscall.h): Conditional include.
(unistd.h): Conditional include.
(GetTimeRealtime): Re-implement.
(SetTimeRealtime): Re-implement.
(timezone): Re-implement.
(istimezone): New function.
(daylight): Re-implement.
(isdst): Re-implement.
(tzname): Re-implement.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'libgm2/configure')
-rwxr-xr-x | libgm2/configure | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/libgm2/configure b/libgm2/configure index 74f93ac..072d584 100755 --- a/libgm2/configure +++ b/libgm2/configure @@ -3976,6 +3976,42 @@ test -n "$target_alias" && target_alias=${target_alias-$host_alias} +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 + ;; + + *) + + ;; + esac +else + GLIBCXX_IS_NATIVE=true +fi + +# Runs configure.host, and assorted other critical bits. Sets +# up critical shell variables. +GLIBCXX_CONFIGURE + +# For gettimeofday support. +GLIBCXX_CHECK_GETTIMEOFDAY + +# For clock_gettime, nanosleep and sched_yield support. +GLIBCXX_ENABLE_LIBSTDCXX_TIME + + am__api_version='1.15' # Find a good install program. We prefer a C program (faster), @@ -12702,7 +12738,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12705 "configure" +#line 12741 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12808,7 +12844,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12811 "configure" +#line 12847 "configure" #include "confdefs.h" #if HAVE_DLFCN_H |