From 266da128c511a512baf9f893c1808bd1dbbf7c8c Mon Sep 17 00:00:00 2001 From: Alexandre Erwin Ittner Date: Wed, 17 Nov 2010 14:39:15 -0200 Subject: [PATCH] Get the installation path from package.cpath instead of pkg-config This commit ensures some portability, since INSTALL_CMOD is no longer present in the .pc files generated from 'make pc' in Lua 5.2.0 --- Makefile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index c26c2af..4a42e1c 100644 --- a/Makefile +++ b/Makefile @@ -30,19 +30,26 @@ # line when debugging. OMIT_FRAME_POINTER = -fomit-frame-pointer -# Name of .pc file. "lua5.2" on Debian/Ubuntu +LUABIN = lua LUAPKG = lua5.2 CFLAGS = `pkg-config $(LUAPKG) --cflags` -fPIC -O3 -Wall LFLAGS = -shared $(OMIT_FRAME_POINTER) -INSTALL_PATH = `pkg-config $(LUAPKG) --variable=INSTALL_CMOD` -## If your system doesn't have pkg-config, comment out the previous lines and -## uncomment and change the following ones according to your building -## enviroment. +INSTALL_PATH = `$(LUABIN) -e' \ + for dir in package.cpath:gmatch("(/[^?;]+)?") do \ + io.write(dir) \ + os.exit(0) \ + end \ + os.exit(1) \ +'` -#CFLAGS = -I/usr/include/lua5.2/ -fPIC -O3 -Wall +## If your system doesn't have pkg-config or if you do not want to get the +## install path from Lua, comment out the previous lines and uncomment and +## change the following ones according to your building environment. + +#CFLAGS = -I/usr/local/include/ -fPIC -O3 -Wall #LFLAGS = -shared $(OMIT_FRAME_POINTER) -#INSTALL_PATH = /usr/lib/lua/5.1 +#INSTALL_PATH = /usr/local/lib/lua/5.2/ all: iconv.so