summaryrefslogtreecommitdiff
blob: 42a703a466398110a76d8e0349329dd3412d50e7 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-devel/libtool/libtool-1.5.2-r5.ebuild,v 1.9 2004/05/30 09:41:15 vapier Exp ${P}-r1.ebuild,v 1.8 2002/10/04 06:34:42 vapier Exp $

inherit eutils gnuconfig

# NOTE:  We install libltdl of libtool-1.3x for compat reasons ...

OLD_PV="1.3.5"
S="${WORKDIR}/${P}"
OLD_S="${WORKDIR}/${PN}-${OLD_PV}"
DESCRIPTION="A shared library tool for developers"
HOMEPAGE="http://www.gnu.org/software/libtool/libtool.html"
SRC_URI="mirror://gnu/${PN}/${P}.tar.gz
	mirror://gnu/${PN}/${PN}-${OLD_PV}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~ppc ppc64 sparc ~mips ~alpha arm ~hppa amd64 ~ia64 s390"
IUSE=""

DEPEND="virtual/glibc
	>=sys-devel/autoconf-2.58
	>=sys-devel/automake-1.8.3"
# the autoconf dep is due to it complaining 'configure.ac:55: error: Autoconf version 2.58 or higher is required'
# the automake dep is due to Bug #46037

lt_setup() {
	export WANT_AUTOCONF_2_5=1
	export WANT_AUTOMAKE_1_5=1
}

gen_ltmain_sh() {
	local date=
	local PACKAGE=
	local VERSION=

	rm -f ltmain.shT
	date=`./mkstamp < ./ChangeLog` && \
	eval `egrep '^[[:space:]]*PACKAGE' configure` && \
	eval `egrep '^[[:space:]]*VERSION' configure` && \
	sed -e "s/@PACKAGE@/${PACKAGE}/" -e "s/@VERSION@/${VERSION}/" \
		-e "s%@TIMESTAMP@%$date%" ./ltmain.in > ltmain.shT || return 1

	mv -f ltmain.shT ltmain.sh || {
		(rm -f ltmain.sh && cp ltmain.shT ltmain.sh && rm -f ltmain.shT)
		return 1
	}

	return 0
}

