Newer
Older
--no-builddir)
export DUNE_BUILDDIR=""
;;
--skipversioncheck)
;;
while ! test -f $CONTROL; do
if test "$OLDPWD" = "$PWD"; then
echo "You are not inside the source tree of a DUNE module." >&2
exit -1
fi
done;
parse_control $PWD/$CONTROL
fix_and_assign MODULE "$module"
export SEARCH_MODULES="$SEARCH_MODULES $MODULE"
export ONLY="$ONLY $MODULE"
Christian Engwer
committed
--current-dep)
while ! test -f $CONTROL; do
cd ..
if test "$OLDPWD" = "$PWD"; then
echo "You are not inside the source tree of a DUNE module." >&2
exit -1
fi
done;
parse_control $PWD/$CONTROL
fix_and_assign MODULE "$module"
export SEARCH_MODULES="$SEARCH_MODULES $MODULE"
;;
--reverse)
export REVERSE_FLAG="yes"
;;
--skipfirst)
export SKIPFIRST=yes
;;
Markus Blatt
committed
--use-cmake|--cmake)
export DUNE_USE_CMAKE=yes
Markus Blatt
committed
;;
Markus Blatt
committed
--no-cmake)
export DUNE_USE_CMAKE=no
;;
--debug) true ;; # ignore this option, it is handled right at the beginning
echo "ERROR: Unknown option \`$option'" >&2
echo >&2
exit 1
extract_multiarch
# create PKG_CONFIG_PATH for installed dune modules
for i in $MULTIARCH_LIBDIR lib64 lib32 lib; do
if test -d "$PREFIX_DIR/$i/pkgconfig"; then
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$PREFIX_DIR/$i/pkgconfig"
fi
done
Christian Engwer
committed
# we assume there should be a command...
Christian Engwer
committed
usage
exit 1
fi
print)
create_module_list
eval "print_module_list ' ' $MODULES"
echo >&2
;;
info)
create_module_list
echo $SORTEDMODULES_INFO
;;
export)
create_module_list
DUNE_CONTROL_PATH=""
for mod in $MODULES; do
path="$(eval echo \$PATH_$mod)"
if test -f "$path/dune.module"; then
export DUNE_CONTROL_PATH="$DUNE_CONTROL_PATH:$path/dune.module"
else
if test -f "$path/lib/dunecontrol/$name/dune.module"; then
export DUNE_CONTROL_PATH="$DUNE_CONTROL_PATH:$path/lib/dunecontrol/$name/dune.module"
else
echo "ERROR: while creating list of dune.module files" >&2
echo " couldn't find dune.module file for $name in $path" >&2
echo >&2
exit 1
fi
fi
done
echo export DUNE_CONTROL_PATH=$(echo $DUNE_CONTROL_PATH | $SED -e 's/^://')
;;
printdeps)
find_modules_in_path
if test "x$SEARCH_MODULES" == "x"; then
echo "ERROR: printdeps requires an explicit --module=... parameter" >&2
exit 1
fi
mainmod=`echo $SEARCH_MODULES`
name=`eval echo \\${NAME_$mainmod}`
echo "dependencies for $name"
### DEPENDENCIES
sort_modules $mainmod
for mod in $SORTEDMODULES_DEPS; do
echo " $mod (required)"
done
echo " $mod (suggested)"
done
;;
m4create)
find_modules_in_path
if test "x$SEARCH_MODULES" == "x"; then
echo "ERROR: m4create requires an explicit --module=... parameter" >&2
exit 1
fi
mainmod=`echo $SEARCH_MODULES`
eval mainmodpath="\$PATH_$mainmod"
fname="$mainmodpath/dependencies.m4"
name=`eval echo \\${NAME_$mainmod}`
version=`eval echo \\${VERS_$mainmod}`
maintainer=`eval echo \\${MAIN_$mainmod}`
# get dependencies
eval deps=\$DEPS_$mainmod
#initially remove leading space
deps=`echo "$deps" | $SED 's/^ *//'`
while test -n "$deps"; do
#the end of the name is marked either by space, opening paren
#or comma
depname="${deps%%[ (,]*}"
#remove the name and adjacent whitespace
deps=`echo "$deps" | $SED 's/^[^ (,]* *//'`
#check whether there is a dependency version
case "$deps" in
'('*) deps="${deps#(}"
depver="${deps%%)*}"
deps="${deps#*)}"
;;
*) depver=
;;
esac
#remove any leading whitespace or commas for te next iteration
deps=`echo "$deps" | $SED 's/^[, ]*//'`
requires="$requires $depname $depver "
done
# get suggestions
eval sugs=\$SUGS_$mainmod
#initially remove leading space
sugs=`echo "$sugs" | $SED 's/^ *//'`
while test -n "$sugs"; do
#the end of the name is marked either by space, opening paren
#or comma
sugsname="${sugs%%[ (,]*}"
#remove the name and adjacent whitespace
sugs=`echo "$sugs" | $SED 's/^[^ (,]* *//'`
#check whether there is a dependency version
case "$sugs" in
'('*) sugs="${sugs#(}"
sugsver="${sugs%%)*}"
sugs="${sugs#*)}"
;;
*) sugver=
;;
esac
#remove any leading whitespace or commas for te next iteration
sugs=`echo "$sugs" | $SED 's/^[, ]*//'`
suggests="$suggests $sugsname"
suggestsall="$suggestsall $sugsname $sugsver "
done
# ensure a version number
if test "x$version" = "x"; then version="0.0"; fi
echo "writing $fname"
echo " for $name $version $maintainer"
echo " requires $requires"
echo " suggests $suggestsall"
AC_MACRO_DIR="."
test ! -d m4 || AC_MACRO_DIR=m4
cat > "$fname" <<EOF
# dependencies.m4 generated by dunecontrol
m4_define([DUNE_AC_INIT],[
AC_INIT([$name], [$version], [$maintainer])
Christian Engwer
committed
AM_INIT_AUTOMAKE([foreign 1.9 tar-pax])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
AC_SUBST([DUNE_MOD_VERSION], [$version])
AC_SUBST([DUNE_MOD_NAME], [$name])
AC_SUBST([DUNE_MAINTAINER_NAME], ["$maintainer"])
DUNE_PARSE_MODULE_VERSION([$name], [$version])
])
AC_DEFUN([DUNE_CHECK_MOD_DEPENDENCIES], [
EOF
### initialize AM_CONDITIONAL for suggestions that were not found
for name in $suggests; do
mod=$(fix_variable_name $name)
MOD=`echo $mod | tr [:lower:] [:upper:]`
if test "x$(eval echo \$HAVE_$mod)" = "x"; then
cat >> "$fname" <<EOF
### add a conditional check for $name,
# just in case the module is not available at autogen time
AM_CONDITIONAL([HAVE_${MOD}], false)
EOF
done
### DEPENDENCIES
name=`eval echo \\$NAME_$mod`
MOD=`echo $mod | tr [:lower:] [:upper:]`
cat >> "$fname" <<EOF
### check dependency $name
# invoke checks required by this module
AC_REQUIRE([${MOD}_CHECKS])
# invoke check for this module
AC_REQUIRE([${MOD}_CHECK_MODULE])
if test x\$with_$mod = xno; then
AC_MSG_ERROR([could not find required module _dune_name])
fi
EOF
done
name=`eval echo \\$NAME_$mod`
MOD=`echo $mod | tr [:lower:] [:upper:]`
cat >> "$fname" <<EOF
### check suggestion $name
# invoke checks required by this module
AC_REQUIRE([${MOD}_CHECKS])
# invoke check for this module
AC_REQUIRE([${MOD}_CHECK_MODULE])
if test x\$with_$mod = xno; then
AC_MSG_WARN([could not find suggested module _dune_name])
fi
EOF
done
###
# only test for the module if we really define our own checks
if test -d m4; then
mod=$mainmod
name=`eval echo \\$NAME_$mod`
MOD=`echo $mod | tr [:lower:] [:upper:]`
cat >> "$fname" <<EOF
### invoke checks for $name
AC_REQUIRE([${MOD}_CHECKS])
fi
cat >> "$fname" <<EOF
])
EOF
;;
unexport)
echo export DUNE_CONTROL_PATH=""
;;
help)
usage
;;
*)
set +e
if test "x$USE_CMAKE" = "xno"; then
echo "$PREFIX_DIR" |$GREP "[ ]" >/dev/null
if test "$?" -eq "0"; then
echo "ERROR: The prefix directory path ($PREFIX_DIR) contains spaces. This is not"
echo " supported when using autotools."
echo " Either rename the path or activate CMake with --use-cmake switch."
exit 1
fi
fi
set -e
if test "$1" = "update"; then export SKIPVERSIONCHECK=yes; fi
check_commands "$@"
create_module_list
NAMES=""
BUILDMODULES=""
for mod in $MODULES; do
if test "$(eval echo \$INST_$mod)" != "yes"; then
NAMES="$NAMES$(eval echo \$NAME_$mod) "
BUILDMODULES="$BUILDMODULES$mod "
done
echo "--- going to build $NAMES ---"
Martin Nolte
committed
if test -n "$RESUME_FILE"; then
# write all modules to the resume file
for mod in $MODULES ; do
echo "$mod"
done > "$RESUME_FILE"
fi
for mod in $BUILDMODULES; do
Martin Nolte
committed
if test -n "$RESUME_FILE"; then
# remove the current module from the resume file
modules_togo=`cat "$RESUME_FILE"`
Martin Nolte
committed
for mod_togo in $modules_togo ; do
if test "$mod_togo" != "$mod" ; then
echo "$mod_togo"
fi
done > "$RESUME_FILE"
fi
echo "--- done ---"
;;
esac