diff options
author | Jeroen Roovers <jer@gentoo.org> | 2013-12-12 17:02:28 +0000 |
---|---|---|
committer | Jeroen Roovers <jer@gentoo.org> | 2013-12-12 17:02:28 +0000 |
commit | 3226205a0aec54e368a63d6c9c3174ff00514d15 (patch) | |
tree | 4d4d4a34996466a297537ba2dbccc165df3d4b95 /net-analyzer | |
parent | Version bump. (diff) | |
download | historical-3226205a0aec54e368a63d6c9c3174ff00514d15.tar.gz historical-3226205a0aec54e368a63d6c9c3174ff00514d15.tar.bz2 historical-3226205a0aec54e368a63d6c9c3174ff00514d15.zip |
Fix POSIX threads checking (bug #490168).
Package-Manager: portage-2.2.7/cvs/Linux x86_64
Manifest-Sign-Key: 0xA792A613
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/iftop/ChangeLog | 6 | ||||
-rw-r--r-- | net-analyzer/iftop/Manifest | 16 | ||||
-rw-r--r-- | net-analyzer/iftop/files/ax_pthread.m4 | 317 | ||||
-rw-r--r-- | net-analyzer/iftop/files/iftop-1.0_pre2-pthread.patch | 46 | ||||
-rw-r--r-- | net-analyzer/iftop/iftop-1.0_pre2.ebuild | 7 |
5 files changed, 381 insertions, 11 deletions
diff --git a/net-analyzer/iftop/ChangeLog b/net-analyzer/iftop/ChangeLog index d6d816f8eaf0..df3ff756944c 100644 --- a/net-analyzer/iftop/ChangeLog +++ b/net-analyzer/iftop/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for net-analyzer/iftop # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/iftop/ChangeLog,v 1.50 2013/11/27 12:25:45 nimiux Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/iftop/ChangeLog,v 1.51 2013/12/12 17:02:26 jer Exp $ + + 12 Dec 2013; Jeroen Roovers <jer@gentoo.org> iftop-1.0_pre2.ebuild, + +files/iftop-1.0_pre2-pthread.patch, +files/ax_pthread.m4: + Fix POSIX threads checking (bug #490168). 27 Nov 2013; Chema Alonso <nimiux@gentoo.org> iftop-1.0_pre2.ebuild: Stable for amd64 wrt bug #490078 diff --git a/net-analyzer/iftop/Manifest b/net-analyzer/iftop/Manifest index b684da01a4ff..d81c20072ba0 100644 --- a/net-analyzer/iftop/Manifest +++ b/net-analyzer/iftop/Manifest @@ -1,23 +1,21 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 +AUX ax_pthread.m4 12983 SHA256 8cab55885c9839deded96f0afedb7f20f9833d3a51c148f01049820d81211516 SHA512 93c7ba3bb00712308de95273563f41814d05a6650ae2eec25f2b198f757b7f0206ae2e5679ff436da939be9bd962f37317978759ac08c1d14df0beb03440f84a WHIRLPOOL 73219045ad2e38027e104e2734e3df773f67263e3f570d47cb0ea7d7c0662ed746119b5e550406b8a7fc59bbdb0a27d8da975f24b330379f992d543b638fd162 AUX iftop-0.16-bar_in_bytes.patch 530 SHA256 39f2b99aa9f16fa54aebd39e066c0cba579c18d82d5a169c91308e72c4439422 SHA512 fbcba72320bb9c98ab4a6ce241021c871bd51100590a201f4fa42b789f10320472505800f4e109ac4143275e8220112ba73c0c221ce1b1351a83628023d858dd WHIRLPOOL 0c1a37a8b957db9b70f8705ec5ffefb774dfc342d149691dff311f3c6bf71aeeac9dbd384c4e7d8f5a25e2f71c9f74991e968a2bc5be86166f47ba5f9bc91b77 +AUX iftop-1.0_pre2-pthread.patch 1442 SHA256 1993f18b717a5c7d08e824135b9873622cb0b0e68d7b2897e53448ae2ee5368f SHA512 59f3139284701dda0f961253ceefc2823096820baa67c3f0fd437cf542582608722a90662617bcaf029de1688726ac5e071f67386eee09cb2809e084e386a074 WHIRLPOOL 8cbca4106079f0a292fa989a4d6c48c692077ad978196de82d2796e985509fcd334eb6473b5f8427621266bfca64cf48d4928f3f2ed293ab6eef129ea0ad78c4 AUX iftop-1.0_pre2-tinfo.patch 1799 SHA256 ce7cd7ee920bcb755f732695413b3caeb99d61bebc1094d2d67257eb53f96d50 SHA512 f92664e47324064ebafcf0ba530afab54cabc68ff97fe43bbd1bc1c69f0abef8a14859626613b9a6022e35d248bc476501f5a145af5ff828d5870ab53d3c092a WHIRLPOOL 2748e8a93b49e80ac5fa22a860fec2178c3914e487b1542920010d968ae63565bd1f0eb5ffa277f45abd2cac206830756cd9351bb6074e04c18431a3103bd20e AUX iftoprc 1391 SHA256 f21c0324774c4b6635359e4de76d13ad6bafdebdcbb29df9f986cc47d3569fa2 SHA512 01373add0177399e7cf4ae0ecba893fdd9c73bad5243478b4ac9ac5e936647738a22906ee1e8b22b51d541cc4150d0e0619f134666a1e3d0cb78a59a5c04b95b WHIRLPOOL 6dfc9099bf5d906844fce63b8aac8326535e0684cf5c26f13a39b9a7df8120dbd1f3bd246e81990f11cc4af2a3e0434958b072f4a63db66f6ae22fff65003eea DIST iftop-0.17.tar.gz 160381 SHA256 d032547c708307159ff5fd0df23ebd3cfa7799c31536fa0aea1820318a8e0eac SHA512 41e3bc5feac5927f67356f491fcab7a28f7a32102cc33c67d81c1dc755273c42e32b540b14b6254a540f1b6c1b1ad6c50e3095c3b5282db2ea12dd0049ce2ebd WHIRLPOOL 997867975de1809f158f824665ce05b700f94ba079f4645941321faac19790dc95a8ee3756989a208d59f55bc7b6646d5e73c31c84a13810438f4a5947ee6fdc DIST iftop-1.0pre2.tar.gz 172736 SHA256 1b193037bb3019afae88cd94c87468aac4b045d81ab816ed8d2f489716b14027 SHA512 708172baa00a94671b494f33e7290af9ed4e0f764fabb500187855ee39840e379590274802e9ef360c128e881cfe0cefe7a12a9bfdcf9cfa7ffb49746b02300a WHIRLPOOL a28996872762d25e6784ef11a98c200cd71bec63092e2b1fbe41e950273b38378e404db89fbfba7eccbbb2153af8cbd30bd2e91a0f577b838d6b591c7ef300a9 EBUILD iftop-0.17.ebuild 796 SHA256 0f028a405150a951600c32b874b5e9981312fd1560438dc66fd83bf5c39530f8 SHA512 7f0ddb6d9784fe6648825eb2043734e21363338ac5ebac0b5c41d915c56ee526de92c56a760f3aa80130507b094998f5ea161739ca147ab090b4fafe0de4d735 WHIRLPOOL 3cda57e1135be95510851e77b0951541f533e918a20a1a6c26af52d1a3593a700d3fadd4c59275167daa3876e35cc56d3ad4e4a38a423deb0440d2e319ee8876 -EBUILD iftop-1.0_pre2.ebuild 904 SHA256 2b2f48582a96c3d94323fbedafb3071a2bc62b6619e4148d6a26c0a028eca01e SHA512 56696d524e3fbd47c9909da68d149583090d63f2a00ae7f8d67943e13739e9c375410d32445c5f54a918322d41ee6e371218e59b31bf5e2e8c67cc47e059f3d6 WHIRLPOOL 8008a670a382ca67ffafdef2a243ce4bec85a809d6032cd1f80450cd0646d04f03df18841ab2401a9e48fc2f0ea890473e10ddde8524cc5e65db4abf2ab1b480 -MISC ChangeLog 6341 SHA256 92b336f3799a613e0d28db0a20a5356c1c7b52076885c9513c51d5ca1c94a1e3 SHA512 0cb78d225a8b5d957dcbac427b6ba3058adfb5233f831efd6498553ec6622300ed7cb832559507bd98ebfc72ad18efeaf523fb89f3763876a8b79b667489385c WHIRLPOOL c86864d84bfde9844c7ed58f37c5d39dc12ee7c3283c36eeb9636efd9cd2710031818f66f79be70572688aca1df7e82348a6037844836f120aef3d4124d2e3c3 +EBUILD iftop-1.0_pre2.ebuild 1021 SHA256 0c8c13e4be94e48f6167a8c81f011dd4e7ea0059c28533adc60a0c7c6d9b26ec SHA512 8ffe1800dce05566712d7627f92b18885c798388f289a6c324c38796029995bc49faa32eff9df4c9efb00f977f9cf9dc9e78bf9b180583614a186cba1cd9bc26 WHIRLPOOL 8f391ca42915417ce42309a01e3e131d9528f40f05fb9d34d12e72ca16c6c3430ee626791ee15bd4d852ae03a1cb7852bec54a7153ca180f2dee1723ec552634 +MISC ChangeLog 6514 SHA256 30986d4cd6c2844fdf389a037a8b0ce21cef17d2c997f0fa7eb0720044e2eb2f SHA512 0feb0c7825a2b1fb33d76ee942c31d4e3843cffd498a4df51305755dda945960ce95d7e148aa10360c9e7a4c9a0e54f8c73ae792f2d057079077576eba4082ac WHIRLPOOL b1f9ea84f980dae66f98dc3767062ec7ca3f06aedcde001fede12644f356874d098a0f47fb28c5ff0b2f96cecbe671230c1a360ee81066fb97ae56451de6816d MISC metadata.xml 161 SHA256 442ce683981a7e51854e06ffdc2bdbbd956decf0d7a1f0c1ca056439a7230ebd SHA512 24f0086dfd65743d480e231efa20106ecd3980449864d6158b7e92542a0f4cfe58d3dbcbabd0042201beb43f5a57f6d30a912037cfcdc56ed56ac0532362c5da WHIRLPOOL de3b36cfc647f36b482a403ce526a395d38a69100917ee50aa5cbd888708678a6d4f67aae3381ef373b5ccb1df196503a2554765598491bd71da9c0415f24a80 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) -iQEcBAEBCAAGBQJSleUIAAoJEA2sAkrWKOU2U04H/0aPDtVAfHmRcNzDRaPjYRUZ -NnEEsz5WVUwoprOfe+EZV0UU4hdTLPnJtZ6u8p/cmZ1e0z4POKK8/Z5ExBy+99gw -//1Bb0eCQVrqC4PLyPKPCC3uyp5FsKiJ3nZC1bh8IsEikFqswMXXrd0I9UHJ1vT8 -BP/oIMpOQWAHlsbAQna0M61kTzCwif9tcMvoUDiLW/7EIXjgiUM+hvHjfmZFkF6V -I8CAPhNjeKVMHxZiIFdD6xMtblk5zX2J79F4vpZZc6rny3SiZzl7x/Bxr1GEWp9L -4Yxas2L5yOdz7jc/fuNPJsMoz181Ux1xMfaxJyU6MQDRz+I/D1I36f2yp2WwNQQ= -=/cZN +iEYEAREIAAYFAlKp7CQACgkQVWmRsqeSphOdXQCaAz3l7y53OjnVn/E8KN5xTd+M +paoAn2I2LpK35KozfIxAwZGmyM/C/awK +=D33x -----END PGP SIGNATURE----- diff --git a/net-analyzer/iftop/files/ax_pthread.m4 b/net-analyzer/iftop/files/ax_pthread.m4 new file mode 100644 index 000000000000..6d400ed4e8e2 --- /dev/null +++ b/net-analyzer/iftop/files/ax_pthread.m4 @@ -0,0 +1,317 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the +# PTHREAD_PRIO_INHERIT symbol is defined when compiling with +# PTHREAD_CFLAGS. +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# Updated for Autoconf 2.68 by Daniel Richard G. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG> +# +# 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 20 + +AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) +AC_DEFUN([AX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_PUSH([C]) +ax_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) + AC_MSG_RESULT($ax_pthread_ok) + if test x"$ax_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case ${host_os} in + solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" + ;; + + darwin*) + ax_pthread_flags="-pthread $ax_pthread_flags" + ;; +esac + +if test x"$ax_pthread_ok" = xno; then +for flag in $ax_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) + if test x"$ax_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h> + static void routine(void *a) { a = 0; } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($ax_pthread_ok) + if test "x$ax_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$ax_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>], + [int attr = $attr; return attr /* ; */])], + [attr_name=$attr; break], + []) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case ${host_os} in + aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";; + osf* | hpux*) flag="-D_REENTRANT";; + solaris*) + if test "$GCC" = "yes"; then + flag="-D_REENTRANT" + else + flag="-mt -D_REENTRANT" + fi + ;; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], + ax_cv_PTHREAD_PRIO_INHERIT, [ + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])], + [ax_cv_PTHREAD_PRIO_INHERIT=yes], + [ax_cv_PTHREAD_PRIO_INHERIT=no]) + ]) + AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"], + AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.])) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: compile with *_r variant + if test "x$GCC" != xyes; then + case $host_os in + aix*) + AS_CASE(["x/$CC"], + [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], + [#handle absolute path differently from PATH based program lookup + AS_CASE(["x$CC"], + [x/*], + [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], + [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + ;; + esac + fi +fi + +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$ax_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + ax_pthread_ok=no + $2 +fi +AC_LANG_POP +])dnl AX_PTHREAD diff --git a/net-analyzer/iftop/files/iftop-1.0_pre2-pthread.patch b/net-analyzer/iftop/files/iftop-1.0_pre2-pthread.patch new file mode 100644 index 000000000000..75424e5043b7 --- /dev/null +++ b/net-analyzer/iftop/files/iftop-1.0_pre2-pthread.patch @@ -0,0 +1,46 @@ +--- a/configure.in ++++ b/configure.in +@@ -383,39 +383,10 @@ + dnl libraries, etc. We use a test program to figure this stuff out. + dnl + +-AC_MSG_CHECKING([POSIX threads compilation]) +-thrfail=1 +-oldCFLAGS=$CFLAGS +-oldLIBS=$LIBS +-for flag in "" -mt -pthread -thread ; do +- CFLAGS="$oldCFLAGS $flag" +- for lib in "" -lpthread "-lpthread -lposix4" ; do +- LIBS="$oldLIBS $lib" +- AC_LINK_IFELSE(AC_LANG_SOURCE([`cat config/pthread.c`]), [ +- foundthrlib=$lib +- foundthrflag=$flag +- thrfail=0 +- break +- ]) +- done +- if test $thrfail = 0 ; then +- break +- fi +-done +- +-if test $thrfail = 1 ; then +- AC_MSG_RESULT([no idea]) +- AC_MSG_ERROR([can't figure out how to compile with POSIX threads +- If your system actually supports POSIX threads, this means we've messed up.]) +-fi +- +-AC_MSG_RESULT([CFLAGS=$foundthrflag and LIBS=$foundthrlib]) +-AC_MSG_CHECKING([POSIX threads usability]) +-AC_RUN_IFELSE([`cat config/pthread.c`], +- [AC_MSG_RESULT([yes])], +- [AC_MSG_ERROR( +- [it fails. We probably guessed the wrong CFLAGS.])], +- [AC_MSG_RESULT([can't test because we are cross-compiling])]) ++AX_PTHREAD( ++ [LIBS="$PTHREAD_LIBS $LIBS" ++ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"], ++ AC_MSG_ERROR([Could not find out how to enable POSIX threads])) + + dnl + dnl Are we on a system (like Solaris) that requires promiscuous mode in order to diff --git a/net-analyzer/iftop/iftop-1.0_pre2.ebuild b/net-analyzer/iftop/iftop-1.0_pre2.ebuild index edf4c270cf81..b44d83b41b7e 100644 --- a/net-analyzer/iftop/iftop-1.0_pre2.ebuild +++ b/net-analyzer/iftop/iftop-1.0_pre2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/iftop/iftop-1.0_pre2.ebuild,v 1.8 2013/11/27 12:25:45 nimiux Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/iftop/iftop-1.0_pre2.ebuild,v 1.9 2013/12/12 17:02:26 jer Exp $ EAPI=5 @@ -24,6 +24,11 @@ S="${WORKDIR}"/${P/_/} src_prepare() { epatch "${FILESDIR}"/${P}-tinfo.patch sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.in || die + + # bug 490168 + cat "${FILESDIR}"/ax_pthread.m4 >> "${S}"/acinclude.m4 || die + epatch "${FILESDIR}"/${P}-pthread.patch + eautoreconf } |