~ubuntu-branches/ubuntu/precise/nss-pam-ldapd/precise-security

« back to all changes in this revision

Viewing changes to m4/ax_pthread.m4

  • Committer: Package Import Robot
  • Author(s): Arthur de Jong
  • Date: 2011-09-04 21:00:00 UTC
  • mfrom: (14.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20110904210000-pe3u91iga88vtr16
Tags: 0.8.4
* Upload to unstable
* switch to using the member attribute by default instead of
  uniqueMember (backwards incompatible change)
* only return "x" as a password hash when the object has the shadowAccount
  objectClass and nsswitch.conf is configured to do shadow lookups using
  LDAP (this avoids some problems with pam_unix)
* fix problem with partial attribute name matches in DN (thanks Timothy
  White)
* fix a problem with objectSid mappings with recent versions of OpenLDAP
  (patch by Wesley Mason)
* set the socket timeout in a connection callback to avoid timeout
  issues during the SSL handshake (patch by Stefan Völkel)
* check for unknown variables in pam_authz_search
* only check password expiration when authenticating, only check account
  expiration when doing authorisation
* make buffer sizes consistent and grow all buffers holding string
  representations of numbers to be able to hold 64-bit numbers
* update AX_PTHREAD from autoconf-archive
* support querying DNS SRV records from a different domain than the current
  one (based on a patch by James M. Leddy)
* fix a problem with uninitialised memory while parsing the tls_ciphers
  option (closes: #638872) (but doesn't work yet due to #640384)
* implement bounds checking of numeric values read from LDAP (patch by
  Jakub Hrozek)
* correctly support large uid and gid values from LDAP (patch by Jakub
  Hrozek)
* improvements to the configure script (patch by Jakub Hrozek)
* switch to dh for debian/rules and bump debhelper compatibility to 8
* build Debian packages with multiarch support
* ship shlibs (but still no symbol files) for libnss-ldapd since that was
  the easiest way to support multiarch
* fix output in init script when restarting nslcd (closes: #637132)
* correctly handle leading and trailing spaces in preseeded debconf uri
  option (patch by Andreas B. Mundt) (closes: #637863)
* support spaces around database names in /etc/nsswitch.conf while
  configuring package (closes: #640185)
* updated Russian debconf translation by Yuri Kozlov (closes: #637751)
* updated French debconf translation by Christian Perrier (closes: #637756)
* added Slovak debconf translation by Slavko (closes: #637759)
* updated Danish debconf translation by Joe Hansen (closes :#637763)
* updated Brazilian Portuguese debconf translation by Denis Doria
* updated Portuguese debconf translation by Américo Monteiro
* updated Japanese debconf translation by Kenshi Muto (closes: #638195)
* updated Czech debconf translation by Miroslav Kure (closes: #639026)
* updated German debconf translation by Chris Leick (closes: #639107)
* updated Spanish debconf translation by Francisco Javier Cuadrado
  (closes: #639236)
* updated Dutch debconf translation by Arthur de Jong with help from Paul
  Gevers and Jeroen Schot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# ===========================================================================
2
 
#           http://www.nongnu.org/autoconf-archive/ax_pthread.html
 
2
#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
3
3
# ===========================================================================
4
4
#
5
5
# SYNOPSIS
33
33
#   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
34
34
#   (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
35
35
#
 
36
#   Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
 
37
#   PTHREAD_PRIO_INHERIT symbol is defined when compiling with
 
38
#   PTHREAD_CFLAGS.
 
39
#
36
40
#   ACTION-IF-FOUND is a list of shell commands to run if a threads library
37
41
#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
38
42
#   is not found. If ACTION-IF-FOUND is not specified, the default action
45
49
#   Alejandro Forero Cuervo to the autoconf macro repository. We are also
46
50
#   grateful for the helpful feedback of numerous users.
47
51
#
 
52
#   Updated for Autoconf 2.68 by Daniel Richard G.
 
53
#
48
54
# LICENSE
49
55
#
50
56
#   Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
 
57
#   Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
51
58
#
52
59
#   This program is free software: you can redistribute it and/or modify it
53
60
#   under the terms of the GNU General Public License as published by the
75
82
#   modified version of the Autoconf Macro, you may extend this special
76
83
#   exception to the GPL to apply to your modified version as well.
77
84
 
78
 
#serial 5
 
85
#serial 16
79
86
 
80
87
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
81
88
AC_DEFUN([AX_PTHREAD], [
82
89
AC_REQUIRE([AC_CANONICAL_HOST])
83
 
AC_LANG_SAVE
84
 
AC_LANG_C
 
90
AC_LANG_PUSH([C])
85
91
ax_pthread_ok=no
86
92
 
87
93
# We used to check for pthread.h first, but this fails if pthread.h
152
158
 
153
159
        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
154
160
        ;;
 
161
 
 
162
        *-darwin*)
 
163
        ax_pthread_flags="-pthread $ax_pthread_flags"
 
164
        ;;
155
165
esac
156
166
 
157
167
if test x"$ax_pthread_ok" = xno; then
167
177
                PTHREAD_CFLAGS="$flag"
168
178
                ;;
169
179
 
170
 
                pthread-config)
171
 
                AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
172
 
                if test x"$ax_pthread_config" = xno; then continue; fi
173
 
                PTHREAD_CFLAGS="`pthread-config --cflags`"
174
 
                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
175
 
                ;;
 
180
                pthread-config)
 
181
                AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
 
182
                if test x"$ax_pthread_config" = xno; then continue; fi
 
183
                PTHREAD_CFLAGS="`pthread-config --cflags`"
 
184
                PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
 
185
                ;;
176
186
 
177
187
                *)
178
188
                AC_MSG_CHECKING([for the pthreads library -l$flag])
194
204
        # pthread_cleanup_push because it is one of the few pthread
195
205
        # functions on Solaris that doesn't have a non-functional libc stub.
196
206
        # We try pthread_create on general principles.
197
 
        AC_TRY_LINK([#include <pthread.h>
198
 
                     static void routine(void* a) {a=0;}
199
 
                     static void* start_routine(void* a) {return a;}],
200
 
                    [pthread_t th; pthread_attr_t attr;
201
 
                     pthread_join(th, 0);
202
 
                     pthread_attr_init(&attr);
203
 
                     pthread_cleanup_push(routine, 0);
204
 
                     pthread_create(&th,0,start_routine,0);
205
 
                     pthread_cleanup_pop(0); ],
206
 
                    [ax_pthread_ok=yes])
 
207
        AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
 
208
                        static void routine(void *a) { a = 0; }
 
209
                        static void *start_routine(void *a) { return a; }],
 
210
                       [pthread_t th; pthread_attr_t attr;
 
211
                        pthread_create(&th, 0, start_routine, 0);
 
212
                        pthread_join(th, 0);
 
213
                        pthread_attr_init(&attr);
 
214
                        pthread_cleanup_push(routine, 0);
 
215
                        pthread_cleanup_pop(0) /* ; */])],
 
216
                [ax_pthread_ok=yes],
 
217
                [])
207
218
 
208
219
        LIBS="$save_LIBS"
209
220
        CFLAGS="$save_CFLAGS"
226
237
        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
227
238
 
228
239
        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
229
 
        AC_MSG_CHECKING([for joinable pthread attribute])
230
 
        attr_name=unknown
231
 
        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
232
 
            AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
233
 
                        [attr_name=$attr; break])
234
 
        done
 
240
        AC_MSG_CHECKING([for joinable pthread attribute])
 
241
        attr_name=unknown
 
242
        for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
 
243
            AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
 
244
                           [int attr = $attr; return attr /* ; */])],
 
245
                [attr_name=$attr; break],
 
246
                [])
 
247
        done
235
248
        AC_MSG_RESULT($attr_name)
236
249
        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
237
250
            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
250
263
            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
251
264
        fi
252
265
 
 
266
        AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
 
267
            ax_cv_PTHREAD_PRIO_INHERIT, [
 
268
                AC_LINK_IFELSE([
 
269
                    AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
 
270
                    [ax_cv_PTHREAD_PRIO_INHERIT=yes],
 
271
                    [ax_cv_PTHREAD_PRIO_INHERIT=no])
 
272
            ])
 
273
        AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
 
274
            AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
 
275
 
253
276
        LIBS="$save_LIBS"
254
277
        CFLAGS="$save_CFLAGS"
255
278
 
256
279
        # More AIX lossage: must compile with xlc_r or cc_r
257
 
        if test x"$GCC" != xyes; then
 
280
        if test x"$GCC" != xyes; then
258
281
          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
259
282
        else
260
283
          PTHREAD_CC=$CC
261
 
        fi
 
284
        fi
262
285
else
263
286
        PTHREAD_CC="$CC"
264
287
fi
275
298
        ax_pthread_ok=no
276
299
        $2
277
300
fi
278
 
AC_LANG_RESTORE
 
301
AC_LANG_POP
279
302
])dnl AX_PTHREAD