Skip to content

Commit 7824bb9

Browse files
author
sf-mensch
committed
configure cleanup
* configure.ac: * fix warning for \ in AC_CHECK_FUNCS by dropping them * only check for IBM/OpenWatcom/Sun's C compilers if not running under GCC / clang
1 parent c265f25 commit 7824bb9

File tree

2 files changed

+40
-8
lines changed

2 files changed

+40
-8
lines changed

ChangeLog

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11

2+
2025-02-11 Simon Sobisch <simonsobisch@gnu.org>
3+
4+
* configure.ac: fix warning for \ in AC_CHECK_FUNCS by dropping them
5+
26
2025-02-11 David Declerck <david.declerck@ocamlpro.com>
37

48
* configure.ac: add -Wno-unused-command-line-argument to CFLAGS under
59
Clang, to prevent some features to be mistakenly detected as missing
610
(in particular -Wno-pointer-sign and -fstack-clash-protection)
711

12+
2025-01-13 Simon Sobisch <simonsobisch@gnu.org>
13+
14+
* configure.ac: only check for IBM/OpenWatcom/Sun's C compilers if not
15+
running under GCC / clang
16+
817
2024-12-08 Simon Sobisch <simonsobisch@gnu.org>
918

1019
* configure.ac: fix check for curses functions if panel headers are found
@@ -1625,7 +1634,7 @@
16251634
* Version 0.9 released.
16261635

16271636

1628-
Copyright 2002-2024 Free Software Foundation, Inc.
1637+
Copyright 2002-2025 Free Software Foundation, Inc.
16291638

16301639
Copying and distribution of this file, with or without modification, are
16311640
permitted provided the copyright notice and this notice are preserved.

configure.ac

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ AC_ARG_WITH([bugurl],
113113
# or:
114114
# options to configure: CFLAGS=-m64 LDFLAGS="-m64 -L/usr/local/lib/sparcv9"
115115
#
116+
# Note for IBM (Mainfraime) on USS
117+
# options to configure: CC="xlc -q64" CFLAGS="-qlanglvl=extc1x" OBJECT_MODE=64 AR=ar NM=nm
118+
#
116119
# Hack for AIX 64 bit (gcc)
117120
# Required -
118121
# options to configure: CC="gcc -maix64" / CC="xlc -q64"
@@ -465,14 +468,27 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
465468
AC_MSG_RESULT([yes])],
466469
[AC_MSG_RESULT([no])])
467470

468-
AC_MSG_CHECKING([for __xlc__])
471+
AS_IF([test "x$COB_USES_GCC$COB_USES_ICC_ONLY$COB_USES_CLANG_ONLY" = xnonono], [
472+
473+
AC_MSG_CHECKING([for __IBMC__])
469474
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
470-
#ifndef __xlc__
475+
#ifndef __IBMC__
471476
# error macro not defined
472477
#endif]])],
473478
[COB_USES_XLC_ONLY=yes
474479
AC_MSG_RESULT([yes])],
475-
[AC_MSG_RESULT([no])])
480+
[
481+
AC_MSG_CHECKING([for __xlc__])
482+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
483+
#ifndef __xlc__
484+
# error macro not defined
485+
#endif]])],
486+
[COB_USES_XLC_ONLY=yes
487+
AC_MSG_RESULT([yes])],
488+
[AC_MSG_RESULT([no])])
489+
])
490+
491+
AS_IF([test "x$COB_USES_XLC_ONLY" = xno], [
476492
477493
AC_MSG_CHECKING([for __WATCOMC__])
478494
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
@@ -481,7 +497,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
481497
#endif]])],
482498
[COB_USES_WATCOMC_ONLY=yes
483499
AC_MSG_RESULT([yes])],
484-
[AC_MSG_RESULT([no])])
500+
[AC_MSG_RESULT([no])
485501
486502
AC_MSG_CHECKING([for __SUNPRO_C])
487503
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
@@ -491,6 +507,13 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
491507
[COB_USES_SUNPRO_C_ONLY=yes
492508
AC_MSG_RESULT([yes])],
493509
[AC_MSG_RESULT([no])])
510+
])
511+
512+
])
513+
514+
])
515+
516+
494517

495518
curr_cflags="$CFLAGS"
496519
AC_CACHE_CHECK([how to error on warnings during configure checks], gc_cv_err_warn, [
@@ -674,9 +697,9 @@ AC_DEFINE_UNQUOTED([COB_KEYWORD_INLINE], [$gc_cv_keyword_inline])
674697

675698
# Checks for library functions.
676699
AC_FUNC_VPRINTF
677-
AC_CHECK_FUNCS([memmove memset setlocale fcntl strerror strcasecmp \
678-
strchr strrchr strdup strstr strtol gettimeofday localeconv \
679-
getexecname canonicalize_file_name popen raise readlink realpath \
700+
AC_CHECK_FUNCS([memmove memset setlocale fcntl strerror strcasecmp
701+
strchr strrchr strdup strstr strtol gettimeofday localeconv
702+
getexecname canonicalize_file_name popen raise readlink realpath
680703
setenv strcoll flockfile])
681704

682705
# more things to save...

0 commit comments

Comments
 (0)