summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoretienne2007-11-30 09:46:26 +0000
committeretienne2007-11-30 09:46:26 +0000
commitfd2d8c2d7353292d99a8ae926cedd70339b9d393 (patch)
tree9db2a5cd01a876b6445e1d89c7fcc946a6798919
parent399cea5af494c91726d2f68c7f9e41ff27c48497 (diff)
downloadivylaunch-fd2d8c2d7353292d99a8ae926cedd70339b9d393.zip
ivylaunch-fd2d8c2d7353292d99a8ae926cedd70339b9d393.tar.gz
ivylaunch-fd2d8c2d7353292d99a8ae926cedd70339b9d393.tar.bz2
ivylaunch-fd2d8c2d7353292d99a8ae926cedd70339b9d393.tar.xz
-rw-r--r--FugueConfig.pm41
-rw-r--r--debian/changelog14
-rwxr-xr-xivylaunch4
3 files changed, 43 insertions, 16 deletions
diff --git a/FugueConfig.pm b/FugueConfig.pm
index dfda1b0..9d74e5f 100644
--- a/FugueConfig.pm
+++ b/FugueConfig.pm
@@ -10,21 +10,32 @@ $rsh = "rsh" unless defined $rsh;
# apply cpp to a fugue config file and open resulting pipe
sub open {
- my $file = shift;
- my @cppopts = @_;
- if (system("which cpp > /dev/null")) {
- print "cpp command can't be located\n";
- return undef;
- } elsif (not -f $file) {
- print "No such file '$file'\n";
- return undef;
- } elsif (not -r $file) {
- print "'$file' is unreadable\n";
- return undef;
- }
- my $cppcmd = "cpp -traditional ".join(' ', @cppopts)." $file";
- open (FD, "$cppcmd |") or return undef;
- return \*FD;
+ my $file = shift;
+ my @cppopts = @_;
+ if (system("which cpp > /dev/null")) {
+ print "cpp command can't be located\n";
+ return undef;
+ } elsif (not -f $file) {
+ print "No such file '$file'\n";
+ return undef;
+ } elsif (not -r $file) {
+ print "'$file' is unreadable\n";
+ return undef;
+ }
+ my $cpp_options = join(' ', @cppopts);
+ open (FD, "$file") or return undef;
+ while(<FD>) {
+ chomp;
+ if (/^#cpp_options\s*:\s*(.*)/) {
+ $cpp_options = $1;
+ last;
+ }
+ }
+ close(FD);
+ print "in ivylaunch, cpp options are [$cpp_options]\n";
+ my $cppcmd = "cpp $file $cpp_options";
+ open (FD, "$cppcmd |") or return undef;
+ return \*FD;
} # end open
diff --git a/debian/changelog b/debian/changelog
index a73d454..8bf6661 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,17 @@
+ivylaunch (1.7) unstable; urgency=low
+
+ * Modification de la gestion des options de cpp :
+ . par défaut, cpp est invoqué sans option (précédemment, il était
+ invoqué avec l'option -traditional)
+ . des options cpp peuvent être passées sur la ligne de commande
+ (comportement inchangé)
+ . si dans le fichier scenario, est présente la chaine :
+ #cpp_options: optstring
+ cpp sera invoqué avec les options "optstring" quelles que soient
+ les options passées sur la ligne de commande.
+
+ -- Daniel Etienne <etienne@cena.fr> Fri, 30 Nov 2007 10:07:52 +0100
+
ivylaunch (1.6) unstable; urgency=low
* FugueConfig.pm : modification du process d'exécution des agents pour
diff --git a/ivylaunch b/ivylaunch
index 63c7aa4..8504a2a 100755
--- a/ivylaunch
+++ b/ivylaunch
@@ -300,7 +300,7 @@ the command to execute and its options.
=back
-Before being analysed, the configuration file is parsed by the preprocessor B<cpp>, which provides some facilities like macro expansion. cpp options can be passed on command line.
+Before being analysed, the configuration file is parsed by the preprocessor B<cpp>, which provides some facilities like macro expansion. cpp options can be passed on command line, or be defined in configfile using the #cpp_options keyword. Options defined in configfile overload those that are passed on command line. See the example below.
=head1 EXAMPLE
@@ -319,6 +319,8 @@ where configfile contains :
#define POSITION --acc ACC --wp WP
#endif
+#cpp_options: -traditional
+
begin lasra none xset fp+ tcp/10.192.36.68:7100
global anglo Rejeu rejeu -s 9:10 STR_ATH_01_06_26.rej