Skip to content

Commit

Permalink
trimstray#13 - minor fixes
Browse files Browse the repository at this point in the history
- signed-off-by: trimstray <[email protected]>
  • Loading branch information
trimstray committed Oct 7, 2019
1 parent 8d32442 commit 7a60690
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 17 deletions.
54 changes: 41 additions & 13 deletions doc/HELPERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -628,12 +628,22 @@ yum install gcc gcc-c++ kernel-devel bison perl perl-devel perl-ExtUtils-Embed l
export LUAJIT_LIB="/usr/local/lib"

# For original:
export LUAJIT_INC="/usr/local/include/luajit-2.0"
# export LUAJIT_INC="/usr/local/include/luajit-2.0"

# For OpenResty's:
export LUAJIT_INC="/usr/local/include/luajit-2.1"

ln -sf /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2 ${LUAJIT_LIB}/liblua.so
for i in libluajit-5.1.so libluajit-5.1.so.2 liblua.so libluajit.so ; do

# For original LuaJIT:
# ln -sf /usr/local/lib/libluajit-5.1.so.2.0.5 ${LUAJIT_LIB}/${i}

# For OpenResty's LuaJIT:
ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 ${LUAJIT_LIB}/${i}

done

# ln -sf /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2 ${LUAJIT_LIB}/liblua.so
```

> Remember to build [`sregex`](#sregex) also if you use above steps.
Expand Down Expand Up @@ -802,7 +812,17 @@ cd "$LUAJIT_SRC"
# CFLAGS='-g' make ...
make && make install

ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 ${LUAJIT_LIB}/liblua.so
for i in libluajit-5.1.so libluajit-5.1.so.2 liblua.so libluajit.so ; do

# For original LuaJIT:
# ln -sf /usr/local/lib/libluajit-5.1.so.2.0.5 ${LUAJIT_LIB}/${i}

# For OpenResty's LuaJIT:
ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 ${LUAJIT_LIB}/${i}

done

# ln -sf /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2 ${LUAJIT_LIB}/liblua.so
```

<a id="sregex"></a>sregex:
Expand Down Expand Up @@ -2217,7 +2237,17 @@ cd "$LUAJIT_SRC"
# CFLAGS='-g' make ...
make && make install

ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 ${LUAJIT_LIB}/liblua.so
for i in libluajit-5.1.so libluajit-5.1.so.2 liblua.so libluajit.so ; do

# For original LuaJIT:
# ln -sf /usr/local/lib/libluajit-5.1.so.2.0.5 ${LUAJIT_LIB}/${i}

# For OpenResty's LuaJIT:
ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 ${LUAJIT_LIB}/${i}

done

# ln -sf /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2 ${LUAJIT_LIB}/liblua.so
```

sregex:
Expand Down Expand Up @@ -2720,20 +2750,18 @@ cd "$LUAJIT_SRC"
gmake && gmake install

# On FreeBSD you should set them manually or use the following instructions:
for i in libluajit-5.1.so libluajit-5.1.so ; do
for i in libluajit-5.1.so libluajit-5.1.so.2 liblua.so libluajit.so ; do

if [[ "$LUAJIT_LIBRARY" == "openresty" ]] ; then
# For original LuaJIT:
ln -sf /usr/local/lib/libluajit-5.1.so.2.0.5 ${LUAJIT_LIB}/${i}

ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 /usr/local/lib/${i}

elif [[ "$LUAJIT_LIBRARY" == "original" ]] ; then

ln -sf /usr/local/lib/libluajit-5.1.so.2.0.5 /usr/local/lib/${i}

fi
# For OpenResty's LuaJIT:
# ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 ${LUAJIT_LIB}/${i}

done

# ln -sf /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2 ${LUAJIT_LIB}/liblua.so

# Without this you get:
/usr/bin/ld: /usr/local/lib/libluajit-5.1.a(lj_err.o): relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libluajit-5.1.a: could not read symbols: Bad value
Expand Down
22 changes: 18 additions & 4 deletions lib/ngx_installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,21 @@ function _inst_luajit() {

_f "1" "make install"

_f "1" "ln -sf /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2 ${LUAJIT_LIB}/liblua.so"
for i in libluajit-5.1.so libluajit-5.1.so.2 liblua.so libluajit.so ; do

if [[ "$LUAJIT_LIBRARY" == "openresty" ]] ; then

_f "1" "ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 ${LUAJIT_LIB}/${i}"

elif [[ "$LUAJIT_LIBRARY" == "original" ]] ; then

_f "1" "ln -sf /usr/local/lib/libluajit-5.1.so.2.0.5 ${LUAJIT_LIB}/${i}"

fi

done

# _f "1" "ln -sf /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2 ${LUAJIT_LIB}/liblua.so"

elif [[ "$_DIST_VERSION" == "bsd" ]] ; then

Expand All @@ -1030,15 +1044,15 @@ function _inst_luajit() {
_f "1" "gmake install"

# On FreeBSD you should set them manually or use the following instructions:
for i in libluajit-5.1.so libluajit-5.1.so ; do
for i in libluajit-5.1.so libluajit-5.1.so.2 ; do

if [[ "$LUAJIT_LIBRARY" == "openresty" ]] ; then

_f "1" "ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 /usr/local/lib/${i}"
_f "1" "ln -sf /usr/local/lib/libluajit-5.1.so.2.1.0 ${LUAJIT_LIB}/${i}"

elif [[ "$LUAJIT_LIBRARY" == "original" ]] ; then

_f "1" "ln -sf /usr/local/lib/libluajit-5.1.so.2.0.5 /usr/local/lib/${i}"
_f "1" "ln -sf /usr/local/lib/libluajit-5.1.so.2.0.5 ${LUAJIT_LIB}/${i}"

fi

Expand Down

0 comments on commit 7a60690

Please sign in to comment.