File: configure

package info (click to toggle)
greenwich 0.8.2-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny, squeeze
  • size: 228 kB
  • ctags: 17
  • sloc: perl: 487; makefile: 106
file content (32 lines) | stat: -rwxr-xr-x 843 bytes parent folder | download | duplicates (3)
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
# simple configure script for greenwich
# $Id: configure,v 1.1 2004/04/07 21:23:42 jodrell Exp $
use strict;
use Getopt::Long;

my ($help, $prefix);
GetOptions('help' => \$help, 'prefix=s' => \$prefix);

if (defined($help)) {
	print <<"END";
Usage: configure [options]
Options:
  --help                  print this message
  --prefix=DIR            installation destination (will use
                          `pkg-config gtk+-2.0 --variable=prefix` by default)
END
} else {
	if (!defined($prefix)) {
		chomp($prefix = `pkg-config gtk+-2.0 --variable=prefix`);
	}
	printf("Configuration options:\n    prefix: %s\nWriting Makefile...\n", $prefix);
	open(SRC, 'Makefile.in');
	open(DST, '>Makefile');
	while (<SRC>) {
		s/\@PREFIX\@/$prefix/g;
		print DST $_;
	}
	close(SRC);
	close(DST);
	print "Now type 'make' to build.\n";
}