--- mjpegtools-1.6.2-r3.ebuild.orig 2005-02-26 17:08:28.000000000 +0100 +++ mjpegtools-1.6.2-r3.ebuild 2005-02-26 18:04:48.216032160 +0100 @@ -11,7 +11,7 @@ LICENSE="as-is" SLOT="1" KEYWORDS="x86 ppc amd64 ~sparc ppc64" -IUSE="gtk avi dv quicktime sdl X yv12 3dnow mmx sse" +IUSE="gtk avi dv quicktime sdl X yv12 3dnow mmx sse pic" DEPEND="media-libs/jpeg >=sys-apps/sed-4 @@ -30,26 +30,45 @@ X? ( virtual/x11 )" src_unpack() { - unpack ${A} ; cd ${S} + local autoreconfflags="" autoreconf="" + unpack ${A} + cd ${S} + cp -rf ${S}{,.orig} - epatch ${FILESDIR}/${P}-fPIC.patch - epatch ${FILESDIR}/${P}-gcc34.patch + # Add 'const' to aggregate elements of vectors epatch ${FILESDIR}/${P}-gcc34-altivec.patch - # remove checks for gtk in configure in - use gtk || epatch ${FILESDIR}/${P}-nogtk.patch + if use !gtk; then + # Force no gtk; alters configure.in, autoreconf required + epatch ${FILESDIR}/${P}-nogtk.patch + autoreconf="yes" + fi if use ppc; then # Fix an error in the detection of the altivec-support - # in the compiler + # in the compiler; alters configure.in, autoreconf required epatch "${FILESDIR}/altivec-fix-${PV}.patch" sed -i 's:-O3::' configure.in + autoreconf="yes" fi - aclocal - libtoolize --copy --force - autoreconf || die + if use pic || use amd64; then + # Build libmjpegutils as shared library; alters Makefile.am + # so autoreconf required including libtoolize + epatch ${FILESDIR}/${P}-fPIC.patch + epatch ${FILESDIR}/${P}-mmx-fPIC.patch + autoreconfflags="--install --force" + autoreconf="yes" + fi + if [[ ${autoreconf} = "yes" ]]; then + einfo Auto-reconfiguring + autoreconf ${autoreconfflags} || diefunc "$FUNCNAME" "$LINENO" "$?" + fi + + # Configure patch to remove -mcpu settings; alters configure + # so must be after any autoreconf. + epatch ${FILESDIR}/${P}-gcc34.patch use X || epatch "${FILESDIR}/no-x11-lib-2.patch" } @@ -78,7 +97,7 @@ if use x86; then if use mmx || use 3dnow || use sse; then myconf="${myconf} --enable-simd-accel" - strip-flags -fstack-protector + #strip-flags -fstack-protector fi if use mmx; then myconf="${myconf} --with-jpeg-mmx=/usr/include/jpeg-mmx" @@ -87,16 +106,6 @@ econf ${myconf} || die - if has_pie ; then - pie_magic="`test_flag -fno-pic` `test_flag -nopie`" - for i in `find "${S}" -name "Makefile"` ; do - sed -e "s:CC = gcc:CC = gcc ${pie_magic}:g" \ - -e "s:CXX = gcc:CXX = g++ ${pie_magic}:g" \ - -e "s:CXXCPP = gcc -E:CXX = g++ -E ${pie_magic}:g" \ - -i "${i}" || die "sed failed" - done - fi - emake CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" -j1 || die "compile problem" cd docs local infofile