Patchwork [3/4] lua: remove 3 sub-options, always install all

login
register
mail settings
Submitter Francois Perrad
Date July 30, 2012, 6:31 a.m.
Message ID <1343629890-4657-3-git-send-email-francois.perrad@gadz.org>
Download mbox | patch
Permalink /patch/173966/
State Superseded
Headers show

Comments

Francois Perrad - July 30, 2012, 6:31 a.m.
---
 package/lua/Config.in |   18 ------------------
 package/lua/lua.mk    |   17 +----------------
 2 files changed, 1 insertion(+), 34 deletions(-)
Thomas Petazzoni - July 30, 2012, 8:56 p.m.
Le Mon, 30 Jul 2012 08:31:29 +0200,
Francois Perrad <fperrad@gmail.com> a écrit :

> ---
>  package/lua/Config.in |   18 ------------------
>  package/lua/lua.mk    |   17 +----------------
>  2 files changed, 1 insertion(+), 34 deletions(-)
> 
> diff --git a/package/lua/Config.in b/package/lua/Config.in
> index 06f3046..fc6bb4c 100644
> --- a/package/lua/Config.in
> +++ b/package/lua/Config.in
> @@ -32,29 +32,11 @@ endchoice
>  
>  if BR2_PACKAGE_LUA
>  
> -config BR2_PACKAGE_LUA_COMPILER
> -	bool "lua compiler"
> -	select BR2_PACKAGE_LUA_SHARED_LIBRARY
> -	help
> -	  Install luac binary
> -
> -config BR2_PACKAGE_LUA_INTERPRETER
> -	bool "lua interpreter"
> -	select BR2_PACKAGE_LUA_SHARED_LIBRARY
> -	help
> -	  Install lua binary

Wouldn't it make sense to keep options for the compiler and
interpreter? I presume using the compiler on the target is fairly
uncommon (you would rather do the compilation at build time, no?).

And Lua can be used as a library without the separate /usr/bin/lua
interpreter, no?

But maybe this last option (the interpreter) is more complicated to
handle with the choice between lua and luajit.

Thomas
Francois Perrad - July 31, 2012, 7:56 a.m.
2012/7/30 Thomas Petazzoni <thomas.petazzoni@free-electrons.com>:
> Le Mon, 30 Jul 2012 08:31:29 +0200,
> Francois Perrad <fperrad@gmail.com> a écrit :
>
>> ---
>>  package/lua/Config.in |   18 ------------------
>>  package/lua/lua.mk    |   17 +----------------
>>  2 files changed, 1 insertion(+), 34 deletions(-)
>>
>> diff --git a/package/lua/Config.in b/package/lua/Config.in
>> index 06f3046..fc6bb4c 100644
>> --- a/package/lua/Config.in
>> +++ b/package/lua/Config.in
>> @@ -32,29 +32,11 @@ endchoice
>>
>>  if BR2_PACKAGE_LUA
>>
>> -config BR2_PACKAGE_LUA_COMPILER
>> -     bool "lua compiler"
>> -     select BR2_PACKAGE_LUA_SHARED_LIBRARY
>> -     help
>> -       Install luac binary
>> -
>> -config BR2_PACKAGE_LUA_INTERPRETER
>> -     bool "lua interpreter"
>> -     select BR2_PACKAGE_LUA_SHARED_LIBRARY
>> -     help
>> -       Install lua binary
>
> Wouldn't it make sense to keep options for the compiler and
> interpreter? I presume using the compiler on the target is fairly
> uncommon (you would rather do the compilation at build time, no?).
>

The lua bytecode is platform dependent (the header contains the
endianness and the size of some types : int, size_t, Instruction &
lua_Number).
So, the Lua code cannot be compiled on the host and interpreted on target.

> And Lua can be used as a library without the separate /usr/bin/lua
> interpreter, no?
>
> But maybe this last option (the interpreter) is more complicated to
> handle with the choice between lua and luajit.
>

Since lua & luac are linked against the shared library, there are
small (< 10KB).
And the post-build script (BR2_ROOTFS_POST_BUILD_SCRIPT) could remove
them if needed.

So, I think that the 3 sub-options could be removed.

François

> Thomas
> --
> Thomas Petazzoni, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

Patch

