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