]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move luajit definitions to one place
authorAlan T. DeKok <aland@freeradius.org>
Fri, 16 Sep 2022 13:44:59 +0000 (09:44 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 16 Sep 2022 14:02:01 +0000 (10:02 -0400)
and only use the definitions if libfreeradius-lua is built.

Apparently on an Apple M1, adding the various pagesize options
results in an invalid Mach-O executable

src/bin/radiusd.mk
src/bin/unit_test_module.mk
src/modules/rlm_lua/libfreeradius-lua.mk.in

index 0dd3fc8d9638e6bf6147f5647740390bad740abc..2d4321fc87ba5fc3df1480ed9c3b566cc120e8c6 100644 (file)
@@ -1,7 +1,7 @@
 TARGET         := radiusd$(E)
 SOURCES                := \
-                       radiusd.c \
-                       radmin.c
+                       radiusd.c \
+                       radmin.c
 
 SRC_CFLAGS     := $(LIBREADLINE_CFLAGS)
 
@@ -11,6 +11,4 @@ TGT_LDFLAGS   := $(LDFLAGS) $(SYSTEMD_LDFLAGS) $(LIBREADLINE_LDFLAGS) $(GPERFTOOLS
 TGT_PREREQS    := $(LIBFREERADIUS_SERVER) libfreeradius-io$(L)
 
 # Flags needed when linking main executables that link against LuaJIT
-ifneq (,$(findstring darwin,$(TARGET_SYSTEM)))
-TGT_LDLIBS     += -pagezero_size 10000 -image_base 100000000
-endif
+TGT_LDLIBS     += $(LUAJIT_LDLIBS)
index 0873ef1bac13307a4b1207b01a60f39b09abddf0..4ba60c569670c6fd99b0852c8b31c9f8d68b042f 100644 (file)
@@ -6,9 +6,7 @@ TGT_LDLIBS      := $(LIBS) $(LCRYPT)
 TGT_PREREQS    := $(LIBFREERADIUS_SERVER) libfreeradius-io$(L)
 
 # Flags needed when linking main executables that link against LuaJIT
-ifneq (,$(findstring darwin,$(TARGET_SYSTEM)))
-TGT_LDLIBS     += -pagezero_size 10000 -image_base 100000000
-endif
+TGT_LDLIBS     += $(LUAJIT_LDLIBS)
 
 # Libraries can't depend on libraries (oops), so make the binary
 # depend on the EAP code...
index af6cc16ed5efd6f4d9649f8bb0be4bf31ae6a498..7d3bbaf8299b1e4fa4adb9c12a8979a9b0427027 100644 (file)
@@ -15,6 +15,13 @@ TARGETNAME   := @targetname@
 
 ifneq "$(TARGETNAME)" ""
 TARGET         := libfreeradius-lua$(L)
+
+#
+#  OSX requires some extra options. But ARM systems can't use them.
+#
+ifneq (,$(findstring x86_64-apple-darwin,$(TARGET_SYSTEM)))
+LUAJIT_LDLIBS  += -pagezero_size 10000 -image_base 100000000
+endif
 endif
 
 SOURCES                := util.c