summaryrefslogtreecommitdiff
path: root/lib/make/setup_configuration.pl
blob: fa8b2fa4ed210077c6f11fc44a3275b34492cdec (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#! /usr/bin/perl -s
#/*@@
#  @file      setup
#  @date      Fri Jan  8 13:48:48 1999
#  @author    Tom Goodale
#  @desc 
#  Prototype setup file for the CCTK
#  @enddesc 
#  @version $Id$
#@@*/

$top = `pwd`;

chop $top;

$configure = "$top/lib/make/configure";

$uname = `uname`;

$uname =~ s/(sn\d\d\d\d|jsimpson)/UNICOS\/mk/;

chop $uname;

if($#ARGV > -1)
{
  $config = shift(@ARGV);
}
else
{
  $config = $uname;
}

# Replace slashes with underscores.
$config =~ s:[/\\]:_:g;

# The build directory doesn't exist.
if (! -d "build" && ! -l "build")
{
  print "Completely new cactus build.  Creating config database\n";

  mkdir("build", 0755)
  
}

chdir build;

# The specified configuration doesn't exist
if (! -d "$config" && ! -l "$config")
{
  print "Creating new configuration $config.\n";

  mkdir("$config",0755);

  chdir "$config";

  mkdir("build",0755);
  mkdir("lib",0755);
  mkdir("config-data",0755);
  mkdir("libraries",0755);

  chdir "config-data";

  $ENV{"EXE"} = "cctk";

  system("$configure");
  chdir "..";
  chdir "..";
}

# Rerun the configure script
if($reconfig)
{
  print "Reconfiguring $config.\n";

  chdir "$config";

  chdir "config-data";

  $ENV{"EXE"} = "cctk";

  system("$configure");
  chdir "..";
  chdir "..";
}