Skip to content

Instantly share code, notes, and snippets.

@ichizok
Created July 16, 2013 02:01
Show Gist options
  • Save ichizok/6005211 to your computer and use it in GitHub Desktop.
Save ichizok/6005211 to your computer and use it in GitHub Desktop.
diff --git a/src/configure.in b/src/configure.in
--- a/src/configure.in
+++ b/src/configure.in
@@ -494,26 +494,44 @@
if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then
vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll"
else
- multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null`
- if test "X$multiarch" != "X"; then
- lib_multiarch="lib/${multiarch}"
+ if test "x$MACOSX" = "xyes"; then
+ ext="dylib"
+ indexes=""
+ else
+ ext="so"
+ indexes=".0 .1 .2 .3 .4 .5 .6 .7 .8 .9"
+ multiarch=`dpkg-architecture -qDEB_HOST_MULTIARCH 2> /dev/null`
+ if test "X$multiarch" != "X"; then
+ lib_multiarch="lib/${multiarch}"
+ fi
fi
dnl Determine the sover for the current version, but fallback to
dnl liblua${vi_cv_version_lua}.so if no sover-versioned file is found.
+ AC_MSG_CHECKING(if liblua*.${ext}* can be found in $vi_cv_path_lua_pfx)
for subdir in "${lib_multiarch}" lib64 lib; do
if test -z "$subdir"; then
continue
fi
- for sover in "${vi_cv_version_lua}.so" "-${vi_cv_version_lua}.so" ".so.${vi_cv_version_lua}"; do
- for i in .0 .1 .2 .3 .4 .5 .6 .7 .8 .9 ""; do
+ for sover in "${vi_cv_version_lua}.${ext}" "-${vi_cv_version_lua}.${ext}" \
+ ".${vi_cv_version_lua}.${ext}" ".${ext}.${vi_cv_version_lua}"; do
+ for i in $indexes ""; do
if test -f "${vi_cv_path_lua_pfx}/${subdir}/liblua${sover}$i"; then
sover2="$i"
break 3
fi
done
done
+ sover=""
done
- vi_cv_dll_name_lua="liblua${sover}$sover2"
+ if test "X$sover" = "X"; then
+ AC_MSG_RESULT(no)
+ vi_cv_dll_name_lua="liblua.${ext}"
+ else
+ AC_MSG_RESULT(yes)
+ vi_cv_dll_name_lua="liblua${sover}$sover2"
+ fi
fi
AC_DEFINE(DYNAMIC_LUA)
LUA_LIBS=""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment