need dependency on bash for REPLACE_BASH to work properly.
[pkgsrcv2.git] / devel / libtool-base / Makefile
1 # $NetBSD: Makefile,v 1.94 2010/12/26 10:46:27 adam Exp $
2
3 ###########################################################################
4 ###########################################################################
5 #
6 # HEADS UP!  DO NOT CHANGE THE VERSION OR PKGREVISION WITHOUT READING THIS:
7 #
8 ###########################################################################
9 ###########################################################################
10 #
11 # This package is maintained specially in order to preserve pkgsrc
12 # specific OS changes that diverge from the "out of the box" libtool.
13 # In order to keep this package in a maintainable condition, the .m4 files
14 # must be manipulated in order to generate the patch-* files.
15 #
16 # See devel/libtool/patches/manual.README for instructions on how to make
17 # these patch files properly; otherwise your changes WILL be lost on the
18 # next libtool update.
19 #
20 # DO NOT MAKE CHANGES TO patch-ab OR patch-ad WITHOUT FOLLOWING THESE
21 # INSTRUCTIONS.  There are no exceptions to this rule.
22 #
23 ###########################################################################
24 ###########################################################################
25
26 .include "../../devel/libtool/Makefile.common"
27
28 PKGNAME=        ${DISTNAME:S/-/-base-/}
29 PKGREVISION=    5
30 SVR4_PKGNAME=   ltoob
31
32 COMMENT=        Generic shared library support script (the script itself)
33
34 CONFLICTS+=     libtool<=1.3.5nb11
35
36 TEST_TARGET=    check
37 PLIST_VARS+=    shlibtool
38
39 OVERRIDE_DIRDEPTH.install-sh=   1
40
41 .if ${OPSYS} == "AIX"
42
43 # always build libraries and executables that use the runtime linker.
44 # in addition, disable libtool locking, as the test is broken on AIX,
45 # and results in files being locked indefinitely.
46 LDFLAGS+=               -Wl,-brtl
47 CONFIGURE_ARGS+=        --disable-libtool-lock
48
49 .elif ${OPSYS} == "IRIX"
50
51 # The MIPSpro compiler doesn't support -c with -o, but the locking
52 # workaround is itself broken.  Disable it unconditionally.
53 CONFIGURE_ARGS+=        --disable-libtool-lock
54
55 .elif ${OPSYS} == "NetBSD"
56 .  if !exists(/usr/libexec/ld.so) && !exists(/usr/libexec/ld.elf_so)
57 CONFIGURE_ARGS+=        --disable-shared
58 BUILD_SHLIBTOOL=        NO
59 .  endif
60 .endif
61
62 BUILD_SHLIBTOOL?=       YES
63
64 # We are going to want libtool to find the same versions of the C, C++,
65 # and Fortran compilers.
66 #
67 USE_LANGUAGES=          c c++ fortran77
68 CONFIGURE_ARGS+=        --disable-ltdl-install
69
70 USE_TOOLS+=             echo
71
72 .PHONY: fix-libtool
73 fix-libtool:
74         cd ${WRKSRC}; for f in libtool; do                              \
75                 ${SED}  -e "s,-L${BUILDLINK_DIR}/lib,," $$f > $$f.new;  \
76                 if [ -x $$f ]; then ${CHMOD} +x $$f.new; fi;            \
77                 ${MV} -f $$f.new $$f;                                   \
78         done
79
80 post-build: fix-libtool
81
82 .if ${BUILD_SHLIBTOOL} != "NO"
83 PLIST.shlibtool=        yes
84
85 post-build:
86         @${SED} -e "s|@PREFIX@|"${PREFIX:Q}"|g"                         \
87                 -e "s|@SH@|"${SH:Q}"|g"                                 \
88                 ${FILESDIR}/shlibtool.in > ${WRKSRC}/shlibtool
89
90 post-install:
91         ${INSTALL_SCRIPT} ${WRKSRC}/shlibtool ${DESTDIR}${PREFIX}/bin/shlibtool
92 .endif
93
94 BUILDLINK_DEPMETHOD.dlcompat=   build
95
96 .include "../../mk/dlopen.buildlink3.mk"
97 .include "../../mk/bsd.pkg.mk"