172ecb8
# Generate OUTPUT_FORMAT line for .so files from the system linker output.
172ecb8
# Imported from glibc/Makerules.
172ecb8
172ecb8
/ld.*[ 	]-E[BL]/b f
172ecb8
/collect.*[ 	]-E[BL]/b f
172ecb8
/OUTPUT_FORMAT[^)]*$/{N
172ecb8
s/\n[	 ]*/ /
172ecb8
}
172ecb8
t o
172ecb8
: o
172ecb8
s/^.*OUTPUT_FORMAT(\([^,]*\), \1, \1).*$/OUTPUT_FORMAT(\1)/
172ecb8
t q
172ecb8
s/^.*OUTPUT_FORMAT(\([^,]*\), \([^,]*\), \([^,]*\)).*$/\1,\2,\3/
172ecb8
t s
172ecb8
s/^.*OUTPUT_FORMAT(\([^,)]*\).*$)/OUTPUT_FORMAT(\1)/
172ecb8
t q
172ecb8
d
172ecb8
: s
172ecb8
s/"//g
172ecb8
G
172ecb8
s/\n//
172ecb8
s/^\([^,]*\),\([^,]*\),\([^,]*\),B/OUTPUT_FORMAT(\2)/p
172ecb8
s/^\([^,]*\),\([^,]*\),\([^,]*\),L/OUTPUT_FORMAT(\3)/p
172ecb8
s/^\([^,]*\),\([^,]*\),\([^,]*\)/OUTPUT_FORMAT(\1)/p
172ecb8
/,/s|^|*** BUG in libc/scripts/output-format.sed *** |p
172ecb8
q
172ecb8
: q
172ecb8
s/"//g
172ecb8
p
172ecb8
q
172ecb8
: f
172ecb8
s/^.*[ 	]-E\([BL]\)[ 	].*$/,\1/
172ecb8
t h
172ecb8
s/^.*[ 	]-E\([BL]\)$/,\1/
172ecb8
t h
172ecb8
d
172ecb8
: h
172ecb8
h