Annotation of pkgsrc/lang/perl5/module.mk, Revision 1.14
1.13 jlam 1: # $NetBSD: module.mk,v 1.12 2003/08/03 20:52:30 jmmv Exp $
1.1 jlam 2: #
3: # This Makefile fragment is intended to be included by packages that build
4: # and install perl5 modules.
5: #
6: # The following targets are provided by this file:
7: #
1.2 seb 8: # perl5-configure runs the standard perl configuration in
1.1 jlam 9: # each of the directories specified in
10: # ${PERL5_CONFIGURE_DIRS}.
11: #
1.2 seb 12: # do-configure runs the perl5-configure target; if PERL5_CONFIGURE
13: # is set to "YES", then this target overrides the
14: # default do-configure provided by bsd.pkg.mk.
15: #
1.1 jlam 16: # The following variables may be set prior to including this file:
17: #
1.2 seb 18: # PERL5_CONFIGURE if "YES", then for do-configure, run the standard
19: # perl configuration assuming Makefile.PL exists;
1.1 jlam 20: # defaults to "YES".
21: #
22: # PERL5_CONFIGURE_DIRS list of directories in which to run the
23: # standard perl configuration; defaults to
24: # ${CONFIGURE_DIRS}.
25: #
26: # PERL5_LDFLAGS extra linker flags to pass on to the build
27: # process.
28:
29: .if !defined(_PERL5_MODULE_MK)
30: _PERL5_MODULE_MK= # defined
1.4 jlam 31:
1.13 jlam 32: .include "../../mk/bsd.prefs.mk"
33:
1.6 jlam 34: BUILDLINK_DEPMETHOD.perl+= full
1.1 jlam 35:
1.13 jlam 36: .if !defined(NO_BUILDLINK)
37: . if empty(USE_BUILDLINK2:M[nN][oO])
38: . include "../../lang/perl5/buildlink2.mk"
39: . endif
40: .endif
1.1 jlam 41:
42: PERL5_CONFIGURE?= YES
43: PERL5_CONFIGURE_DIRS?= ${CONFIGURE_DIRS}
44:
1.2 seb 45: perl5-configure:
1.1 jlam 46: ${_PKG_SILENT}${_PKG_DEBUG} \
47: for dir in ${PERL5_CONFIGURE_DIRS}; do \
48: if [ -f $$dir/Makefile.PL ]; then \
49: ( cd $$dir && ${SETENV} ${MAKE_ENV} \
50: ${PERL5} Makefile.PL ${MAKE_PARAMS}); \
51: fi; \
52: done
1.2 seb 53:
54: .if defined(PERL5_CONFIGURE) && !empty(PERL5_CONFIGURE:M[yY][eE][sS])
1.13 jlam 55: . if target(do-configure)
1.11 jmmv 56: do-configure: perl5-configure
1.13 jlam 57: . else
1.2 seb 58: do-configure: perl5-configure
59: ${_PKG_SILENT}${_PKG_DEBUG}${DO_NADA}
1.13 jlam 60: . endif
1.12 jmmv 61: .endif
1.13 jlam 62:
63: .if !defined(_PERL5_SITEPREFIX)
64: . if exists(${PERL5})
65: _PERL5_SITEPREFIX!= \
66: eval `${PERL5} -V:siteprefix 2>/dev/null`; ${ECHO} $${siteprefix}
67: MAKEFLAGS+= _PERL5_SITEPREFIX="${_PERL5_SITEPREFIX}"
68: #
69: # Repoint all of the site-specific variables to be under the perl5
70: # module's ${PREFIX}.
71: #
72: _PERL5_VAR.INSTALLSITEBIN= installsitebin
73: _PERL5_VAR.INSTALLSITELIB= installsitelib
74: _PERL5_VAR.INSTALLSITEARCH= installsitearch
75: _PERL5_VAR.INSTALLSITEMAN1DIR= installsiteman1dir
76: _PERL5_VAR.INSTALLSITEMAN3DIR= installsiteman3dir
77: _PERL5_VAR.SITELIBEXP= sitelibexp
78: _PERL5_VAR.SITEARCHEXP= sitearchexp
79:
80: . for _var_ in \
81: INSTALLSITEBIN INSTALLSITELIB INSTALLSITEARCH \
82: INSTALLSITEMAN1DIR INSTALLSITEMAN3DIR \
83: SITELIBEXP SITEARCHEXP
84: _PERL5_SUB_${_var_}!= \
85: eval `${PERL5} -V:${_PERL5_VAR.${_var_}} 2>/dev/null`; \
86: ${ECHO} $${${_PERL5_VAR.${_var_}}} | \
87: ${SED} -e "s,^${_PERL5_SITEPREFIX}/,,"
88: _PERL5_${_var_}= ${PREFIX}/${_PERL5_SUB_${_var_}}
89: MAKEFLAGS+= ${_var_}="${_PERL5_${_var_}}"
90: MAKE_FLAGS+= ${_var_}="${_PERL5_${_var_}}"
91: . endfor
92: . endif
93: .endif
94:
95: .if defined(DEFAULT_VIEW.perl)
96: DEFAULT_VIEW.${PKGBASE}= ${DEFAULT_VIEW.perl}
1.1 jlam 97: .endif
98:
99: # OTHERLDFLAGS is the hook provided by the perl5 MakeMaker module to allow
100: # customizing the LDFLAGS passed to the compiler/linker.
101: #
102: .if defined(PERL5_LDFLAGS) && !empty(PERL5_LDFLAGS)
1.8 jlam 103: FIX_RPATH+= PERL5_LDFLAGS
1.1 jlam 104: LDFLAGS+= ${PERL5_LDFLAGS}
105: . include "../../mk/bsd.prefs.mk"
106: . if ${OBJECT_FMT} == "a.out"
107: MAKE_FLAGS+= OTHERLDFLAGS="${LDFLAGS:S/-Wl,//g}"
108: . else
109: MAKE_FLAGS+= OTHERLDFLAGS="${LDFLAGS}"
110: . endif
111: .endif
112:
113: # Generate the PLIST from the files listed in PERL5_PACKLIST.
114: .if defined(PERL5_PACKLIST)
115: PERL5_PLIST_COMMENT= \
116: ( ${ECHO} "@comment The following lines are automatically generated"; \
117: ${ECHO} "@comment from the installed .packlist files." )
118: PERL5_PLIST_FILES= \
119: ( ${CAT} ${PERL5_PACKLIST}; for f in ${PERL5_PACKLIST}; do [ ! -f $$f ] || ${ECHO} $$f; done ) \
120: | ${SED} -e "s,[ ].*,," -e "s,/\./,/,g" -e "s,${PREFIX}/,," \
121: | ${SORT} -u
122: PERL5_PLIST_DIRS= \
123: ( ${CAT} ${PERL5_PACKLIST}; for f in ${PERL5_PACKLIST}; do [ ! -f $$f ] || ${ECHO} $$f; done ) \
124: | ${SED} -e "s,[ ].*,," -e "s,/\./,/,g" -e "s,${PREFIX}/,," \
125: -e "s,^,@unexec \${RMDIR} -p %D/," \
126: -e "s,/[^/]*$$, 2>/dev/null || \${TRUE}," \
127: | ${SORT} -ur
128: PERL5_GENERATE_PLIST= ${PERL5_PLIST_COMMENT}; \
129: ${PERL5_PLIST_FILES}; \
130: ${PERL5_PLIST_DIRS}
131: GENERATE_PLIST+= ${PERL5_GENERATE_PLIST};
132: .endif
1.7 seb 133:
1.14 ! jlam 134: # Skip appending to perllocal.pod. We don't keep this consistent anyway
! 135: # with binary packages.
! 136: #
! 137: # XXX We should be adding to and removing from perllocal.pod in
! 138: # XXX VIEW-{INSTALL,DEINSTALL} actions from the INSTALL/DEINSTALL
! 139: # XXX scripts.
! 140: #
! 141: INSTALL_TARGET?= pure_install
! 142:
1.7 seb 143: # Default test target for perl5 modules
144: TEST_TARGET?= test
1.1 jlam 145:
146: .endif # _PERL5_MODULE_MK
CVSweb <webmaster@jp.NetBSD.org>