From d21cceb01451a38b694380b4359f60817a15e5ba Mon Sep 17 00:00:00 2001 From: Jeremy Baxter Date: Tue, 27 Feb 2024 18:05:21 +1300 Subject: [PATCH] configure: separate callisto's cppflags from other libraries' cppflags --- configure | 6 +++++- external/lua/Makefile | 2 +- external/lua/patches/lua-5.4.6-makefile.diff | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 7273e6b..67c6f3a 100755 --- a/configure +++ b/configure @@ -7,7 +7,8 @@ set -e mkf=config.mk # these also apply to all libraries in external/ cflags='-std=c99' -cppflags='-DLUA_USE_POSIX' +cppflags='' +ext_cppflags='-DLUA_USE_POSIX' ldflags='-lm' # optional libraries to build with support for; a dynamically # linked Lua 5.4 library may be supported here later @@ -203,9 +204,12 @@ _CC = %s _CFLAGS = %s _CPPFLAGS = %s _LDFLAGS =%s + +_EXT_CPPFLAGS = %s ' \ "$cc" \ "$cflags" \ "$cppflags"\ "$ldflags" \ + "$ext_cppflags"\ >"$mkf" diff --git a/external/lua/Makefile b/external/lua/Makefile index 67279aa..ac8a4f2 100644 --- a/external/lua/Makefile +++ b/external/lua/Makefile @@ -6,7 +6,7 @@ include ../../config.mk CC= ${_CC} -CFLAGS= ${_CFLAGS} ${_CPPFLAGS} +CFLAGS= ${_CFLAGS} ${_EXT_CPPFLAGS} LDFLAGS= ${_LDFLAGS} AR= ar cr diff --git a/external/lua/patches/lua-5.4.6-makefile.diff b/external/lua/patches/lua-5.4.6-makefile.diff index d7b6620..979cad0 100644 --- a/external/lua/patches/lua-5.4.6-makefile.diff +++ b/external/lua/patches/lua-5.4.6-makefile.diff @@ -13,7 +13,7 @@ -LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) -LIBS= -lm $(SYSLIBS) $(MYLIBS) +CC= ${_CC} -+CFLAGS= ${_CFLAGS} ${_CPPFLAGS} ++CFLAGS= ${_CFLAGS} ${_EXT_CPPFLAGS} +LDFLAGS= ${_LDFLAGS} -AR= ar rcu