diff --git a/package/lua/Config.in b/package/lua/Config.in
index 06f3046..fc6bb4c 100644
--- a/package/lua/Config.in
+++ b/package/lua/Config.in
@@ -32,29 +32,11 @@  endchoice
 
 if BR2_PACKAGE_LUA
 
-config BR2_PACKAGE_LUA_COMPILER
-	bool "lua compiler"
-	select BR2_PACKAGE_LUA_SHARED_LIBRARY
-	help
-	  Install luac binary
-
-config BR2_PACKAGE_LUA_INTERPRETER
-	bool "lua interpreter"
-	select BR2_PACKAGE_LUA_SHARED_LIBRARY
-	help
-	  Install lua binary
-
 config BR2_PACKAGE_LUA_INTERPRETER_READLINE
 	bool "readline support"
-	depends on BR2_PACKAGE_LUA_INTERPRETER
 	select BR2_PACKAGE_READLINE
 	select BR2_PACKAGE_NCURSES
 	help
 	  Enables command-line editing in the lua interpreter.
 
-config BR2_PACKAGE_LUA_SHARED_LIBRARY
-	bool "shared library"
-	help
-	  Install shared liblua.so
-
 endif
diff --git a/package/lua/lua.mk b/package/lua/lua.mk
index 26c1576..136dca6 100644
--- a/package/lua/lua.mk
+++ b/package/lua/lua.mk
@@ -8,10 +8,7 @@  LUA_VERSION = 5.1.5
 LUA_SITE = http://www.lua.org/ftp
 LUA_INSTALL_STAGING = YES
 
-LUA_CFLAGS = -Wall
-ifeq ($(BR2_PACKAGE_LUA_SHARED_LIBRARY),y)
-	LUA_CFLAGS += -fPIC
-endif
+LUA_CFLAGS = -Wall -fPIC
 
 LUA_MYLIBS += -ldl
 
@@ -44,13 +41,11 @@  define HOST_LUA_BUILD_CMDS
 	PKG_VERSION=$(LUA_VERSION) -C $(@D)/src all
 endef
 
-ifeq ($(BR2_PACKAGE_LUA_SHARED_LIBRARY),y)
 define LUA_INSTALL_STAGING_SHARED_LIB
 	$(INSTALL) -m 0755 -D $(@D)/src/liblua.so.$(LUA_VERSION) \
 		$(STAGING_DIR)/usr/lib/liblua.so.$(LUA_VERSION)
 	ln -sf liblua.so.$(LUA_VERSION) $(STAGING_DIR)/usr/lib/liblua.so
 endef
-endif
 
 define LUA_INSTALL_STAGING_CMDS
 	$(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
@@ -64,29 +59,19 @@  define LUA_INSTALL_STAGING_CMDS
 	$(INSTALL) -m 0644 -D $(@D)/src/lauxlib.h $(STAGING_DIR)/usr/include/lauxlib.h
 endef
 
-ifeq ($(BR2_PACKAGE_LUA_INTERPRETER),y)
 define LUA_INSTALL_INTERPRETER
 	$(INSTALL) -m 0755 -D $(@D)/src/lua $(TARGET_DIR)/usr/bin/lua
 endef
-endif
 
-ifeq ($(BR2_PACKAGE_LUA_COMPILER),y)
 define LUA_INSTALL_COMPILER
 	$(INSTALL) -m 0755 -D $(@D)/src/luac $(TARGET_DIR)/usr/bin/luac
 endef
-endif
 
-ifeq ($(BR2_PACKAGE_LUA_SHARED_LIBRARY),y)
 define LUA_INSTALL_LIBRARY
 	$(INSTALL) -m 0755 -D $(@D)/src/liblua.so.$(LUA_VERSION) \
 		$(TARGET_DIR)/usr/lib/liblua.so.$(LUA_VERSION)
 	ln -sf liblua.so.$(LUA_VERSION) $(TARGET_DIR)/usr/lib/liblua.so
 	$(INSTALL) -m 0644 -D $(@D)/src/liblua.a $(TARGET_DIR)/usr/lib/liblua.a
-endef
-else
-define LUA_INSTALL_LIBRARY
-	$(INSTALL) -m 0644 -D $(@D)/src/liblua.a $(TARGET_DIR)/usr/lib/liblua.a
-endef
 endif
 
 ifeq ($(BR2_HAVE_DEVFILES),y)