1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-03-19 16:11:45 +00:00

Compare commits

...

7 Commits

Author SHA1 Message Date
Frank Halasz
bbe011c583 Take geminis suggestion on getting glibc version number in linux-common.mk 2026-03-18 01:27:16 -07:00
Frank Halasz
54c81a3762 Fixed comment in linux-compiler.mk 2026-03-18 01:15:21 -07:00
Frank Halasz
6c20a5c635 Fixed comment in linux-compiler.mk 2026-03-18 01:03:32 -07:00
Frank Halasz
1195048b1b Ooops. Took out debugging code. 2026-03-18 00:51:03 -07:00
Frank Halasz
7a286a8f1f Fix sed script in linux-common.mk 2026-03-18 00:50:14 -07:00
Frank Halasz
034c52b86f In CMakelists, limit use of libbsd for linux to cases where libc does not include strlcat 2026-03-18 00:25:28 -07:00
Frank Halasz
a26cafcbda Change USE_GCC=T/USE_CLANG=T to USE_COMPILER=clang/gcc for linux-y makefiles 2026-03-18 00:01:24 -07:00
3 changed files with 27 additions and 22 deletions

View File

@@ -37,9 +37,12 @@ IF(NEED_LIB_M)
ENDIF()
IF (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBBSD-OVERLAY REQUIRED IMPORTED_TARGET "libbsd-overlay")
SET(MAIKO_LIBRARIES ${MAIKO_LIBRARIES} PkgConfig::LIBBSD-OVERLAY)
CHECK_LIBRARY_EXISTS(c strlcat "" NO_NEED_FOR_LIBBSD)
IF(NOT NO_NEED_FOR_LIBBSD)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBBSD-OVERLAY REQUIRED IMPORTED_TARGET "libbsd-overlay")
SET(MAIKO_LIBRARIES ${MAIKO_LIBRARIES} PkgConfig::LIBBSD-OVERLAY)
ENDIF()
ENDIF()
SET (MAIKO_RELEASE 351 CACHE STRING "Release version to build. Release: 115, 200, 201, 210, 300, 350, 351")
@@ -559,7 +562,9 @@ if(NOT res EQUAL 0)
message(FATAL_ERROR "machinetype script failed")
endif()
set(release_dir "${os_ver}.${machine_type}")INSTALL(TARGETS lde DESTINATION ${release_dir})
set(release_dir "${os_ver}.${machine_type}")
INSTALL(TARGETS lde DESTINATION ${release_dir})
IF(MAIKO_DISPLAY_X11)
INSTALL(TARGETS ldex ldeinit DESTINATION ${release_dir})

View File

@@ -8,8 +8,11 @@ ifeq ($(USE_LIBBSD),T)
# Use LIBBSD - but only if glibc < 2.38
# Because we only need strlcat, strlcpy and friends from libbsd
# and they are included in glibc from 2.38 on.
GLIBC_VERSION := $(shell ldd --version | head -1 | sed -e "s/^.*\([0-9]\.[0-9][0-9]\)/\\1/")
GLIBC_CHECK := $(shell echo "$(GLIBC_VERSION) >= 2.38" | bc)
GLIBC_VERSION := $(shell getconf GNU_LIBC_VERSION | sed 's/glibc //')
GLIBC_CHECK := 0
ifneq ($(GLIBC_VERSION),)
GLIBC_CHECK := $(shell echo "$(GLIBC_VERSION) >= 2.38" | bc)
endif
ifneq ($(GLIBC_CHECK),1)
include linux-libbsd.mk
endif

View File

@@ -1,36 +1,33 @@
# Select whether to use clang or gcc
# Priority
# 1. If -DUSE_GCC or -DUSE_CLANG on command line (but not both) use the requested compiler.
# 2. If one compiler is installed but not the other, use the installed compiler.
# 3. Use clang
# 1. If USE_COMPILER=gcc or USE_COMPILER=clang on make command line use the requested compiler.
# 2. If clang is installed use it.
# 3. Use gcc
EXISTS_GCC := $(shell command -v gcc)
EXISTS_CLANG := $(shell command -v clang)
ifeq ($(or $(EXISTS_GCC),$(EXISTS_CLANG)),)
$(error "Cannot find compiler: neither gcc nor clang. Exiting.")
endif
ifneq ($(and $(USE_CLANG),$(USE_GCC)),)
$(error "Cannot use both USE_CLANG=T and USE_GCC=T. Exiting.")
endif
COMPILER :=
ifdef USE_CLANG
ifeq ($(USE_COMPILER),clang)
ifeq ($(EXISTS_CLANG),)
$(error "USE_CLANG=T given, but cannot find the clang compiler. Exiting")
$(error "USE_COMPILER=clang, but cannot find the clang compiler. Exiting")
endif
COMPILER := clang
endif
ifdef USE_GCC
else ifeq ($(USE_COMPILER),gcc)
ifeq ($(EXISTS_GCC),)
$(error "USE_GCC=T given, but cannot find the gcc compiler. Exiting")
$(error "USE_COMPILER=gcc given, but cannot find the gcc compiler. Exiting")
endif
COMPILER := gcc
else ifneq ($(EXISTS_CLANG),)
COMPILER := clang
else
COMPILER := gcc
endif
ifeq ($(COMPILER),)
ifneq ($(EXISTS_CLANG),)
COMPILER := clang
else
COMPILER := gcc
endif
$(error "Oops. Trying to select gcc or clang but should never get here")
endif
ifeq ($(COMPILER),gcc)