toolchain: Added autoconf-2.69 and automake-1.15.1

Environment variables changed:
- KOS_SDK_DIR to install libraries
- KOS_PORTS_DIR for ported applications to KolibriOS

Signed-off-by: Max Logaev <maxlogaev@proton.me>
This commit is contained in:
2025-12-24 17:24:18 +03:00
parent aa7a9c99f3
commit 4d8e694c2e
5 changed files with 59 additions and 21 deletions

View File

@@ -8,21 +8,21 @@ include(ExternalProject)
set(JOBS 6) set(JOBS 6)
# Installation directory for GCC and Binutils # Installation directory for GCC and Binutils
if(NOT DEFINED ENV{SDK_TOOLCHAIN_DIR}) if(NOT DEFINED ENV{KOS_SDK_DIR})
message(FATAL_ERROR "The environment variable SDK_TOOLCHAIN_DIR is not set!") message(FATAL_ERROR "The environment variable KOS_SDK_DIR is not set!")
endif() endif()
set(SDK_TOOLCHAIN_DIR $ENV{SDK_TOOLCHAIN_DIR}) set(KOS_SDK_DIR $ENV{KOS_SDK_DIR})
message(STATUS "SDK_TOOLCHAIN_DIR=${SDK_TOOLCHAIN_DIR}") message(STATUS "KOS_SDK_DIR=${KOS_SDK_DIR}")
# Directory for installing ports # Directory for installing ports
if(NOT DEFINED ENV{SDK_SYSROOT_DIR}) if(NOT DEFINED ENV{KOS_PORTS_DIR})
message(FATAL_ERROR "The environment variable SDK_SYSROOT_DIR is not set!") message(FATAL_ERROR "The environment variable KOS_PORTS_DIR is not set!")
endif() endif()
set(SDK_SYSROOT_DIR $ENV{SDK_SYSROOT_DIR}) set(KOS_PORTS_DIR $ENV{KOS_PORTS_DIR})
message(STATUS "SDK_SYSROOT_DIR=${SDK_SYSROOT_DIR}") message(STATUS "SDK_SYSROOT_DIR=${KOS_PORTS_DIR}")
add_subdirectory(toolchain) add_subdirectory(toolchain)
add_subdirectory(libraries) add_subdirectory(libraries)

View File

@@ -1,10 +1,8 @@
#!/bin/bash #!/bin/bash
# Installation directory for GCC and Binutils" # Installation directory for GCC and Binutils
export SDK_TOOLCHAIN_DIR="$(pwd)/sdk/toolchain" export KOS_SDK_DIR="$(pwd)/sdk"
export KOS_PORTS_DIR="$(pwd)/ports"
# Directory for installing ports" # Add i586-kolibrios toolchain to PATH
export SDK_SYSROOT_DIR="$(pwd)/sdk/sysroot" export PATH="$KOS_SDK_DIR/bin:$PATH"
# Add i586-kolibrios toolchain to PATH
export PATH=$PATH:"$SDK_TOOLCHAIN_DIR/bin"

View File

@@ -12,4 +12,4 @@ if [ ! -f "kolibri.img" ]; then
download_kolibrios download_kolibrios
fi fi
qemu-system-i386 -boot a -fda kolibri.img -m 512 -drive file=fat:rw:"$SDK_SYSROOT_DIR" -usbdevice tablet qemu-system-i386 -boot a -fda kolibri.img -m 512 -drive file=fat:rw:"$KOS_PORTS_DIR" -usbdevice tablet

View File

@@ -1,5 +1,33 @@
# Rules for building the i586-kolibrios-gcc toolchain # Rules for building the i586-kolibrios-gcc toolchain
# Autoconf
set(AUTOCONF_VER 2.69)
ExternalProject_Add(
autoconf
URL https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VER}.tar.gz
URL_HASH SHA256=954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${KOS_SDK_DIR}
BUILD_COMMAND make
INSTALL_COMMAND make install
)
# Automake
set(AUTOMAKE_VER 1.15.1)
ExternalProject_Add(
automake
CONFIGURE_COMMAND
URL https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VER}.tar.gz
URL_HASH SHA256=988e32527abe052307d21c8ca000aa238b914df363a617e38f4fb89f5abf6260
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/automake/add-kolibrios.diff
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${KOS_SDK_DIR}
BUILD_COMMAND make -j${JOBS}
INSTALL_COMMAND make install
)
# Binutils # Binutils
set(BINUTILS_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/binutils) set(BINUTILS_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/binutils)
@@ -9,8 +37,7 @@ ExternalProject_Add(
CONFIGURE_COMMAND CONFIGURE_COMMAND
${BINUTILS_SRC_DIR}/configure ${BINUTILS_SRC_DIR}/configure
--target=i586-kolibrios --target=i586-kolibrios
--prefix=${SDK_TOOLCHAIN_DIR} --prefix=${KOS_SDK_DIR}
--with-sysroot=${SDK_SYSROOT_DIR}
--disable-werror --disable-werror
--disable-nls --disable-nls
--disable-intl --disable-intl
@@ -30,8 +57,8 @@ ExternalProject_Add(
CONFIGURE_COMMAND CONFIGURE_COMMAND
${GCC_SRC_DIR}/configure ${GCC_SRC_DIR}/configure
--target=i586-kolibrios --target=i586-kolibrios
--with-sysroot=${SDK_SYSROOT_DIR} --with-sysroot=${KOS_SDK_DIR}/i586-kolibrios
--prefix=${SDK_TOOLCHAIN_DIR} --prefix=${KOS_SDK_DIR}
--disable-multilib --disable-multilib
--disable-nls --disable-nls
--enable-shared --enable-shared
@@ -48,5 +75,5 @@ add_dependencies(gcc newlib-headers)
# Copy kos-app.lds # Copy kos-app.lds
file( file(
COPY "${CMAKE_CURRENT_SOURCE_DIR}/kos-app.lds" COPY "${CMAKE_CURRENT_SOURCE_DIR}/kos-app.lds"
DESTINATION "${SDK_TOOLCHAIN_DIR}/i586-kolibrios/lib/" DESTINATION "${KOS_SDK_DIR}/i586-kolibrios/lib/"
) )

View File

@@ -0,0 +1,13 @@
diff --git a/lib/config.sub b/lib/config.sub
index 40ea5df..5c666fb 100755
--- a/lib/config.sub
+++ b/lib/config.sub
@@ -1417,7 +1417,7 @@ case $os in
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
- | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
+ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -kolibrios* )
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)