2002-01-28 01:25:27 +01:00
|
|
|
# $NetBSD: Makefile,v 1.54 2002/01/28 00:25:27 jlam Exp $
|
1997-10-06 16:51:03 +02:00
|
|
|
|
2001-06-07 06:25:31 +02:00
|
|
|
.include "../../lang/perl5/Makefile.common"
|
|
|
|
|
2002-01-28 01:25:27 +01:00
|
|
|
PKGREVISION= 7
|
2001-06-07 06:25:31 +02:00
|
|
|
CATEGORIES+= lang devel
|
1997-10-06 16:51:03 +02:00
|
|
|
|
2001-09-05 19:13:40 +02:00
|
|
|
MAINTAINER= jlam@netbsd.org
|
1998-08-20 17:16:34 +02:00
|
|
|
HOMEPAGE= http://language.perl.com/index.html
|
2001-02-17 10:06:56 +01:00
|
|
|
COMMENT= Practical Extraction and Report Language
|
1997-10-06 16:51:03 +02:00
|
|
|
|
2001-09-06 19:33:50 +02:00
|
|
|
CONFLICTS= perl-5.00* perl-base-[0-9]* \
|
2001-09-05 19:13:40 +02:00
|
|
|
p5-CGI-2.66 p5-CGI-2.75 p5-CGI-2.75.[0-2] \
|
|
|
|
p5-Data-Dumper-2.1[0-9][0-9] p5-Data-Dumper-[0-9][0-9] \
|
|
|
|
p5-Devel-DProf-[0-9]* p5-Devel-Peek-[0-9]* \
|
|
|
|
perl-mk-[0-9]*
|
1997-10-06 16:51:03 +02:00
|
|
|
|
2001-09-05 19:13:40 +02:00
|
|
|
HAS_CONFIGURE= # defined
|
|
|
|
CONFIGURE_SCRIPT= ./Configure
|
|
|
|
CONFIGURE_ARGS+= -sde
|
|
|
|
CONFIGURE_ARGS+= -Dprefix="${PREFIX}"
|
2001-09-26 05:12:14 +02:00
|
|
|
CONFIGURE_ARGS+= -Dscriptdir="${PREFIX}/bin"
|
2001-09-05 19:13:40 +02:00
|
|
|
CONFIGURE_ARGS+= -Darchname="${MACHINE_ARCH}-${LOWER_OPSYS}"
|
|
|
|
CONFIGURE_ARGS+= -Doptimize="${CFLAGS}"
|
|
|
|
CONFIGURE_ARGS+= -Dcc="${CC}"
|
|
|
|
CONFIGURE_ARGS+= -Uusemymalloc
|
|
|
|
CONFIGURE_ARGS+= -Uinstallusrbinperl
|
2000-08-30 21:46:47 +02:00
|
|
|
|
2001-09-05 19:13:40 +02:00
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
|
|
|
MKPIC?= yes
|
|
|
|
|
|
|
|
# Nail down the needed libraries for each platform here to avoid hidden
|
2001-09-17 20:11:36 +02:00
|
|
|
# dependencies. If this isn't defined, then use the perl defaults for the
|
|
|
|
# particular operating system.
|
2001-09-05 19:13:40 +02:00
|
|
|
#
|
|
|
|
LIBSWANTED.NetBSD= m crypt
|
2001-10-21 08:56:30 +02:00
|
|
|
LIBSWANTED.SunOS= m crypt dl socket nsl
|
2001-09-05 19:13:40 +02:00
|
|
|
|
2001-09-12 20:58:57 +02:00
|
|
|
# Nail down the directories in which the system libraries may be found.
|
|
|
|
# If this isn't defined, then use the perl defaults for the particular
|
|
|
|
# operating system.
|
2001-09-05 19:13:40 +02:00
|
|
|
#
|
|
|
|
SYSLIBPATH.NetBSD= /usr/lib
|
2001-09-17 20:04:42 +02:00
|
|
|
SYSLIBPATH.SunOS= /usr/lib
|
2001-09-05 19:13:40 +02:00
|
|
|
|
2001-10-01 09:05:10 +02:00
|
|
|
# Nail down the directories in which headers and libraries of
|
|
|
|
# locally-installed software may be found.
|
|
|
|
#
|
|
|
|
LOCLIBPATH= ${LOCALBASE}/lib
|
|
|
|
LOCINCPATH= ${LOCALBASE}/include
|
|
|
|
|
2001-10-14 21:55:47 +02:00
|
|
|
# On a.out platforms, we link with "ld" and on ELF platforms, we link with
|
|
|
|
# "cc", so we need to use different options to pass the run-time search path
|
|
|
|
# flags to the link command in the right way.
|
|
|
|
#
|
2001-10-01 09:05:10 +02:00
|
|
|
.if ${OBJECT_FMT} == "a.out"
|
|
|
|
LOCLIBRPATHFLAGS= ${LOCLIBPATH:S/^/-R/g}
|
|
|
|
.else
|
|
|
|
LOCLIBRPATHFLAGS= ${LOCLIBPATH:S/^/-Wl,-R/g}
|
|
|
|
.endif
|
|
|
|
|
2001-09-05 19:13:40 +02:00
|
|
|
.if defined(LIBSWANTED.${OPSYS})
|
|
|
|
CONFIGURE_ARGS+= -Dlibswanted="${LIBSWANTED.${OPSYS}}"
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if (${OPSYS} == "NetBSD")
|
|
|
|
.if !exists(/usr/libexec/ld.so) && !exists(/usr/libexec/ld.elf_so)
|
|
|
|
MKPIC= no
|
|
|
|
.endif
|
|
|
|
.if (${MACHINE_ARCH} == "sparc64")
|
|
|
|
# The toolchain on sparc64 is not really production-quality right now, but
|
|
|
|
# gcc-2.96 is supposed to fix most problems. Passing -g to the configure
|
|
|
|
# process triggers -DDEBUGGING, which plays the real trick and circumvents
|
|
|
|
# code-generation bugs, so we add -g to CFLAGS to at least have a really
|
|
|
|
# debuggable build.
|
|
|
|
#
|
|
|
|
CFLAGS+= -g -msoft-quad-float -O2
|
|
|
|
.endif
|
|
|
|
.elif (${OPSYS} == "SunOS")
|
|
|
|
CFLAGS=
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if (${MKPIC} == "yes")
|
|
|
|
CONFIGURE_ARGS+= -Duseshrplib
|
|
|
|
.endif
|
|
|
|
|
|
|
|
PERL5_ARCHLIB= ${PREFIX}/lib/perl5/${PERL5_DIST_VERS}/${MACHINE_ARCH}-${LOWER_OPSYS}
|
|
|
|
PERL5_SITEARCH= ${PREFIX}/lib/perl5/site_perl/${PERL5_DIST_VERS}/${MACHINE_ARCH}-${LOWER_OPSYS}
|
|
|
|
PERL5_PACKLIST= ${PERL5_ARCHLIB}/.packlist
|
|
|
|
|
|
|
|
# It's tough to guess which hints file will be used, so add our modifications
|
2001-09-12 20:58:57 +02:00
|
|
|
# to all of them:
|
|
|
|
#
|
|
|
|
# - Don't install any manpages in man3; make user use perldoc (to prevent
|
|
|
|
# confusion/conflicts with similarly named man2/man3 pages).
|
|
|
|
#
|
|
|
|
# - Explicitly set the local compiler search paths to contain only the
|
|
|
|
# pkgsrc-controlled directories.
|
2001-09-05 19:13:40 +02:00
|
|
|
#
|
|
|
|
post-patch:
|
|
|
|
hintdir="${WRKSRC}/hints"; \
|
|
|
|
for hints in $${hintdir}/*.sh; do \
|
|
|
|
${CHMOD} +w $${hints}; \
|
2001-10-01 09:05:10 +02:00
|
|
|
( ${ECHO} ''; \
|
|
|
|
${ECHO} 'man3dir=none'; \
|
|
|
|
${ECHO} 'locincpth="${LOCINCPATH}"'; \
|
|
|
|
${ECHO} 'loclibpth="${LOCLIBPATH}"'; \
|
|
|
|
${ECHO} 'ldflags="${LOCLIBRPATHFLAGS} $$ldflags"'; \
|
2001-09-05 19:13:40 +02:00
|
|
|
) >> $${hints}; \
|
|
|
|
done
|
|
|
|
.if defined(SYSLIBPATH.${OPSYS})
|
|
|
|
hintdir="${WRKSRC}/hints"; \
|
|
|
|
for hints in $${hintdir}/*.sh; do \
|
|
|
|
( ${ECHO} "glibpth='${SYSLIBPATH.${OPSYS}}'"; \
|
|
|
|
) >> $${hints}; \
|
|
|
|
done
|
|
|
|
.endif
|
|
|
|
|
2001-12-14 06:32:35 +01:00
|
|
|
# By default, on platforms that build shared libraries, rebuild the perl
|
|
|
|
# binary as a statically-linked binary as a speed optimization. Performance
|
|
|
|
# increase is only by word-of-mouth -- no actual benchmarks have been
|
|
|
|
# produced. However, it has been remarked that the advantage of having a
|
|
|
|
# statically-linked perl is pretty much non-existent on any platform with
|
|
|
|
# any reasonable number of registers. These platforms should be added to
|
|
|
|
# the list below to bypass the build of the statically-linked perl.
|
2001-09-05 19:13:40 +02:00
|
|
|
#
|
|
|
|
.if (${MKPIC} == "yes")
|
2001-12-14 06:32:35 +01:00
|
|
|
. for _arch_ in mipsel mipseb
|
|
|
|
. if !empty(MACHINE_ARCH:M${_arch_})
|
|
|
|
STATIC_PERL?= NO
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
STATIC_PERL?= YES
|
|
|
|
|
|
|
|
.if defined(STATIC_PERL) && (${STATIC_PERL} == "YES")
|
2001-09-05 19:13:40 +02:00
|
|
|
STATIC_WRKDIR= ${WRKDIR}/static
|
2001-12-14 06:32:35 +01:00
|
|
|
STATIC_MAKEFLAGS= MKPIC=no STATIC_PERL=NO
|
2001-09-05 19:13:40 +02:00
|
|
|
STATIC_MAKEFLAGS+= WRKDIR=${STATIC_WRKDIR}
|
|
|
|
STATIC_MAKEFLAGS+= ALL_TARGET=perl
|
|
|
|
|
|
|
|
post-build:
|
|
|
|
cd ${.CURDIR} && ${MAKE} build ${STATIC_MAKEFLAGS}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
post-install:
|
2001-12-14 06:32:35 +01:00
|
|
|
.if defined(STATIC_PERL) && (${STATIC_PERL} == "YES")
|
2001-12-14 20:26:11 +01:00
|
|
|
${RM} -f ${PREFIX}/bin/perl ${PREFIX}/bin/perl${PERL5_DIST_VERS}
|
2001-09-05 19:13:40 +02:00
|
|
|
${INSTALL_PROGRAM} ${STATIC_WRKDIR}/${DISTNAME}/perl ${PREFIX}/bin/perl
|
2001-12-14 20:26:11 +01:00
|
|
|
${LN} -f ${PREFIX}/bin/perl ${PREFIX}/bin/perl${PERL5_DIST_VERS}
|
2001-09-05 19:13:40 +02:00
|
|
|
.endif
|
|
|
|
strip ${PREFIX}/bin/a2p
|
|
|
|
strip ${PREFIX}/bin/perl
|
|
|
|
${RMDIR} -p ${PERL5_SITEARCH} 2>/dev/null || ${TRUE}
|
|
|
|
${RM} -f ${WRKDIR}/bsd.perl.mk
|
|
|
|
eval `${PERL5} -V:installsitelib 2>/dev/null` && \
|
|
|
|
echo PERL5_SITELIB=$$installsitelib >>${WRKDIR}/bsd.perl.mk
|
|
|
|
eval `${PERL5} -V:installsitearch 2>/dev/null` && \
|
|
|
|
echo PERL5_SITEARCH=$$installsitearch >>${WRKDIR}/bsd.perl.mk
|
|
|
|
eval `${PERL5} -V:installarchlib 2>/dev/null` && \
|
|
|
|
echo PERL5_ARCHLIB=$$installarchlib >>${WRKDIR}/bsd.perl.mk
|
|
|
|
${INSTALL_DATA} ${WRKDIR}/bsd.perl.mk ${PREFIX}/share/mk/bsd.perl.mk
|
|
|
|
|
|
|
|
test:
|
2001-12-14 06:32:35 +01:00
|
|
|
-@cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} \
|
2001-09-05 19:13:40 +02:00
|
|
|
${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKEFILE} test
|
1998-10-03 05:14:23 +02:00
|
|
|
|
1998-04-15 12:38:15 +02:00
|
|
|
.include "../../mk/bsd.pkg.mk"
|