Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
0ba48d55
Commit
0ba48d55
authored
18 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
updated dunecontrol to support opts files
[[Imported from SVN: r4506]]
parent
70205fe4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/dunecontrol
+101
-28
101 additions, 28 deletions
bin/dunecontrol
bin/example.opts
+4
-0
4 additions, 0 deletions
bin/example.opts
with
105 additions
and
28 deletions
bin/dunecontrol
+
101
−
28
View file @
0ba48d55
#!/bin/sh
set
-e
if
test
"x
$DEBUG
"
==
"xyes"
;
then
if
test
"x
$1
"
=
"x--debug"
;
then
DEBUG
=
yes
fi
if
test
"x
$DEBUG
"
=
"xyes"
;
then
set
-x
set
-v
fi
...
...
@@ -119,20 +124,22 @@ _build_module() {
}
build_modules
()
{
command
=
run_
$1
command
=
$1
runcommand
=
run_
$command
shift
load_opts
$command
for
m
in
$MODULES
;
do
_build_module
$command
$m
"
$@
"
_build_module
$
run
command
$m
"
$@
"
done
}
usage
()
{
echo
"Usage: build COMMAND [COMMAND-OPTIONS]"
echo
"
COMMAND
S:"
echo
" help"
for
i
in
$COMMANDS
;
do
echo
"
$i
"
done
load_opts
()
{
command
=
$1
COMMAND
=
$(
echo
$command
|
tr
'[:lower:]'
'[:upper:]'
)
if
test
"x
$OPTS_FILE
"
!=
"x"
;
then
echo
"----- loading default flags
\$
${
COMMAND
}
_FLAGS from
$OPTS_FILE
-----"
CMD_PARAMS
=
"
$(
.
$OPTS_FILE
;
eval echo
\$
${
COMMAND
}
_FLAGS
)
"
fi
}
###############################################
...
...
@@ -142,9 +149,11 @@ usage () {
# these can be overwritten in the $CONTROL files
#
COMMANDS
=
"update autogen configure make all"
COMMANDS
=
"autogen configure make all exec"
run_default_nothing
()
{
echo
-n
;
}
run_default_
list
()
{
echo
-n
;
}
run_default_
exec
()
{
bash
-c
"eval
$CMD_PARAMS
"
;
}
run_default_update
()
{
echo
"WARNING: Doing nothing"
;
}
...
...
@@ -177,12 +186,12 @@ run_default_configure () {
PARAMS
=
"
$PARAMS
\"
--with-dunedisc=
$PATH_dune_disc
\"
"
fi
echo
./configure
"
$PARAMS
"
eval
./configure
"
$PARAMS
"
eval
./configure
"
$PARAMS
"
||
exit
1
else
if
test
-f
configure.in
||
test
-f
configure.ac
;
then
echo
"ERROR: configure.[in|ac] found, but configure missing"
echo
"did you forget to run autoconf?"
false
exit
1
fi
fi
}
...
...
@@ -194,13 +203,19 @@ run_default_make () {
}
run_default_all
()
{
load_opts autogen
run_autogen
"
$@
"
load_opts configure
run_configure
"
$@
"
load_opts make
run_make
"
$@
"
}
run_list
()
{
run_default_list
"
$@
"
run_nothing
()
{
run_default_nothing
"
$@
"
}
run_exec
()
{
run_default_exec
"
$@
"
}
run_update
()
{
run_default_update
"
$@
"
...
...
@@ -229,6 +244,24 @@ onfailure() {
exit
1
}
usage
()
{
echo
"Usage:
$0
[OPTIONS] COMMAND [COMMAND-OPTIONS]"
echo
""
echo
"Execute COMMAND for all Dune modules."
echo
"Dependencies are controlled by the dune.module files."
echo
""
echo
"Options:"
echo
" -h, --help show this help"
echo
" --debug enable debug output of this script"
echo
" --opts=FILE load default options from FILE (see dune-common/bin/example.opts)"
echo
"Commands:"
echo
"
\`
help'"
for
i
in
$COMMANDS
;
do
echo
"
\`
$i
'"
done
echo
}
if
test
"x
$1
"
==
"x"
;
then
usage
exit
1
...
...
@@ -236,24 +269,64 @@ fi
trap
onfailure EXIT
command
=
$1
shift
while
test
"x
$1
"
!=
"x"
;
do
# get option
option
=
$1
shift
# get args
set
+e
# stolen from configure...
# when no option is set, this returns an error code
arg
=
`
expr
"x
$option
"
:
'x[^=]*=\(.*\)'
`
set
-e
# switch
case
"
$option
"
in
--opts
=
*
)
if
test
"x
$arg
"
==
"x"
;
then
usage
echo
"ERROR: Parameter for --opts is missing"
echo
exit
1
;
fi
OPTS_FILE
=
$(
cd
$(
dirname
$arg
)
;
pwd
)
/
$(
basename
$arg
)
if
!
test
-r
"
$OPTS_FILE
"
;
then
usage
echo
"ERROR: could not read opts file
\"
$OPTS_FILE
\"
"
echo
exit
1
;
fi
;;
-h
|
--help
)
command
=
help
break
;;
--debug
)
true
;;
*
)
command
=
$option
break
;;
esac
done
if
test
"x
$1
"
!=
"x"
;
then
CMD_PARAMS
=
"
$PARAMS
\"
$1
\"
"
while
shift
;
do
if
test
"x
$1
"
!=
"x"
;
then
CMD_PARAMS
=
"
$PARAMS
\"
$1
\"
"
fi
done
fi
while
test
"x
$1
"
!=
"x"
;
do
# setup paramter list
CMD_PARAMS
=
"
$CMD_PARAMS
\"
$1
\"
"
shift
# disable usage of opts file
if
test
"x
$OPTS_FILE
"
!=
"x"
;
then
echo
"WARNING: commandline parameters will overwrite setting in opts file
\"
$OPTS_FILE
\"
"
fi
OPTS_FILE
=
""
done
case
"
$command
"
in
update
|
autogen
|
configure
|
make
|
all
|
list
)
update
|
autogen
|
configure
|
make
|
all
|
exec
|
nothing
)
find_modules
.
build_modules
$command
"
$@
"
;;
help
|
--help
|
-h
)
help
)
usage
;;
*
)
...
...
This diff is collapsed.
Click to expand it.
bin/example.opts
0 → 100644
+
4
−
0
View file @
0ba48d55
# use these options for configure if no options a provided on the cmdline
AUTOGEN_FLAGS="--ac=2.50 --am=-1.8"
CONFIGURE_FLAGS="CXX=g++-3.4 --prefix='/tmp/Hu Hu'"
MAKE_FLAGS=install
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment