[Pkg-utopia-commits] r511 - in packages/unstable/avahi/debian: . patches

Sjoerd Simons sjoerd at costa.debian.org
Fri Jan 20 09:40:43 UTC 2006


Author: sjoerd
Date: 2006-01-20 09:40:43 +0000 (Fri, 20 Jan 2006)
New Revision: 511

Added:
   packages/unstable/avahi/debian/patches/04_pthread_flags.patch
Modified:
   packages/unstable/avahi/debian/changelog
Log:
Extra checking for pthread flags

Modified: packages/unstable/avahi/debian/changelog
===================================================================
--- packages/unstable/avahi/debian/changelog	2006-01-19 22:58:23 UTC (rev 510)
+++ packages/unstable/avahi/debian/changelog	2006-01-20 09:40:43 UTC (rev 511)
@@ -1,8 +1,11 @@
 avahi (0.6.4-2) unstable; urgency=low
 
+  * debian/patches/04_pthread_flags.patch
+    + Added. Check how gcc handles -pthread in combination with -shared.
+    Fixes FTBS on mips{,el}.
   * Add --disabled-password to adduser options in postinst
 
- -- Sjoerd Simons <sjoerd at debian.org>  Thu, 19 Jan 2006 16:50:30 +0100
+ -- Sjoerd Simons <sjoerd at debian.org>  Fri, 20 Jan 2006 10:40:27 +0100
 
 avahi (0.6.4-1) unstable; urgency=low
 

