aboutsummaryrefslogtreecommitdiff
path: root/libgcobol/configure
diff options
context:
space:
mode:
Diffstat (limited to 'libgcobol/configure')
-rwxr-xr-xlibgcobol/configure328
1 files changed, 277 insertions, 51 deletions
diff --git a/libgcobol/configure b/libgcobol/configure
index 6c2747c..7271517 100755
--- a/libgcobol/configure
+++ b/libgcobol/configure
@@ -788,6 +788,7 @@ enable_option_checking
enable_multilib
enable_maintainer_mode
enable_silent_rules
+enable_libgcobol
enable_version_specific_runtime_libs
enable_dependency_tracking
enable_shared
@@ -1438,6 +1439,7 @@ Optional Features:
sometimes confusing) to the casual installer
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-libgcobol Enable libgcobol
--enable-version-specific-runtime-libs
Specify that runtime libraries should be installed
in a compiler-specific directory
@@ -2380,6 +2382,52 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_cxx_check_header_compile
+# ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES
+# -----------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_cxx_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_decl
+
# ac_fn_cxx_check_func LINENO FUNC VAR
# ------------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -2449,6 +2497,63 @@ $as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_cxx_check_func
+
+# ac_fn_cxx_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ------------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_cxx_check_member ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval "$4=yes"
+else
+ eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_member
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -2739,6 +2844,8 @@ as_fn_append ac_header_list " fenv.h"
as_fn_append ac_header_list " fptrap.h"
as_fn_append ac_header_list " complex.h"
as_fn_append ac_header_list " stdlib.h"
+as_fn_append ac_header_list " errno.h"
+as_fn_append ac_func_list " getprogname"
as_fn_append ac_func_list " random_r"
as_fn_append ac_func_list " srandom_r"
as_fn_append ac_func_list " initstate_r"
@@ -3618,6 +3725,16 @@ END
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-libgcobol" >&5
+$as_echo_n "checking for --enable-libgcobol... " >&6; }
+# Check whether --enable-libgcobol was given.
+if test "${enable_libgcobol+set}" = set; then :
+ enableval=$enable_libgcobol;
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_libgcobol" >&5
+$as_echo "$enable_libgcobol" >&6; }
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-version-specific-runtime-libs" >&5
$as_echo_n "checking for --enable-version-specific-runtime-libs... " >&6; }
# Check whether --enable-version-specific-runtime-libs was given.
@@ -11693,7 +11810,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11696 "configure"
+#line 11813 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11799,7 +11916,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11802 "configure"
+#line 11919 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16690,6 +16807,14 @@ _ACEOF
unset LIBGCOBOL_SUPPORTED
. ${srcdir}/configure.tgt
+# Decide if it's usable.
+case $LIBGCOBOL_SUPPORTED:$enable_libgcobol in
+*:no) use_libgcobol=no ;;
+*:yes) use_libgcobol=yes ;;
+yes:*) use_libgcobol=yes ;;
+*:*) use_libgcobol=no ;;
+esac
+
# -----------------
# __int128 support
# -----------------
@@ -16782,7 +16907,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcobol_cv_have_int128" >&5
$as_echo "$libgcobol_cv_have_int128" >&6; }
- if test "x$LIBGCOBOL_SUPPORTED" = xyes && test "x$libgcobol_cv_have_int128" = xyes; then
+ if test "x$use_libgcobol" = xyes && test "x$libgcobol_cv_have_int128" = xyes; then
BUILD_LIBGCOBOL_TRUE=
BUILD_LIBGCOBOL_FALSE='#'
else
@@ -16959,7 +17084,29 @@ done
-# These are GLIBC
+
+
+# Look for a way to represent the program name
+# First, check the GLIBC case
+ac_fn_cxx_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "
+#if HAVE_ERRNO_H
+# define _GNU_SOURCE
+# include <errno.h>
+#endif
+
+"
+if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
+_ACEOF
+
+
+# Check an alternate
@@ -16979,6 +17126,11 @@ done
+# These are GLIBC
+
+
+
+
@@ -17123,6 +17275,59 @@ if test "$ac_res" != no; then :
fi
+# Copied from gcc/configure.ac. 2025-06-05 R.J.Dubner
+# At least for glibc, clock_gettime is in librt. But don't pull that
+# in if it still doesn't give us the function we want.
+ac_cv_func_clock_gettime=no
+if test $ac_cv_func_clock_gettime = no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
+$as_echo_n "checking for clock_gettime in -lrt... " >&6; }
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt $LIBS"
+if test x$gcc_no_link = xyes; then
+ as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
+fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_lib_rt_clock_gettime=yes
+else
+ ac_cv_lib_rt_clock_gettime=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
+$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+ LIBS="-lrt $LIBS"
+
+$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
+fi
+
+fi
+
have_iec_60559_libc_support=no
if test "x$ac_cv_func_strtof128$ac_cv_func_strfromf128" = xyesyes \
&& test "x$libgcobol_have_sinf128$libgcobol_have_cacosf128" = xyesyes; then
@@ -17172,6 +17377,10 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381
+#error "long double is IEEE quad, no need for libquadmath"
+#endif
+
_Float128 foo (_Float128 x)
{
_Complex _Float128 z1, z2;
@@ -17225,6 +17434,10 @@ fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#if __LDBL_MANT_DIG__ == 113 && __LDBL_MIN_EXP__ == -16381
+#error "long double is IEEE quad, no need for libquadmath"
+#endif
+
_Float128 foo (_Float128 x)
{
_Complex _Float128 z1, z2;
@@ -17296,23 +17509,24 @@ $as_echo "#define USE_QUADMATH 1" >>confdefs.h
$as_echo "#define HAVE_FLOAT128 1" >>confdefs.h
- ac_xsave_cxx_werror_flag=$ac_cxx_werror_flag
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --as-needed/-z ignore works" >&5
+ if test "x$USE_IEC_60559" != xyes; then
+ ac_xsave_cxx_werror_flag=$ac_cxx_werror_flag
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --as-needed/-z ignore works" >&5
$as_echo_n "checking whether --as-needed/-z ignore works... " >&6; }
if ${libgcob_cv_have_as_needed+:} false; then :
$as_echo_n "(cached) " >&6
else
- # Test for native Solaris options first.
- # No whitespace after -z to pass it through -Wl.
- libgcob_cv_as_needed_option="-zignore"
- libgcob_cv_no_as_needed_option="-zrecord"
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option"
- libgcob_cv_have_as_needed=no
+ # Test for native Solaris options first.
+ # No whitespace after -z to pass it through -Wl.
+ libgcob_cv_as_needed_option="-zignore"
+ libgcob_cv_no_as_needed_option="-zrecord"
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option"
+ libgcob_cv_have_as_needed=no
ac_cxx_werror_flag=yes
- if test x$gcc_no_link = xyes; then
+ if test x$gcc_no_link = xyes; then
as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -17333,16 +17547,16 @@ else
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
- if test "x$libgcob_cv_have_as_needed" = xno; then
- libgcob_cv_as_needed_option="--as-needed"
- libgcob_cv_no_as_needed_option="--no-as-needed"
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option"
- libgcob_cv_have_as_needed=no
+ LDFLAGS="$save_LDFLAGS"
+ if test "x$libgcob_cv_have_as_needed" = xno; then
+ libgcob_cv_as_needed_option="--as-needed"
+ libgcob_cv_no_as_needed_option="--no-as-needed"
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,$libgcob_cv_as_needed_option -lm -Wl,$libgcob_cv_no_as_needed_option"
+ libgcob_cv_have_as_needed=no
ac_cxx_werror_flag=yes
- if test x$gcc_no_link = xyes; then
+ if test x$gcc_no_link = xyes; then
as_fn_error $? "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5
fi
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -17363,44 +17577,43 @@ else
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
- fi
- ac_cxx_werror_flag=$ac_xsave_cxx_werror_flag
+ LDFLAGS="$save_LDFLAGS"
+ fi
+ ac_cxx_werror_flag=$ac_xsave_cxx_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgcob_cv_have_as_needed" >&5
$as_echo "$libgcob_cv_have_as_needed" >&6; }
- touch conftest1.$ac_objext conftest2.$ac_objext
- LQUADMATH=-lquadmath
- $CXX -static-libgcobol -### -o conftest \
- conftest1.$ac_objext -lgcobol conftest2.$ac_objext 2>&1 >/dev/null \
- | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd
- if grep "conftest1.$ac_objext.* -Bstatic -lgcobol -Bdynamic .*conftest2.$ac_objext" \
- conftest.cmd >/dev/null 2>&1; then
- LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}"
- elif grep "conftest1.$ac_objext.* -bstatic -lgcobol -bdynamic .*conftest2.$ac_objext" \
- conftest.cmd >/dev/null 2>&1; then
- LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}"
- elif grep "conftest1.$ac_objext.* -aarchive_shared -lgcobol -adefault .*conftest2.$ac_objext" \
+ touch conftest1.$ac_objext conftest2.$ac_objext
+ LQUADMATH=-lquadmath
+ $CXX -static-libgcobol -### -o conftest \
+ conftest1.$ac_objext -lgcobol conftest2.$ac_objext 2>&1 >/dev/null \
+ | grep "conftest1.$ac_objext.*conftest2.$ac_objext" > conftest.cmd
+ if grep "conftest1.$ac_objext.* -Bstatic -lgcobol -Bdynamic .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:-Bstatic} -lquadmath %{static-libquadmath:-Bdynamic}"
+ elif grep "conftest1.$ac_objext.* -bstatic -lgcobol -bdynamic .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:-bstatic} -lquadmath %{static-libquadmath:-bdynamic}"
+ elif grep "conftest1.$ac_objext.* -aarchive_shared -lgcobol -adefault .*conftest2.$ac_objext" \
+ conftest.cmd >/dev/null 2>&1; then
+ LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}"
+ elif grep "conftest1.$ac_objext.*libgcobol.a .*conftest2.$ac_objext" \
conftest.cmd >/dev/null 2>&1; then
- LQUADMATH="%{static-libquadmath:-aarchive_shared} -lquadmath %{static-libquadmath:-adefault}"
- elif grep "conftest1.$ac_objext.*libgcobol.a .*conftest2.$ac_objext" \
- conftest.cmd >/dev/null 2>&1; then
- LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}"
- fi
- rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd
+ LQUADMATH="%{static-libquadmath:libquadmath.a%s;:-lquadmath}"
+ fi
+ rm -f conftest1.$ac_objext conftest2.$ac_objext conftest conftest.cmd
- if test "x$libgcob_cv_have_as_needed" = xyes; then
- if test "x$USE_IEC_60559" = xyes; then
- LIBQUADSPEC="$libgcob_cv_as_needed_option $LQUADMATH $libgcob_cv_no_as_needed_option"
+ if test "x$libgcob_cv_have_as_needed" = xyes; then
+ if test "x$USE_IEC_60559" = xyes; then
+ LIBQUADSPEC="$libgcob_cv_as_needed_option $LQUADMATH $libgcob_cv_no_as_needed_option"
+ else
+ LIBQUADSPEC="%{static-libgcobol:$libgcob_cv_as_needed_option} $LQUADMATH %{static-libgcobol:$libgcob_cv_no_as_needed_option}"
+ fi
else
- LIBQUADSPEC="%{static-libgcobol:$libgcob_cv_as_needed_option} $LQUADMATH %{static-libgcobol:$libgcob_cv_no_as_needed_option}"
+ LIBQUADSPEC="$LQUADMATH"
fi
- else
- LIBQUADSPEC="$LQUADMATH"
- fi
- if test "x$USE_IEC_60559" != xyes; then
if test -f ../libquadmath/libquadmath.la; then
LIBQUADLIB=../libquadmath/libquadmath.la
LIBQUADLIB_DEP=../libquadmath/libquadmath.la
@@ -17426,6 +17639,19 @@ $as_echo "#define USE_IEC_60559 1" >>confdefs.h
+# struct tm tm_zone is a POSIX.1-2024 addition.
+ac_fn_cxx_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include <time.h>
+"
+if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_TM_TM_ZONE 1
+_ACEOF
+
+
+fi
+
+
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"
else