RPM Community Forums

Mailing List Message of <rpm-cvs>

[CVS] RPM: xar/ Makefile.in configure.ac xar/lib/ Makefile.inc.in libx...

From: Anders F. Björklund <afb@rpm5.org>
Date: Wed 12 Sep 2007 - 17:47:42 CEST
Message-Id: <20070912154742.A6E8334844C@rpm5.org>
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Anders F. Björklund
  Root:   /v/rpm/cvs                       Email:  afb@rpm5.org
  Module: xar                              Date:   12-Sep-2007 17:47:42
  Branch: HEAD                             Handle: 2007091216474101

  Added files:
    xar/lib                 libxar.la.in.in
  Modified files:
    xar                     Makefile.in configure.ac
    xar/lib                 Makefile.inc.in
    xar/src                 Makefile.inc.in

  Log:
    allow static build too, fake libtool

  Summary:
    Revision    Changes     Path
    1.3         +2  -0      xar/Makefile.in
    1.5         +23 -0      xar/configure.ac
    1.4         +57 -2      xar/lib/Makefile.inc.in
    1.1         +35 -0      xar/lib/libxar.la.in.in
    1.3         +21 -6      xar/src/Makefile.inc.in
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: xar/Makefile.in
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 Makefile.in
  --- xar/Makefile.in	12 Sep 2007 15:17:37 -0000	1.2
  +++ xar/Makefile.in	12 Sep 2007 15:47:41 -0000	1.3
  @@ -13,6 +13,8 @@
   SHELL := /bin/sh
   CC := @CC@
   LD := @LD@
  +AR := @AR@
  +RANLIB := @RANLIB@
   INSTALL := @INSTALL@
   AUTOCONF := @AUTOCONF@
   
  @@ .
  patch -p0 <<'@@ .'
  Index: xar/configure.ac
  ============================================================================
  $ cvs diff -u -r1.4 -r1.5 configure.ac
  --- xar/configure.ac	30 Aug 2007 18:35:44 -0000	1.4
  +++ xar/configure.ac	12 Sep 2007 15:47:41 -0000	1.5
  @@ -61,6 +61,7 @@
   cfgoutputs="${cfgoutputs} Makefile"
   cfgoutputs="${cfgoutputs} include/xar.h"
   cfgoutputs="${cfgoutputs} lib/Makefile.inc"
  +cfgoutputs="${cfgoutputs} lib/libxar.la.in"
   cfgoutputs="${cfgoutputs} src/Makefile.inc"
   
   cfghdrs="${objroot}cfghdrs.stamp"
  @@ -84,8 +85,30 @@
   
   AC_PROG_INSTALL
   AC_PATH_PROG([LD], [ld], , [$PATH])
  +AC_PATH_PROG([AR], [ar], , [$PATH])
  +AC_PATH_PROG([RANLIB], [ranlib], , [$PATH])
   AC_PATH_PROG([AUTOCONF], [autoconf], , [$PATH])
   
  +dnl Some libtool envy
  +#AC_ENABLE_SHARED
  +AC_MSG_CHECKING([whether to build shared libraries])
  +AC_ARG_ENABLE([shared],
  +    [AC_HELP_STRING([--enable-shared],
  +	[build shared libraries @<:@default=yes@:>@])],
  +	[shared=$enableval],[shared=yes])
  +AC_MSG_RESULT($shared)
  +AC_SUBST([shared])
  +#AC_ENABLE_STATIC
  +AC_MSG_CHECKING([whether to build static libraries])
  +AC_ARG_ENABLE([static],
  +    [AC_HELP_STRING([--enable-static],
  +	[build static libraries @<:@default=yes@:>@])],
  +	[static=$enableval],[static=yes])
  +AC_MSG_RESULT($static)
  +AC_SUBST([static])
  +# Make sure either enable_shared or enable_static is yes.
  +test "$shared" = "yes" || test "$static" = "yes"
  +
   dnl Platform-specific settings.  abi and RPATH can probably be determined
   dnl programmatically, but doing so is error-prone, which makes it generally
   dnl not worth the trouble.
  @@ .
  patch -p0 <<'@@ .'
  Index: xar/lib/Makefile.inc.in
  ============================================================================
  $ cvs diff -u -r1.3 -r1.4 Makefile.inc.in
  --- xar/lib/Makefile.inc.in	30 Aug 2007 18:35:45 -0000	1.3
  +++ xar/lib/Makefile.inc.in	12 Sep 2007 15:47:42 -0000	1.4
  @@ -24,6 +24,8 @@
   # Libraries.  librxar is created such that it's possible to run xar without
   # first installing libxar.
   
  +LIBXAR_LANAME := libxar.la
  +LIBXAR_ANAME := libxar.a
   ifeq (elf, @abi@)
   LIBRXAR_SNAME := librxar.so.@LIB_REV@
   LIBRXAR_LNAME := librxar.so
  @@ -48,6 +50,8 @@
   LIBXAR_LNAME :=
   LIBXAR_L :=
   endif
  +LIBXAR_LA := @objroot@lib/$(LIBXAR_LANAME)
  +LIBXAR_A := @objroot@lib/$(LIBXAR_ANAME)
   LIBRXAR_S := @objroot@lib/$(LIBRXAR_SNAME)
   LIBXAR_S := @objroot@lib/$(LIBXAR_SNAME)
   
  @@ -62,30 +66,55 @@
   # User make'ables.
   #
   
  -lib_all : $(LIBRXAR_S) $(LIBXAR_S)
  +lib_all : lib_shared lib_static $(LIBXAR_LA)
  +ifeq (yes, @shared@)
  +lib_shared : $(LIBRXAR_S) $(LIBXAR_S)
  +else
  +lib_shared :
  +endif
  +ifeq (yes, @static@)
  +lib_static : $(LIBXAR_A)
  +else
  +lib_static :
  +endif
   
  -lib_install : $(LIBXAR_S)
  +lib_install : lib_shared lib_static
   	@INSTALL@ -d $(DESTDIR)$(INCLUDEDIR)/xar
   	@INSTALL@ -m 0644 $(LIBXAR_INCS) $(DESTDIR)$(INCLUDEDIR)/xar
   	@INSTALL@ -d $(DESTDIR)$(LIBDIR)
  +ifeq (yes, @shared@)
   	@INSTALL@ -m 0755 $(LIBXAR_S) $(DESTDIR)$(LIBDIR)
   ifneq ($(words "" $(LIBXAR_LNAME)), 1)
   	rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_LNAME)
   	ln -s $(LIBXAR_SNAME) $(DESTDIR)$(LIBDIR)/$(LIBXAR_LNAME)
   endif
  +endif
  +ifeq (yes, @static@)
  +	@INSTALL@ -m 0644 $(LIBXAR_A) $(DESTDIR)$(LIBDIR)
  +endif
  +	@INSTALL@ -m 0644 $(LIBXAR_LA) $(DESTDIR)$(LIBDIR)
   
   lib_uninstall :
   	rm -rf $(DESTDIR)$(INCLUDEDIR)/xar
  +ifeq (yes, @shared@)
   	rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_SNAME)
   ifneq ($(words "" $(LIBXAR_LNAME)), 1)
   	rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_LNAME)
   endif
  +endif
  +ifeq (yes, @static@)
  +	rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_ANAME)
  +endif
  +	rm -f $(DESTDIR)$(LIBDIR)/$(LIBXAR_LANAME)
   
   lib_clean :
   	rm -f $(LIBRXAR_S) $(LIBRXAR_L)
   	rm -f $(LIBXAR_S) $(LIBXAR_L)
  +	rm -f $(LIBXAR_A) $(LIBXAR_LA)
   	rm -f $(LIBXAR_SRCS:@srcroot@%.c=@objroot@%.o)
   	rm -f $(LIBXAR_SRCS:@srcroot@%.c=@objroot@%.d)
  +	rm -f $(LIBXAR_SRCS:@srcroot@%.c=@objroot@%.static.o)
  +	rm -f $(LIBXAR_SRCS:@srcroot@%.c=@objroot@%.static.d)
   
   lib_distclean :
   
  @@ -134,7 +163,33 @@
   	ln -s $(LIBXAR_SNAME) $(LIBXAR_L)
   endif
   
  +ifeq (yes, @shared@)
  +LT_LIBXAR_SNAME := $(LIBXAR_SNAME)
  +LT_LIBXAR_LNAME := $(LIBXAR_LNAME)
  +else
  +LT_LIBXAR_SNAME :=
  +LT_LIBXAR_LNAME :=
  +endif
  +ifeq (yes, @static@)
  +LT_LIBXAR_ANAME := $(LIBXAR_ANAME)
  +else
  +LT_LIBXAR_ANAME :=
  +endif
  +
  +$(LIBXAR_LA) : $(LIBXAR_LA).in
  +	sed -e s/@LIBXAR_SNAME@/$(LT_LIBXAR_SNAME)/ -e s/@LIBXAR_LNAME@/$(LT_LIBXAR_LNAME)/ -e s/@LIBXAR_ANAME@/$(LT_LIBXAR_ANAME)/ < $< > $@
  +
  +$(LIBXAR_A) : $(LIBXAR_SRCS:@srcroot@%.c=@objroot@%.static.o)
  +	@mkdir -p $(@D)
  +	$(AR) cvr $@ $+
  +	$(RANLIB) $@ 
  +
   @objroot@lib/%.o : @srcroot@lib/%.c
   	@mkdir -p $(@D)
   	$(CC) $(S_CFLAGS) $(CPPFLAGS) -c $< -o $@
   	@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"
  +
  +@objroot@lib/%.static.o : @srcroot@lib/%.c
  +	@mkdir -p $(@D)
  +	$(CC) $(A_CFLAGS) $(CPPFLAGS) -c $< -o $@
  +	@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"
  @@ .
  patch -p0 <<'@@ .'
  Index: xar/lib/libxar.la.in.in
  ============================================================================
  $ cvs diff -u -r0 -r1.1 libxar.la.in.in
  --- /dev/null	2007-09-12 17:44:00 +0200
  +++ libxar.la.in.in	2007-09-12 17:47:42 +0200
  @@ -0,0 +1,35 @@
  +# libxar.la - a libtool library file
  +# Generated by @PACKAGE_STRING@ for libtool
  +#
  +# Please DO NOT delete this file!
  +# It is necessary for linking the library.
  +
  +# The name that we can dlopen(3).
  +dlname='@LIBXAR_SNAME@'
  +
  +# Names of this library.
  +library_names='@LIBXAR_SNAME@ @LIBXAR_LNAME@'
  +
  +# The name of the static archive.
  +old_library='@LIBXAR_ANAME@'
  +
  +# Libraries that this one depends upon.
  +dependency_libs='@LIBS@'
  +
  +# Version information for libxar.
  +current=0
  +age=0
  +revision=@LIB_REV@
  +
  +# Is this an already installed library?
  +installed=no
  +
  +# Should we warn about portability when linking against -modules?
  +shouldnotlink=no
  +
  +# Files to dlopen/dlpreopen
  +dlopen=''
  +dlpreopen=''
  +
  +# Directory that this library needs to be installed in:
  +libdir=''
  @@ .
  patch -p0 <<'@@ .'
  Index: xar/src/Makefile.inc.in
  ============================================================================
  $ cvs diff -u -r1.2 -r1.3 Makefile.inc.in
  --- xar/src/Makefile.inc.in	29 Aug 2007 12:36:30 -0000	1.2
  +++ xar/src/Makefile.inc.in	12 Sep 2007 15:47:42 -0000	1.3
  @@ -25,23 +25,38 @@
   
   src_distclean :
   
  +
  +ifeq (yes, @shared@)
  +LIBRXAR := $(LIBRXAR_S)
  +endif
  +ifeq (yes, @static@)
  +LIBRXAR := $(LIBXAR_A)
  +endif
  +
   # xar links against librxar, so that it can be run without first installing
   # libxar.
  -@objroot@src/% : @objroot@src/%.o $(LIBRXAR_S)
  +@objroot@src/% : @objroot@src/%.o $(LIBRXAR)
   	@mkdir -p $(@D)
   ifneq ($(words "" @RPATH@), 1)
  -	$(CC) $(CFLAGS) -o $@ $< @RPATH@@abs_objroot@lib $(LDFLAGS) -lrxar @LIBS@
  +	$(CC) $(CFLAGS) -o $@ $< @RPATH@@abs_objroot@lib $(LDFLAGS) $(LIBRXAR) @LIBS@
   else
  -	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -lrxar @LIBS@
  +	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBRXAR) @LIBS@
  +endif
  +
  +ifeq (yes, @static@)
  +LIBXAR := $(LIBXAR_A)
  +endif
  +ifeq (yes, @shared@)
  +LIBXAR := $(LIBXAR_S)
   endif
   
   # ixar is the version of the xar binary that gets installed.
  -@objroot@src/i% : @objroot@src/%.o $(LIBXAR_S)
  +@objroot@src/i% : @objroot@src/%.o $(LIBXAR)
   	@mkdir -p $(@D)
   ifneq ($(words "" @RPATH@), 1)
  -	$(CC) $(CFLAGS) -o $@ $< @RPATH@$(LIBDIR) $(LDFLAGS) -lxar @LIBS@
  +	$(CC) $(CFLAGS) -o $@ $< @RPATH@$(LIBDIR) $(LDFLAGS) $(LIBXAR) @LIBS@
   else
  -	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) -lxar @LIBS@
  +	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBXAR) @LIBS@
   endif
   
   @objroot@src/%.o : @srcroot@src/%.c
  @@ .
Received on Wed Sep 12 17:47:42 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.