# awk script to convert symbol export table formats

# converts an msvc .def file to an darwin ld export-symbols-list file
# we only support the most basic module definition syntax

# skip comments
/^\w*#.*/ {next}
/^\w*;.*/ {next}

# remember and propagate the library name
/LIBRARY/ {name = $2; print "\# export list for", name; next}

# skip various other lines
/^\w*NAME/ ||
/^\w*VERSION/ ||
/^\w*EXPORTS/ ||
/^\w*HEAPSIZE/ ||
/^\w*STACKSIZE/ ||
/^\w*STUB/ {next}

# todo: handle SECTIONS

# for symbols, strip the semicolon and mangle the name
/[a-zA-Z]+/ {sub(/\;/, ""); print "_" $1}

# todo: warn if we see publicname=privatename mappings
#       which other linkers don't support

# awk script to convert symbol export table formats

# converts an msvc .def file to an darwin ld export-symbols-list file
# we only support the most basic module definition syntax

# skip comments
/^\w*#.*/ {next}
/^\w*;.*/ {next}

# remember and propagate the library name
/LIBRARY/ {name = $2; print "# export list for", name; next}

# skip various other lines
/^\w*NAME/ ||
/^\w*VERSION/ ||
/^\w*EXPORTS/ ||
/^\w*HEAPSIZE/ ||
/^\w*STACKSIZE/ ||
/^\w*STUB/ {next}

# todo: handle SECTIONS

# for symbols, strip the semicolon and mangle the name
/[a-zA-Z]+/ {sub(/\;/, ""); print "_" $1}

# todo: warn if we see publicname=privatename mappings
#       which other linkers don't support

Remove a redundant escape character.

Some awks warn about it having no effect.


git-svn-id: 8dbf393e6e9ab8d4979d29f9a341a98016792aa6@16492 0101bb08-14d6-0310-b084-bc0e0c8e3800
