luajit: handles BR2_PREFER_STATIC_LIB
authorFrancois Perrad <fperrad@gmail.com>
Sat, 1 Mar 2014 17:23:04 +0000 (18:23 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 3 Mar 2014 22:10:07 +0000 (23:10 +0100)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/luajit/luajit.mk

index 32596a1e2caa869367d1f0beaaa9abdad4451c4c..859425ab5201dbfce847a6e274a426a91342afd2 100644 (file)
@@ -16,6 +16,12 @@ ifneq ($(BR2_LARGEFILE),y)
 LUAJIT_NO_LARGEFILE = TARGET_LFSFLAGS=
 endif
 
+ifeq ($(BR2_PREFER_STATIC_LIB),y)
+LUAJIT_BUILDMODE = static
+else
+LUAJIT_BUILDMODE = dynamic
+endif
+
 # The luajit build procedure requires the host compiler to have the
 # same bitness as the target compiler. Therefore, on a x86 build
 # machine, we can't build luajit for x86_64, which is checked in
@@ -44,7 +50,7 @@ define LUAJIT_BUILD_CMDS
                HOST_CFLAGS="$(HOST_CFLAGS)" \
                HOST_LDFLAGS="$(HOST_LDFLAGS)" \
                $(LUAJIT_NO_LARGEFILE) \
-               BUILDMODE=dynamic \
+               BUILDMODE=$(LUAJIT_BUILDMODE) \
                -C $(@D) amalg
 endef