head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2013.01.05.23.50.23;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/309973
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r309973 | mandree | 2013-01-05 23:24:51 +0000 (Sat, 05 Jan 2013) | 27 lines
## SVN ##
## SVN ## Add new port lang/lua52.
## SVN ##
## SVN ## Lua is a programming language originally designed for extending applications,
## SVN ## but also frequently used as a general-purpose, stand-alone language. Lua
## SVN ## combines simple procedural syntax (similar to Pascal) with powerful data
## SVN ## description constructs based on associative arrays and extensible semantics.
## SVN ## Lua is dynamically typed, interpreted from bytecodes, and has automatic memory
## SVN ## management with garbage collection, making it ideal for configuration,
## SVN ## scripting, and rapid prototyping.
## SVN ##
## SVN ## A fundamental concept in the design of Lua is to provide meta-mechanisms for
## SVN ## implementing features, instead of providing a host of features directly in
## SVN ## the language. For example, although Lua is not a pure object-oriented
## SVN ## language, it does provide meta-mechanisms for implementing classes and
## SVN ## inheritance. Lua's meta-mechanisms bring an economy of concepts and keep the
## SVN ## language small, while allowing the semantics to be extended in unconventional
## SVN ## ways. Extensible semantics is a distinguishing feature of Lua.
## SVN ##
## SVN ## Lua is implemented as a small library of C functions, written in ANSI C, and
## SVN ## compiles unmodified in all known platforms. The implementation goals are
## SVN ## simplicity, efficiency, portability, and low embedding cost.
## SVN ##
## SVN ## WWW: http://www.lua.org/
## SVN ##
## SVN ## PR:		ports/174437
## SVN ## Submitted by:	Green Dog <fiziologus@@gmail.com>
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@--- src/Makefile.orig	2012-03-09 20:32:16.000000000 +0400
+++ src/Makefile	2012-12-14 16:39:47.000000000 +0400
@@@@ -6,12 +6,13 @@@@
 # Your platform. See PLATS for possible values.
 PLAT= none
 
-CC= gcc
-CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
+CC?= gcc
+CFLAGS= -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
 LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
 LIBS= -lm $(SYSLIBS) $(MYLIBS)
 
-AR= ar rcu
+AR= ar
+ARFLAGS= rcu
 RANLIB= ranlib
 RM= rm -f
 
@@@@ -19,8 +20,8 @@@@
 SYSLDFLAGS=
 SYSLIBS=
 
-MYCFLAGS=
-MYLDFLAGS=
+MYCFLAGS?=
+MYLDFLAGS?=
 MYLIBS=
 MYOBJS=
 
@@@@ -38,12 +39,13 @@@@
 
 LUA_T=	lua
 LUA_O=	lua.o
+LUA_SO=	liblua.so
 
 LUAC_T=	luac
 LUAC_O=	luac.o
 
 ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
 ALL_A= $(LUA_A)
 
 # Targets start here.
@@@@ -55,8 +57,11 @@@@
 
 a:	$(ALL_A)
 
+$(LUA_SO):	$(CORE_O) $(LIB_O)
+	$(CC) -o $@@ $(CFLAGS) $(LDFLAGS) $(MYLDFLAGS) -shared -Wl,-soname=$(LUA_SONAME) $?
+
 $(LUA_A): $(BASE_O)
-	$(AR) $@@ $(BASE_O)
+	$(AR) $(ARFLAGS) $@@ $(BASE_O)
 	$(RANLIB) $@@
 
 $(LUA_T): $(LUA_O) $(LUA_A)
@
