Author: nkinder
Update of /cvs/dirsec/ldapserver
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27022
Modified Files:
config.h.in configure configure.ac
Log Message:
Resolves: 207457
Summary: Added 64-bit atomic functions for platforms lacking built-ins.
Index: config.h.in
===================================================================
RCS file: /cvs/dirsec/ldapserver/config.h.in,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- config.h.in 24 Oct 2008 22:36:57 -0000 1.24
+++ config.h.in 29 Oct 2008 19:16:29 -0000 1.25
@@ -15,6 +15,12 @@
/* cpu type sparc */
#undef CPU_sparc
+/* cpu type x86 */
+#undef CPU_x86
+
+/* cpu type x86_64 */
+#undef CPU_x86_64
+
/* enable ldapi auto bind support in the server */
#undef ENABLE_AUTOBIND
@@ -43,6 +49,10 @@
don't. */
#undef HAVE_DECL_STRERROR_R
+/* Define to 1 if you have the declaration of `__sync_add_and_fetch', and to 0
+ if you don't. */
+#undef HAVE_DECL___SYNC_ADD_AND_FETCH
+
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
Index: configure
===================================================================
RCS file: /cvs/dirsec/ldapserver/configure,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -r1.96 -r1.97
--- configure 24 Oct 2008 22:36:57 -0000 1.96
+++ configure 29 Oct 2008 19:16:29 -0000 1.97
@@ -23358,7 +23358,7 @@
# those with our 64 bit compiled product.
perlexec='/usr/bin/env perl'
case $host in
- *-*-linux*)
+ i*86-*-linux*)
cat >>confdefs.h <<\_ACEOF
#define XP_UNIX 1
@@ -23391,6 +23391,133 @@
cat >>confdefs.h <<\_ACEOF
+#define CPU_x86
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define _GNU_SOURCE 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define ATOMIC_64BIT_OPERATIONS 1
+_ACEOF
+
+ echo "$as_me:$LINENO: checking whether __sync_add_and_fetch is declared"
>&5
+echo $ECHO_N "checking whether __sync_add_and_fetch is declared... $ECHO_C"
>&6
+if test "${ac_cv_have_decl___sync_add_and_fetch+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __sync_add_and_fetch
+ char *p = (char *) __sync_add_and_fetch;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl___sync_add_and_fetch=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl___sync_add_and_fetch=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl___sync_add_and_fetch"
>&5
+echo "${ECHO_T}$ac_cv_have_decl___sync_add_and_fetch" >&6
+if test $ac_cv_have_decl___sync_add_and_fetch = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL___SYNC_ADD_AND_FETCH 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL___SYNC_ADD_AND_FETCH 0
+_ACEOF
+
+
+fi
+
+
+ platform="linux"
+ # relative to sysconfdir
+ initdir=/rc.d/init.d
+ ;;
+ x86_64-*-linux*)
+
+cat >>confdefs.h <<\_ACEOF
+#define XP_UNIX 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define Linux 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define LINUX 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define LINUX2_0 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define LINUX2_2 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define LINUX2_4 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define CPU_x86_64
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
#define _GNU_SOURCE 1
_ACEOF
@@ -23399,6 +23526,78 @@
#define ATOMIC_64BIT_OPERATIONS 1
_ACEOF
+ echo "$as_me:$LINENO: checking whether __sync_add_and_fetch is declared"
>&5
+echo $ECHO_N "checking whether __sync_add_and_fetch is declared... $ECHO_C"
>&6
+if test "${ac_cv_have_decl___sync_add_and_fetch+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __sync_add_and_fetch
+ char *p = (char *) __sync_add_and_fetch;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl___sync_add_and_fetch=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl___sync_add_and_fetch=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl___sync_add_and_fetch"
>&5
+echo "${ECHO_T}$ac_cv_have_decl___sync_add_and_fetch" >&6
+if test $ac_cv_have_decl___sync_add_and_fetch = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL___SYNC_ADD_AND_FETCH 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL___SYNC_ADD_AND_FETCH 0
+_ACEOF
+
+
+fi
+
+
platform="linux"
# relative to sysconfdir
initdir=/rc.d/init.d
Index: configure.ac
===================================================================
RCS file: /cvs/dirsec/ldapserver/configure.ac,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- configure.ac 24 Oct 2008 22:36:58 -0000 1.55
+++ configure.ac 29 Oct 2008 19:16:29 -0000 1.56
@@ -294,15 +294,32 @@
# those with our 64 bit compiled product.
perlexec='/usr/bin/env perl'
case $host in
- *-*-linux*)
+ i*86-*-linux*)
AC_DEFINE([XP_UNIX], [1], [UNIX])
AC_DEFINE([Linux], [1], [Linux])
AC_DEFINE([LINUX], [1], [Linux])
AC_DEFINE([LINUX2_0], [1], [Linux 2.0])
AC_DEFINE([LINUX2_2], [1], [Linux 2.2])
AC_DEFINE([LINUX2_4], [1], [Linux 2.4])
+ AC_DEFINE([CPU_x86], [], [cpu type x86])
AC_DEFINE([_GNU_SOURCE], [1], [GNU Source])
AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
+ AC_CHECK_DECLS([__sync_add_and_fetch])
+ platform="linux"
+ # relative to sysconfdir
+ initdir=/rc.d/init.d
+ ;;
+ x86_64-*-linux*)
+ AC_DEFINE([XP_UNIX], [1], [UNIX])
+ AC_DEFINE([Linux], [1], [Linux])
+ AC_DEFINE([LINUX], [1], [Linux])
+ AC_DEFINE([LINUX2_0], [1], [Linux 2.0])
+ AC_DEFINE([LINUX2_2], [1], [Linux 2.2])
+ AC_DEFINE([LINUX2_4], [1], [Linux 2.4])
+ AC_DEFINE([CPU_x86_64], [], [cpu type x86_64])
+ AC_DEFINE([_GNU_SOURCE], [1], [GNU Source])
+ AC_DEFINE([ATOMIC_64BIT_OPERATIONS], [1], [enabling atomic counter])
+ AC_CHECK_DECLS([__sync_add_and_fetch])
platform="linux"
# relative to sysconfdir
initdir=/rc.d/init.d