src_unpack() {
	lt_setup

	unpack ${A}

	cd ${OLD_S}
	echo
	# Install updated missing script
	portageq has_version / "sys-devel/automake" && {
		rm -f missing
		automake --add-missing
	}

	einfo "Patching ${OLD_S##*/} ..."
	epatch ${FILESDIR}/1.4.3/${PN}-1.2f-cache.patch
	epatch ${FILESDIR}/1.4.3/${PN}-1.3.5-nonneg.patch
	epatch ${FILESDIR}/1.4.3/${PN}-1.3.5-mktemp.patch

	use hppa && S="${OLD_S}" gnuconfig_update
	use amd64 && S="${OLD_S}" gnuconfig_update
	use ppc64 && S="${OLD_S}" gnuconfig_update

	cd ${S}
	echo
	# Install updated missing script
#	portageq has_version / "sys-devel/automake" && {
#		rm -f missing
#		automake --add-missing
#	}

	# Make sure non of the patches touch ltmain.sh, but rather ltmain.in
	rm -f ltmain.sh*

	einfo "Patching ${S##*/} ..."
	# Redhat patches
	epatch ${FILESDIR}/1.4.3/${PN}-1.4-nonneg.patch
	# Fix the relink problem where the relinked libs do not get
	# installed.  It is *VERY* important that you get a updated
	# 'libtool-1.4.3-relink.patch' if you update this, as it
	# fixes a very serious bug.  Please not that this patch is
	# included in 'libtool-1.4.3-gentoo.patch' for this ebuild.
	#
	# NOTE: all affected apps should get a 'libtoolize --copy --force'
	#      added to upate libtool
	#
# Seems to be included in shipped tarball ...
#	epatch ${FILESDIR}/1.4.3/${PN}-1.4.2-relink-58664.patch

	epatch ${FILESDIR}/1.4.3/${PN}-1.4.2-multilib.patch
	epatch ${FILESDIR}/1.4.3/${PN}-1.4.2-demo.patch
	epatch ${FILESDIR}/${PV}/${PN}-1.5-libtool.m4-x86_64.patch
	epatch ${FILESDIR}/${PV}/${PN}-1.5-testfailure.patch
	# Mandrake patches
	epatch ${FILESDIR}/1.4.3/${PN}-1.4.3-lib64.patch
# Fix bug #43244
#	epatch ${FILESDIR}/1.4.3/${PN}-1.4.2-fix-linkage-of-cxx-code-with-gcc.patch
	epatch ${FILESDIR}/1.4.3/${PN}-1.4.2-archive-shared.patch
	epatch ${FILESDIR}/1.4.3/${PN}-1.4.3-ltmain-SED.patch
	epatch ${FILESDIR}/1.4.3/${PN}-1.4.2-expsym-linux.patch
	epatch ${FILESDIR}/1.4.3/${PN}-1.4.3-amd64-alias.patch
	epatch ${FILESDIR}/1.4.3/${PN}-1.4.3-libtoolize--config-only.patch
	epatch ${FILESDIR}/1.4.3/${PN}-1.4.3-pass-thread-flags.patch

	# Gentoo Patches
	# Do not create bogus entries in $dependency_libs or $libdir
	# with ${D} or ${S} in them.
	# <azarah@gentoo.org> - (07 April 2002)
	epatch ${FILESDIR}/1.4.3/${PN}-1.4.2-portage.patch
	# If a package use an older libtool, and libtool.m4 for that
	# package is updated, but not libtool, then we run into an
	# issue where $shared_ext is not set.  This results in libraries
	# being built without '.so' extension, bug #40901
	# <azarah@gentoo.org> - (11 Feb 2004)
	epatch ${FILESDIR}/${PV}/${PN}-1.5.2-libtool_m4-shared_ext.patch
	# For older autoconf setups's that do not support libtool.m4,
	# $max_cmd_len are never set, causing all tests against it to
	# fail, resulting in 'integer expression expected' errors and
	# possible misbehaviour.
	# <azarah@gentoo.org> - (11 Feb 2004)
	epatch ${FILESDIR}/${PV}/${PN}-1.5.2-ltmain_sh-max_cmd_len.patch

	einfo "Generate ltmain.sh ..."
	gen_ltmain_sh || die "Failed to generate ltmain.sh!"
}

src_compile() {
	lt_setup

	#
	# ************ libtool-1.3x ************
	#

	cd ${OLD_S}

	# Detect mips/mips64
	use mips && gnuconfig_update

	# regen to allow for build,host,target ppc64
	use ppc64 && gnuconfig_update

	einfo "Configuring ${OLD_S##*/} ..."
	./configure --host=${CHOST} \
			--prefix=/usr \
			--infodir=/usr/share/info || die

	einfo "Building ${OLD_S##*/} ..."
	emake || die

	#
	# ************ libtool-1.5x ************
	#

	cd ${S}

	# Detect mips/mips64
	use mips && gnuconfig_update

	einfo "Configuring ${S##*/} ..."
	./configure --host=${CHOST} \
		--prefix=/usr \
		--infodir=/usr/share/info || die

	einfo "Building ${S##*/} ..."
	emake || die
}

src_install() {
	#
	# ************ libtool-1.3x ************
	#

	einfo "Installing ${OLD_S##*/} ..."
	cd ${OLD_S}/libltdl; make DESTDIR=${D} install || die

	# Remove stuff we are not going to use ...
	for x in libltdl.a  libltdl.la  libltdl.so
	do
		[ -f ${x} ] && rm -f ${D}/usr/lib/${x}
	done
	rm -rf ${D}/usr/include

	#
	# ************ libtool-1.5x ************
	#

	einfo "Installing ${S##*/} ..."
	cd ${S}; make DESTDIR=${D} install || die

	dodoc AUTHORS ChangeLog* NEWS README THANKS TODO doc/PLATFORMS
}