summaryrefslogtreecommitdiff
path: root/scripts/setglobvals.pl
blob: 13288a5cde5d1c5b3e597cc30c7d71e2843a257f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/perl

# The yChat Project (2003)
#
# This script sets up some variables in src/glob.h 

use strict;

use scripts::modules::file;

my $file = 'src/glob.h';
my $gmake = `which gmake`;
my @glob = fopen($file);
chomp($gmake);

print "-> Setting values in $file\n";

my $modified = 0;
foreach (@glob)
{
 if (/^(#define GMAKE) "(.*)"/)
 {
  if ($2 ne "$gmake \\0")
  {
   s/^$1 "$2"/#define GMAKE "$gmake \\0"/;
   print " -> Set $gmake\n";
   fwrite($file,@glob);  
   last;  
  }
 }
}