Annotation of pkgsrc/lang/lua/module.mk, revision 1.9

1.9     ! nia         1: # $NetBSD: module.mk,v 1.8 2020/07/09 15:01:53 nia Exp $
1.1       minskim     2: #
                      3: # This Makefile fragment is intended to be included by packages that
1.6       alnsn       4: # install Lua modules.
                      5: #
1.9     ! nia         6: # === Package-settable variables ===
        !             7: #
        !             8: # LUA_LINKER_MAGIC
        !             9: #      This appends LDFLAGS to properly link Lua modules on non-ELF
        !            10: #      linkers.
        !            11: #
        !            12: #      You probably want to set this to "no" if the package links
        !            13: #      binaries that are not Lua modules.
        !            14: #
        !            15: #      Possible values: yes no
        !            16: #      Default: yes
        !            17: #
1.6       alnsn      18: # === Defined variables ===
                     19: #
                     20: # LUA_LDIR
                     21: #      Path where Lua modules are installed.
                     22: #
                     23: # LUA_CDIR
                     24: #      Path where Lua C modules are installed. Not defined if
                     25: #      NO_BUILD variable is set to "yes".
                     26: #
                     27: # LUA_DOCDIR
                     28: #      Path where documentation files are installed.
                     29: #
                     30: # LUA_EXAMPLESDIR
                     31: #      Path where example files are installed.
                     32: #
                     33: # Keywords: lua
                     34: #
1.1       minskim    35: 
                     36: .if !defined(LUA_MODULE_MK)
                     37: LUA_MODULE_MK= # defined
                     38: 
1.6       alnsn      39: .if !defined(LUA_LUAVERSION_MK)
1.5       dholland   40: .include "../../lang/lua/luaversion.mk"
1.6       alnsn      41: .endif
1.1       minskim    42: 
1.5       dholland   43: LUA_LDIR=      share/lua/${_LUA_DOT_VERSION}
1.1       minskim    44: PLIST_SUBST+=  LUA_LDIR=${LUA_LDIR}
                     45: 
1.6       alnsn      46: PRINT_PLIST_AWK+=      /^${LUA_LDIR:S|/|\\/|g}/ \
                     47:                        { gsub(/${LUA_LDIR:S|/|\\/|g}/, "$${LUA_LDIR}") }
                     48: 
1.1       minskim    49: .if defined(NO_BUILD) && empty(NO_BUILD:M[Nn][Oo])
1.5       dholland   50: DEPENDS+=      ${LUA_BASEDEPENDS}
                     51: 
1.1       minskim    52: .else
1.5       dholland   53: LUA_CDIR=      lib/lua/${_LUA_DOT_VERSION}
1.1       minskim    54: PLIST_SUBST+=  LUA_CDIR=${LUA_CDIR}
                     55: 
1.4       joerg      56: PRINT_PLIST_AWK+=      /^${LUA_CDIR:S|/|\\/|g}/ \
                     57:                        { gsub(/${LUA_CDIR:S|/|\\/|g}/, "$${LUA_CDIR}") }
                     58: 
1.5       dholland   59: .include "${LUA_PKGSRCDIR}/buildlink3.mk"
1.1       minskim    60: .endif
                     61: 
1.6       alnsn      62: LUA_DOCDIR=    share/doc/${PKGBASE}
                     63: PLIST_SUBST+=  LUA_DOCDIR=${LUA_DOCDIR}
                     64: 
1.8       nia        65: PRINT_PLIST_AWK+=      /^${LUA_DOCDIR:S|/|\\/|g}/ \
                     66:                        { gsub(/${LUA_DOCDIR:S|/|\\/|g}/, "$${LUA_DOCDIR}") }
                     67: 
1.6       alnsn      68: LUA_EXAMPLESDIR=       share/examples/${PKGBASE}
                     69: PLIST_SUBST+=          LUA_EXAMPLESDIR=${LUA_EXAMPLESDIR}
                     70: 
1.9     ! nia        71: LUA_LINKER_MAGIC?=     yes
        !            72: 
        !            73: .if !empty(LUA_LINKER_MAGIC:M[yY][eE][sS])
1.7       ryoon      74: LDFLAGS.Cygwin+=       -llua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
1.9     ! nia        75: LDFLAGS.Darwin+=       -bundle -undefined dynamic_lookup
        !            76: .endif
1.7       ryoon      77: 
1.1       minskim    78: .endif  # LUA_MODULE_MK

CVSweb <webmaster@jp.NetBSD.org>