Files
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
libcxx
libcxxabi
libunwind
lld
lldb
cmake
docs
examples
include
lit
lldb.xcodeproj
lldb.xcworkspace
packages
resources
scripts
Python
Xcode
interface
swig_bot_lib
CMakeLists.txt
analyze-project-deps.py
build-lldb-llvm-clang
buildbot.py
checkpoint-llvm.pl
disasm-gdb-remote.pl
finish-swig-wrapper-classes.sh
finishSwigWrapperClasses.py
framework-header-fix.sh
generate-vers.pl
get_relative_lib_dir.py
install-lldb.sh
install_custom_python.py
lldb.swig
prepare_bindings.py
sed-sources
shush
swig_bot.py
use_lldb_suite.py
utilsArgsParse.py
utilsDebug.py
utilsOsType.py
verify_api.py
source
third_party
tools
unittests
utils
www
.arcconfig
.clang-format
.gitignore
CMakeLists.txt
CODE_OWNERS.txt
INSTALL.txt
LICENSE.TXT
use_lldb_suite_root.py
llvm
openmp
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mk
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
linux-packaging-mono/external/llvm-project/lldb/scripts/generate-vers.pl

57 lines
1.3 KiB
Perl
Raw Normal View History

#!/usr/bin/perl
sub usage()
{
print "Usage: generate-vers.pl /path/toproject.pbxproj program_name";
exit(0);
}
(scalar @ARGV == 2) or usage();
open $pbxproj, $ARGV[0] or die "Couldn't open ".$ARGV[0];
$lldb_version = None;
$lldb_train = None;
$lldb_revision = None;
$lldb_version_string = None;
$product_name = "lldb";
while ($line = <$pbxproj>)
{
chomp ($line);
if ($lldb_version == None &&
$line =~ /CURRENT_PROJECT_VERSION = ([0-9]+).([0-9]+).([0-9]+)(.[0-9])?/)
{
$lldb_version = $1;
$lldb_train = $2;
$lldb_revision = $3;
$lldb_patchlevel = $4;
if ($lldb_patchlevel != None)
{
$lldb_version_string = $lldb_version.".".$lldb_train.".".$lldb_revision.".".$lldb_patchlevel;
}
else
{
$lldb_version_string = $lldb_version.".".$lldb_train.".".$lldb_revision;
}
}
}
if (!$product_name || !$lldb_version_string)
{
print "Couldn't get needed information from the .pbxproj";
exit(-1);
}
$uppercase_name = uc $product_name;
$lowercase_name = lc $product_name;
close $pbxproj;
$file_string = " const unsigned char ".$ARGV[1]."VersionString[] __attribute__ ((used)) = \"@(#)PROGRAM:".$uppercase_name." PROJECT:".$lowercase_name."-".$lldb_version_string."\" \"\\n\"; const double ".$ARGV[1]."VersionNumber __attribute__ ((used)) = (double)".$lldb_version.".".$lldb_train.";\n";
print $file_string;