[Cbe-oss-dev] [PATCH 4/7]MARS/dist: Add top level configure

Yuji Mano yuji.mano at am.sony.com
Sat Jan 17 07:36:45 EST 2009


From: Kazunori Asayama <asayama at sm.sony.co.jp>

Add top level configure and Makefile

This patch adds configure script and Makefile in the top directory so
build system can build all libraries at the same time.

Signed-off-by: Kazunori Asayama <asayama at sm.sony.co.jp>
---
 Makefile.am     |   44 ++++++++++++++++++++++++++
 base/bootstrap  |   40 ------------------------
 bootstrap       |   92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac.in |   59 +++++++++++++++++++++++++++++++++++
 make-dist       |   48 ++---------------------------
 mars.spec.in    |   46 ++++++----------------------
 task/bootstrap  |   40 ------------------------
 7 files changed, 211 insertions(+), 158 deletions(-)

Index: b/Makefile.am
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ b/Makefile.am	2009-01-08 12:19:48.000000000 +0900
@@ -0,0 +1,44 @@
+## Makefile.am -- Process this file with automake to produce Makefile.in
+#
+#  Copyright 2008 Sony Corporation of America
+#
+#
+#  Permission is hereby granted, free of charge, to any person obtaining
+#  a copy of this Library and associated documentation files (the
+#  "Library"), to deal in the Library without restriction, including
+#  without limitation the rights to use, copy, modify, merge, publish,
+#  distribute, sublicense, and/or sell copies of the Library, and to
+#  permit persons to whom the Library is furnished to do so, subject to
+#  the following conditions:
+#
+#   The above copyright notice and this permission notice shall be
+#   included in all copies or substantial portions of the Library.
+#
+#   If you modify the Library, you may copy and distribute your modified
+#   version of the Library in object code or as an executable provided
+#   that you also do one of the following:
+#
+#    Accompany the modified version of the Library with the complete
+#    corresponding machine-readable source code for the modified version
+#    of the Library; or,
+#
+#    Accompany the modified version of the Library with a written offer
+#    for a complete machine-readable copy of the corresponding source
+#    code of the modified version of the Library.
+#
+#
+#  THE LIBRARY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+#  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+#  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+#  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+#  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+#  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+#  LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY.
+#
+
+SUBDIRS = base task
+DIST_SUBDIRS = base task doxygen samples tests
+
+EXTRA_DIST = bootstrap configure.ac.in mars.spec mars.spec.in
+
+MAINTAINERCLEANFILES = Makefile.in
Index: b/base/bootstrap
===================================================================
--- a/base/bootstrap	2009-01-08 12:19:38.000000000 +0900
+++ b/base/bootstrap	2009-01-08 12:23:16.000000000 +0900
@@ -37,45 +37,7 @@
 #  LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY.
 #
 
