Try and disable over-engineering in the rpm build system. --- rpm-4.4.7/build/Makefile.am +++ rpm-4.4.7/build/Makefile.am @@ -24,10 +24,7 @@ pkginc_HEADERS = rpmbuild.h rpmfc.h rpmfile.h rpmspec.h noinst_HEADERS = buildio.h -LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir) - -usrlibdir = $(libdir)@MARK64@ -usrlib_LTLIBRARIES = librpmbuild.la +lib_LTLIBRARIES = librpmbuild.la librpmbuild_la_SOURCES = \ build.c expression.c files.c misc.c names.c pack.c \ parseBuildInstallClean.c parseChangelog.c parseDescription.c \ --- rpm-4.4.7/configure.ac +++ rpm-4.4.7/configure.ac @@ -117,7 +117,9 @@ dnl with_selinuxval=no AC_MSG_CHECKING(flag used by libtool to link rpm) -if test X"$GCC" = Xyes ; then +# We do not want static linking +#if test X"$GCC" = Xyes ; then +if false ; then case "$target" in *-*-linux*) LDFLAGS_STATIC="-all-static" with_selinuxval=yes ;; @@ -160,14 +162,15 @@ dnl XXX Test for libpthread.a that is NPTL aware (static link only). dnl LDFLAGS_NPTL= -if test -f /usr/lib/nptl/libpthread.a ; then - LDFLAGS_NPTL="-L/usr/lib/nptl" +# Also do not need static linking +#if test -f /usr/lib/nptl/libpthread.a ; then +# LDFLAGS_NPTL="-L/usr/lib/nptl" # INCPATH="$INCPATH -I/usr/include/nptl" -fi -if test -f /usr/lib64/nptl/libpthread.a ; then - LDFLAGS_NPTL="-L/usr/lib64/nptl" +#fi +#if test -f /usr/lib64/nptl/libpthread.a ; then +# LDFLAGS_NPTL="-L/usr/lib64/nptl" # INCPATH="$INCPATH -I/usr/include/nptl" -fi +#fi AC_SUBST(LDFLAGS_NPTL) dnl @@ -1306,6 +1309,8 @@ case "${target_cpu}" in x86_64*|ppc64*|powerpc64*|sparc64*|s390x*) MARK64=64 ;; esac +# We don't want this magic as portage handles it +MARK64=ALL-SCREWED-UP AC_SUBST(MARK64) # For some systems we know that we have ld_version scripts. @@ -1388,13 +1384,16 @@ else usrprefix=$prefix fi + +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + LOCALEDIR="`echo ${usrprefix}/share/locale`" AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [Full path to rpm locale directory (usually /usr/share/locale)]) AC_SUBST(LOCALEDIR) LIBDIR="`echo $libdir | sed 's-/lib$-/%{_lib}-'`" AC_SUBST(LIBDIR) -RPMCONFIGDIR="`echo ${usrprefix}/lib/rpm`" +RPMCONFIGDIR="`eval echo ${libdir}/rpm`" AC_DEFINE_UNQUOTED(RPMCONFIGDIR, "$RPMCONFIGDIR", [Full path to rpm global configuration directory (usually /usr/lib/rpm)]) AC_SUBST(RPMCONFIGDIR) --- rpm-4.4.7/lib/Makefile.am +++ rpm-4.4.7/lib/Makefile.am @@ -29,10 +29,7 @@ mylibs = librpm.la LIBS = -LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir) - -usrlibdir = $(libdir)@MARK64@ -usrlib_LTLIBRARIES = librpm.la +lib_LTLIBRARIES = librpm.la librpm_la_SOURCES = \ cpio.c depends.c formats.c fs.c fsm.c getdate.c \ manifest.c misc.c package.c \ --- rpm-4.4.7/python/Makefile.am +++ rpm-4.4.7/python/Makefile.am @@ -4,8 +4,8 @@ LINT = splint -pylibdir = ${prefix}/lib@MARK64@/python@WITH_PYTHON_VERSION@ -pyincdir = $(prefix)/include/python@WITH_PYTHON_VERSION@ +pylibdir = $(libdir)/python@WITH_PYTHON_VERSION@ +pyincdir = $(includedir)/python@WITH_PYTHON_VERSION@ SUBDIRS = rpm --- rpm-4.4.7/python/rpm/Makefile.am +++ rpm-4.4.7/python/rpm/Makefile.am @@ -4,8 +4,8 @@ PYVER = @WITH_PYTHON_VERSION@ -pylibdir = ${prefix}/lib@MARK64@/python@WITH_PYTHON_VERSION@ -pyincdir = $(prefix)/include/python@WITH_PYTHON_VERSION@ +pylibdir = $(libdir)/python@WITH_PYTHON_VERSION@ +pyincdir = $(includedir)/python@WITH_PYTHON_VERSION@ EXTRA_DIST = \ __init__.py --- rpm-4.4.7/rpmdb/Makefile.am +++ rpm-4.4.7/rpmdb/Makefile.am @@ -41,11 +41,7 @@ # XXX watchout, ../db3/libdb.la created by this Makefile may surprise libdb_la = $(top_builddir)/$(WITH_DB_SUBDIR)/libdb.la -# XXX grrr, RPM_BUILD_ROOT prevents build pollution if/when -lrpm different -LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir) - -usrlibdir = $(libdir)@MARK64@ -usrlib_LTLIBRARIES = librpmdb.la +lib_LTLIBRARIES = librpmdb.la librpmdb_la_SOURCES = \ dbconfig.c fprint.c \ hdrNVR.c header.c header_internal.c legacy.c merge.c \ --- rpm-4.4.7/rpmio/Makefile.am +++ rpm-4.4.7/rpmio/Makefile.am @@ -28,10 +28,7 @@ BEECRYPTLOBJS = $(shell test X"@WITH_BEECRYPT_SUBDIR@" != X && cat $(top_builddir)/@WITH_BEECTYPT_SUBDIR@/listobjs) -LDFLAGS = -L$(RPM_BUILD_ROOT)$(usrlibdir) -L$(DESTDIR)$(usrlibdir) - -usrlibdir = $(libdir)@MARK64@ -usrlib_LTLIBRARIES = librpmio.la +lib_LTLIBRARIES = librpmio.la librpmio_la_SOURCES = \ argv.c digest.c fts.c macro.c md2.c md4.c rmd128.c rmd160.c tiger.c \ rpmdav.c rpmhook.c rpmio.c rpmlog.c rpmlua.c rpmmalloc.c \ --- rpm-4.4.7/scripts/Makefile.am +++ rpm-4.4.7/scripts/Makefile.am @@ -24,7 +24,7 @@ all: -configdir = ${prefix}/lib/rpm +configdir = $(libdir)/rpm config_SCRIPTS = \ brp-compress brp-python-bytecompile brp-java-gcjcompile brp-redhat \ brp-strip brp-strip-comment-note brp-nobuildrootpath \ --- rpm-4.4.7/tools/Makefile.am +++ rpm-4.4.7/tools/Makefile.am @@ -54,10 +54,6 @@ #rpmdeps_LDFLAGS = $(staticLDFLAGS) rpmdeps_LDADD = $(top_builddir)/build/librpmbuild.la -rpmfile.c: $(top_srcdir)/file/src/file.c - rm -f $@ - ln -s $< $@ - rpmfile_SOURCES = rpmfile.c rpmfile_CFLAGS = -DMAGIC='"$(MAGIC)"' $(INCLUDES) rpmfile_LDADD = $(top_builddir)/rpmio/librpmio.la