This file is indexed.

/usr/sbin/gpt_build_config is in grid-packaging-tools 3.6.7-1.

This file is owned by root:root, with mode 0o755.

The actual contents of the file can be viewed below.

  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
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
#! /usr/bin/perl


my ($prefix, $globus_prefix, $exec_prefix, $bindir, $sbindir, $libdir);
my ($datarootdir, $datadir, $perlmoduledir, $gptdatadir);
my ($gptexecsharedir, $amdir, $pkg_confdir, $aclocaldir);

if (exists $ENV{GPT_LOCATION})
{
    $prefix = $ENV{GPT_LOCATION};
}
else
{
    $prefix = "/usr";
}

if (exists $ENV{GLOBUS_LOCATION})
{
    $globus_prefix = $ENV{GLOBUS_LOCATION};
}
else
{
    $globus_prefix = "/usr";
}

$exec_prefix = "${prefix}";
$bindir = "${exec_prefix}/bin";
$sbindir = "${exec_prefix}/sbin";
$libdir = "${exec_prefix}/lib";
$datarootdir = "${prefix}/share";
$datadir = "${prefix}/share";
$perlmoduledir = "/usr/share/perl5";
$gptdatadir = "${datadir}/globus/gpt";
$gptexecsharedir = "${datadir}/globus/gpt";
$amdir = "${datadir}/globus/amdir";
$pkg_confdir = "${datadir}/globus/gpt";
$aclocaldir = "${datadir}/globus/aclocal";

unshift(@INC, "${perlmoduledir}");

use strict;
use Getopt::Long;
use Config;

#
# Do a perl check for version >= 5.005.
#

if ( ! ( defined eval "require 5.005" ) )
{
    die "GPT requires at least Perl version 5.005";
}

if ( ! ( defined eval "require Grid::GPT::GPTObject" ) )
{
    die("$prefix does not appear to hold a valid GPT installation\n");
}

require Pod::Usage;

my $VERSION = 0.01;
my $srcdir = cwd();
my $srcfile;
my $flavor;
my $static;
my $link;
my $outfile = 'gpt_build_temp.sh';
my $verbose = 0;
my ($help, $man);
my $cflagslist;
my $includeslist;
my $libslist;
my $pkglibslist;
my $pgm_linkslist;
my $lib_linkslist;

GetOptions( 'src=s'=> \$srcfile, 
            'flavor=s'=> \$flavor, 
            'o=s' => \$outfile, 
            'verbose=i' => \$verbose, 
            'static'=> \$static,
            'link=s'=> \$link, # depreciate because all other scripts use -static
	    'help' => \$help) 
  or Pod::Usage::pod2usage(1);

Pod::Usage::pod2usage(0) if $help;

die "ERROR: need a build flavor\n",Pod::Usage::pod2usage(1) if !defined $flavor;
die "ERROR: need a source packaging data file\n",Pod::Usage::pod2usage(1) if !defined $srcfile;

require Grid::GPT::Installation;
require Grid::GPT::PackageFactory;
require Grid::GPT::BuildLine;
use Cwd;

# sub pod2usage {
#   print "gpt-build-config [-verbose -help -static -o=output ] -flavor=build_flavor -src=src_metadata_file\n";
# }

$static = 1 if defined $link and $link eq 'static';

my $factory = new Grid::GPT::PackageFactory;

my $pkg = $factory->type_of_package($srcfile);

$pkg->read_metadata_file($srcfile);

my @pkgdirs;

for my $e ( keys %{$pkg->{'Source_Dependencies'}->{'pkgname-list'}} ) {
   next if ($e =~ /setup/);
   push @pkgdirs, $e;
}

my $installation = new Grid::GPT::Installation( root_package => $pkg,
                                                dep_packages => \@pkgdirs,
                                                deps => 1);

$pkg->{'disable_version_checking'} = 
  $installation->{'disable_version_checking'};

open (OUT, ">$outfile") or die "ERROR: $outfile could not be opened";
#open (DEBUG, ">/tmp/debuggingoutput") or die "ERROR: debuggingoutput could not be opened";

my $depenv = defined $static ? 'BuildStatic' : 'Build';

my $node = $installation->add_package(pkg => $pkg,flavor => $flavor);
$installation->set_depenv($depenv);
$installation->sort_pkgs();

my $libpkgs =  $installation->extract_deptree(
                                              srcpkg => $node,
                                              srcdep => 'lib_link',
                                             );


$libpkgs->check_missing();

my $libenvs = $libpkgs->get_sorted_buildenvs();

my $liblines = Grid::GPT::BuildLine::create_buildlines($libenvs);

my $pgmpkgs =  $installation->extract_deptree(
                                              srcpkg => $node,
                                              srcdep => 'pgm_link',
                                             );


$pgmpkgs->check_missing();

my $pgmenvs = $pgmpkgs->get_sorted_buildenvs();
my $pgmlines = Grid::GPT::BuildLine::create_buildlines($pgmenvs);


my $staticline;


$cflagslist  = $pgmlines->{'cflags'}; 
$includeslist  = $pgmlines->{'includes'}; 
$libslist  = $pgmlines->{'extlibs'}; 
$pkglibslist  = $pgmlines->{'pkglibs'}; 
$pgm_linkslist  = $pgmlines->{'pkglibs'};
$lib_linkslist  = $liblines->{'pkglibs'}; 
$staticline  = defined $static ? "-static " : ""; 

if (defined $static) {
  $pkglibslist=Grid::GPT::BuildLine::convert_static_libs($pkglibslist, $flavor);
  $libslist=Grid::GPT::BuildLine::convert_static_libs($libslist, $flavor);
#  $lib_linkslist=Grid::GPT::BuildLine::convert_static_libs($lib_linkslist, $flavor);
  $pgm_linkslist=Grid::GPT::BuildLine::convert_static_libs($pgm_linkslist, $flavor);
}

print_var("GPT_CONFIG_CFLAGS",$cflagslist);
print_var("GPT_CONFIG_INCLUDES",$includeslist);
print_var("GPT_CONFIG_LIBS",$libslist);
print_var("GPT_CONFIG_PKG_LIBS",$pkglibslist);
#print OUT "GPT_CONFIG_PGM_LINKS=\"$pgm_linkslist\"\n";
#print OUT "GPT_CONFIG_LIB_LINKS=\"$lib_linkslist\"\n"; 
#pgm_links and lib_links are broken at the moment, so we'll put in a hack:
print_var("GPT_CONFIG_PGM_LINKS",$pgm_linkslist);
print_var("GPT_CONFIG_LIB_LINKS",$lib_linkslist);
print_var("GPT_CONFIG_STATIC_LINKLINE",$staticline);

close OUT;
chmod 0755, $outfile;
exit;

sub print_var {
  my ($name, $value) = @_;
  $value = "" if not defined $value;
  $value  =~ s/\s+/ /g;
  print OUT "$name=\"$value\"\n";
}


__END__

=head1 NAME

B<gpt_build_config> - Returns a minimized list of ldflags from a list of globus packages and external libraries.

=head1 SYNOPSIS

gpt_build_config -src <source metadata file> -f <globus_flavor_name> -link [static|shared] 

=head1 DESCRIPTION

B<gpt_build_config> creates a file in it's current directory named
gpt_build_temp.sh that contains a list of necessary flags assembled from 
the build environment metadata of the packages on which the source metadata 
depends.  
This scanning is done recursively to cover the entire dependency tree.
This script was initially inspired by the shell script gnome_config.

=head1 LINK ORDER

The flag list returned by B<gpt_build_config> is assembled in
dependent order.  A dependency between two libraries occurs when one
library needs the symbols of another library in order to link
correctly.  For most linkers the library providing the symbols has to
be linked after the library that needs the symbols.  For
example, from the line:

   -L/opt/Xpm/lib -lXpm -L/usr/lib/X11 -lXm -lX

B<gpt_build_config> assumes that the library Xpm is dependent on Xm which in turn is dependent on X.  In addition, B<gpt_build_config> assumes that Xpm is located in /opt/Xpm/lib and Xm and X are both located in /usr/lib/X11.

=head1 BUGS

Circular dependencies between libraries are not supported.

=head1 AUTHOR

Michael Bletzinger E<lt>mbletzin.ncsa.uiuc.eduE<gt> and Eric Blau
E<lt>eblau.ncsa.uiuc.eduE<gt>

=cut