summaryrefslogtreecommitdiff
path: root/devel/libtool-base/Makefile
blob: 7e254a1fed88564efa8e66df556d3ef731aa3374 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# $NetBSD: Makefile,v 1.38 2004/07/18 09:38:26 schmonz Exp $
#

PKGNAME=	${DISTNAME:C/-/-base-/}
PKGREVISION=	1
SVR4_PKGNAME=	ltoob

COMMENT=	Generic shared library support script (the script itself)

CONFLICTS+=	libtool<=1.3.5nb11

# We are going to want libtool to find the same versions of the C, C++,
# and Fortran compilers.
#
USE_LANGUAGES=	c c++ fortran

.include "../../devel/libtool/Makefile.common"

TEST_TARGET=	check

.include "../../mk/bsd.prefs.mk"

.if ${OPSYS} == "NetBSD"
.  if !exists(/usr/libexec/ld.so) && !exists(/usr/libexec/ld.elf_so)
CONFIGURE_ARGS=		--disable-shared
BUILD_SHLIBTOOL=	NO
.  endif
.else
CONFIGURE_ARGS=		--enable-ltdl-install
.endif

# The configure script persists in trying to find the path to ld, which
# always ends up in ${BUILDLINK_DIR}.  Prevent it from caring.
#
CONFIGURE_ENV+=		lt_cv_path_LD=${LD:Q}

# The configure script persists in trying to find the path to sed or gsed,
# which breaks when SED is nbsed.  Tell it explicitly to use the sed
# named by ${SED}.
#
CONFIGURE_ENV+=		SED=${SED:Q}
CONFIGURE_ENV+=		lt_cv_path_SED=${SED:Q}

# The configure script doesn't seem to be working out the need for -p
# or -B, so tell it
.if ${OPSYS} == "SunOS"
CONFIGURE_ENV+=		lt_cv_path_NM="nm -p"
.elif ${OPSYS} == "IRIX"
CONFIGURE_ENV+=		lt_cv_path_NM="nm -B"
.endif

BUILD_SHLIBTOOL?=	YES

.PHONY: fix-libtool
fix-libtool:
	cd ${WRKSRC}; for f in libtool; do				\
		${SED}	-e "s,-L${BUILDLINK_DIR}/lib,," $$f > $$f.new;	\
		if [ -x $$f ]; then ${CHMOD} +x $$f.new; fi;		\
		${MV} -f $$f.new $$f;					\
	done

post-build: fix-libtool

.if ${BUILD_SHLIBTOOL} == "NO"
PLIST_SUBST+=		SHLIBTOOL="@comment "
.else
PLIST_SUBST+=		SHLIBTOOL=

post-build:
	cd ${WRKSRC} && \
		${SED} -e '/^# Whether or not to build static/{n;s/yes/no/;}' \
		< libtool > shlibtool

post-install:
	${INSTALL_SCRIPT} ${WRKSRC}/shlibtool ${PREFIX}/bin/shlibtool
.endif

.include "../../devel/dlcompat/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"