RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: rpm/ CHANGES Makefile.am rpm/build/ Makefile.am rpm/ config...

From: Ralf S. Engelschall <rse@rpm5.org>
Date: Tue 26 Jun 2007 - 20:19:09 CEST
Message-Id: <20070626181909.6F4733484E0@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs                       Email:  rse@rpm5.org
  Module: rpm                              Date:   26-Jun-2007 20:19:09
  Branch: HEAD                             Handle: 2007062619190702

  Modified files:
    rpm                     CHANGES Makefile.am configure.ac devtool.conf
    rpm/build               Makefile.am
    rpm/python              Makefile.am
    rpm/rpmdb               Makefile.am
    rpm/tools               Makefile.am debugedit.c

  Log:
    cleanup the elf(3) API related Autoconf glue by nuking the support for
    a local ancient copy and this way simplify the whole build environment
    again (where the ELF stuff was a nasty special case). Also cleanup
    the remaining Autoconf code.
    
    Notice this currently cannot use the RPM_CHECK_LIB macro because of
    the nasty but required LFS related header hacks. Nevertheless, we
    wrap the whole elf(3) API usage into a --with-libelf so it can be
    enabled/disabled explicitly.

  Summary:
    Revision    Changes     Path
    1.1399      +1  -0      rpm/CHANGES
    2.177       +3  -9      rpm/Makefile.am
    2.59        +1  -3      rpm/build/Makefile.am
    2.138       +60 -77     rpm/configure.ac
    2.18        +2  -0      rpm/devtool.conf
    1.71        +1  -3      rpm/python/Makefile.am
    1.60        +2  -4      rpm/rpmdb/Makefile.am
    2.90        +1  -3      rpm/tools/Makefile.am
    2.10        +0  -4      rpm/tools/debugedit.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1398 -r1.1399 CHANGES
  --- rpm/CHANGES	26 Jun 2007 14:02:59 -0000	1.1398
  +++ rpm/CHANGES	26 Jun 2007 18:19:07 -0000	1.1399
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - rse: cleanup elf(3) API related Autoconf glue
       - rse: use --enable-maintainer-mode to enable Automake rebuilds for maintainers only
       - rse: cleanup Automake specifications replace old-style INCLUDES with AM_CPPFLAGS
       - rse: allow one to control/override the /usr/lib64 use via Autoconf option --enable-build-lib64
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/Makefile.am
  ============================================================================
  $ cvs diff -u -r2.176 -r2.177 Makefile.am
  --- rpm/Makefile.am	26 Jun 2007 12:57:14 -0000	2.176
  +++ rpm/Makefile.am	26 Jun 2007 18:19:08 -0000	2.177
  @@ -27,7 +27,6 @@
   	@WITH_FILE_SUBDIR@ \
   	@WITH_NEON_SUBDIR@ \
   	@WITH_BEECRYPT_SUBDIR@ \
  -	@WITH_ELFUTILS_SUBDIR@ \
   	rpmio \
   	rpmdb \
   	lib \
  @@ -44,12 +43,7 @@
   	-I$(top_srcdir)/lib \
   	-I$(top_srcdir)/rpmdb \
   	-I$(top_srcdir)/rpmio \
  -	-I$(top_srcdir)/misc \
  -	@WITH_LIBELF_INCLUDE@
  -
  -staticLDFLAGS = @LDFLAGS_STATIC@
  -
  -myLDFLAGS = @WITH_LIBELF_LIB@
  +	-I$(top_srcdir)/misc
   
   myLDADD = \
   	$(top_builddir)/build/librpmbuild.la \
  @@ -66,13 +60,13 @@
   noinst_HEADERS = build.h debug.h system.h
   
   rpm_SOURCES =		$(top_srcdir)/build.c
  -rpm_LDFLAGS =		$(myLDFLAGS) $(staticLDFLAGS)
  +rpm_LDFLAGS =		@LDFLAGS_STATIC@
   rpm_LDADD =		rpm.o $(myLDADD)
   rpm.o:	$(top_srcdir)/rpmqv.c
   	$(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $<
   
   rpmbuild_SOURCES =	$(top_srcdir)/build.c
  -rpmbuild_LDFLAGS =	$(myLDFLAGS) $(staticLDFLAGS)
  +rpmbuild_LDFLAGS =	@LDFLAGS_STATIC@
   rpmbuild_LDADD =	rpmbuild.o $(myLDADD)
   rpmbuild.o: $(top_srcdir)/rpmqv.c
   	$(COMPILE) -DIAM_RPMBT -o $@ -c $<
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/build/Makefile.am
  ============================================================================
  $ cvs diff -u -r2.58 -r2.59 Makefile.am
  --- rpm/build/Makefile.am	26 Jun 2007 12:57:14 -0000	2.58
  +++ rpm/build/Makefile.am	26 Jun 2007 18:19:08 -0000	2.59
  @@ -11,7 +11,6 @@
   	-I$(top_srcdir)/lib \
   	-I$(top_srcdir)/rpmdb \
   	-I$(top_srcdir)/rpmio \
  -	@WITH_LIBELF_INCLUDE@ \
   	-I$(top_srcdir)/misc
   
   LIBS =
  @@ -32,8 +31,7 @@
   librpmbuild_la_LDFLAGS = -no-undefined -release $(LT_CURRENT).$(LT_REVISION) $(LDFLAGS) \
   	$(top_builddir)/lib/librpm.la \
   	$(top_builddir)/rpmdb/librpmdb.la \
  -	$(top_builddir)/rpmio/librpmio.la \
  -	@WITH_LIBELF_LIB@
  +	$(top_builddir)/rpmio/librpmio.la
   
   if HAVE_LD_VERSION_SCRIPT
   librpmbuild_la_LDFLAGS += -Wl,--version-script=$(srcdir)/librpmbuild.vers
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/configure.ac
  ============================================================================
  $ cvs diff -u -r2.137 -r2.138 configure.ac
  --- rpm/configure.ac	26 Jun 2007 14:02:59 -0000	2.137
  +++ rpm/configure.ac	26 Jun 2007 18:19:08 -0000	2.138
  @@ -530,19 +530,21 @@
   
   AC_MSG_HEADER([THIRD-PARTY LIBRARIES (1/2)])
   
  -dnl # check for libelf library. Prefer external, then internal, otherwise none.
  -WITH_ELFUTILS_SUBDIR=
  -WITH_LIBELF_INCLUDE=
  -WITH_LIBELF_LIB=
  -AC_CHECK_HEADERS([libelf.h])
  -
  -dnl # libelf.h on Solaris is incompatible with Largefile support.  If
  -dnl # we couldn't include libelf.h, see if we can when _FILE_ACCESS_BITS is
  -dnl # set for non-LFS.
  -if test X"$ac_cv_header_libelf_h" = X"no" ; then
  -  AC_MSG_CHECKING([if libelf.h conflicts with _LARGEFILE_SOURCE])
  -  AC_COMPILE_IFELSE(
  -  [AC_LANG_PROGRAM([[
  +dnl # optional ELF support
  +WITH_LIBELF_DEBUGEDIT=""
  +AC_MSG_CHECKING([whether to use libelf/gelf API])
  +AC_ARG_WITH(libelf, AS_HELP_STRING([--with-libelf], [use libelf/gelf API]), [
  +    if test ".$withval" = .yes; then
  +        AC_MSG_RESULT(yes)
  +        AC_CHECK_HEADERS([libelf.h gelf.h])
  +        if test ".$ac_cv_header_libelf_h" = .no; then
  +            dnl # <libelf.h> on Solaris is incompatible with LFS. If we couldn't
  +            dnl # include <libelf.h>, see if we can when _FILE_OFFSET_BITS is
  +            dnl # set for non-LFS. Same applies for <gelf.h>, since it probably
  +            dnl # includes <libelf.h>
  +            AC_MSG_CHECKING([if libelf.h conflicts with _LARGEFILE_SOURCE])
  +            AC_COMPILE_IFELSE([
  +                AC_LANG_PROGRAM([[
   #undef _LARGEFILE64_SOURCE
   #undef _LARGEFILE_SOURCE
   #if !defined(_LP64)
  @@ -550,22 +552,22 @@
   # define _FILE_OFFSET_BITS 32
   #endif
   #include <libelf.h>
  -]],[[Elf_Data foo;]])],
  -  [AC_DEFINE(HAVE_LIBELF_H, 1, [Define to 1 if you have libelf.h])
  -   AC_DEFINE(LIBELF_H_LFS_CONFLICT, 1,
  -	[Define to 1 if libelf.h is incompatible with the Large Files API])
  -   AC_MSG_RESULT(yes)
  -  ],
  -  [AC_MSG_RESULT(no)]
  - )
  -fi
  -
  -AC_CHECK_HEADERS([gelf.h])
  -dnl # same for gelf.h, since it probably includes libelf.h
  -if test X"$ac_cv_header_gelf_h" = X"no" ; then
  -  AC_MSG_CHECKING([if gelf.h conflicts with _LARGEFILE_SOURCE])
  -  AC_COMPILE_IFELSE(
  -  [AC_LANG_PROGRAM([[
  +                ]], [[
  +                    Elf_Data foo;
  +                ]])
  +            ], [
  +                AC_DEFINE(HAVE_LIBELF_H, 1, [Define to 1 if you have libelf.h])
  +                ac_cv_header_libelf_h=yes
  +                AC_DEFINE(LIBELF_H_LFS_CONFLICT, 1, [Define to 1 if libelf.h is incompatible with LFS API])
  +                AC_MSG_RESULT(yes)
  +            ], [
  +                AC_MSG_RESULT(no)
  +            ])
  +        fi
  +        if test ".$ac_cv_header_gelf_h" = .no; then
  +            AC_MSG_CHECKING([if gelf.h conflicts with _LARGEFILE_SOURCE])
  +            AC_COMPILE_IFELSE([
  +                AC_LANG_PROGRAM([[
   #undef _LARGEFILE64_SOURCE
   #undef _LARGEFILE_SOURCE
   #if !defined(_LP64)
  @@ -573,55 +575,36 @@
   # define _FILE_OFFSET_BITS 32
   #endif
   #include <gelf.h>
  -]],[[Elf32_Verdef foo;]])],
  -  [AC_DEFINE(HAVE_GELF_H, 1, [Define to 1 if you have gelf.h])
  -   ac_cv_header_gelf_h=yes
  -   AC_MSG_RESULT(yes)
  -  ],
  -  [AC_MSG_RESULT(no)]
  - )
  -fi
  -
  -dnl # if we found gelf.h, look for libelf and see if it has gelf_getvernaux
  -if test X"$ac_cv_header_gelf_h" = X"yes" ; then
  -	AC_CHECK_LIB(elf, elf_version, [
  -    		AC_DEFINE(HAVE_LIBELF, 1,
  -		  [Define to 1 if you have the 'elf' library (-lelf).])
  -    		WITH_LIBELF_LIB="-lelf"
  -		AC_CHECK_LIB(elf, gelf_getvernaux, [
  -		  AC_DEFINE(HAVE_GELF_GETVERNAUX, 1,
  -		  [Define to 1 if you have the gelf_getvernaux() function.])
  -		])
  -	])
  -else
  -	# allow for an internalized elfutils
  -	if test -d elfutils/libelf ; then
  -	    AC_DEFINE(HAVE_GELF_H, 1, [Define to 1 if you have the <gelf.h> header file.])
  -	    AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have the 'elf' library (-lelf).])
  -	    WITH_ELFUTILS_SUBDIR=elfutils
  -	    WITH_LIBELF_INCLUDE="-I\${top_srcdir}/${WITH_ELFUTILS_SUBDIR}/libelf"
  -	    WITH_LIBELF_LIB="\${top_builddir}/${WITH_ELFUTILS_SUBDIR}/libelf/libelf.a"
  -	fi
  -fi
  -
  -AC_SUBST(WITH_ELFUTILS_SUBDIR)
  -AC_SUBST(WITH_LIBELF_INCLUDE)
  -AC_SUBST(WITH_LIBELF_LIB)
  -
  -WITH_LIBDWARF_INCLUDE=
  -WITH_LIBDWARF_DEBUGEDIT=
  -AC_CHECK_HEADER([dwarf.h], [
  -  AC_DEFINE(HAVE_DWARF_H, 1, [Define to 1 if you have the <dwarf.h> header file.])
  -  WITH_LIBDWARF_DEBUGEDIT="debugedit"
  -],[
  -  if test -d elfutils/libdwarf ; then
  -    AC_DEFINE(HAVE_DWARF_H, 1, [Define to 1 if you have the <dwarf.h> header file.])
  -    WITH_LIBDWARF_INCLUDE="-I\${top_srcdir}/${WITH_ELFUTILS_SUBDIR}/libdwarf"
  -    WITH_LIBDWARF_DEBUGEDIT="debugedit"
  -  fi
  +                ]], [[
  +                    Elf32_Verdef foo;
  +                ]])
  +            ], [
  +                AC_DEFINE(HAVE_GELF_H, 1, [Define to 1 if you have gelf.h])
  +                ac_cv_header_gelf_h=yes
  +                AC_MSG_RESULT(yes)
  +            ], [
  +                AC_MSG_RESULT(no)
  +          ])
  +        fi
  +        if test ".$ac_cv_header_gelf_h" = .yes; then
  +            AC_CHECK_LIB([elf], [elf_version], [
  +                AC_CHECK_LIB([elf], [gelf_getvernaux], [
  +                    AC_DEFINE(HAVE_GELF_GETVERNAUX, 1, [Define to 1 if you have the gelf_getvernaux() function.])
  +                ])
  +                AC_DEFINE(HAVE_LIBELF, 1, [Define to 1 if you have ELF library])
  +                WITH_LIBELF_DEBUGEDIT="debugedit"
  +                LIBS="$LIBS -lelf"
  +            ])
  +        else
  +            AC_ERROR([libelf/gelf API requested but not found or not usable])
  +        fi
  +    else
  +        AC_MSG_RESULT(no)
  +    fi
  +], [
  +    AC_MSG_RESULT(no)
   ])
  -AC_SUBST(WITH_LIBDWARF_INCLUDE)
  -AC_SUBST(WITH_LIBDWARF_DEBUGEDIT)
  +AC_SUBST(WITH_LIBELF_DEBUGEDIT)
   
   dnl # optional SELinux support
   WITH_SELINUX_LIB=
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  ============================================================================
  $ cvs diff -u -r2.17 -r2.18 devtool.conf
  --- rpm/devtool.conf	26 Jun 2007 14:02:59 -0000	2.17
  +++ rpm/devtool.conf	26 Jun 2007 18:19:08 -0000	2.18
  @@ -60,6 +60,8 @@
           --with-neon=external \
           --with-bzip2=external \
           --with-popt=external \
  +        --with-libelf \
  +        --with-selinux \
           --enable-build-warnings \
           --enable-build-pic \
           --enable-build-pie \
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/python/Makefile.am
  ============================================================================
  $ cvs diff -u -r1.70 -r1.71 Makefile.am
  --- rpm/python/Makefile.am	26 Jun 2007 12:57:15 -0000	1.70
  +++ rpm/python/Makefile.am	26 Jun 2007 18:19:08 -0000	1.71
  @@ -17,7 +17,6 @@
   	-I$(top_srcdir)/lib \
   	-I$(top_srcdir)/rpmdb \
   	-I$(top_srcdir)/rpmio \
  -	@WITH_LIBELF_INCLUDE@ \
   	-I$(top_srcdir)/misc \
   	-I$(pyincdir)
   
  @@ -30,8 +29,7 @@
   	$(top_builddir)/build/librpmbuild.la \
   	$(top_builddir)/lib/librpm.la \
   	$(top_builddir)/rpmdb/librpmdb.la \
  -	$(top_builddir)/rpmio/librpmio.la \
  -	@WITH_LIBELF_LIB@
  +	$(top_builddir)/rpmio/librpmio.la
   
   LDADD =
   LIBS =
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/Makefile.am
  ============================================================================
  $ cvs diff -u -r1.59 -r1.60 Makefile.am
  --- rpm/rpmdb/Makefile.am	26 Jun 2007 12:57:15 -0000	1.59
  +++ rpm/rpmdb/Makefile.am	26 Jun 2007 18:19:08 -0000	1.60
  @@ -9,8 +9,7 @@
   	-I$(top_srcdir)/build \
   	-I$(top_srcdir)/lib \
   	-I$(top_srcdir)/rpmio \
  -	-I$(top_srcdir)/misc \
  -	@WITH_LIBELF_INCLUDE@
  +	-I$(top_srcdir)/misc
   
   EXTRA_DIST = db3.c sqlite.c db_emu.h librpmdb.vers
   
  @@ -52,8 +51,7 @@
   	poptDB.c rpmdb.c \
   	tagname.c tagtbl.c
   librpmdb_la_LDFLAGS = -no-undefined -release $(LT_CURRENT).$(LT_REVISION) \
  -	$(top_builddir)/rpmio/librpmio.la \
  -	@WITH_LIBELF_LIB@
  +	$(top_builddir)/rpmio/librpmio.la
   librpmdb_la_LIBADD = $(DBLIBOBJS) $(libdb_la)
   librpmdb_la_DEPENDENCIES = $(DBLIBOBJS) $(libdb_la)
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tools/Makefile.am
  ============================================================================
  $ cvs diff -u -r2.89 -r2.90 Makefile.am
  --- rpm/tools/Makefile.am	26 Jun 2007 12:57:16 -0000	2.89
  +++ rpm/tools/Makefile.am	26 Jun 2007 18:19:09 -0000	2.90
  @@ -7,7 +7,6 @@
   	-I$(top_srcdir)/lib \
   	-I$(top_srcdir)/rpmdb \
   	-I$(top_srcdir)/rpmio \
  -	@WITH_LIBELF_INCLUDE@ \
   	-I$(top_srcdir)/misc
   
   EXTRA_DIST =	hashtab.h
  @@ -18,12 +17,11 @@
   
   pkglibdir =		@USRLIBRPM@
   versionlibdir =		$(pkglibdir)/@VERSION@
  -versionlib_PROGRAMS =	rpmdeps @WITH_LIBDWARF_DEBUGEDIT@
  +versionlib_PROGRAMS =	rpmdeps @WITH_LIBELF_DEBUGEDIT@
   
   convertdb1_SOURCES =	convertdb1.c
   
   debugedit_SOURCES =	debugedit.c hashtab.c
  -debugedit_LDADD =	@WITH_LIBELF_LIB@
   
   rpmdeps_SOURCES =	rpmdeps.c
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/tools/debugedit.c
  ============================================================================
  $ cvs diff -u -r2.9 -r2.10 debugedit.c
  --- rpm/tools/debugedit.c	25 May 2007 17:36:41 -0000	2.9
  +++ rpm/tools/debugedit.c	26 Jun 2007 18:19:09 -0000	2.10
  @@ -35,9 +35,6 @@
   
   #include <gelf.h>
   
  -#if 0		/* XXX compile without dwarf.h */
  -#include <dwarf.h>
  -#else
   /* some defines taken from the dwarf standard */
   
   #define DW_TAG_compile_unit	0x11
  @@ -67,7 +64,6 @@
   #define DW_FORM_ref8		0x14
   #define DW_FORM_ref_udata	0x15
   #define DW_FORM_indirect	0x16
  -#endif
   
   #include "hashtab.h"
   
  @@ .
Received on Tue Jun 26 20:19:09 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.