source: box/trunk/infrastructure/setupexternal.pl @ 536

Revision 536, 1.2 KB checked in by martin, 6 years ago (diff)

This is part 1 of a patch from James O'Gorman.

configure now detects perl executable location and updates all scripts to use the correct path; also adds PERL_EXECUTABLE define to BoxConfig?.h. makebuildenv.pl adds PERL define to all makefiles.

  • Property svn:eol-style set to native
Line 
1#!@PERL@
2use strict;
3
4# This script links in the essential directories and processes various
5# files to allow the Box libraries to be used in projects outside the main
6# box library tree.
7
8# directories to link through
9my @linkdirs = qw/lib infrastructure/;
10
11# ----------------------------------------------------
12
13my $libdir = $ARGV[0];
14die "Provided library dir $libdir does not exist" unless -d $libdir;
15
16# Check and remove links from the directory, then add new symlinks
17for my $d (@linkdirs)
18{
19        if(-e $d)
20        {
21                die "In project, $d is not a symbolic link"
22                        unless -l $d;
23                print "Removing existing symlink $d\n";
24                unlink $d;
25        }
26        my $link_target = "$libdir/$d";
27        print "Add symlink $d -> $link_target\n";
28        die "Can't create symlink $d" unless
29                symlink $link_target, $d;
30}
31
32# Copy and create a base modules file which includes all the libraries
33print "Create new modules_base.txt file\n";
34open OUT,">modules_base.txt" or die "Can't open modules_base.txt file for writing";
35print OUT <<__E;
36#
37# Automatically generated file, do not edit
38#
39# Source: $libdir/modules.txt
40#
41
42__E
43
44open IN,"$libdir/modules.txt" or die "Can't open $libdir/modules.txt for reading";
45
46while(<IN>)
47{
48        if(m/\A(lib\/.+?)\s/)
49        {
50                print OUT
51        }
52}
53
54close IN;
55close OUT;
Note: See TracBrowser for help on using the repository browser.