Skip to content
Snippets Groups Projects
Commit 4c5d50c3 authored by Ansgar Burchardt's avatar Ansgar Burchardt Committed by Christoph Grüninger
Browse files

dunecontrol: Remove `m4create` command

The `m4create` command was only useful for modules using autotools.
parent b04f0420
Branches
Tags
1 merge request!130[cleanup] Remove scripts related to Autotools, old online testing
......@@ -1030,152 +1030,6 @@ case "$command" in
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])
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])
REQUIRES="$requires"
AC_SUBST(REQUIRES, [$REQUIRES])
AC_CONFIG_MACRO_DIR([$AC_MACRO_DIR])
])
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
fi
done
### ANALYSE MODULE
sort_modules $mainmod
### DEPENDENCIES
for mod in $SORTEDMODULES_DEPS; do
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
###
for mod in $SORTEDMODULES_SUGS; do
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])
EOF
fi
cat >> "$fname" <<EOF
])
EOF
;;
unexport)
echo export DUNE_CONTROL_PATH=""
;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment