summaryrefslogtreecommitdiff
path: root/generateversionscript.awk
blob: 7efc537325aa61c9e641db742956b013ec969da5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
BEGIN {
    print "V1.0 {";
    print "    global:";
} 
{ 
    # Remove the CR character in case the sources are mapped from
    # a Windows share and contain CRLF line endings
    gsub(/\r/,"", $0);
	
    # Skip empty lines and comment lines starting with semicolon
    if (NF && !match($0, /^[ \t]*;/))
    {
        # Only prefix the entries that start with "#"
	if (match($0, /^#.*/))
	{
	    gsub(/^#/,"", $0);
	    print "        "prefix $0 ";";
	}
        else
        {
	    print "        "$0 ";";
	}
    }
} 
END {
    print "    local: *;"
    print "};";
}