diff options
author | Kevin P. Fleming <kpfleming@digium.com> | 2006-08-26 00:06:38 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2011-02-27 21:09:14 +0200 |
commit | d29126d9147c0a40635028372b4bbd7e66e40803 (patch) | |
tree | d41baf7ca39dc3fee95edba7a85b9c103d3467df /software/get_discards | |
parent | 2cfe606f47211fd24879e1d14733acd03d9b70c0 (diff) |
add stuff to be used for determining which parts of the API kit we need to build
git-svn-id: http://svn.asterisk.org/svn/octasic_api/oct612x/trunk@10 537310ab-6354-42db-a3cc-247b777f7be6
Diffstat (limited to 'software/get_discards')
-rwxr-xr-x | software/get_discards | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/software/get_discards b/software/get_discards new file mode 100755 index 0000000..5436118 --- /dev/null +++ b/software/get_discards @@ -0,0 +1,51 @@ +#!/usr/bin/php + +<?php +/* + * Written by Jared Smith and Kevin P. Fleming + * + * Copyright (C) 2006, Jared Smith and Digium, Inc. + * + */ + +# create an array of all the different prefixes you want to match on, +# as Perl-compatible regular expressions +# (yes, this is a stupid example, as the second one is just a simplified +# version of the first, but it's just an example) +$prefixes = array('\.text\.Oct'); + +$fp = fopen('test.map','r'); + +while (!feof($fp)) +{ + # Loop until we find the top of section we want + while ($line = fgets($fp)) + { + if (preg_match('/Discarded input sections/i',$line)) + { + break; + } + } + + # Now loop until we find the next section + while ($line = fgets($fp)) + { + if (preg_match('/Memory Configuration/i',$line)) + { + # we found it! + break; + } + foreach ($prefixes as $prefix) + { + if (preg_match("/$prefix/i",$line)) + { + preg_match("/Oct.*/", $line, $matches); + $line2 = fgets($fp); + echo "#define SKIP_".$matches[0]." 1\n"; + break; + } + } + } +} +fclose($fp); +?> |