lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1921 - in nss-pam-ldapd: . m4 nslcd nss

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1921 - in nss-pam-ldapd: . m4 nslcd nss



Author: arthur
Date: Fri Jan 18 14:02:37 2013
New Revision: 1921
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1921&view=revision

Log:
use the AX_TLS macro to find correct thread-local storage class compiler 
directive

Added:
   nss-pam-ldapd/m4/ax_tls.m4
Modified:
   nss-pam-ldapd/configure.ac
   nss-pam-ldapd/nslcd/log.c
   nss-pam-ldapd/nss/aliases.c
   nss-pam-ldapd/nss/ethers.c
   nss-pam-ldapd/nss/group.c
   nss-pam-ldapd/nss/hosts.c
   nss-pam-ldapd/nss/netgroup.c
   nss-pam-ldapd/nss/networks.c
   nss-pam-ldapd/nss/passwd.c
   nss-pam-ldapd/nss/protocols.c
   nss-pam-ldapd/nss/rpc.c
   nss-pam-ldapd/nss/services.c
   nss-pam-ldapd/nss/shadow.c

Modified: nss-pam-ldapd/configure.ac
==============================================================================
--- nss-pam-ldapd/configure.ac  Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/configure.ac  Fri Jan 18 14:02:37 2013        (r1921)
@@ -300,17 +300,7 @@
 AC_CHECK_SIZEOF(unsigned long long int)
 AC_CHECK_SIZEOF(uid_t)
 AC_CHECK_SIZEOF(gid_t)
-
-# check for support for the __thread keyword
-AC_CACHE_CHECK([whether $CC supports '__thread'], [mn_cv_c___thread_supported],
-               [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[static __thread i;]], 
[])],
-                       [mn_cv_c___thread_supported=yes],
-                       [mn_cv_c___thread_supported=no])])
-if test $mn_cv_c___thread_supported != yes
-then
-  AC_MSG_WARN([$CC does not support '__thread' keyword])
-  AC_DEFINE(__thread,, [Define to empty if compiler does not support 
`__thread' keyword.])
-fi
+AX_TLS()
 
 # check for support for the struct ether_addr structure
 AC_CHECK_TYPES(struct ether_addr,,, [

Added: nss-pam-ldapd/m4/ax_tls.m4
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nss-pam-ldapd/m4/ax_tls.m4  Fri Jan 18 14:02:37 2013        (r1921)
@@ -0,0 +1,76 @@
+# ===========================================================================
+#          http://www.gnu.org/software/autoconf-archive/ax_tls.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_TLS([action-if-found], [action-if-not-found])
+#
+# DESCRIPTION
+#
+#   Provides a test for the compiler support of thread local storage (TLS)
+#   extensions. Defines TLS if it is found. Currently knows about GCC/ICC
+#   and MSVC. I think SunPro uses the same as GCC, and Borland apparently
+#   supports either.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Alan Woodland <ajw05@aber.ac.uk>
+#   Copyright (c) 2010 Diego Elio Petteno` <flameeyes@gmail.com>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 10
+
+AC_DEFUN([AX_TLS], [
+  AC_MSG_CHECKING(for thread local storage (TLS) class)
+  AC_CACHE_VAL(ac_cv_tls, [
+    ax_tls_keywords="__thread __declspec(thread) none"
+    for ax_tls_keyword in $ax_tls_keywords; do
+       AS_CASE([$ax_tls_keyword],
+          [none], [ac_cv_tls=none ; break],
+          [AC_TRY_COMPILE(
+              [#include <stdlib.h>
+               static void
+               foo(void) {
+               static ] $ax_tls_keyword [ int bar;
+               exit(1);
+               }],
+               [],
+               [ac_cv_tls=$ax_tls_keyword ; break],
+               ac_cv_tls=none
+           )])
+    done
+  ])
+  AC_MSG_RESULT($ac_cv_tls)
+
+  AS_IF([test "$ac_cv_tls" != "none"],
+    AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS 
storage class define it to that here])
+      m4_ifnblank([$1], [$1]),
+    m4_ifnblank([$2], [$2])
+  )
+])

Modified: nss-pam-ldapd/nslcd/log.c
==============================================================================
--- nss-pam-ldapd/nslcd/log.c   Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nslcd/log.c   Fri Jan 18 14:02:37 2013        (r1921)
@@ -1,7 +1,7 @@
 /*
    log.c - logging funtions
 
-   Copyright (C) 2002, 2003, 2008, 2010, 2011, 2012 Arthur de Jong
+   Copyright (C) 2002, 2003, 2008, 2010, 2011, 2012, 2013 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -44,10 +44,10 @@
 static int loglevel = LOG_INFO;
 
 /* the session id that is set for this thread */
-static __thread char *sessionid = NULL;
+static TLS char *sessionid = NULL;
 
 /* the request identifier that is set for this thread */
-static __thread char *requestid = NULL;
+static TLS char *requestid = NULL;
 #define MAX_REQUESTID_LENGTH 40
 
 /* set loglevel when no logging is configured */

