RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs                       Email:  [EMAIL PROTECTED]
  Module: rpm                              Date:   25-Jun-2007 08:22:01
  Branch: HEAD                             Handle: 2007062507220001

  Modified files:
    rpm                     CHANGES Makefile.am configure.ac
    rpm/rpmio               Makefile.am

  Log:
    Cleanup old Autoconf glue for static linking by resurrecting
    functionality under --enable-link-static (only). This way the
    functionality is not lost, but instead of a hard-wired disabling in
    Makefile.am it is not disabled by default via Autoconf.

  Summary:
    Revision    Changes     Path
    1.1393      +1  -0      rpm/CHANGES
    2.175       +1  -1      rpm/Makefile.am
    2.118       +34 -31     rpm/configure.ac
    1.85        +1  -1      rpm/rpmio/Makefile.am
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.1392 -r1.1393 CHANGES
  --- rpm/CHANGES       24 Jun 2007 18:32:03 -0000      1.1392
  +++ rpm/CHANGES       25 Jun 2007 06:22:00 -0000      1.1393
  @@ -1,4 +1,5 @@
   4.5 -> 5.0:
  +    - rse: cleanup Autoconf glue for static linking by resurrecting 
functionality under --enable-link-static
       - rse: replace too weak Autoconf glue for C99 va_copy(3) with a more 
sophisticated solution
       - jbj: add patch macro, renamed to Xpatch until fully wired.
       - jbj: remove support for patch-2.1.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/Makefile.am
  ============================================================================
  $ cvs diff -u -r2.174 -r2.175 Makefile.am
  --- rpm/Makefile.am   24 Jun 2007 20:39:08 -0000      2.174
  +++ rpm/Makefile.am   25 Jun 2007 06:22:00 -0000      2.175
  @@ -47,7 +47,7 @@
        -I$(top_srcdir)/misc \
        @WITH_LIBELF_INCLUDE@
   
  -staticLDFLAGS = # @LDFLAGS_STATIC@ # @LDFLAGS_NPTL@
  +staticLDFLAGS = @LDFLAGS_STATIC@
   
   myLDFLAGS = @WITH_LIBELF_LIB@
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/configure.ac
  ============================================================================
  $ cvs diff -u -r2.117 -r2.118 configure.ac
  --- rpm/configure.ac  25 Jun 2007 06:00:12 -0000      2.117
  +++ rpm/configure.ac  25 Jun 2007 06:22:00 -0000      2.118
  @@ -67,40 +67,43 @@
   fi
   AC_PROG_GCC_TRADITIONAL
   
  -dnl # determine whether to use partial static, full static
  -dnl # standard dynamic linking via GNU libtool
  -AC_MSG_CHECKING(flag used by GNU libtool to link RPM statically)
  +dnl # support static linking of RPM via GNU libtool
   LDFLAGS_STATIC=""
  -case "$target" in
  -        *-*-darwin*)    LDFLAGS_STATIC="";;             # Mac OS X does not 
do static binaries.
  -        *-*-sysv5uw*)   LDFLAGS_STATIC="-static";;      # Unixware has no 
shared libthread.
  -        *-*-linux*)     LDFLAGS_STATIC="-all-static";;
  -        *-*-freebsd*)   LDFLAGS_STATIC="-all-static";;
  -        *-*-osf*)       LDFLAGS_STATIC="";;             # OSF5 has no shared 
pthreads libs
  -        *-*-aix*)       LDFLAGS_STATIC="-static";;      # -Wl,-bnso doesn't 
seem to work...
  -        *-*-hpux*)      LDFLAGS_STATIC="-static";;
  -        *-*-solaris*)   LDFLAGS_STATIC="-static";;
  -        *-*-irix*)      LDFLAGS_STATIC="-static";;      #should be 
-non_shared, but can't link because of crt1.o then.
  -        *-*-ultrix*)    LDFLAGS_STATIC="-all-static";;  #ultrix doesn't have 
shared libs.
  -        *-*-*)          LDFLAGS_STATIC=""; AC_MSG_WARN([
  -Unable to guess what option to pass to GNU libtool to generate a static
  -executable. You will need to set the LDFLAGS_STATIC macro in Makefile.in to
  -the appropriate argument(s) if you want to build a static RPM executable.
  -]);;
  -esac
  -AC_MSG_RESULT($LDFLAGS_STATIC)
  +AC_ARG_ENABLE(link-static,
  +    AS_HELP_STRING([--enable-link-static=ARG], [link RPM statically]), [dnl
  +    AC_MSG_CHECKING(whether to link RPM statically via GNU libtool)
  +    if test ".$enableval" = .yes; then
  +        case "$target" in
  +            *-*-darwin*)    LDFLAGS_STATIC="";;             # Mac OS X does 
not do static binaries.
  +            *-*-sysv5uw*)   LDFLAGS_STATIC="-static";;      # Unixware has 
no shared libthread.
  +            *-*-linux*)     LDFLAGS_STATIC="-all-static";;
  +            *-*-freebsd*)   LDFLAGS_STATIC="-all-static";;
  +            *-*-osf*)       LDFLAGS_STATIC="";;             # OSF5 has no 
shared pthreads libs
  +            *-*-aix*)       LDFLAGS_STATIC="-static";;      # -Wl,-bnso 
doesn't seem to work...
  +            *-*-hpux*)      LDFLAGS_STATIC="-static";;
  +            *-*-solaris*)   LDFLAGS_STATIC="-static";;
  +            *-*-irix*)      LDFLAGS_STATIC="-static";;      # should be 
-non_shared, but can't link because of crt1.o then.
  +            *-*-ultrix*)    LDFLAGS_STATIC="-all-static";;  # ultrix doesn't 
have shared libs.
  +            *-*-*)          LDFLAGS_STATIC="-static";;      # let GNU 
libtool decide how to do it for the particular platform
  +        esac
  +        case "$target" in
  +            *-*-linux*)
  +                dnl # use libpthread.a that is NPTL aware
  +                if test -f /usr/lib/nptl/libpthread.a; then
  +                    LDFLAGS_STATIC="$LDFLAGS_STATIC -L/usr/lib/nptl"
  +                fi
  +                if test -f /usr/lib64/nptl/libpthread.a; then
  +                    LDFLAGS_STATIC="$LDFLAGS_STATIC -L/usr/lib64/nptl"
  +                fi
  +                ;;
  +        esac
  +        AC_MSG_RESULT([yes (flag "$LDFLAGS_STATIC")])
  +    else
  +        AC_MSG_RESULT([no])
  +    fi
  +])
   AC_SUBST(LDFLAGS_STATIC)
   
  -dnl # use libpthread.a that is NPTL aware (static link only).
  -LDFLAGS_NPTL=
  -if test -f /usr/lib/nptl/libpthread.a; then
  -    LDFLAGS_NPTL="-L/usr/lib/nptl"
  -fi
  -if test -f /usr/lib64/nptl/libpthread.a; then
  -    LDFLAGS_NPTL="-L/usr/lib64/nptl"
  -fi
  -AC_SUBST(LDFLAGS_NPTL)
  -
   dnl # old RPM 4.x style platform-specific flag extension hack
   addlib () {
      l=$1
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/Makefile.am
  ============================================================================
  $ cvs diff -u -r1.84 -r1.85 Makefile.am
  --- rpm/rpmio/Makefile.am     24 Jun 2007 18:12:32 -0000      1.84
  +++ rpm/rpmio/Makefile.am     25 Jun 2007 06:22:01 -0000      1.85
  @@ -74,7 +74,7 @@
   thkp_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
   
   tmacro_SOURCES = 
  -tmacro_LDFLAGS = # @LDFLAGS_STATIC@
  +tmacro_LDFLAGS = @LDFLAGS_STATIC@
   tmacro_LDADD = tmacro.o # librpmio.la $(top_builddir)/popt/libpopt.la
   tmacro.o:  macro.c
        $(COMPILE) -DDEBUG_MACROS -o $@ -c $<
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                [email protected]

Reply via email to