3 # mpk - top level, user visible script.
4 # Copyright (C) 2008 Cesar Strauss
6 # This file is part of Minipack - an automated build tool.
8 # Minipack is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # Minipack is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Minipack. If not, see <http://www.gnu.org/licenses/>.
25 *) bindir
=$PWD/$bindir;;
28 prefix
=$
(cd $bindir && pwd)
30 recipedir
=$prefix/recipes
31 patchdir
=$prefix/patches
35 export PATH
=$tooldir:$PATH
37 test -f ~
/minipack.conf
&& . ~
/minipack.conf
41 until [ "$topdir" = "/" ]; do
42 if [ -f $topdir/minipack.conf
]; then
50 if [ "$topdir" = "/" ]; then
51 echo Warning
: no minipack.conf found.
55 builddir
=$topdir/build
56 resultdir
=$topdir/result
57 sourcedir
=$topdir/sources
59 test -f $topdir/minipack.conf
&& .
$topdir/minipack.conf
61 # Setup environment variables
62 export PATH
=$resultdir/bin
:$PATH
63 export ACLOCAL
="aclocal -I $resultdir/share/aclocal"
64 export ACLOCAL_FLAGS
="-I $resultdir/share/aclocal"
65 export PKG_CONFIG_LIBDIR
=$resultdir/lib
/pkgconfig
69 name
=$recipedir/$1.recipe
70 if [ ! -f $name ]; then
71 echo >&2 "Recipe for \"$1\" not found."
77 setup_configure_options
()
79 pkg_configure_opt
=$configure_opt
80 pkg_configure_opt
="$pkg_configure_opt --prefix=$resultdir"
82 if [ -n "$host" ]; then
83 pkg_configure_opt
="$pkg_configure_opt --host=$host"
85 if [ -n "$build" ]; then
86 pkg_configure_opt
="$pkg_configure_opt --build=$build"
89 if [ -z "$configure_no_more_flags" ]; then
90 pkg_configure_opt
="$pkg_configure_opt CPPFLAGS=-I$resultdir/include"
91 pkg_configure_opt
="$pkg_configure_opt LDFLAGS=-L$resultdir/lib"
99 echo "$prog: missing argument."
109 tool
=$tooldir/mpk-
$cmd
110 if [ -f $tool ]; then
113 echo $prog: Invalid
command: $cmd