-version=
-
-if [ "$1" ]; then
-	version=$1
-elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
-
-	# If available, use the git commit revision for the package version.
-
-	months="Jan:01 Feb:02 Mar:03 Apr:04 May:05 Jun:06 Jul:07 Aug:08 \
-		Sep:09 Oct:10 Nov:11 Dec:12"
-
-	# Add a date prefix for easy reading.
-
-	date=$(git log --pretty=format:"%cD" -1 HEAD)
-
-	# date='Fri, 2 Aug 2007 19:36:06 -0700'
-
-	date=${date##*, }
-	date=${date% [0-9][0-9]:*}
-	day=${date%* [A-Z][a-z][a-z] *}
-	year=${date##* [A-Z][a-z][a-z] 20}
-	month=${date##${day} }
-	month=${month%% 20${year}}
-	month=${months##*${month}:}
-	month=${month%% *}
-	[ ! ${day#[0-9][0-9]} ] || day="0$day"
-
-	version=$(printf '%s.%s.%s-%s%s' ${year} ${month} ${day} g ${head})
-
-	# Add a '-dirty' postfix for uncommitted changes.
-
-	if git diff-index HEAD | read dummy; then
-		version=`printf '%s%s' ${version} -dirty`
-	fi
-else
-	# Default to date and time.
-
-	version="dev-$(date +%y.%m.%d-%H.%M.%S)"
-fi
+version="$1"
 
 set -x
 
Index: b/bootstrap
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ b/bootstrap	2009-01-08 12:19:48.000000000 +0900
@@ -0,0 +1,92 @@
+#! /bin/bash
+#  bootstrap -- Use this script to create generated files from a VCS checkout
+#
+#  Copyright 2008 Sony Corporation of America
+#
+#
+#  Permission is hereby granted, free of charge, to any person obtaining
+#  a copy of this Library and associated documentation files (the
+#  "Library"), to deal in the Library without restriction, including
+#  without limitation the rights to use, copy, modify, merge, publish,
+#  distribute, sublicense, and/or sell copies of the Library, and to
+#  permit persons to whom the Library is furnished to do so, subject to
+#  the following conditions:
+#
+#   The above copyright notice and this permission notice shall be
+#   included in all copies or substantial portions of the Library.
+#
+#   If you modify the Library, you may copy and distribute your modified
+#   version of the Library in object code or as an executable provided
+#   that you also do one of the following:
+#
+#    Accompany the modified version of the Library with the complete
+#    corresponding machine-readable source code for the modified version
+#    of the Library; or,
+#
+#    Accompany the modified version of the Library with a written offer
+#    for a complete machine-readable copy of the corresponding source
+#    code of the modified version of the Library.
+#
+#
+#  THE LIBRARY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+#  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+#  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+#  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+#  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+#  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+#  LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY.
+#
+
+version=
+
+if [ "$1" ]; then
+	version=$1
+elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
+
+	# If available, use the git commit revision for the package version.
+
+	months="Jan:01 Feb:02 Mar:03 Apr:04 May:05 Jun:06 Jul:07 Aug:08 \
+		Sep:09 Oct:10 Nov:11 Dec:12"
+
+	# Add a date prefix for easy reading.
+
+	date=$(git log --pretty=format:"%cD" -1 HEAD)
+
+	# date='Fri, 2 Aug 2007 19:36:06 -0700'
+
+	date=${date##*, }
+	date=${date% [0-9][0-9]:*}
+	day=${date%* [A-Z][a-z][a-z] *}
+	year=${date##* [A-Z][a-z][a-z] 20}
+	month=${date##${day} }
+	month=${month%% 20${year}}
+	month=${months##*${month}:}
+	month=${month%% *}
+	[ ! ${day#[0-9][0-9]} ] || day="0$day"
+
+	version=$(printf '%s.%s.%s-%s%s' ${year} ${month} ${day} g ${head})
+
+	# Add a '-dirty' postfix for uncommitted changes.
+
+	if git diff-index HEAD | read dummy; then
+		version=`printf '%s%s' ${version} -dirty`
+	fi
+else
+	# Default to date and time.
+
+	version="dev-$(date +%y.%m.%d-%H.%M.%S)"
+fi
+
+set -x
+
+sed -e s, at version@,${version},g configure.ac.in > configure.ac
+sed -e s, at version@,${version},g mars.spec.in > mars.spec
+
+ln -sf scripts/acinclude.m4 .
+
+aclocal
+automake --foreign --add-missing --copy
+autoconf
+
+pushd base > /dev/null && ./bootstrap ${version} && popd > /dev/null
+pushd task > /dev/null && ./bootstrap ${version} && popd > /dev/null
Index: b/configure.ac.in
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ b/configure.ac.in	2009-01-08 12:19:48.000000000 +0900
@@ -0,0 +1,59 @@
+## configure.ac -- Process this file with autoconf to produce configure
+#
+#  Copyright 2008 Sony Corporation of America
+#
+#
+#  Permission is hereby granted, free of charge, to any person obtaining
+#  a copy of this Library and associated documentation files (the
+#  "Library"), to deal in the Library without restriction, including
+#  without limitation the rights to use, copy, modify, merge, publish,
+#  distribute, sublicense, and/or sell copies of the Library, and to
+#  permit persons to whom the Library is furnished to do so, subject to
+#  the following conditions:
+#
+#   The above copyright notice and this permission notice shall be
+#   included in all copies or substantial portions of the Library.
+#
+#   If you modify the Library, you may copy and distribute your modified
+#   version of the Library in object code or as an executable provided
+#   that you also do one of the following:
+#
+#    Accompany the modified version of the Library with the complete
+#    corresponding machine-readable source code for the modified version
+#    of the Library; or,
+#
+#    Accompany the modified version of the Library with a written offer
+#    for a complete machine-readable copy of the corresponding source
+#    code of the modified version of the Library.
+#
+#
+#  THE LIBRARY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+#  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+#  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+#  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+#  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+#  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+#  LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY.
+#
+
+AC_INIT([mars], [@version@], [MARS <cbe-oss-dev at ozlabs.org>])
+
+AC_PREFIX_DEFAULT([/usr])
+AC_CONFIG_AUX_DIR([.])
+
+AM_INIT_AUTOMAKE
+
+AC_CONFIG_MARS_HOST
+
+AC_SUBST([DESTDIR])
+AC_CONFIG_FILES([Makefile])
+
+for mars_subdir in base task
+do
+	AS_MKDIR_P([${ac_pwd}/$mars_subdir]) &&
+	pushd ${ac_pwd}/$mars_subdir &&
+	eval "${ac_abs_confdir}/$mars_subdir/configure $ac_configure_args" &&
+	popd || exit 1
+done
+
+AC_OUTPUT
Index: b/make-dist
===================================================================
--- a/make-dist	2009-01-08 12:19:38.000000000 +0900
+++ b/make-dist	2009-01-08 12:19:48.000000000 +0900
@@ -14,58 +14,18 @@ else
 	exit 1
 fi
 
+SRC_DIR=.
 DEST_DIR=.
-DIST_DIR=$DEST_DIR/mars-src-$VERSION
-BASE_DIR=./base
-TASK_DIR=./task
-DOXYGEN_DIR=./doxygen
-SAMPLES_DIR=./samples
-TESTS_DIR=./tests
 
-# create the dist dir
-mkdir $DIST_DIR
+DOXYGEN_DIR=$SRC_DIR/doxygen
 
 # make src dist tarball
-pushd $BASE_DIR
+pushd $SRC_DIR
 ./bootstrap $VERSION
 ./configure --with-mars-platform=cell
 make dist
 popd
-mv $BASE_DIR/mars-base-$VERSION.tar.gz $DIST_DIR
-
-pushd $TASK_DIR
-./bootstrap $VERSION
-./configure --with-mars-platform=cell
-make dist
-popd
-mv $TASK_DIR/mars-task-$VERSION.tar.gz $DIST_DIR
-
-pushd $DOXYGEN_DIR && make dist VERSION=$VERSION && popd
-mv $DOXYGEN_DIR/mars-doxygen-$VERSION.tar.gz $DIST_DIR
-
-pushd $SAMPLES_DIR && make dist VERSION=$VERSION && popd
-mv $SAMPLES_DIR/mars-samples-$VERSION.tar.gz $DIST_DIR
-
-pushd $TESTS_DIR
-make distclean
-popd
-find $TESTS_DIR ! -name '.[^.]*' -type f | tar cf - -T - | tar xf - -C $DIST_DIR
-
-mkdir $DIST_DIR/scripts
-cp scripts/*.m4 $DIST_DIR/scripts/
-
-cp README RELEASES $DIST_DIR
-sed -e "s, at version@,$VERSION,g" mars.spec.in > $DIST_DIR/mars.spec
-
-pushd $DIST_DIR
-tar xvzf mars-base-$VERSION.tar.gz && mv mars-base-$VERSION base
-tar xvzf mars-task-$VERSION.tar.gz && mv mars-task-$VERSION task
-tar xvzf mars-doxygen-$VERSION.tar.gz && mv mars-doxygen-$VERSION doxygen
-tar xvzf mars-samples-$VERSION.tar.gz && mv mars-samples-$VERSION samples
-rm -f *.tar.gz
-popd
-tar cvzf $DIST_DIR.tar.gz $DIST_DIR
-rm -rf $DIST_DIR
+mv $SRC_DIR/mars-$VERSION.tar.gz $DEST_DIR
 
 # make docs dist tarball
 pushd $DOXYGEN_DIR && make docs-dist VERSION=$VERSION && popd
Index: b/mars.spec.in
===================================================================
--- a/mars.spec.in	2009-01-08 12:19:38.000000000 +0900
+++ b/mars.spec.in	2009-01-08 12:19:48.000000000 +0900
@@ -5,7 +5,7 @@ Release: 1
 License: MIT plus and MIT
 Group: System Environment/Libraries
 URL: ftp://ftp.infradead.org/pub/Sony-PS3/mars/
-Source0: ftp://ftp.infradead.org/pub/Sony-PS3/mars/%{version}/mars-src-%{version}.tar.gz
+Source0: ftp://ftp.infradead.org/pub/Sony-PS3/mars/%{version}/mars-%{version}.tar.gz
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 
 Requires: libspe2, numactl
@@ -45,7 +45,7 @@ Requires: %{name} = %{version}
 Samples of MARS (Multicore Application Runtime System).
 
 %prep
-%setup -q -n mars-src-%{version}
+%setup -q -n mars-%{version}
 
 %build
 
@@ -57,58 +57,29 @@ PPU_CFLAGS='-m32'
 PPU_CFLAGS='-m64'
 %endif
 
-tmp_install_dir="`pwd`/install_dir"
-
 %define mars_configure_opts \\\
 	PPU_CC="$PPU_CC" PPU_CFLAGS="$PPU_CFLAGS -g -O2" \\\
-	PPU_CPPFLAGS="-I$tmp_install_dir%{_prefix}/include" \\\
-	PPU_LDFLAGS="-Wl,-L$tmp_install_dir%{_libdir}" \\\
-	SPU_CPPFLAGS="-I$tmp_install_dir%{_prefix}/spu/include" \\\
-	SPU_LDFLAGS="-Wl,-L$tmp_install_dir%{_prefix}/spu/lib" \\\
 	--host=%{_host} \\\
 	--build=%{_build} \\\
 	--prefix=%{_prefix} \\\
 	--libdir=%{_libdir} \\\
 	--with-mars-platform=cell
 
-cd base
-./configure %{mars_configure_opts}
-make
-make DESTDIR="$tmp_install_dir" install
-cd ..
-
-cd task
 ./configure %{mars_configure_opts}
 make
-cd ..
-
-cd doxygen
-make VERSION=%{version}
-cd ..
-
-cd samples
-make VERSION=%{version} dist
-cd ..
 
 %install
 rm -rf %{buildroot}
 
-cd base
 make install DESTDIR=%{buildroot}
-cd ..
 
-cd task
-make install DESTDIR=%{buildroot}
+cd doxygen
+make install DESTDIR=%{buildroot} VERSION=%{version}
 cd ..
 
-mkdir -p %{buildroot}%{_docdir}/%{name}-%{version}
-cp -a doxygen/mars-docs-%{version} %{buildroot}%{_docdir}/%{name}-%{version}/mars-doc
-cp base/{README,COPYING} %{buildroot}%{_docdir}/%{name}-%{version}
-
-mkdir -p %{buildroot}%{_datadir}/%{name}-%{version}
-tar zxf samples/mars-samples-%{version}.tar.gz -C %{buildroot}%{_datadir}/%{name}-%{version}
-mv %{buildroot}%{_datadir}/%{name}-%{version}/mars-samples-%{version} \
-   %{buildroot}%{_datadir}/%{name}-%{version}/samples
+cd samples
+make install DESTDIR=%{buildroot} VERSION=%{version}
+cd ..
 
 %clean
 rm -rf %{buildroot}
@@ -133,6 +104,9 @@ rm -rf %{buildroot}
 %{_datadir}/%{name}-%{version}/samples/*
 
 %changelog
+* Thu Dec 25 2008 Kazunori Asayama <asayama at sm.sony.co.jp> - 1.1.0-2
+- Support top level Makefile and configure.
+
 * Thu Dec 11 2008 Kazunori Asayama <asayama at sm.sony.co.jp> - 1.1.0-1
 - Add task module to the package.
 
Index: b/task/bootstrap
===================================================================
--- a/task/bootstrap	2008-12-24 13:34:29.000000000 +0900
+++ b/task/bootstrap	2009-01-08 12:23:42.000000000 +0900
@@ -37,45 +37,7 @@
 #  LIBRARY OR THE USE OR OTHER DEALINGS IN THE LIBRARY.
 #
 
-version=
-
-if [ "$1" ]; then
-	version=$1
-elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
-
-	# If available, use the git commit revision for the package version.
-
-	months="Jan:01 Feb:02 Mar:03 Apr:04 May:05 Jun:06 Jul:07 Aug:08 \
-		Sep:09 Oct:10 Nov:11 Dec:12"
-
-	# Add a date prefix for easy reading.
-
-	date=$(git log --pretty=format:"%cD" -1 HEAD)
-
-	# date='Fri, 2 Aug 2007 19:36:06 -0700'
-
-	date=${date##*, }
-	date=${date% [0-9][0-9]:*}
-	day=${date%* [A-Z][a-z][a-z] *}
-	year=${date##* [A-Z][a-z][a-z] 20}
-	month=${date##${day} }
-	month=${month%% 20${year}}
-	month=${months##*${month}:}
-	month=${month%% *}
-	[ ! ${day#[0-9][0-9]} ] || day="0$day"
-
-	version=$(printf '%s.%s.%s-%s%s' ${year} ${month} ${day} g ${head})
-
-	# Add a '-dirty' postfix for uncommitted changes.
-
-	if git diff-index HEAD | read dummy; then
-		version=`printf '%s%s' ${version} -dirty`
-	fi
-else
-	# Default to date and time.
-
-	version="dev-$(date +%y.%m.%d-%H.%M.%S)"
-fi
+version="$1"
 
 set -x
 






More information about the cbe-oss-dev mailing list