summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2003-03-06 20:35:26 +0000
committerMartin Schlemmer <azarah@gentoo.org>2003-03-06 20:35:26 +0000
commitf88ae7b1f76ba5cb389a4f0a78ed994ac95d34b3 (patch)
treec4b8beb9a8837a596b65cb3c651553f1b6063d74 /eclass
parentNew rpm! (diff)
downloadgentoo-2-f88ae7b1f76ba5cb389a4f0a78ed994ac95d34b3.tar.gz
gentoo-2-f88ae7b1f76ba5cb389a4f0a78ed994ac95d34b3.tar.bz2
gentoo-2-f88ae7b1f76ba5cb389a4f0a78ed994ac95d34b3.zip
add have_NPTL
Diffstat (limited to 'eclass')
-rw-r--r--eclass/eutils.eclass49
1 files changed, 48 insertions, 1 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
index d23d691addc4..b9c9d1cbdccb 100644
--- a/eclass/eutils.eclass
+++ b/eclass/eutils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.25 2003/03/03 21:42:05 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.26 2003/03/06 20:35:26 azarah Exp $
#
# Author: Martin Schlemmer <azarah@gentoo.org>
#
@@ -320,6 +320,53 @@ epatch() {
fi
}
+# This function return true if we are using the NPTL pthreads
+# implementation.
+#
+# <azarah@gentoo.org> (06 March 2003)
+#
+
+have_NPTL() {
+
+ cat > ${T}/test-nptl.c <<-"END"
+ #define _XOPEN_SOURCE
+ #include <unistd.h>
+ #include <stdio.h>
+
+ int main()
+ {
+ char buf[255];
+ char *str = buf;
+
+ confstr(_CS_GNU_LIBPTHREAD_VERSION, str, 255);
+ if (NULL != str) {
+ printf("%s\n", str);
+ if (NULL != strstr(str, "NPTL"))
+ return 0;
+ }
+
+ return 1;
+ }
+ END
+
+ einfon "Checking for _CS_GNU_LIBPTHREAD_VERSION support in glibc ... "
+ if gcc -o ${T}/nptl ${T}/test-nptl.c &> /dev/null
+ then
+ echo "yes"
+ einfon "Checking what PTHREADS implementation we have ... "
+ if ${T}/nptl
+ then
+ return 0
+ else
+ return 1
+ fi
+ else
+ echo "no"
+ fi
+
+ return 1
+}
+
# This function check how many cpu's are present, and then set
# -j in MAKEOPTS accordingly.
#