From ca3d0e48c44fafafc5dff8f27a9a5ac5da090050 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 20 Aug 2010 12:07:51 -0300 Subject: Always set -fPIC when using gcc (Unix systems). Should settle the "please drop whatever you're doing and add -fPIC to all your rockspecs" issue. --- src/luarocks/cfg.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index ae07f905..8706bd60 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua @@ -246,6 +246,9 @@ if detected.unix then include = { "?.h" } } defaults.local_cache = home.."/.cache/luarocks" + if not defaults.variables.CFLAGS:match("-fPIC") then + defaults.variables.CFLAGS = defaults.variables.CFLAGS.." -fPIC" + end end if detected.cygwin then @@ -284,10 +287,6 @@ if detected.freebsd then defaults.variables.LIBFLAG = "-shared" end -if proc == "x86_64" and not defaults.variables.CFLAGS:match("-fPIC") then - defaults.variables.CFLAGS = defaults.variables.CFLAGS.." -fPIC" -end - -- Expose some more values detected by LuaRocks for use by rockspec authors. defaults.variables.LUA = defaults.lua_interpreter defaults.variables.LIB_EXTENSION = defaults.lib_extension -- cgit v1.2.3-55-g6feb