From 29211fd70d0e8ad6660e2b552323747bc28e2941 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 9 Feb 2023 16:59:31 -0500 Subject: [PATCH] Fix libgloss build for fr30 and xstormy16 - conditionally don't use -idirafter option --- libgloss/Makefile.am | 4 ++++ libgloss/Makefile.in | 3 ++- libgloss/configure | 17 +++++++++++++++++ libgloss/configure.ac | 5 +++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am index 4309cd3..92d91bf 100644 --- a/libgloss/Makefile.am +++ b/libgloss/Makefile.am @@ -24,7 +24,11 @@ includetool_DATA = includesystooldir = $(tooldir)/include/sys includesystool_DATA = +if HAVE_IDIRAFTER AM_CPPFLAGS = -idirafter $(srcroot)/include +else +AM_CPPFLAGS = +endif # A fake library so automake will generate rules for plain objects that we want # to install (e.g. our crt0.o objects). diff --git a/libgloss/Makefile.in b/libgloss/Makefile.in index a117577..ebbf28c 100644 --- a/libgloss/Makefile.in +++ b/libgloss/Makefile.in @@ -807,7 +807,8 @@ includetooldir = $(tooldir)/include includetool_DATA = $(am__append_16) includesystooldir = $(tooldir)/include/sys includesystool_DATA = $(am__append_17) -AM_CPPFLAGS = -idirafter $(srcroot)/include +@HAVE_IDIRAFTER_FALSE@AM_CPPFLAGS = +@HAVE_IDIRAFTER_TRUE@AM_CPPFLAGS = -idirafter $(srcroot)/include # A fake library so automake will generate rules for plain objects that we want # to install (e.g. our crt0.o objects). diff --git a/libgloss/configure b/libgloss/configure index 28754b6..a188a79 100755 --- a/libgloss/configure +++ b/libgloss/configure @@ -630,6 +630,8 @@ CPPFLAGS LDFLAGS CFLAGS CC +HAVE_IDIRAFTER_FALSE +HAVE_IDIRAFTER_TRUE CONFIG_WINCE_FALSE CONFIG_WINCE_TRUE CONFIG_RISCV_FALSE @@ -2865,6 +2867,7 @@ case "${target}" in ac_config_files="$ac_config_files fr30/Makefile" subdirs="$subdirs fr30" + config_fr30=true ;; frv*-*-*) ac_config_files="$ac_config_files frv/Makefile" @@ -2925,6 +2928,7 @@ case "${target}" in ac_config_files="$ac_config_files xstormy16/Makefile" subdirs="$subdirs xstormy16" + config_xstormy16=true ;; m32c-*-*) ac_config_files="$ac_config_files m32c/Makefile" @@ -3081,6 +3085,15 @@ fi + if test x$config_fr30 = x && test x$config_xstormy16 = x; then + HAVE_IDIRAFTER_TRUE= + HAVE_IDIRAFTER_FALSE='#' +else + HAVE_IDIRAFTER_TRUE='#' + HAVE_IDIRAFTER_FALSE= +fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -5347,6 +5360,10 @@ if test -z "${CONFIG_WINCE_TRUE}" && test -z "${CONFIG_WINCE_FALSE}"; then as_fn_error $? "conditional \"CONFIG_WINCE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_IDIRAFTER_TRUE}" && test -z "${HAVE_IDIRAFTER_FALSE}"; then + as_fn_error $? "conditional \"HAVE_IDIRAFTER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libgloss/configure.ac b/libgloss/configure.ac index 5fb2684..4528b09 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -145,6 +145,7 @@ case "${target}" in fr30-*-*) AC_CONFIG_FILES([fr30/Makefile]) subdirs="$subdirs fr30" + config_fr30=true ;; frv*-*-*) AC_CONFIG_FILES([frv/Makefile]) @@ -194,6 +195,7 @@ case "${target}" in xstormy16-*-*) AC_CONFIG_FILES([xstormy16/Makefile]) subdirs="$subdirs xstormy16" + config_xstormy16=true ;; m32c-*-*) AC_CONFIG_FILES([m32c/Makefile]) @@ -252,6 +254,9 @@ m4_foreach_w([SUBDIR], [ AM_CONDITIONAL([CONFIG_]m4_toupper(SUBDIR), [test x$config_]SUBDIR = xtrue) ]) +dnl fr30 and xstormy16 compilers don't support -idirafter +AM_CONDITIONAL([HAVE_IDIRAFTER], [[test x$config_fr30] = x] && [[test x$config_xstormy16] = x]) + dnl For now, don't bother configuring testsuite dnl dnl if test "${config_testsuite}" = "true"; -- 1.8.3.1