Eli,

the generated file you're looking for is LLDB_vers.c, a file generated by Apple Generic Versioning, which is described in more detail

A properly-built LLDB_vers.c looks like this:
 const unsigned char LLDBVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:LLDB  PROJECT:lldb-24" "\n"; const double LLDBVersionNumber __attribute__ ((used)) = (double)24.;
I've attached a simple Perl script that generates the above code given the location of the .pbxproj as input.

Sean

#!/usr/bin/perl

sub usage()
{
  print "Usage: generate-vers.pl /path/toproject.pbxproj";
  exit(0);
}

(scalar @ARGV == 1) or usage();

open $pbxproj, $ARGV[0] or die "Couldn't open ".$ARGV[0];

$current_project_version = None;
$product_name = None;

while ($line = <$pbxproj>)
{
  chomp ($line);
  
  if ($current_project_version == None &&
      $line =~ /CURRENT_PROJECT_VERSION = ([0-9]+)/)
  {
    $current_project_version = $1;
  }
  
  if ($product_name == None &&
      $line =~ /productName = ([^;]+)/)
  {
    $product_name = $1;
  }
}

if (!$product_name || !$current_project_version)
{
  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 ".$uppercase_name."VersionString[] __attribute__ ((used)) = \"@(#)PROGRAM:".$uppercase_name."  PROJECT:".$lowercase_name."-".$current_project_version."\" \"\\n\"; const double ".$uppercase_name."VersionNumber __attribute__ ((used)) = (double)".$current_project_version.".;\n";

print $file_string;

On Jul 2, 2010, at 12:50 PM, Eli Friedman wrote:

Attached are two patches which (along with recent commits) allow
compiling lldb on Linux; the generated executable even works to the
point where it can disassemble named functions from an x86-32 ELF
file.  The build procedure is essentially just check out lldb into
llvm/tools/ in an LLVM tree with a built LLVM and clang, apply this
patch, and run make in the lldb directory.  Note that the makefiles
depend on a Python 2.6 install, and the presence of libedit, which
isn't normally installed on Linux (but libedit-dev is available in
Ubuntu).

The Makefiles aren't quite complete; they're missing steps to generate
some files.  The second patch is required because of this.  Any help
with that and reviews would be welcome.

-Eli
<lldbmakefiles.txt><lldbhack.txt>_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

_______________________________________________
lldb-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

Reply via email to