-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·49 lines (40 loc) · 1.1 KB
/
configure
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/perl
use strict;
use warnings;
my $prefix = '/usr/local';
my $version = '0.2.0';
my $debug = 0;
for (@ARGV)
{
if (/^--prefix=(.*)/)
{
$prefix = $1;
}
elsif (/^--debug/)
{
$debug = 1;
}
else
{
print
"Usage: $0 [OPTION ...]
--prefix=<prefix> specify install location (default /usr/local)
--debug compile for debugging
";
exit;
}
}
unlink 'src/ffind.c';
qx(sed -e "s/\@{VERSION}/$version/" src/ffind.c.in > src/ffind.c);
chmod 0444, 'src/ffind.c';
$prefix .= '/';
$prefix =~ s|/|\\/|g;
my $cflags = ($debug ? '-O0 -g' : '-O2 -fstrict-aliasing -fomit-frame-pointer -DNDEBUG');
unlink 'Makefile';
qx(sed -e "s/\@{PREFIX}/$prefix/g" -e "s/\@{VERSION}/$version/g" -e "s/\@{CFLAGS}/$cflags/g" Makefile.in > Makefile);
chmod 0444, 'Makefile';
#my ($sec, $min, $hour, $mday, $month, $year, $wday, $yday, $dst) = localtime();
#my @months = qw|January February March April May June July August September October November December|;
#my $date = "$mday $months[$month] $year";
my $date = '19 May 2018';
qx(sed -e "s/\@{DATE}/$date/" -e "s/\@{VERSION}/$version/" ffind.1.in > ffind.1);