lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello

I'm going through some Makefiles I found to compile Lua for the
Blackfin/uClinux, and was wondering why they chose to include the
following libraries into Lua (ie. I'd like to avoid having to compile
libraries that aren't usually needed):

- Libdl
- Libreadline
- Libm

I assume Libdl is required because a lot of features are actually
found in modules, so the Lua interpreter must be able to load
libraries dynamically.

Libm is required because I guess Lua can't perform much maths without
this library.

As for Libreadline, is it because Lua can't handle the command-line
parameters natively?

Thank you.

Here are the two Makefiles:

====================
/usr/src/uClinux-dist/user/lua# cat Makefile
VER = lua-5.1.4
URL = http://www.lua.org/ftp/$(VER).tar.gz

CPPFLAGS-y := -DLUA_USE_POSIX
CPPFLAGS-$(CONFIG_FMT_USE_FDPIC_ELF) += -DLUA_USE_DLOPEN
CPPFLAGS-$(CONFIG_LIB_READLINE)      += -DLUA_USE_READLINE
CPPFLAGS += $(CPPFLAGS-y)

MYLIBS-y :=
MYLIBS-$(CONFIG_FMT_USE_FDPIC_ELF) += -ldl
MYLIBS-$(CONFIG_LIB_READLINE)      += -lreadline -lhistory

all:
        $(MAKE) \
                -C $(VER) \
                INSTALL_TOP=/usr \
                PLAT=generic \
                CC=$(CC) \
                AR="$(AR) rcu" \
                RANLIB=$(RANLIB) \
                MYLIBS="$(MYLIBS-y)"
====================
/usr/src/uClinux-dist/user/lua/lua-5.1.4/src# cat Makefile
# makefile for building Lua
# see ../INSTALL for installation instructions
# see ../Makefile and luaconf.h for further customization

# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT
=======================

# Your platform. See PLATS for possible values.
PLAT= none

CC= gcc
CFLAGS= -O2 -Wall $(MYCFLAGS)
AR= ar rcu
RANLIB= ranlib
RM= rm -f
LIBS= -lm $(MYLIBS)

MYCFLAGS=
MYLDFLAGS=
MYLIBS=
====================