[Ocfs2-commits] manish commits r1857 - trunk
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Thu Jan 27 18:29:56 CST 2005
Author: manish
Date: 2005-01-27 18:29:54 -0600 (Thu, 27 Jan 2005)
New Revision: 1857
Added:
trunk/rpmarch.guess
Modified:
trunk/Config.make.in
trunk/Makefile
trunk/configure.in
Log:
Use rpmarch.guess
Modified: trunk/Config.make.in
===================================================================
--- trunk/Config.make.in 2005-01-27 19:06:59 UTC (rev 1856)
+++ trunk/Config.make.in 2005-01-28 00:29:54 UTC (rev 1857)
@@ -52,8 +52,6 @@
GCCINC = @GCCINC@
-MODULEARCH = @MODULEARCH@
-
KVER =
endif
Modified: trunk/Makefile
===================================================================
--- trunk/Makefile 2005-01-27 19:06:59 UTC (rev 1856)
+++ trunk/Makefile 2005-01-28 00:29:54 UTC (rev 1857)
@@ -2,6 +2,8 @@
include $(TOPDIR)/Preamble.make
+MODULEARCH = $(shell $(TOPDIR)/rpmarch.guess module $(TOPDIR))
+
SUBDIRS = fs docs patches vendor
DIST_FILES = \
@@ -16,7 +18,8 @@
configure \
configure.in \
install-sh \
- mkinstalldirs
+ mkinstalldirs \
+ rpmarch.guess
#
# RHEL3
@@ -31,8 +34,8 @@
rpmbuild -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/redhat/ocfs2-2.4.21-$(patsubst rhel3_%_srpm,%,$@).EL.spec
rhel3_%_rpm: rhel3_%_srpm
- rpmbuild --rebuild --target $(MODULEARCH) "ocfs2-2.4.21-$(patsubst rhel3_%_rpm,%,$@).EL-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
- if test "$(MODULEARCH)" = "x86_64"; then \
+ rpmbuild --rebuild $(MODULEARCH) "ocfs2-2.4.21-$(patsubst rhel3_%_rpm,%,$@).EL-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+ if test "$(MODULEARCH)" = "--target x86_64"; then \
rpmbuild --rebuild --target ia32e "ocfs2-2.4.21-$(patsubst rhel3_%_rpm,%,$@).EL-$(DIST_VERSION)-$(RPM_VERSION).src.rpm" \
fi
@@ -50,7 +53,7 @@
rpmbuild -bs --define "_sourcedir $(TOPDIR)" --define "_srcrpmdir $(TOPDIR)" $(TOPDIR)/vendor/redhat/ocfs2-2.6.9-$(patsubst rhel4_%_srpm,%,$@).EL.spec
rhel4_%_rpm: rhel4_%_srpm
- rpmbuild --rebuild --target $(MODULEARCH) ocfs2-2.6.9-$(patsubst rhel4_%_rpm,%,$@).EL-$(DIST_VERSION)-$(RPM_VERSION).src.rpm
+ rpmbuild --rebuild $(MODULEARCH) ocfs2-2.6.9-$(patsubst rhel4_%_rpm,%,$@).EL-$(DIST_VERSION)-$(RPM_VERSION).src.rpm
#
@@ -66,7 +69,7 @@
rpmbuild -bs --define "_sourcedir `pwd`" --define "_srcrpmdir `pwd`" $(TOPDIR)/vendor/suse/ocfs2-2.6.5-$(patsubst sles9_%_srpm,%,$@).spec
sles9_%_rpm: sles9_%_srpm
- rpmbuild --rebuild --target $(MODULEARCH) "ocfs2-2.6.5-$(patsubst sles9_%_rpm,%,$@)-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
+ rpmbuild --rebuild $(MODULEARCH) "ocfs2-2.6.5-$(patsubst sles9_%_rpm,%,$@)-$(DIST_VERSION)-$(RPM_VERSION).src.rpm"
include $(TOPDIR)/Postamble.make
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2005-01-27 19:06:59 UTC (rev 1856)
+++ trunk/configure.in 2005-01-28 00:29:54 UTC (rev 1857)
@@ -43,17 +43,19 @@
AC_MSG_CHECKING(build architectures)
USERARCH=
-MODULEARCH=
-OCFS_PROCESSOR=
-KERNEL_CFLAGS=
+QUERYFILE=
if test -f /etc/redhat-release; then
- RPMARCH="`rpm -qf /etc/redhat-release --queryformat \"%{ARCH}\"`"
- if test -n "$RPMARCH" -a "$RPMARCH" != "noarch"; then
- USERARCH="$RPMARCH"
- fi
+ QUERYFILE=/etc/redhat-release
+elif test -f /etc/SuSE-release ; then
+ QUERYFILE=/etc/SuSE-release
fi
+RPMARCH="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`"
+if test -n "$RPMARCH" -a "$RPMARCH" != "noarch"; then
+ USERARCH="$RPMARCH"
+fi
+
if test -z "$USERARCH"; then
case "$host_cpu" in
x86_64|ppc|ia64|s390x)
@@ -73,12 +75,11 @@
fi
OCFS_PROCESSOR="$USERARCH"
-MODULEARCH="$USERARCH"
+KERNEL_CFLAGS=
case "$USERARCH" in
ppc)
OCFS_PROCESSOR="ppc64"
- MODULEARCH="$host_cpu"
KERNEL_CFLAGS="-m64"
;;
x86_64)
@@ -86,17 +87,11 @@
;;
i386)
OCFS_PROCESSOR="i686"
- if test -r /etc/SuSE-release; then
- MODULEARCH="i586"
- else
- MODULEARCH="i686"
- fi
;;
esac
-AC_MSG_RESULT($MODULEARCH)
+AC_MSG_RESULT($OCFS_PROCESSOR)
AC_SUBST(OCFS_PROCESSOR)
-AC_SUBST(MODULEARCH)
AC_PROG_CC
AC_PROG_CPP
Added: trunk/rpmarch.guess
===================================================================
--- trunk/rpmarch.guess 2005-01-27 19:06:59 UTC (rev 1856)
+++ trunk/rpmarch.guess 2005-01-28 00:29:54 UTC (rev 1857)
@@ -0,0 +1,69 @@
+#! /bin/sh
+
+mode="$1"
+srcdir="$2"
+
+RPMARCH=
+if test -f /etc/redhat-release ; then
+ QUERYFILE=/etc/redhat-release
+elif test -f /etc/SuSE-release ; then
+ QUERYFILE=/etc/SuSE-release
+elif test -f /etc/UnitedLinux-release ; then
+ QUERYFILE=/etc/UnitedLinux-release
+fi
+
+host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`"
+if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then
+ host_alias=`$srcdir/config.guess`
+ host=`$srcdir/config.sub $host_alias`
+ host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+fi
+
+case "$host_cpu" in
+ x86_64|ppc|ia64|s390x)
+ TOOLSARCH=""
+ ;;
+ i386|i486|i586|i686|i786|k6|k7)
+ TOOLSARCH="i386"
+ ;;
+ ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+ TOOLSARCH="ppc"
+ ;;
+ *)
+ echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2
+ TOOLSARCH=""
+ ;;
+esac
+
+# Only a few of these need to be overwritten from RPM's default
+case "$host_cpu" in
+ i586)
+ MODULEARCH="$host_cpu"
+ ;;
+ i386)
+ MODULEARCH="i686"
+ ;;
+ *)
+ MODULEARCH=""
+ ;;
+esac
+
+case "$mode" in
+ module)
+ if [ -n "$MODULEARCH" ] ; then
+ echo "--target $MODULEARCH"
+ fi
+ ;;
+ tools)
+ if [ -n "$TOOLSARCH" ] ; then
+ echo "--target $TOOLSARCH"
+ fi
+ ;;
+ *)
+ echo "rpmarch.guess: Invalid mode: $mode" >&2
+ echo "error"
+ exit 1
+ ;;
+esac
+
+exit 0
Property changes on: trunk/rpmarch.guess
___________________________________________________________________
Name: svn:executable
+ *
More information about the Ocfs2-commits
mailing list