[2/2] sim: igen: drop config.h & header checking

Message ID 20210222055540.19790-2-vapier@gentoo.org
State New
Headers show
Series
  • [1/2] sim: igen: delete more unused toolchain programs
Related show

Commit Message

Simon Marchi via Gdb-patches Feb. 22, 2021, 5:55 a.m.
While the configure script was checking for a bunch of headers, only
one of them was conditionally included in the source (unistd.h).  The
rest were always included.  Based on those usage this whole time, we
can reasonably assume that the build also has unistd.h.

All the other files including config.h never actually used any defines
from the header.
---
 sim/igen/Makefile.in   |  9 +-----
 sim/igen/config.in     | 64 ------------------------------------------
 sim/igen/configure.ac  |  9 +-----
 sim/igen/filter.c      |  3 --
 sim/igen/filter_host.c |  1 -
 sim/igen/igen.c        |  1 -
 sim/igen/lf.c          |  1 -
 sim/igen/misc.c        |  1 -
 sim/igen/misc.h        |  3 --
 sim/igen/table.c       |  3 --
 10 files changed, 2 insertions(+), 93 deletions(-)
 delete mode 100644 sim/igen/config.in

-- 
2.30.0

Patch

diff --git a/sim/igen/Makefile.in b/sim/igen/Makefile.in
index 34a3a89f9ee0..de5fe1f4c527 100644
--- a/sim/igen/Makefile.in
+++ b/sim/igen/Makefile.in
@@ -88,9 +88,6 @@  all:	igen
 .c.o:
 	$(CC_FOR_BUILD) -c $(BUILD_CFLAGS) $<
 
-
-filter_filename.o: filter_filename.c filter_filename.h config.h ppc-config.h
-
 IGEN_OBJS=\
 	table.o \
 	lf.o misc.o \
@@ -159,7 +156,7 @@  clean mostlyclean:
 	rm -f tmp-* *.[oasi] core igen
 
 distclean realclean: clean
-	rm -f TAGS Makefile config.cache config.status config.h defines.h stamp-h config.log
+	rm -f TAGS Makefile config.cache config.status defines.h config.log
 
 maintainer-clean: distclean
 	rm -f *~ *.log ppc-config.h core *.core
@@ -167,10 +164,6 @@  maintainer-clean: distclean
 Makefile: Makefile.in config.status
 	CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
 
-config.h: stamp-h ; @true
-stamp-h: config.in config.status
-	CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
-
 config.status: configure
 	$(SHELL) ./config.status --recheck
 
diff --git a/sim/igen/config.in b/sim/igen/config.in
deleted file mode 100644
index 037c3100385e..000000000000
--- a/sim/igen/config.in
+++ /dev/null
@@ -1,64 +0,0 @@ 
-/* config.in.  Generated from configure.ac by autoheader.  */
-
-/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_DIRENT_H
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
-#undef HAVE_NDIR_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_DIR_H
-
-/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
-   */
-#undef HAVE_SYS_NDIR_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
diff --git a/sim/igen/configure.ac b/sim/igen/configure.ac
index d35bf0744eaf..807e1d596939 100644
--- a/sim/igen/configure.ac
+++ b/sim/igen/configure.ac
@@ -18,14 +18,7 @@  fi
 
 AC_CANONICAL_SYSTEM
 
-AC_CONFIG_HEADER(config.h:config.in)
-
-# NB: You can assume C11 headers exist.
-AC_CHECK_HEADERS(sys/stat.h sys/types.h unistd.h)
-AC_HEADER_DIRENT
-
 AC_SUBST(CC_FOR_BUILD)
 AC_SUBST(CFLAGS_FOR_BUILD)
 
-AC_OUTPUT(Makefile,
-[case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
+AC_OUTPUT(Makefile)
diff --git a/sim/igen/filter.c b/sim/igen/filter.c
index e37d680b09c8..83431d8d2efb 100644
--- a/sim/igen/filter.c
+++ b/sim/igen/filter.c
@@ -21,9 +21,6 @@ 
 
 
 #include <stdio.h>
-
-#include "config.h"
-
 #include <string.h>
 
 #include "misc.h"
diff --git a/sim/igen/filter_host.c b/sim/igen/filter_host.c
index 52e4d859e4fb..0e1992cfae81 100644
--- a/sim/igen/filter_host.c
+++ b/sim/igen/filter_host.c
@@ -19,7 +19,6 @@ 
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include "config.h"
 #include "filter_host.h"
 
 /* Shorten traces by eliminating the directory component to filenames.  */
diff --git a/sim/igen/igen.c b/sim/igen/igen.c
index d0e0da979bb1..e649f853c3dc 100644
--- a/sim/igen/igen.c
+++ b/sim/igen/igen.c
@@ -25,7 +25,6 @@ 
 #include "misc.h"
 #include "lf.h"
 #include "table.h"
-#include "config.h"
 #include "filter.h"
 
 #include "igen.h"
diff --git a/sim/igen/lf.c b/sim/igen/lf.c
index 4a7978e7a713..275938ffb513 100644
--- a/sim/igen/lf.c
+++ b/sim/igen/lf.c
@@ -25,7 +25,6 @@ 
 #include <stdarg.h>
 #include <ctype.h>
 
-#include "config.h"
 #include "misc.h"
 #include "lf.h"
 
diff --git a/sim/igen/misc.c b/sim/igen/misc.c
index d74f74e12e5d..fafe2e9a93fa 100644
--- a/sim/igen/misc.c
+++ b/sim/igen/misc.c
@@ -25,7 +25,6 @@ 
 #include <stdarg.h>
 #include <ctype.h>
 
-#include "config.h"
 #include "misc.h"
 
 #include <stdlib.h>
diff --git a/sim/igen/misc.h b/sim/igen/misc.h
index 40e9cd05d1c3..2492f1763890 100644
--- a/sim/igen/misc.h
+++ b/sim/igen/misc.h
@@ -23,9 +23,6 @@ 
 
 /* Frustrating header junk */
 
-#include "config.h"
-
-
 enum
 {
   default_insn_bit_size = 32,
diff --git a/sim/igen/table.c b/sim/igen/table.c
index d21b282dc45b..8cc8dc40eef0 100644
--- a/sim/igen/table.c
+++ b/sim/igen/table.c
@@ -27,14 +27,11 @@ 
 #include <fcntl.h>
 #include <ctype.h>
 
-#include "config.h"
 #include "misc.h"
 #include "lf.h"
 #include "table.h"
 
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <stdlib.h>
 
 typedef struct _open_table open_table;