openpkg/rpm-config.pod

Tue, 29 Mar 2011 20:04:34 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 29 Mar 2011 20:04:34 +0200
changeset 334
4a34d7a82eab
child 428
f880f219c566
permissions
-rw-r--r--

Rework package yet again, correcting and introducing new buildconf logic:
Conditionally disable bootstrap stage comparison correctly, correct
english grammar, better find system as(1) and ld(1), indotruce detailed
optimization option messages, more completely guess cpu types, allow
profiled bootstrapping without a preinstalled GCC because many other
compilers have long since implemented 64-bit arithmetic, instruct make
to build sequentially (not in sparallel) when building a profiled
bootstrap as GCC online documents recommend, and generally improve
comment blocks.

The single most important correction in this changeset relates to the
GCC changed optimization policy since at least GCC 4.5, in which -march
is always passed and not always correctly guessed. In the case of this
package, allowing GCC to guess the architecture leads to wild build
errors at various subcomponents (zlib, libgcc, libiberty...) and
bootstrap stages. It seems quite platform specific, and the safest
approach to correcting this seems to be explicitly always specifying the
-march argument when bootstrapping GCC. Because the best choice 'native'
is not available when bootstrapping using a foreign (non GCC) compiler,
a guess is made according to rpmmacros l_platform in that case.

It is questionable as to whether these recent optimization changes
on the part of GCC or this package are compatible with each other,
or if either are complete or correct at all. At least applying these
corrections allows this package to build again in most cases test.

     1 ##
     2 ##  rpm-config -- OpenPKG RPM Library Build Utility
     3 ##  Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
     4 ##  Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
     5 ##
     6 ##  Permission to use, copy, modify, and distribute this software for
     7 ##  any purpose with or without fee is hereby granted, provided that
     8 ##  the above copyright notice and this permission notice appear in all
     9 ##  copies.
    10 ##
    11 ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    12 ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    13 ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    14 ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    15 ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    16 ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    17 ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    18 ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    19 ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    20 ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    21 ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    22 ##  SUCH DAMAGE.
    23 ##
    24 ##  rpm-config.pod: manual page
    25 ##
    27 =pod
    29 =head1 NAME
    31 B<rpm-config> - OpenPKG RPM library build utility
    33 =head1 VERSION
    35 OpenPKG RPM RPM_VERSION
    37 =head1 SYNOPSIS
    39 B<rpm-config>
    40 [B<--help>]
    41 [B<--version>]
    42 [B<--cc>]
    43 [B<--cppflags>]
    44 [B<--cflags>]
    45 [B<--ldflags>]
    46 [B<--libs>]
    48 =head1 DESCRIPTION
    50 The B<rpm-config> program is a little helper utility for easy
    51 configuring and building applications based on the OpenPKG RPM library.
    52 It can be used to query the C compiler and linker flags which are
    53 required to correctly compile and link the application against the
    54 RPM library.
    56 =head1 OPTIONS
    58 B<rpm-config> accepts the following options:
    60 =over 4
    62 =item B<--help>
    64 Prints the short usage information.
    66 =item B<--version>
    68 Prints the version number and date of the installed RPM library.
    70 =item B<--cc>
    72 =item B<--cppflags>
    74 Prints the C pre-processor flags (C<-I>) which are needed to compile the
    75 RPM-based application. The output is usually added to the C<CPPFLAGS>
    76 variable of the applications C<Makefile>.
    78 =item B<--cflags>
    80 Prints the C compiler flags which are needed to compile the RPM-based
    81 application. The output is usually added to the C<CFLAGS> variable of the
    82 applications C<Makefile>.
    84 =item B<--ldflags>
    86 Prints the linker flags (C<-L>) which are needed to link the application with
    87 the RPM library. The output is usually added to the C<LDFLAGS> variable of
    88 the applications C<Makefile>.
    90 =item B<--libs>
    92 Prints the library flags (C<-l>) which are needed to link the application with
    93 the RPM library. The output is usually added to the C<LIBS> variable of the
    94 applications C<Makefile>.
    96 =back
    98 =head1 EXAMPLE
   100  CC       = `rpm-config --cc`
   101  CPPFLAGS = `rpm-config --cppflags`
   102  CFLAGS   = `rpm-config --cflags`
   103  LDFLAGS  = `rpm-config --ldflags`
   104  LIBS     = `rpm-config --libs`
   106  all: foo
   108  foo: foo.o
   109      $(CC) $(LDFLAGS) -o foo foo.o $(LIBS)
   111  foo.o: foo.c
   112      $(CC) $(CPPFLAGS) $(CFLAGS) -o foo.o -c foo.c
   114 =head1 SEE ALSO
   116 rpm(1), cc(1).
   118 =head1 AUTHOR
   120  Ralf S. Engelschall
   121  rse@engelschall.com
   122  www.engelschall.com
   124 =cut

mercurial