bart | b1c4412 | 2008-03-19 17:12:01 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | # Exit with status 0 if a supported version of libpthread is found (NPTL or |
| 4 | # non-Linux libpthread) and exit with status 1 if a non-supported version of |
| 5 | # libpthread is found (LinuxThreads). |
| 6 | |
| 7 | if [ "$(uname)" = "Linux" ]; then |
bart | 303dbe8 | 2008-05-03 08:34:52 +0000 | [diff] [blame] | 8 | if [ ! -x /usr/bin/getconf ]; then |
| 9 | echo "Error: could not find the program /usr/bin/getconf." |
bart | 5b14816 | 2008-05-03 09:35:01 +0000 | [diff] [blame] | 10 | echo "Please install the glibc-common package." |
bart | 303dbe8 | 2008-05-03 08:34:52 +0000 | [diff] [blame] | 11 | # Assume NPTL. |
| 12 | exit 0 |
| 13 | fi |
bart | b1c4412 | 2008-03-19 17:12:01 +0000 | [diff] [blame] | 14 | libpthread_version="$(/usr/bin/getconf GNU_LIBPTHREAD_VERSION 2>/dev/null)" |
| 15 | if [ "${libpthread_version#NPTL}" != "${libpthread_version}" ]; then |
| 16 | # NPTL |
| 17 | exit 0 |
| 18 | fi |
| 19 | # configuration string is empty or does start with "linuxthreads". |
| 20 | exit 1 |
| 21 | fi |
| 22 | |
| 23 | # Another OS than Linux, which is also fine. |
| 24 | exit 0 |