Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
run autoupdate on more m4 files in config
just the ones that it works for
(I also did some postediting of things autoupdate screwed up, like changing stuff in comments, or breaking arguments to AC_REQUIRE)
  • Loading branch information
cooljeanius committed May 25, 2022
1 parent d5ea2ae commit 6b44b2c
Show file tree
Hide file tree
Showing 26 changed files with 97 additions and 149 deletions.
44 changes: 21 additions & 23 deletions config/acinclude.m4
Expand Up @@ -12,7 +12,7 @@ AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
CYG_AC_PROG_GXX_WORKS
if test $ac_cv_prog_gxx = yes; then
if test $ac_cv_cxx_compiler_gnu = yes; then
GXX=yes
dnl Check whether -g works, even if CXXFLAGS is set, in case the package
dnl plays around with CXXFLAGS (such as to build both debugging and
Expand All @@ -38,7 +38,7 @@ dnl See if the G++ compiler we found works.
AC_DEFUN([CYG_AC_PROG_GXX_WORKS],
[AC_MSG_CHECKING([whether the G++ compiler ($CXX $CXXFLAGS $LDFLAGS) actually works])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_LANG([C++])
dnl Try a test case. We only compile, because it's close to impossible
dnl to get a correct fully linked executable with a cross compiler. For
dnl most cross compilers, this test is bogus. For G++, we can use various
Expand All @@ -59,14 +59,14 @@ libgccpath=`${CXX} --print-libgcc`
dnl If we don't have a path with libgcc.a on the end, this isn't G++.
if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then
ac_cv_prog_gxx=yes
ac_cv_cxx_compiler_gnu=yes
else
ac_cv_prog_gxx=no
ac_cv_cxx_compiler_gnu=no
fi
dnl If we are using G++, look for the files that need to exist if this
dnl compiler works.
if test x"${ac_cv_prog_gxx}" = xyes ; then
if test x"${ac_cv_cxx_compiler_gnu}" = xyes ; then
gccfiles=`echo $libgccpath | sed -e 's:/libgcc.a::'`
if test -f ${gccfiles}/specs -a -f ${gccfiles}/cpp -a -f ${gccfiles}/cc1plus; then
gccfiles=yes
Expand Down Expand Up @@ -109,7 +109,7 @@ AC_CHECK_PROGS(CC, cc, gcc)
CYG_AC_PROG_GCC_WORKS
if test $ac_cv_prog_gcc = yes; then
if test $ac_cv_c_compiler_gnu = yes; then
GCC=yes
dnl Check whether -g works, even if CFLAGS is set, in case the package
dnl plays around with CFLAGS (such as to build both debugging and
Expand All @@ -135,7 +135,7 @@ dnl See if the GCC compiler we found works.
AC_DEFUN([CYG_AC_PROG_GCC_WORKS],
[AC_MSG_CHECKING([whether the Gcc compiler ($CC $CFLAGS $LDFLAGS) actually works])
AC_LANG_SAVE
AC_LANG_C
AC_LANG([C])
dnl Try a test case. We only compile, because it's close to impossible
dnl to get a correct fully linked executable with a cross
dnl compiler. For most cross compilers, this test is bogus. For G++,
Expand All @@ -155,14 +155,14 @@ libgccpath=`${CC} --print-libgcc`
dnl If we don't have a path with libgcc.a on the end, this isn't G++.
if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then
ac_cv_prog_gcc=yes
ac_cv_c_compiler_gnu=yes
else
ac_cv_prog_gcc=no
ac_cv_c_compiler_gnu=no
fi
dnl If we are using Gcc, look for the files that need to exist if this
dnl compiler works.
if test x"${ac_cv_prog_gcc}" = xyes ; then
if test x"${ac_cv_c_compiler_gnu}" = xyes ; then
gccfiles=`echo $libgccpath | sed -e 's:/libgcc.a::'`
if test -f ${gccfiles}/specs -a -f ${gccfiles}/cpp -a -f ${gccfiles}/cc1plus; then
gccfiles=yes
Expand Down Expand Up @@ -562,21 +562,21 @@ AC_MSG_CHECKING(to see if this is a little endian host)
AC_CACHE_VAL(ac_cv_c_little_endian, [
ac_cv_c_little_endian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/param.h>], [
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/param.h>]], [[
#if !BYTE_ORDER || !_BIG_ENDIAN || !_LITTLE_ENDIAN
bogus endian macros
#endif], [# It does; now see whether it defined to _LITTLE_ENDIAN or not.
AC_TRY_COMPILE([#include <sys/types.h>
#endif]])],[# It does; now see whether it defined to _LITTLE_ENDIAN or not.
_au_m4_changequote([,])AC_TRY_COMPILE([#include <sys/types.h>

This comment has been minimized.

Copy link
@cooljeanius

cooljeanius Jun 12, 2022

Author Contributor

oops looks like I missed one of these instances of a stray _au_m4_changequote([,]) getting inserted by autoupdate

This comment has been minimized.

Copy link
@cooljeanius

cooljeanius Jun 12, 2022

Author Contributor

fixed in 55a1c9f

#include <sys/param.h>], [
#if BYTE_ORDER != _LITTLE_ENDIAN
not big endian
#endif], ac_cv_c_little_endian=yes, ac_cv_c_little_endian=no)
])
],[])
if test ${ac_cv_c_little_endian} = unknown; then
old_cflags=$CFLAGS
CFLAGS=-g
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
main () {
/* Are we little or big endian? From Harbison&Steele. */
union
Expand All @@ -586,9 +586,7 @@ main () {
} u;
u.l = 1;
exit (u.c[0] == 1);
}],
ac_cv_c_little_endian=no,
ac_cv_c_little_endian=yes,[
}]])],[ac_cv_c_little_endian=no],[ac_cv_c_little_endian=yes],[
dnl Yes, this is ugly, and only used for a canadian cross anyway. This
dnl is just to keep configure from stopping here.
case "${host}" in
Expand Down Expand Up @@ -617,20 +615,20 @@ dnl in libgcc.a with LD.
AC_DEFUN([CYG_AC_PATH_LIBGCC],
[AC_MSG_CHECKING([Looking for the path to libgcc.a])
AC_LANG_SAVE
AC_LANG_C
AC_LANG([C])
dnl Get Gcc's full path to libgcc.a
libgccpath=`${CC} --print-libgcc`
dnl If we don't have a path with libgcc.a on the end, this isn't G++.
if test `echo $libgccpath | sed -e 's:/.*/::'` = libgcc.a ; then
ac_cv_prog_gcc=yes
ac_cv_c_compiler_gnu=yes
else
ac_cv_prog_gcc=no
ac_cv_c_compiler_gnu=no
fi
dnl
if test x"${ac_cv_prog_gcc}" = xyes ; then
if test x"${ac_cv_c_compiler_gnu}" = xyes ; then
gccpath=`echo $libgccpath | sed -e 's:/libgcc.a::'`
LIBGCC="-L${gccpath}"
AC_MSG_RESULT(${gccpath})
Expand Down
4 changes: 1 addition & 3 deletions config/asmcfi.m4
Expand Up @@ -4,9 +4,7 @@ AC_DEFUN([GCC_AS_CFI_PSEUDO_OP],
[AC_CACHE_CHECK([assembler .cfi pseudo-op support],
gcc_cv_as_cfi_pseudo_op, [
gcc_cv_as_cfi_pseudo_op=unknown
AC_TRY_COMPILE([asm (".cfi_startproc\n\t.cfi_endproc");],,
[gcc_cv_as_cfi_pseudo_op=yes],
[gcc_cv_as_cfi_pseudo_op=no])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[asm (".cfi_startproc\n\t.cfi_endproc");]], [[]])],[gcc_cv_as_cfi_pseudo_op=yes],[gcc_cv_as_cfi_pseudo_op=no])
])
if test "x$gcc_cv_as_cfi_pseudo_op" = xyes; then
AC_DEFINE(HAVE_AS_CFI_PSEUDO_OP, 1,
Expand Down
6 changes: 2 additions & 4 deletions config/bitfields.m4
Expand Up @@ -12,11 +12,9 @@ AC_DEFUN([gt_BITFIELD_TYPE_MATTERS],
[
AC_CACHE_CHECK([if the type of bitfields matters], gt_cv_bitfield_type_matters,
[
AC_TRY_COMPILE(
[struct foo1 { char x; char y:1; char z; };
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[struct foo1 { char x; char y:1; char z; };
struct foo2 { char x; long long int y:1; char z; };
int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ]; ],
[], gt_cv_bitfield_type_matters=yes, gt_cv_bitfield_type_matters=no)
int foo1test[ sizeof (struct foo1) < sizeof (struct foo2) ? 1 : -1 ]; ]], [[]])],[gt_cv_bitfield_type_matters=yes],[gt_cv_bitfield_type_matters=no])
])
if test $gt_cv_bitfield_type_matters = yes; then
AC_DEFINE(HAVE_BITFIELD_TYPE_MATTERS, 1,
Expand Down
17 changes: 5 additions & 12 deletions config/cet.m4
Expand Up @@ -121,27 +121,22 @@ cet_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-z,ibt,-z,shstk"
if test x$may_have_cet = xyes; then
# Check whether -fcf-protection=none -Wl,-z,ibt,-z,shstk work.
AC_TRY_LINK(
[],[return 0;],
[may_have_cet=yes],
[may_have_cet=no])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[may_have_cet=yes],[may_have_cet=no])
fi
if test x$may_have_cet = xyes; then
if test x$cross_compiling = xno; then
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
int
main ()
{
asm ("endbr32");
return 0;
}
],
[have_multi_byte_nop=yes],
[have_multi_byte_nop=no])
]])],[have_multi_byte_nop=yes],[have_multi_byte_nop=no],[])
have_cet=no
if test x$have_multi_byte_nop = xyes; then
AC_TRY_RUN([
AC_RUN_IFELSE([AC_LANG_SOURCE([[
static void
foo (void)
{
Expand All @@ -167,9 +162,7 @@ main ()
bar ();
return 0;
}
],
[have_cet=no],
[have_cet=yes])
]])],[have_cet=no],[have_cet=yes],[])
fi
if test x$enable_cet = xno -a x$have_cet = xyes; then
AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
Expand Down
5 changes: 1 addition & 4 deletions config/codeset.m4
Expand Up @@ -11,10 +11,7 @@ dnl From Bruno Haible.
AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include <langinfo.h>],
[char* cs = nl_langinfo(CODESET);],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[char* cs = nl_langinfo(CODESET);]])],[am_cv_langinfo_codeset=yes],[am_cv_langinfo_codeset=no])
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
Expand Down
2 changes: 1 addition & 1 deletion config/enable.m4
Expand Up @@ -11,7 +11,7 @@ dnl See docs/html/17_intro/configury.html#enable for documentation.
dnl
AC_DEFUN([GCC_ENABLE],[dnl
m4_define([_g_switch],[--enable-$1])dnl
m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
m4_define([_g_help],[AS_HELP_STRING([_g_switch$3],[$4 @<:@default=$2@:>@])])dnl
AC_ARG_ENABLE($1,_g_help,
m4_bmatch([$5],
[^permit ],
Expand Down
5 changes: 1 addition & 4 deletions config/gcc-plugin.m4
Expand Up @@ -107,10 +107,7 @@ AC_DEFUN([GCC_ENABLE_PLUGINS],
;;
esac
AC_MSG_CHECKING([for -fPIC -shared])
AC_TRY_LINK(
[extern int X;],[return X == 0;],
[AC_MSG_RESULT([yes]); have_pic_shared=yes],
[AC_MSG_RESULT([no]); have_pic_shared=no])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern int X;]], [[return X == 0;]])],[AC_MSG_RESULT([yes]); have_pic_shared=yes],[AC_MSG_RESULT([no]); have_pic_shared=no])
if test x"$have_pic_shared" != x"yes" -o x"$ac_cv_search_dlopen" = x"no"; then
pluginlibs=
enable_plugin=no
Expand Down
44 changes: 18 additions & 26 deletions config/gettext.m4
Expand Up @@ -127,26 +127,23 @@ AC_DEFUN([AM_GNU_GETTEXT],
define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
[AC_TRY_LINK([#include <libintl.h>
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libintl.h>
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
extern int _nl_msg_cat_cntr;
extern int *_nl_domain_bindings;
#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings)
#else
#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
#endif
]ifelse([$2], [need-formatstring-macros],
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
ifelse($2, need-formatstring-macros,

This comment has been minimized.

Copy link
@cooljeanius

cooljeanius Jun 12, 2022

Author Contributor

This had to be reverted in 6e6be6e

#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl
], []),
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
gt_cv_func_gnugettext_libc=yes,
gt_cv_func_gnugettext_libc=no)])
, )]], [[bindtextdomain ("", "");
return (int) gettext ("")ifelse($2, need-ngettext, + (int) ngettext ("", "", 0), ) + __GNU_GETTEXT_SYMBOL_EXPRESSION]])],[gt_cv_func_gnugettext_libc=yes],[gt_cv_func_gnugettext_libc=no])])
if test "$gt_cv_func_gnugettext_libc" != "yes"; then
dnl Sometimes libintl requires libiconv, so first search for libiconv.
Expand All @@ -165,7 +162,7 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
gt_save_LIBS="$LIBS"
LIBS="$LIBS $LIBINTL"
dnl Now see whether libintl exists and does not depend on libiconv.
AC_TRY_LINK([#include <libintl.h>
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libintl.h>
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
extern int _nl_msg_cat_cntr;
extern
Expand All @@ -177,22 +174,19 @@ const char *_nl_expand_alias ();
#else
#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
#endif
]ifelse([$2], [need-formatstring-macros],
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
ifelse($2, need-formatstring-macros,
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl
], []),
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
gt_cv_func_gnugettext_libintl=yes,
gt_cv_func_gnugettext_libintl=no)
, )]], [[bindtextdomain ("", "");
return (int) gettext ("")ifelse($2, need-ngettext, + (int) ngettext ("", "", 0), ) + __GNU_GETTEXT_SYMBOL_EXPRESSION]])],[gt_cv_func_gnugettext_libintl=yes],[gt_cv_func_gnugettext_libintl=no])
dnl Now see whether libintl exists and depends on libiconv.
if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
LIBS="$LIBS $LIBICONV"
AC_TRY_LINK([#include <libintl.h>
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libintl.h>
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
extern int _nl_msg_cat_cntr;
extern
Expand All @@ -204,20 +198,18 @@ const char *_nl_expand_alias ();
#else
#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0
#endif
]ifelse([$2], [need-formatstring-macros],
[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
ifelse($2, need-formatstring-macros,
#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
#endif
changequote(,)dnl
typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
changequote([,])dnl
], []),
[bindtextdomain ("", "");
return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + __GNU_GETTEXT_SYMBOL_EXPRESSION],
[LIBINTL="$LIBINTL $LIBICONV"
, )]], [[bindtextdomain ("", "");
return (int) gettext ("")ifelse($2, need-ngettext, + (int) ngettext ("", "", 0), ) + __GNU_GETTEXT_SYMBOL_EXPRESSION]])],[LIBINTL="$LIBINTL $LIBICONV"
LTLIBINTL="$LTLIBINTL $LTLIBICONV"
gt_cv_func_gnugettext_libintl=yes
])
],[])
fi
CPPFLAGS="$gt_save_CPPFLAGS"
LIBS="$gt_save_LIBS"])
Expand Down Expand Up @@ -369,8 +361,8 @@ AC_DEFUN([AM_INTL_SUBDIR],
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_PROG_RANLIB])dnl
AC_REQUIRE([AC_ISC_POSIX])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl
AC_REQUIRE([AC_PROG_EGREP])dnl
AC_REQUIRE([AC_C_CONST])dnl
AC_REQUIRE([AC_C_INLINE])dnl
AC_REQUIRE([AC_TYPE_OFF_T])dnl
Expand Down
4 changes: 2 additions & 2 deletions config/hwcaps.m4
Expand Up @@ -16,7 +16,7 @@ AC_DEFUN([GCC_CHECK_ASSEMBLER_HWCAP], [
CFLAGS="$CFLAGS -Wa,-nH"
AC_MSG_CHECKING([for as that supports -Wa,-nH])
AC_TRY_COMPILE([], [return 0;], [ac_hwcap_flags=yes],[ac_hwcap_flags=no])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_hwcap_flags=yes],[ac_hwcap_flags=no])
if test "$ac_hwcap_flags" = "yes"; then
HWCAP_CFLAGS="-Wa,-nH $HWCAP_CFLAGS"
fi
Expand Down Expand Up @@ -46,7 +46,7 @@ AC_DEFUN([GCC_CHECK_LINKER_HWCAP], [
LDFLAGS="$LFLAGS -mclear-hwcap"
AC_MSG_CHECKING([for -mclear-hwcap])
AC_TRY_LINK([], [return 0;], [ac_hwcap_ldflags=yes],[ac_hwcap_ldflags=no])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ac_hwcap_ldflags=yes],[ac_hwcap_ldflags=no])
if test "$ac_hwcap_ldflags" = "yes"; then
HWCAP_LDFLAGS="-mclear-hwcap $HWCAP_LDFLAGS"
fi
Expand Down

1 comment on commit 6b44b2c

@cooljeanius
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"works" in the commit message should really be in scare-quotes, since for a lot of these it didn't actually work

Please sign in to comment.