Compare commits

...

4 Commits

Author SHA1 Message Date
George Sokianos 92d3ef3d19 Changes in the Makefile.os4 to fully compile 2023-01-11 00:23:36 +00:00
George Sokianos 9098ed0e31 Added OS4 makefile 2023-01-10 23:51:34 +00:00
Chun-wei Fan c47cf796fc tools/psl.c: Fix build on Windows
localtime_r() is not available on Windows but a more-secure variant
of localtime(), localtime_s() is provided on Windows.

Define localtime_r() on Windows as its arguments are reversed as compared
to localetime_s(), to achive more or less the same purpose.
2022-12-27 11:09:14 +01:00
Chun-wei Fan 86923341a3 meson: Clean up ICU dependency search
Since we are using Meson 0.60.0 or later, use CMake to help us find ICU,
which is cleaner and more comprehensive, and allows us to use libicu_dep
= depedency(...) even on Visual Studio, where CMake will find the
appropriate ICU headers and libraries for us internally.

Sadly, due to peculiarities, we have to live with the warning that comes
up as we needed to look for ICU in the older method instead of the
recommended modules: ['ICU::uc'] method.
2022-12-27 11:07:54 +01:00
3 changed files with 42 additions and 11 deletions

35
Makefile.os4 Normal file
View File

@ -0,0 +1,35 @@
USE_CLIB2=YES
ifeq ($(USE_CLIB2), YES)
LIBC=clib2
else
LIBC=newlib
endif
all: build
init:
# git submodule update --init
sh ./autogen.sh
autoreconf --install --force --symlink
build: init
CC="ppc-amigaos-gcc" CFLAGS="-mcrt=${LIBC} -fPIC" CXXFLAGS="-mcrt=${LIBC} -fPIC" LDFlags="-mcrt=${LIBC}" LIBS="-lpthread -athread=native" ./configure --host=ppc-amigaos --enable-shared=no --enable-builtin --disable-runtime && \
make -j$(shell nproc)
clean:
@make -f Makefile clean
@rm -rf autom4te.cache .deps
@rm config.log config.status configure libtool Makefile Makefile.in *.m4
release:
@mkdir -p release/local/common/include
@mkdir -p release/local/clib2/lib
# @mkdir -p release/local/newlib/lib
@make -f Makefile.os4 USE_CLIB2=YES
@cp ./src/.libs/libpsl.a ./src/.libs/libpsl.lai ./src/libpsl.la release/local/clib2/lib/
@cp ./include/libpsl.h release/local/common/include/
# @make -f Makefile.os4 clean
# @make -f Makefile.os4 USE_CLIB2=NO
# @cp ./src/.libs/libpsl.a ./src/.libs/libpsl.lai ./src/libpsl.la release/local/newlib/lib/
@lha -aeq libpsl.lha release/

View File

@ -40,17 +40,9 @@ if ['libidn2', 'auto'].contains(enable_runtime)
endif endif
if ['libicu', 'auto'].contains(enable_runtime) if ['libicu', 'auto'].contains(enable_runtime)
libicu_dep = dependency('icu-uc', required : false) libicu_dep = dependency('icu-uc', 'ICU',
if not libicu_dep.found() and cc.has_header('unicode/ustring.h') components: 'uc',
# MSVC: the debug configuration of ICU generated the libraries with d suffix required : false)
# we must handle this and search for the right library depending on the
# build type. Note debugoptimized is just a release build with .pdb files enabled
if cc.get_id() == 'msvc' and buildtype == 'debug'
libicu_dep = cc.find_library('icuucd', required : false)
else
libicu_dep = cc.find_library('icuuc', required : false)
endif
endif
if libicu_dep.found() if libicu_dep.found()
if enable_runtime == 'auto' if enable_runtime == 'auto'
enable_runtime = 'libicu' enable_runtime = 'libicu'

View File

@ -38,6 +38,10 @@
#ifdef _WIN32 #ifdef _WIN32
# include <winsock2.h> // WSAStartup, WSACleanup # include <winsock2.h> // WSAStartup, WSACleanup
// Windows does not have localtime_r but has localtime_s, which is more or less
// the same except that the arguments are reversed
# define localtime_r(t_sec,t_now) localtime_s(t_now,t_sec)
#endif #endif
#include <stdlib.h> #include <stdlib.h>