RPM Community Forums

Mailing List Message of <rpm-devel>

db3 configure wrapper

From: Mark Hatle <mark.hatle@windriver.com>
Date: Fri 29 Jun 2007 - 23:06:37 CEST
Message-ID: <4685745D.9080405@windriver.com>
Any objections to the attached change?

I believe this will work in any POSIX shell.  The idea is instead of
processing all of the arguments and possibly blowing away quoting and
such, we process them one at a time and use shift and set to recreate
the argument list.

In my testing, this fixed the configuration problem I was having.

My configuration is:

CC="ccache gcc" \
CFLAGS="-O2 -march=i486 -mtune=i686 -D__USE_STRING_INLINES
-fomit-frame-pointer -pipe
-I/home/mhatle/build/host-tools/host-cross/include" \
CXX="ccache g++" \
CXXFLAGS="-O2 -march=i486 -mtune=i686 -D__USE_STRING_INLINES -fno-rtti
-fno-implicit-templates -pipe" \
CXXCPP="g++ -E" \
CPP="gcc -E" \
LD="ld" \
LDFLAGS="-s -L/home/mhatle/build/host-tools/host-cross/lib" \
AR="ar" \
AS="as" \
NM="nm" \
OBJCOPY="objcopy" \
OBJDUMP="objdump" \
RANLIB="ranlib" \
STRIP="strip" \
/home/mhatle/build/host-tools/build-tools/rpm5-20070629/configure \
--cache-file=wrs_config_cache \
--prefix=/home/mhatle/build/host-tools/host-cross \
--build=i686-pc-linux-gnu --disable-nls --without-python \
--without-perl --without-selinux \
--without-apidocs

This results in:

configure: running /bin/sh ./configure
'--prefix=/home/mhatle/build/host-tools/h
ost-cross'  '--build=i686-pc-linux-gnu' '--disable-nls'
'--without-python' '--wi
thout-perl' '--without-selinux' '--without-apidocs'
'build_alias=i686-pc-linux-g
nu' 'CC=ccache gcc' 'CFLAGS=-O2 -march=i486 -mtune=i686
-D__USE_STRING_INLINES -
fomit-frame-pointer -pipe
-I/home/mhatle/build/host-tools/host-cross/include' 'L
DFLAGS=-s -L/home/mhatle/build/host-tools/host-cross/lib' 'CPP=gcc -E'
'CXX=ccac
he g++' 'CXXFLAGS=-O2 -march=i486 -mtune=i686 -D__USE_STRING_INLINES
-fno-rtti -
fno-implicit-templates -pipe' 'CXXCPP=g++ -E'
--cache-file=../wrs_config_cache -
-srcdir=.
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: g++
checking build system type... i686-pc-linux-gnu
checking host system type... Invalid configuration `g++': machine `g++'
not reco
gnized
configure: error: /bin/sh ./../db/dist/config.sub g++ failed
mv: cannot stat `Makefile': No such file or directory
cat: Makefile.orig: No such file or directory
mv: cannot stat `db.h': No such file or directory
cat: db.h.orig: No such file or directory



--Mark

Index: CHANGES
===================================================================
RCS file: /v/rpm/cvs/rpm/CHANGES,v
retrieving revision 1.1418
diff -u -r1.1418 CHANGES
--- CHANGES	29 Jun 2007 20:23:06 -0000	1.1418
+++ CHANGES	29 Jun 2007 20:57:53 -0000
@@ -1,4 +1,5 @@
 4.5 -> 5.0:
+    - mgh: change db3 configure wrapper to process one argument at a time
     - mgh: allow rpm to be built w/o neon
     - rse: remove unused rpmio/sexp/ sub-library
     - rse: add "errno" information to be more informative in error message when lstat(2) on verification fails.
Index: db3/configure
===================================================================
RCS file: /v/rpm/cvs/rpm/db3/configure,v
retrieving revision 1.32
diff -u -r1.32 configure
--- db3/configure	27 Jun 2007 21:18:48 -0000	1.32
+++ db3/configure	29 Jun 2007 20:57:53 -0000
@@ -7,7 +7,12 @@
 
 rm -f config.cache
 
-ARGS="`echo $* |\
+# We iterate over the argument list.  Processing the arguments using 
+# echo "$*" can fail with the sed chopping out parts of unrelated 
+# arguments
+set - "$@" eoa_marker
+while [ "$1" != "eoa_marker" ]; do
+   ARG="`echo "$1" | \
        sed -e 's% [^ ]*CFLAGS=[^ ]*%%' \
            -e 's% [^ ]*CC=[^ ]*ccache [^ ]*%%' \
            -e 's% [^ ]*CC=[^ ]*%%' \
@@ -24,6 +29,11 @@
            -e 's%--with-db-mutex%%' \
            -e 's%--without-db-mutex%%' \
 `"
+   shift
+   set - "$@" "$ARG"
+done
+shift
+
 
 #   NOTICE:
 #   1. "--enable-shared" is there for enforcing GNU libtool usage only
Received on Fri Jun 29 23:06:42 2007
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.