+# Make a link for the correct stdio-lock.h file.
+case "${target}" in
+ *-linux-gnu)
+ # We have a correct file in glibc but the libioP.h file is written
+ # with glibc 2.1 in mind which has the internals headers in special
+ # directory while glibc 2.0 has them in /usr/include. Create a wrapper
+ # if necessary.
+ (echo "#include <bits/libc-lock.h>" | ${CC-cc} -E -) >/dev/null 2>&1 ||
+ {
+ rm -fr bits
+ mkdir bits
+ echo "#include <libc-lock.h>" > bits/libc-lock.h
+ echo 'asm (".weak _pthread_cleanup_pop_restore");' >> bits/libc-lock.h
+ echo 'asm (".weak _pthread_cleanup_push_defer");' >> bits/libc-lock.h
+
+ echo "#include <stdio-lock.h>" > bits/stdio-lock.h
+ }
+ ;;
+ *)
+ rm -fr bits
+ mkdir bits
+ ln -s ${srcdir}/include/empty.h bits/stdio-lock.h
+ ;;
+esac
+