Allow compiler to be specified on the run-line

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5912 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-04-12 23:45:46 +00:00
parent 5f04c869ab
commit 8df919728b
4 changed files with 79 additions and 43 deletions

View File

@ -1798,20 +1798,6 @@ do_initialize() {
# #
ensure_config_path ensure_config_path
if [ $PROGRAM = compiler ]; then
case "${SHOREWALL_COMPILER:=shell}" in
perl)
export CONFIG_PATH;
return;
;;
shell)
;;
*)
startup_error "Invalid value ($SHOREWALL_COMPILER) for SHOREWALL_COMPILER"
;;
esac
fi
TMP_DIR=$(mktempdir) TMP_DIR=$(mktempdir)
[ -n "$TMP_DIR" ] && chmod 700 $TMP_DIR || \ [ -n "$TMP_DIR" ] && chmod 700 $TMP_DIR || \

View File

@ -244,7 +244,9 @@ compiler() {
set +a set +a
if [ -x $sc ]; then if [ -n "$SHOREWALL_COMPILER" ]; then
compiler="$SHOREWALL_COMPILER"
elif [ -x $sc ]; then
if [ -x $pc ]; then if [ -x $pc ]; then
compiler= compiler=
else else
@ -450,10 +452,18 @@ compile_command() {
EXPORT=Yes EXPORT=Yes
option=${option#e} option=${option#e}
;; ;;
p*) P*)
PROFILE=Yes PROFILE=Yes
option=${option#P}
;;
p*)
SHOREWALL_COMPILER=perl
option=${option#p} option=${option#p}
;; ;;
s*)
SHOREWALL_COMPILER=shell
option=${option#s}
;;
d*) d*)
DEBUG=Yes; DEBUG=Yes;
option=${option#d} option=${option#d}
@ -529,10 +539,18 @@ check_command() {
EXPORT=Yes EXPORT=Yes
option=${option#e} option=${option#e}
;; ;;
p*) P*)
PROFILE=Yes PROFILE=Yes
option=${option#P}
;;
p*)
SHOREWALL_COMPILER=perl
option=${option#p} option=${option#p}
;; ;;
s*)
SHOREWALL_COMPILER=shell
option=${option#s}
;;
d*) d*)
DEBUG=Yes; DEBUG=Yes;
option=${option#d} option=${option#d}
@ -601,6 +619,14 @@ restart_command() {
NOROUTES=Yes NOROUTES=Yes
option=${option#n} option=${option#n}
;; ;;
p*)
SHOREWALL_COMPILER=perl
option=${option#p}
;;
s*)
SHOREWALL_COMPILER=shell
option=${option#s}
;;
*) *)
usage 1 usage 1
;; ;;
@ -678,6 +704,14 @@ refresh_command() {
finished=1 finished=1
option= option=
;; ;;
p*)
SHOREWALL_COMPILER=perl
option=${option#p}
;;
s*)
SHOREWALL_COMPILER=shell
option=${option#s}
;;
*) *)
usage 1 usage 1
;; ;;
@ -755,6 +789,14 @@ safe_commands() {
NOROUTES=Yes NOROUTES=Yes
option=${option#n} option=${option#n}
;; ;;
p*)
SHOREWALL_COMPILER=perl
option=${option#p}
;;
s*)
SHOREWALL_COMPILER=shell
option=${option#s}
;;
*) *)
usage 1 usage 1
;; ;;
@ -899,6 +941,14 @@ try_command() {
NOROUTES=Yes NOROUTES=Yes
option=${option#n} option=${option#n}
;; ;;
p*)
SHOREWALL_COMPILER=perl
option=${option#p}
;;
s*)
SHOREWALL_COMPILER=shell
option=${option#s}
;;
*) *)
usage 1 usage 1
;; ;;

View File

@ -5673,13 +5673,13 @@ case "$COMMAND" in
check) check)
[ $# -ne 1 ] && usage [ $# -ne 1 ] && usage
do_initialize do_initialize
[ "$SHOREWALL_COMPILER" = perl ] && exec perl $debug /usr/share/shorewall-perl/compiler.pl || compile_firewall compile_firewall
;; ;;
compile) compile)
[ $# -ne 2 ] && usage [ $# -ne 2 ] && usage
do_initialize do_initialize
[ "$SHOREWALL_COMPILER" = perl ] && exec perl $debug /usr/share/shorewall-perl/compiler.pl $2 || compile_firewall $2 compile_firewall $2
;; ;;
call) call)

View File

@ -120,6 +120,30 @@
Shorewall.</para> Shorewall.</para>
</section> </section>
<section>
<title>Prerequisites for using the Shorewall Version 4 Perl-based
Compiler</title>
<itemizedlist>
<listitem>
<para>Perl (I use Perl 5.8.8 but other versions should work
fine)</para>
</listitem>
<listitem>
<para>Perl Cwd Module</para>
</listitem>
<listitem>
<para>Perl File::Basename Module</para>
</listitem>
<listitem>
<para>Perl File::Temp Module</para>
</listitem>
</itemizedlist>
</section>
<section> <section>
<title>Incompatibilities Introduced in the Shorewall Version 4 Perl-based <title>Incompatibilities Introduced in the Shorewall Version 4 Perl-based
Compiler</title> Compiler</title>
@ -376,30 +400,6 @@ fi</programlisting>
</orderedlist> </orderedlist>
</section> </section>
<section>
<title>Prerequisites for using the Shorewall Version 4 Perl-based
Compiler</title>
<itemizedlist>
<listitem>
<para>Perl (I use Perl 5.8.8 but other versions should work
fine)</para>
</listitem>
<listitem>
<para>Perl Cwd Module</para>
</listitem>
<listitem>
<para>Perl File::Basename Module</para>
</listitem>
<listitem>
<para>Perl File::Temp Module</para>
</listitem>
</itemizedlist>
</section>
<section> <section>
<title>Compiler Selection</title> <title>Compiler Selection</title>