toolchain: add autoconf-lean

Use it to generate a more comprehensive configure sitefile

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2018-03-02 14:12:18 +01:00
parent 6fa0e07758
commit fdb30eed03
5 changed files with 1838 additions and 1 deletions

View File

@ -29,7 +29,7 @@
curdir:=toolchain curdir:=toolchain
# subdirectories to descend into # subdirectories to descend into
$(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_NASM),nasm) $(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_NASM),nasm) autoconf-lean
ifdef CONFIG_USE_UCLIBC ifdef CONFIG_USE_UCLIBC
$(curdir)/builddirs += $(LIBC)/utils $(curdir)/builddirs += $(LIBC)/utils
endif endif
@ -51,6 +51,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
$(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile $(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile
$(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile $(curdir)/kernel-headers/compile $(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile $(curdir)/kernel-headers/compile
$(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile $(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile
$(curdir)/autoconf-lean/compile:=$(curdir)/gcc/final/compile
endif endif
ifndef DUMP_TARGET_DB ifndef DUMP_TARGET_DB

View File

@ -0,0 +1,65 @@
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=autoconf-lean
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2012-09-01
PKG_SOURCE_URL:=https://github.com/GregorR/autoconf-lean
PKG_SOURCE_VERSION:=bd81206959881c511b28e16e81b0a281fd15bd02
PKG_HASH:=e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8
HOST_FIXUP := autoreconf
HOST_BUILD_PREFIX:=$(TOOLCHAIN_DIR)
BUILD_DIR_HOST:=$(BUILD_DIR_TOOLCHAIN)
include $(INCLUDE_DIR)/host-build.mk
HOST_CONFIG_SITE:=$(CURDIR)/config.site
CONFIGURE_PATH := config-site-generator
HOST_CONFIGURE_VARS := \
$(TARGET_CONFIGURE_OPTS) \
CFLAGS="$(TARGET_CFLAGS)" \
CXXFLAGS="$(TARGET_CXXFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)"
HOST_CONFIGURE_ARGS := \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
--build=$(GNU_HOST_NAME) \
--program-prefix="" \
--program-suffix="" \
--prefix=$(TOOLCHAIN_DIR) \
--exec-prefix=$(TOOLCHAIN_DIR) \
--bindir=$(TOOLCHAIN_DIR)/bin \
--sbindir=$(TOOLCHAIN_DIR)/sbin \
--libexecdir=$(TOOLCHAIN_DIR)/lib
HOST_MAKE_VARS :=
HOST_MAKE_FLAGS :=
define Host/Configure
$(call Host/Configure/Default,,,config-site-generator)
endef
define Host/Compile
$(MAKE) -C $(HOST_BUILD_DIR)/config-site-generator
endef
define Host/Install
grep -v '/' \
$(HOST_BUILD_DIR)/config-site-generator/config.site \
> $(TOOLCHAIN_DIR)/config.site
endef
$(eval $(call HostBuild))

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,93 @@
--- a/config-site-generator/configure.ac
+++ b/config-site-generator/configure.ac
@@ -31,16 +31,16 @@ AC_PROG_GCC_TRADITIONAL
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CXX_C_O
-AC_PROG_OBJC
-AC_PROG_OBJCPP
-AC_PROG_OBJCXX
-AC_PROG_OBJCXXCPP
+#AC_PROG_OBJC
+#AC_PROG_OBJCPP
+#AC_PROG_OBJCXX
+#AC_PROG_OBJCXXCPP
#AC_ERLANG_PATH_ERLC
#AC_ERLANG_PATH_ERL
-AC_PROG_F77
-AC_PROG_FC
-AC_PROG_F77_C_O
-AC_PROG_FC_C_O
+#AC_PROG_F77
+#AC_PROG_FC
+#AC_PROG_F77_C_O
+#AC_PROG_FC_C_O
#AC_PROG_GO
AC_PROG_AWK
AC_PROG_GREP
@@ -52,13 +52,13 @@ AC_PROG_LEX
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PROG_SED
-AC_PROG_YACC
+#AC_PROG_YACC
AM_PROG_AS
# Checks for system services.
-AC_PATH_X
-AC_PATH_XTRA
+#AC_PATH_X
+#AC_PATH_XTRA
AC_SYS_INTERPRETER
AC_SYS_LARGEFILE
AC_SYS_LONG_FILE_NAMES
@@ -163,27 +163,27 @@ AC_C_FLEXIBLE_ARRAY_MEMBER
AC_C_VARARRAYS
AC_C_TYPEOF
AC_C_PROTOTYPES
-AC_F77_LIBRARY_LDFLAGS
-AC_FC_LIBRARY_LDFLAGS
-AC_F77_DUMMY_MAIN
-AC_FC_DUMMY_MAIN
-AC_F77_MAIN
-AC_FC_MAIN
-AC_F77_WRAPPERS
-AC_FC_WRAPPERS
-AC_F77_FUNC
-AC_FC_FUNC
-AC_FC_PP_SRCEXT
-AC_FC_PP_DEFINE
-AC_FC_FREEFORM
-AC_FC_FIXEDFORM
-AC_FC_LINE_LENGTH
-AC_FC_CHECK_BOUNDS
-AC_F77_IMPLICIT_NONE
-AC_FC_IMPLICIT_NONE
-AC_FC_MODULE_EXTENSION
-AC_FC_MODULE_FLAG
-AC_FC_MODULE_OUTPUT_FLAG
+#AC_F77_LIBRARY_LDFLAGS
+#AC_FC_LIBRARY_LDFLAGS
+#AC_F77_DUMMY_MAIN
+#AC_FC_DUMMY_MAIN
+#AC_F77_MAIN
+#AC_FC_MAIN
+#AC_F77_WRAPPERS
+#AC_FC_WRAPPERS
+#AC_F77_FUNC
+#AC_FC_FUNC
+#AC_FC_PP_SRCEXT
+#AC_FC_PP_DEFINE
+#AC_FC_FREEFORM
+#AC_FC_FIXEDFORM
+#AC_FC_LINE_LENGTH
+#AC_FC_CHECK_BOUNDS
+#AC_F77_IMPLICIT_NONE
+#AC_FC_IMPLICIT_NONE
+#AC_FC_MODULE_EXTENSION
+#AC_FC_MODULE_FLAG
+#AC_FC_MODULE_OUTPUT_FLAG
# Checks for library functions.
AC_FUNC_ALLOCA

View File

@ -0,0 +1,48 @@
--- a/config-site-generator/configure.ac
+++ b/config-site-generator/configure.ac
@@ -23,6 +23,7 @@ AC_DEFUN([AC_MSG_ERROR], [
test -e conftest.dir && rm -rf conftest.dir ])
# Checks for programs.
+AC_PROG_CC
AC_PROG_CC_C89
AC_PROG_CC_C_O
AC_PROG_CPP
@@ -52,9 +53,11 @@ AC_PROG_LEX
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PROG_SED
+AC_PROG_LEX
#AC_PROG_YACC
AM_PROG_AS
+AM_PROG_AR
# Checks for system services.
#AC_PATH_X
@@ -118,6 +121,8 @@ sys/ucontext.h sys/uio.h sys/un.h sys/us
sys/wait.h sys/xattr.h tar.h termios.h tgmath.h time.h ucontext.h ulimit.h \
unistd.h utime.h utmp.h utmpx.h wchar.h wctype.h wordexp.h
])
+# extra headers
+AC_CHECK_HEADERS([sys/cdefs.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_GETGROUPS
@@ -217,6 +222,16 @@ AC_FUNC_STRTOLD
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(unsigned int)
+AC_CHECK_SIZEOF(unsigned long)
+AC_CHECK_SIZEOF(unsigned long long)
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(size_t)
+
# Functions list scraped from musl 0.9.4 x86_64
AC_CHECK_FUNCS([ \
a64l abort abs accept access acos acosf acosh acoshf acoshl acosl addmntent \