diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-30 22:24:04 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-30 22:24:04 +0000 |
commit | 6f1c7e4d7aad23ce36ee10657173428927e2c667 (patch) | |
tree | 06652bbd8c0f73eb442ec0d4890be7639d6d3dc4 /bin | |
parent | e9421d10c7656dc0e07665e148bee48774c30079 (diff) | |
download | ATCD-6f1c7e4d7aad23ce36ee10657173428927e2c667.tar.gz |
added create_ace_build
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/create_ace_build | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/bin/create_ace_build b/bin/create_ace_build new file mode 100755 index 00000000000..ae0bfc4a782 --- /dev/null +++ b/bin/create_ace_build @@ -0,0 +1,104 @@ +#! /bin/sh -- # perl +# $Id$ +# +# Creates an ACE build tree in directory "build/<build name>" below the current +# directory, which must be a ACE "top level" directory (such as $WRAPPER_ROOT). +# The build tree directory structure mirrors that of the ACE top level +# directory structure, except that instead of containing any plain files, +# it contains only symlinks to the files in the ACE top level structure. +# +# The first line above and the following one let this script run without +# specifying the full path to perl, as long as it is in the user's PATH. +# Taken from perlrun man page. + +eval 'exec perl -S $0 ${1+"$@"}' + if 0; + +$usage = "usage: $0 -? | [-d <directory mode>] [-v] <build name>\n"; +$directory_mode = 042755; #### fine on Suns, but maybe not all Unix platforms +$verbose = 0; + + +#### +#### process command line args +#### +while ( $#ARGV >= 0 && $ARGV[0] =~ /^-/ ) { + if ( $ARGV[0] eq '-v' ) { + $verbose = 1; + } elsif ( $ARGV[0] eq '-d' ) { + if ( $ARGV[1] =~ /^\d+$/ ) { + $directory_mode = $ARGV[1]; shift; + } else { + warn "$0: must provide argument for -d option\n"; + die $usage; + } + } elsif ( $ARGV[0] eq '-?' ) { + print "$usage"; + exit; + } else { + warn "$0: unknown option $ARGV[0]\n"; + die $usage; + } + shift; +} + +die $usage unless $#ARGV == 0; +$build = $ARGV[0]; + +#### +#### check that we're in an ACE "top level" directory +#### +( -d 'ace' && -d 'examples' && -d 'netsvcs' ) || + die "$0: must be in an ACE top level (WRAPPER_ROOT) directory!\n"; + +#### +#### create build directories, if needed. +#### +-d 'build' || mkdir 'build', $directory_mode; +-d "build/$build" || mkdir "build/$build", $directory_mode; + +#### +#### get all ACE plain file and directory names +#### +@files = ( `/usr/bin/find . -name CVS -prune -o -name build -prune -o \\\ + -name '.*obj' -prune -o -name Templates.DB -prune -o \\\ + \\( ! -type l ! -name core ! -name '*.state' ! -name '*.so' \\\ + ! -name '*.[oa]' ! -name '*~' ! -name '.' ! -name '.#*' \\\ + ! -name '*.log' \\) \\\ + -print` ); + +#### +#### create directories and symlinks to files +#### +foreach $file ( @files ) { + chop $file; #### remove trailing newline (from find command above) + $file =~ s%^\./%%g; #### excise leading ./ directory component + + if ( -d $file ) { + print "mkdir build/$build/$file, $directory_mode\n" if $verbose; + -d "build/$build/$file" || mkdir "build/$build/$file", + $directory_mode; + } else { + $up = '../..'; + while ( $file =~ m%/%g ) { $up .= '/..'; } + + print "symlink $up/$file build/$build/$file\n" if $verbose; + symlink "$up/$file", "build/$build/$file" || + die "$0 symlink to build/$build/$file failed\n"; + } +} + +#### +#### create symlink to ChangeLog symlink +#### +symlink '../../ChangeLog', "build/$build/ChangeLog" || + die "$0: unable to create build/$build/ChangeLog symlink\n"; + +#### +#### done: print message +#### +print "\nCompleted creation of build/$build/.\n" . + "Be sure to setup build/$build/ace/config.h and\n" . + "build/$build/include/makeinclude/platform_macros.GNU symlinks.\n"; + +#### EOF |