Added: packages/unstable/avahi/debian/patches/04_pthread_flags.patch
===================================================================
--- packages/unstable/avahi/debian/patches/04_pthread_flags.patch	2006-01-19 22:58:23 UTC (rev 510)
+++ packages/unstable/avahi/debian/patches/04_pthread_flags.patch	2006-01-20 09:40:43 UTC (rev 511)
@@ -0,0 +1,424 @@
+Only in avahi-0.6.4: Makefile
+diff -aur avahi-0.6.4.orig/aclocal.m4 avahi-0.6.4/aclocal.m4
+--- avahi-0.6.4.orig/aclocal.m4	2006-01-20 10:34:06.000000000 +0100
++++ avahi-0.6.4/aclocal.m4	2006-01-20 10:37:02.000000000 +0100
+@@ -13,7 +13,7 @@
+ 
+ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+ 
+-# serial 48 Debian 1.5.22-1 AC_PROG_LIBTOOL
++# serial 48 Debian 1.5.22-2 AC_PROG_LIBTOOL
+ 
+ 
+ # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+Only in avahi-0.6.4/avahi-client: .deps
+Only in avahi-0.6.4/avahi-client: Makefile
+Only in avahi-0.6.4/avahi-common: .deps
+Only in avahi-0.6.4/avahi-common: Makefile
+Only in avahi-0.6.4/avahi-core: .deps
+Only in avahi-0.6.4/avahi-core: Makefile
+Only in avahi-0.6.4/avahi-daemon: .deps
+Only in avahi-0.6.4/avahi-daemon: Makefile
+Only in avahi-0.6.4/avahi-discover-standalone: .deps
+Only in avahi-0.6.4/avahi-discover-standalone: Makefile
+Only in avahi-0.6.4/avahi-dnsconfd: .deps
+Only in avahi-0.6.4/avahi-dnsconfd: Makefile
+Only in avahi-0.6.4/avahi-glib: .deps
+Only in avahi-0.6.4/avahi-glib: Makefile
+Only in avahi-0.6.4/avahi-qt: .deps
+Only in avahi-0.6.4/avahi-qt: Makefile
+Only in avahi-0.6.4/avahi-sharp: Makefile
+Only in avahi-0.6.4/avahi-utils: .deps
+Only in avahi-0.6.4/common: Makefile
+diff -aur avahi-0.6.4.orig/common/acx_pthread.m4 avahi-0.6.4/common/acx_pthread.m4
+--- avahi-0.6.4.orig/common/acx_pthread.m4	2006-01-20 10:34:06.000000000 +0100
++++ avahi-0.6.4/common/acx_pthread.m4	2006-01-20 10:34:23.000000000 +0100
+@@ -43,6 +43,10 @@
+ dnl @author Steven G. Johnson <stevenj at alum.mit.edu>
+ dnl @version 2005-01-14
+ dnl @license GPLWithACException
++dnl 
++dnl Checks for GCC shared/pthread inconsistency based on work by
++dnl Marcin Owsiany <marcin at owsiany.pl>
++
+ 
+ AC_DEFUN([ACX_PTHREAD], [
+ AC_REQUIRE([AC_CANONICAL_HOST])
+@@ -215,6 +219,107 @@
+ 
+         # More AIX lossage: must compile with cc_r
+         AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
++
++   # The next part tries to detect GCC inconsistency with -shared on some
++   # architectures and systems. The problem is that in certain
++   # configurations, when -shared is specified, GCC "forgets" to
++   # internally use various flags which are still necessary.
++   
++   # First, check whether caller wants us to skip -shared checks
++   # this is useful
++   AC_MSG_CHECKING([whether to check for GCC pthread/shared inconsistencies])
++   if test x"$3" = x1; then
++      AC_MSG_RESULT([no])
++   else
++      AC_MSG_RESULT([yes])
++
++      # In order not to create several levels of indentation, we test
++      # the value of "$ok" until we find out the cure or run out of
++      # ideas.
++      ok="no"
++
++      #
++      # Prepare the flags
++      #
++      save_CFLAGS="$CFLAGS"
++      save_LIBS="$LIBS"
++      save_CC="$CC"
++      # Try with the flags determined by the earlier checks.
++      #
++      # -Wl,-z,defs forces link-time symbol resolution, so that the
++      # linking checks with -shared actually have any value
++      #
++      # FIXME: -fPIC is required for -shared on many architectures,
++      # so we specify it here, but the right way would probably be to
++      # properly detect whether it is actually required.
++      CFLAGS="-shared -fPIC -Wl,-z,defs $CFLAGS $PTHREAD_CFLAGS"
++      LIBS="$PTHREAD_LIBS $LIBS"
++      CC="$PTHREAD_CC"
++
++      AC_MSG_CHECKING([whether -pthread is sufficient with -shared])
++      AC_TRY_LINK([#include <pthread.h>],
++         [pthread_t th; pthread_join(th, 0);
++         pthread_attr_init(0); pthread_cleanup_push(0, 0);
++         pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
++         [ok=yes])
++      
++      if test "x$ok" = xyes; then
++         AC_MSG_RESULT([yes])
++      else
++         AC_MSG_RESULT([no])
++      fi
++   
++      #
++      # Linux gcc on some architectures such as mips/mipsel forgets
++      # about -lpthread
++      #
++      if test x"$ok" = xno; then
++         AC_MSG_CHECKING([whether -lpthread fixes that])
++         LIBS="-lpthread $PTHREAD_LIBS $save_LIBS"
++         AC_TRY_LINK([#include <pthread.h>],
++            [pthread_t th; pthread_join(th, 0);
++            pthread_attr_init(0); pthread_cleanup_push(0, 0);
++            pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
++            [ok=yes])
++   
++         if test "x$ok" = xyes; then
++            AC_MSG_RESULT([yes])
++            PTHREAD_LIBS="-lpthread $PTHREAD_LIBS"
++         else
++            AC_MSG_RESULT([no])
++         fi
++      fi
++      #
++      # FreeBSD 4.10 gcc forgets to use -lc_r instead of -lc
++      #
++      if test x"$ok" = xno; then
++         AC_MSG_CHECKING([whether -lc_r fixes that])
++         LIBS="-lc_r $PTHREAD_LIBS $save_LIBS"
++         AC_TRY_LINK([#include <pthread.h>],
++             [pthread_t th; pthread_join(th, 0);
++              pthread_attr_init(0); pthread_cleanup_push(0, 0);
++              pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
++             [ok=yes])
++   
++         if test "x$ok" = xyes; then
++            AC_MSG_RESULT([yes])
++            PTHREAD_LIBS="-lc_r $PTHREAD_LIBS"
++         else
++            AC_MSG_RESULT([no])
++         fi
++      fi
++      if test x"$ok" = xno; then
++         # OK, we have run out of ideas
++         AC_MSG_WARN([Impossible to determine how to use pthreads with shared libraries])
++
++         # so it's not safe to assume that we may use pthreads
++         acx_pthread_ok=no
++      fi
++
++      CFLAGS="$save_CFLAGS"
++      LIBS="$save_LIBS"
++      CC="$save_CC"
++   fi
+ else
+         PTHREAD_CC="$CC"
+ fi
+Only in avahi-0.6.4: config.h
+Only in avahi-0.6.4: config.log
+Only in avahi-0.6.4: config.status
+diff -aur avahi-0.6.4.orig/configure avahi-0.6.4/configure
+--- avahi-0.6.4.orig/configure	2006-01-20 10:34:06.000000000 +0100
++++ avahi-0.6.4/configure	2006-01-20 10:37:29.000000000 +0100
+@@ -19294,6 +19294,243 @@
+ echo "${ECHO_T}no" >&6
+ fi
+ 
++
++   # The next part tries to detect GCC inconsistency with -shared on some
++   # architectures and systems. The problem is that in certain
++   # configurations, when -shared is specified, GCC "forgets" to
++   # internally use various flags which are still necessary.
++
++   # First, check whether caller wants us to skip -shared checks
++   # this is useful
++   echo "$as_me:$LINENO: checking whether to check for GCC pthread/shared inconsistencies" >&5
++echo $ECHO_N "checking whether to check for GCC pthread/shared inconsistencies... $ECHO_C" >&6
++   if test x"" = x1; then
++      echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++   else
++      echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++
++      # In order not to create several levels of indentation, we test
++      # the value of "$ok" until we find out the cure or run out of
++      # ideas.
++      ok="no"
++
++      #
++      # Prepare the flags
++      #
++      save_CFLAGS="$CFLAGS"
++      save_LIBS="$LIBS"
++      save_CC="$CC"
++      # Try with the flags determined by the earlier checks.
++      #
++      # -Wl,-z,defs forces link-time symbol resolution, so that the
++      # linking checks with -shared actually have any value
++      #
++      # FIXME: -fPIC is required for -shared on many architectures,
++      # so we specify it here, but the right way would probably be to
++      # properly detect whether it is actually required.
++      CFLAGS="-shared -fPIC -Wl,-z,defs $CFLAGS $PTHREAD_CFLAGS"
++      LIBS="$PTHREAD_LIBS $LIBS"
++      CC="$PTHREAD_CC"
++
++      echo "$as_me:$LINENO: checking whether -pthread is sufficient with -shared" >&5
++echo $ECHO_N "checking whether -pthread is sufficient with -shared... $ECHO_C" >&6
++      cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <pthread.h>
++int
++main ()
++{
++pthread_t th; pthread_join(th, 0);
++         pthread_attr_init(0); pthread_cleanup_push(0, 0);
++         pthread_create(0,0,0,0); pthread_cleanup_pop(0);
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++  (eval $ac_link) 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_exeext'
++  { (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
++  ok=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
++
++      if test "x$ok" = xyes; then
++         echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++      else
++         echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++      fi
++
++      #
++      # Linux gcc on some architectures such as mips/mipsel forgets
++      # about -lpthread
++      #
++      if test x"$ok" = xno; then
++         echo "$as_me:$LINENO: checking whether -lpthread fixes that" >&5
++echo $ECHO_N "checking whether -lpthread fixes that... $ECHO_C" >&6
++         LIBS="-lpthread $PTHREAD_LIBS $save_LIBS"
++         cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <pthread.h>
++int
++main ()
++{
++pthread_t th; pthread_join(th, 0);
++            pthread_attr_init(0); pthread_cleanup_push(0, 0);
++            pthread_create(0,0,0,0); pthread_cleanup_pop(0);
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++  (eval $ac_link) 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_exeext'
++  { (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
++  ok=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
++
++         if test "x$ok" = xyes; then
++            echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++            PTHREAD_LIBS="-lpthread $PTHREAD_LIBS"
++         else
++            echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++         fi
++      fi
++      #
++      # FreeBSD 4.10 gcc forgets to use -lc_r instead of -lc
++      #
++      if test x"$ok" = xno; then
++         echo "$as_me:$LINENO: checking whether -lc_r fixes that" >&5
++echo $ECHO_N "checking whether -lc_r fixes that... $ECHO_C" >&6
++         LIBS="-lc_r $PTHREAD_LIBS $save_LIBS"
++         cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++#include <pthread.h>
++int
++main ()
++{
++pthread_t th; pthread_join(th, 0);
++              pthread_attr_init(0); pthread_cleanup_push(0, 0);
++              pthread_create(0,0,0,0); pthread_cleanup_pop(0);
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++  (eval $ac_link) 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_exeext'
++  { (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
++  ok=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++fi
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
++
++         if test "x$ok" = xyes; then
++            echo "$as_me:$LINENO: result: yes" >&5
++echo "${ECHO_T}yes" >&6
++            PTHREAD_LIBS="-lc_r $PTHREAD_LIBS"
++         else
++            echo "$as_me:$LINENO: result: no" >&5
++echo "${ECHO_T}no" >&6
++         fi
++      fi
++      if test x"$ok" = xno; then
++         # OK, we have run out of ideas
++         { echo "$as_me:$LINENO: WARNING: Impossible to determine how to use pthreads with shared libraries" >&5
++echo "$as_me: WARNING: Impossible to determine how to use pthreads with shared libraries" >&2;}
++
++         # so it's not safe to assume that we may use pthreads
++         acx_pthread_ok=no
++      fi
++
++      CFLAGS="$save_CFLAGS"
++      LIBS="$save_LIBS"
++      CC="$save_CC"
++   fi
+ else
+         PTHREAD_CC="$CC"
+ fi
+Only in avahi-0.6.4/initscript: Makefile
+Only in avahi-0.6.4/initscript/archlinux: Makefile
+Only in avahi-0.6.4/initscript/darwin: Makefile
+Only in avahi-0.6.4/initscript/debian: Makefile
+Only in avahi-0.6.4/initscript/fedora: Makefile
+Only in avahi-0.6.4/initscript/freebsd: Makefile
+Only in avahi-0.6.4/initscript/gentoo: Makefile
+Only in avahi-0.6.4/initscript/suse: Makefile
+Only in avahi-0.6.4: libtool
+Only in avahi-0.6.4.orig/man: avahi-bookmarks.1
+Only in avahi-0.6.4.orig/man: avahi-browse.1
+Only in avahi-0.6.4.orig/man: avahi-daemon.8
+Only in avahi-0.6.4.orig/man: avahi-daemon.conf.5
+Only in avahi-0.6.4.orig/man: avahi-discover.1
+Only in avahi-0.6.4.orig/man: avahi-dnsconfd.8
+Only in avahi-0.6.4.orig/man: avahi-dnsconfd.action.8
+Only in avahi-0.6.4.orig/man: avahi-publish.1
+Only in avahi-0.6.4.orig/man: avahi-resolve.1
+Only in avahi-0.6.4.orig/man: avahi.service.5
+Only in avahi-0.6.4: stamp-h1




More information about the Pkg-utopia-commits mailing list