From 8df919728bad873169d05cc6965b0fa1453bb867 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 12 Apr 2007 23:45:46 +0000 Subject: [PATCH] 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 --- Shorewall-common/lib.config | 14 ---------- Shorewall-common/shorewall | 56 +++++++++++++++++++++++++++++++++++-- Shorewall-shell/compiler | 4 +-- docs/Shorewall-4.xml | 48 +++++++++++++++---------------- 4 files changed, 79 insertions(+), 43 deletions(-) diff --git a/Shorewall-common/lib.config b/Shorewall-common/lib.config index 12b0373bb..39a485644 100644 --- a/Shorewall-common/lib.config +++ b/Shorewall-common/lib.config @@ -1798,20 +1798,6 @@ do_initialize() { # 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) [ -n "$TMP_DIR" ] && chmod 700 $TMP_DIR || \ diff --git a/Shorewall-common/shorewall b/Shorewall-common/shorewall index 49dcbd87a..0e39ed6e9 100755 --- a/Shorewall-common/shorewall +++ b/Shorewall-common/shorewall @@ -244,7 +244,9 @@ compiler() { set +a - if [ -x $sc ]; then + if [ -n "$SHOREWALL_COMPILER" ]; then + compiler="$SHOREWALL_COMPILER" + elif [ -x $sc ]; then if [ -x $pc ]; then compiler= else @@ -450,10 +452,18 @@ compile_command() { EXPORT=Yes option=${option#e} ;; - p*) + P*) PROFILE=Yes + option=${option#P} + ;; + p*) + SHOREWALL_COMPILER=perl option=${option#p} ;; + s*) + SHOREWALL_COMPILER=shell + option=${option#s} + ;; d*) DEBUG=Yes; option=${option#d} @@ -529,10 +539,18 @@ check_command() { EXPORT=Yes option=${option#e} ;; - p*) + P*) PROFILE=Yes + option=${option#P} + ;; + p*) + SHOREWALL_COMPILER=perl option=${option#p} ;; + s*) + SHOREWALL_COMPILER=shell + option=${option#s} + ;; d*) DEBUG=Yes; option=${option#d} @@ -601,6 +619,14 @@ restart_command() { NOROUTES=Yes option=${option#n} ;; + p*) + SHOREWALL_COMPILER=perl + option=${option#p} + ;; + s*) + SHOREWALL_COMPILER=shell + option=${option#s} + ;; *) usage 1 ;; @@ -678,6 +704,14 @@ refresh_command() { finished=1 option= ;; + p*) + SHOREWALL_COMPILER=perl + option=${option#p} + ;; + s*) + SHOREWALL_COMPILER=shell + option=${option#s} + ;; *) usage 1 ;; @@ -755,6 +789,14 @@ safe_commands() { NOROUTES=Yes option=${option#n} ;; + p*) + SHOREWALL_COMPILER=perl + option=${option#p} + ;; + s*) + SHOREWALL_COMPILER=shell + option=${option#s} + ;; *) usage 1 ;; @@ -899,6 +941,14 @@ try_command() { NOROUTES=Yes option=${option#n} ;; + p*) + SHOREWALL_COMPILER=perl + option=${option#p} + ;; + s*) + SHOREWALL_COMPILER=shell + option=${option#s} + ;; *) usage 1 ;; diff --git a/Shorewall-shell/compiler b/Shorewall-shell/compiler index 28af44fb5..06854e800 100755 --- a/Shorewall-shell/compiler +++ b/Shorewall-shell/compiler @@ -5673,13 +5673,13 @@ case "$COMMAND" in check) [ $# -ne 1 ] && usage do_initialize - [ "$SHOREWALL_COMPILER" = perl ] && exec perl $debug /usr/share/shorewall-perl/compiler.pl || compile_firewall + compile_firewall ;; compile) [ $# -ne 2 ] && usage do_initialize - [ "$SHOREWALL_COMPILER" = perl ] && exec perl $debug /usr/share/shorewall-perl/compiler.pl $2 || compile_firewall $2 + compile_firewall $2 ;; call) diff --git a/docs/Shorewall-4.xml b/docs/Shorewall-4.xml index 0e27e7982..c5fcb0304 100644 --- a/docs/Shorewall-4.xml +++ b/docs/Shorewall-4.xml @@ -120,6 +120,30 @@ Shorewall. +
+ Prerequisites for using the Shorewall Version 4 Perl-based + Compiler + + + + Perl (I use Perl 5.8.8 but other versions should work + fine) + + + + Perl Cwd Module + + + + Perl File::Basename Module + + + + Perl File::Temp Module + + +
+
Incompatibilities Introduced in the Shorewall Version 4 Perl-based Compiler @@ -376,30 +400,6 @@ fi
-
- Prerequisites for using the Shorewall Version 4 Perl-based - Compiler - - - - Perl (I use Perl 5.8.8 but other versions should work - fine) - - - - Perl Cwd Module - - - - Perl File::Basename Module - - - - Perl File::Temp Module - - -
-
Compiler Selection