Modified: nss-pam-ldapd/nss/aliases.c
==============================================================================
--- nss-pam-ldapd/nss/aliases.c Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/aliases.c Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    aliases.c - NSS lookup functions for aliases database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -59,7 +59,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *aliasentfp;
+static TLS TFILE *aliasentfp;
 
 /* start a request to read all aliases */
 nss_status_t _nss_ldap_setaliasent(void)

Modified: nss-pam-ldapd/nss/ethers.c
==============================================================================
--- nss-pam-ldapd/nss/ethers.c  Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/ethers.c  Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    ethers.c - NSS lookup functions for ethers database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -65,7 +65,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *etherentfp;
+static TLS TFILE *etherentfp;
 
 /* open a connection to read all ether entries */
 nss_status_t _nss_ldap_setetherent(int UNUSED(stayopen))

Modified: nss-pam-ldapd/nss/group.c
==============================================================================
--- nss-pam-ldapd/nss/group.c   Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/group.c   Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    group.c - NSS lookup functions for group database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -133,7 +133,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *grentfp;
+static TLS TFILE *grentfp;
 
 /* start a request to read all groups */
 nss_status_t _nss_ldap_setgrent(int UNUSED(stayopen))

Modified: nss-pam-ldapd/nss/hosts.c
==============================================================================
--- nss-pam-ldapd/nss/hosts.c   Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/hosts.c   Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    hosts.c - NSS lookup functions for hosts database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -193,7 +193,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *hostentfp;
+static TLS TFILE *hostentfp;
 
 nss_status_t _nss_ldap_sethostent(int UNUSED(stayopen))
 {

Modified: nss-pam-ldapd/nss/netgroup.c
==============================================================================
--- nss-pam-ldapd/nss/netgroup.c        Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/netgroup.c        Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    netgroup.c - NSS lookup functions for netgroup entries
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -92,7 +92,7 @@
 #ifdef NSS_FLAVOUR_GLIBC
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *netgrentfp;
+static TLS TFILE *netgrentfp;
 
 /* start a request to get a netgroup by name */
 nss_status_t _nss_ldap_setnetgrent(const char *group,

Modified: nss-pam-ldapd/nss/networks.c
==============================================================================
--- nss-pam-ldapd/nss/networks.c        Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/networks.c        Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    networks.c - NSS lookup functions for networks database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -136,7 +136,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *netentfp;
+static TLS TFILE *netentfp;
 
 /* start a request to read all networks */
 nss_status_t _nss_ldap_setnetent(int UNUSED(stayopen))

Modified: nss-pam-ldapd/nss/passwd.c
==============================================================================
--- nss-pam-ldapd/nss/passwd.c  Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/passwd.c  Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    passwd.c - NSS lookup functions for passwd database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -72,7 +72,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *pwentfp;
+static TLS TFILE *pwentfp;
 
 /* open a connection to read all passwd entries */
 nss_status_t _nss_ldap_setpwent(int UNUSED(stayopen))

Modified: nss-pam-ldapd/nss/protocols.c
==============================================================================
--- nss-pam-ldapd/nss/protocols.c       Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/protocols.c       Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    protocols.c - NSS lookup functions for protocol database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -67,7 +67,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *protoentfp;
+static TLS TFILE *protoentfp;
 
 /* start a request to read all protocol entries */
 nss_status_t _nss_ldap_setprotoent(int UNUSED(stayopen))

Modified: nss-pam-ldapd/nss/rpc.c
==============================================================================
--- nss-pam-ldapd/nss/rpc.c     Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/rpc.c     Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    rpc.c - NSS lookup functions for rpc database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -66,7 +66,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *rpcentfp;
+static TLS TFILE *rpcentfp;
 
 /* request a stream to list all rpc entries */
 nss_status_t _nss_ldap_setrpcent(int UNUSED(stayopen))

Modified: nss-pam-ldapd/nss/services.c
==============================================================================
--- nss-pam-ldapd/nss/services.c        Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/services.c        Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    service.c - NSS lookup functions for services database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -74,7 +74,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *serventfp;
+static TLS TFILE *serventfp;
 
 /* open request to get all services */
 nss_status_t _nss_ldap_setservent(int UNUSED(stayopen))

Modified: nss-pam-ldapd/nss/shadow.c
==============================================================================
--- nss-pam-ldapd/nss/shadow.c  Fri Jan 18 13:54:09 2013        (r1920)
+++ nss-pam-ldapd/nss/shadow.c  Fri Jan 18 14:02:37 2013        (r1921)
@@ -2,7 +2,7 @@
    shadow.c - NSS lookup functions for shadow database
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2010, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Arthur de Jong
    Copyright (C) 2010 Symas Corporation
 
    This library is free software; you can redistribute it and/or
@@ -61,7 +61,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-static __thread TFILE *spentfp;
+static TLS TFILE *spentfp;
 
 /* start listing all shadow users */
 nss_status_t _nss_ldap_setspent(int UNUSED(stayopen))
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/