Richard W.M. Jones wrote:
On Thu, Nov 27, 2008 at 11:40:52AM +0100, Farkas Levente wrote:
should i wait for your merge or send a new patch?
Send a new patch.
Actually, I'm very busy today, so not sure if I can review it. Dan?
here is my latest patch.
a few comments:
mingw32-filesystem.spec
- add mingw32.sh but not mingw32.csh since csh can't be generated from
macro files
- readd mingw32-make
mingw32-macros.mingw32
- reorder macros use _mingw32_target as the base for others
- add all _mingw32_xxx macros for /usr/bin/i686-pc-mingw32-*
- generate env variable for all /usr/bin/i686-pc-mingw32-*
- rewrite config env too to the same way
mingw32-scripts.sh rewrite i hope it's working now (for me it's working)
mingw32.sh add mingw32-env alias
if it's finally good for everyone i'd like to review and test again all
accepted packages (hope it'd be very quick). then we can go further.
--
Levente "Si vis pacem para bellum!"
Index: mingw32-filesystem.spec
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-filesystem/devel/mingw32-filesystem.spec,v
retrieving revision 1.6
diff -u -u -r1.6 mingw32-filesystem.spec
--- mingw32-filesystem.spec 24 Nov 2008 16:08:07 -0000 1.6
+++ mingw32-filesystem.spec 27 Nov 2008 20:54:54 -0000
@@ -1,8 +1,8 @@
%define debug_package %{nil}
Name: mingw32-filesystem
-Version: 39
-Release: 3%{?dist}
+Version: 40
+Release: 1%{?dist}
Summary: MinGW base filesystem and environment
Group: Development/Libraries
@@ -13,7 +13,7 @@
Source0: mingw32-COPYING
Source1: mingw32-macros.mingw32
-#Source2: mingw32.sh
+Source2: mingw32.sh
#Source3: mingw32.csh
Source4: mingw32-find-requires.sh
Source5: mingw32-find-provides.sh
@@ -75,13 +75,14 @@
mkdir -p $RPM_BUILD_ROOT%{_bindir}
pushd $RPM_BUILD_ROOT%{_bindir}
-for i in mingw32-configure; do
+for i in mingw32-configure mingw32-make; do
ln -s %{_libexecdir}/mingw32-scripts $i
done
popd
-#mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
-#install -m 644 %{SOURCE2} %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
+install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
+#install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.mingw32
@@ -133,15 +134,20 @@
%defattr(-,root,root,-)
%doc COPYING
%config(noreplace) %{_sysconfdir}/rpm/macros.mingw32
-#%config(noreplace) %{_sysconfdir}/profile.d/mingw32.sh
+%config(noreplace) %{_sysconfdir}/profile.d/mingw32.sh
#%config(noreplace) %{_sysconfdir}/profile.d/mingw32.csh
-%{_bindir}/mingw32-configure
+%{_bindir}/mingw32-*
%{_libexecdir}/mingw32-scripts
%{_prefix}/i686-pc-mingw32/
/usr/lib/rpm/mingw32-*
%changelog
+* Tue Nov 25 2008 Levente Farkas
lfarkas@lfarkas.org - 40-1
+- Rewrite mingw32-scripts to run in the current shell
+- Re-add mingw32-make
+- Add mingw32-env to mingw32.sh
+
* Mon Nov 24 2008 Richard W.M. Jones
rjones@redhat.com - 39-3
- Unify mingw32-filesystem packages from all three branches again, and test.
- Fix mingw32-scripts so it can handle extra parameters correctly.
Index: mingw32-macros.mingw32
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-filesystem/devel/mingw32-macros.mingw32,v
retrieving revision 1.4
diff -u -u -r1.4 mingw32-macros.mingw32
--- mingw32-macros.mingw32 24 Nov 2008 16:08:07 -0000 1.4
+++ mingw32-macros.mingw32 27 Nov 2008 20:54:54 -0000
@@ -1,7 +1,9 @@
# RPM macros for Fedora MinGW.
+%_mingw32_target i686-pc-mingw32
+
# Paths.
-%_mingw32_sysroot %{_prefix}/i686-pc-mingw32/sys-root
+%_mingw32_sysroot %{_prefix}/%{_mingw32_target}/sys-root
%_mingw32_prefix %{_mingw32_sysroot}/mingw
%_mingw32_exec_prefix %{_mingw32_prefix}
%_mingw32_bindir %{_mingw32_exec_prefix}/bin
@@ -18,22 +20,33 @@
%_mingw32_includedir %{_mingw32_prefix}/include
# Build macros.
-%_mingw32_host i686-pc-mingw32
-%_mingw32_target i686-pc-mingw32
+%_mingw32_host %{_mingw32_target}
%_mingw32_cflags -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -mms-bitfields
-%_mingw32_cc i686-pc-mingw32-gcc
-%_mingw32_cpp i686-pc-mingw32-gcc -E
-%_mingw32_ar i686-pc-mingw32-ar
-%_mingw32_as i686-pc-mingw32-as
-%_mingw32_dlltool i686-pc-mingw32-dlltool
-%_mingw32_ranlib i686-pc-mingw32-ranlib
-%_mingw32_strip i686-pc-mingw32-strip
-%_mingw32_objdump i686-pc-mingw32-objdump
-%_mingw32_nm i686-pc-mingw32-nm
-%_mingw32_windres i686-pc-mingw32-windres
-%_mingw32_cxx i686-pc-mingw32-g++
+%_mingw32_cc %{_mingw32_target}-gcc
+%_mingw32_cxx %{_mingw32_target}-g++
+%_mingw32_cpp %{_mingw32_target}-gcc -E
+%_mingw32_addr2line %{_mingw32_target}-addr2line
+%_mingw32_ar %{_mingw32_target}-ar
+%_mingw32_as %{_mingw32_target}-as
+%_mingw32_c++ %{_mingw32_target}-c++
+%_mingw32_c++filt %{_mingw32_target}-c++filt
+%_mingw32_dlltool %{_mingw32_target}-dlltool
+%_mingw32_dllwrap %{_mingw32_target}-dllwrap
+%_mingw32_gcov %{_mingw32_target}-gcov
+%_mingw32_gprof %{_mingw32_target}-gprof
+%_mingw32_ld %{_mingw32_target}-ld
+%_mingw32_nm %{_mingw32_target}-nm
+%_mingw32_objcopy %{_mingw32_target}-objcopy
+%_mingw32_objdump %{_mingw32_target}-objdump
+%_mingw32_ranlib %{_mingw32_target}-ranlib
+%_mingw32_readelf %{_mingw32_target}-readelf
+%_mingw32_size %{_mingw32_target}-size
+%_mingw32_strings %{_mingw32_target}-strings
+%_mingw32_strip %{_mingw32_target}-strip
+%_mingw32_windmc %{_mingw32_target}-windmc
+%_mingw32_windres %{_mingw32_target}-windres
%_mingw32_cache mingw32-config.cache
@@ -41,19 +54,23 @@
%_mingw32_findrequires /usr/lib/rpm/mingw32-find-requires.sh
%_mingw32_env HOST_CC=gcc; export HOST_CC; \
- AS="%{_mingw32_as}"; export AS; \
- AR="%{_mingw32_ar}"; export AR; \
- NM="%{_mingw32_nm}"; export NM; \
- OBJDUMP="%{_mingw32_objdump}"; export OBJDUMP; \
PKG_CONFIG_PATH="%{_mingw32_libdir}/pkgconfig"; export PKG_CONFIG_PATH; \
CC="${MINGW32_CC:-%_mingw32_cc}"; export CC; \
CXX="${MINGW32_CXX:-%_mingw32_cxx}"; export CXX; \
CFLAGS="${MINGW32_CFLAGS:-%_mingw32_cflags}"; export CFLAGS; \
CXXFLAGS="${MINGW32_CXXFLAGS:-%_mingw32_cflags}"; export CXXFLAGS; \
- for i in `ls %{_mingw32_bindir}|grep -- "-config$"` ; do \
- CONFIG_NAME=`echo $i|tr "a-z-" "A-Z_"`; \
- declare -x $CONFIG_NAME="%{_mingw32_bindir}/$i" ; export $CONFIG_NAME; \
- done
+ _PREFIX="%{_bindir}/%{_mingw32_target}-"; \
+ for i in `ls ${_PREFIX}*|egrep -v "gcc-"`; do \
+ x=`echo $i|sed "s,${_PREFIX},,"|tr "a-z+-" "A-ZX_"`; \
+ declare -x $x="$i" ; export $x; \
+ done; \
+ unset _PREFIX; \
+ for i in `ls %{_mingw32_bindir}/*|grep -- "-config$"` ; do \
+ x=`basename $i|tr "a-z+-" "A-ZX_"`; \
+ declare -x $x="$i" ; export $x; \
+ done; \
+ unset x i
+
%_mingw32_configure %{_mingw32_env} ; \
./configure --cache-file=%{_mingw32_cache} \\
Index: mingw32-scripts.sh
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-filesystem/devel/mingw32-scripts.sh,v
retrieving revision 1.1
diff -u -u -r1.1 mingw32-scripts.sh
--- mingw32-scripts.sh 24 Nov 2008 16:08:07 -0000 1.1
+++ mingw32-scripts.sh 27 Nov 2008 20:54:54 -0000
@@ -1,6 +1,6 @@
#!/bin/sh -
-# mingw32-configure
+# mingw32-scripts
# Copyright (C) 2008 Red Hat Inc., Richard W.M. Jones.
# Copyright (C) 2008 Levente Farkas
#
@@ -21,7 +21,5 @@
# This is a useful command-line script through which one can use the
# macros from mingw32-macros.mingw32 cross-compilation.
-# XXX This doesn't handle quoting of extra parameters which contain
-# spaces correctly.
-
-rpm --eval "%{_"`basename $0|tr "-" "_"`"} $@"|sh
+NAME="_`basename $0|tr -- - _`"
+eval "`rpm --eval "%{$NAME}"`" "$@"
Index: mingw32.sh
===================================================================
RCS file: /cvs/pkgs/rpms/mingw32-filesystem/devel/mingw32.sh,v
retrieving revision 1.1
diff -u -u -r1.1 mingw32.sh
--- mingw32.sh 30 Oct 2008 09:49:17 -0000 1.1
+++ mingw32.sh 27 Nov 2008 20:54:54 -0000
@@ -1 +1,3 @@
# Environment variables for MinGW.
+
+alias mingw32-env='eval `rpm --eval %{_mingw32_env}`'