Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 162640 - net-p2p/ctorrent-2.2 does compile (cannot find sha.h)
Summary: net-p2p/ctorrent-2.2 does compile (cannot find sha.h)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo net-p2p team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2007-01-18 10:40 UTC by Matthias Schwarzott
Modified: 2007-01-20 14:23 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
files/ctorrent-2.2-as-needed.patch (ctorrent-2.2-as-needed.patch,916 bytes, patch)
2007-01-18 23:25 UTC, TGL
Details | Diff
ctorrent-2.2-ebuild.patch (ctorrent-2.2-ebuild.patch,396 bytes, patch)
2007-01-18 23:26 UTC, TGL
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Schwarzott gentoo-dev 2007-01-18 10:40:25 UTC
net-p2p/ctorrent-2.2 does compile (cannot find sha.h):
# emerge ctorrent
...
make[1]: Entering directory `/var/tmp/portage/net-p2p/ctorrent-2.2/work/ctorrent-dnh2.2'
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.     -O2 -march=athlon-xp -fomit-frame-pointer -pipe -MT bencode.o -MD -MP -MF ".deps/bencode.Tpo" -c -o bencode.o bencode.cpp; \
        then mv -f ".deps/bencode.Tpo" ".deps/bencode.Po"; else rm -f ".deps/bencode.Tpo"; exit 1; fi
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.     -O2 -march=athlon-xp -fomit-frame-pointer -pipe -MT bitfield.o -MD -MP -MF ".deps/bitfield.Tpo" -c -o bitfield.o bitfield.cpp; \
        then mv -f ".deps/bitfield.Tpo" ".deps/bitfield.Po"; else rm -f ".deps/bitfield.Tpo"; exit 1; fi
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.     -O2 -march=athlon-xp -fomit-frame-pointer -pipe -MT btconfig.o -MD -MP -MF ".deps/btconfig.Tpo" -c -o btconfig.o btconfig.cpp; \
        then mv -f ".deps/btconfig.Tpo" ".deps/btconfig.Po"; else rm -f ".deps/btconfig.Tpo"; exit 1; fi
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.     -O2 -march=athlon-xp -fomit-frame-pointer -pipe -MT btcontent.o -MD -MP -MF ".deps/btcontent.Tpo" -c -o btcontent.o btcontent.cpp; \
        then mv -f ".deps/btcontent.Tpo" ".deps/btcontent.Po"; else rm -f ".deps/btcontent.Tpo"; exit 1; fi
btcontent.cpp:13:17: Fehler: sha.h: Datei oder Verzeichnis nicht gefunden
btcontent.cpp: In function »void Sha1(char*, size_t, unsigned char*)«:
btcontent.cpp:62: Fehler: »SHA_CTX« wurde in diesem Gültigkeitsbereich nicht definiert
btcontent.cpp:62: Fehler: expected `;' before »context«
btcontent.cpp:63: Fehler: »context« wurde in diesem Gültigkeitsbereich nicht definiert
btcontent.cpp:63: Fehler: »SHA1_Init« wurde in diesem Gültigkeitsbereich nicht definiert
btcontent.cpp:64: Fehler: »SHA1_Update« wurde in diesem Gültigkeitsbereich nicht definiert
btcontent.cpp:65: Fehler: »SHA1_Final« wurde in diesem Gültigkeitsbereich nicht definiert
make[1]: *** [btcontent.o] Fehler 1
make[1]: Leaving directory `/var/tmp/portage/net-p2p/ctorrent-2.2/work/ctorrent-dnh2.2'
make: *** [all] Fehler 2

!!! ERROR: net-p2p/ctorrent-2.2 failed.
Call stack:
  ebuild.sh, line 1618:   Called dyn_compile
  ebuild.sh, line 975:   Called qa_call 'src_compile'
  environment, line 3425:   Called src_compile
  ebuild.sh, line 649:   Called die

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at '/var/log/portage/net-p2p:ctorrent-2.2:20070118-103755.log'.


# emerge --info
Portage 2.1.2 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.5-r0, 2.6.18.6 i686)
=================================================================
System uname: 2.6.18.6 i686 AMD Athlon(tm) XP 3000+
Gentoo Base System version 1.12.9
Timestamp of tree: Unknown
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
dev-java/java-config: 1.3.7, 2.0.31-r3
dev-lang/python:     2.3.6, 2.4.4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.4-r6
sys-apps/sandbox:    1.2.18.1
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.7.9-r1, 1.9.6-r2, 1.10
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.14
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.19.2-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/eselect/compiler /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
DISTDIR="/usr/my-distfiles"
FEATURES="autoaddcvs autoconfig ccache collision-detect cvs distlocks metadata-transfer parallel-fetch sandbox sfperms sign strict"
GENTOO_MIRRORS="http://85.25.128.62 http://pandemonium.tiscali.de/pub/gentoo/"
LANG="de_DE.utf8"
LC_ALL="de_DE.utf8"
LDFLAGS="-Wl,--as-needed"
LINGUAS="de"
PKGDIR="/usr/my-packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/matze/overlays/gentoo.de /home/matze/overlays/zzam /home/matze/overlays/vdr/testing /home/matze/overlays/vdr/experimental /home/matze/overlays/layman/sunrise"
SYNC="cvs://zzam@cvs.gentoo.org:/var/cvsroot"
USE="3dnow 3dnowext X Xaw3d a52 aac acl alsa amr apache2 artswrappersuid audacious berkdb bitmap-fonts bluetooth bzip2 cairo cap caps cddb cdparanoia cdr cli cracklib crypt cups dbus dlloader doc dri dts dvb dvd dvdr eds emboss encode exif fam fbcon ffmpeg firefox font-server fortran fuse gcj gdbm gif gimpprint glut gphoto2 gpm gstreamer gtk gtk2 hal iconv imap ipv6 isdnlog java jpeg jpeg2k kde kdexdeltas ldap libdvdread libg++ lirc logitech-mouse mad mikmod mmx mmxext mng mp3 mpeg mplayer musicbrainz mysql ncurses nls nptl nptlonly nvram offensive ogg opengl oss pam pcre pdf perl php png ppds pppd python qt3 qt4 quotes readline reflection samba session sms sndfile spell spl sql sqlite sse ssl svg taglib tcltk tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode usb userlocales vcd vdr visualization vorbis win32codecs wma wmf x264 x86 xinerama xml xorg xrandr xslt xv zlib zvbi" ALSA_CARDS="emu10k1 intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" DVB_CARDS="ttpci usb-wt220u dibusb-usb2 usb-dib0700" ELIBC="glibc" INPUT_DEVICES="mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de" LIRC_DEVICES="serial" USERLAND="GNU" VIDEO_CARDS="nvidia v4l vesa vbdev nv"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS


My system only provides /usr/include/openssl/sha.h
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-01-18 11:47:03 UTC
Please, set your locales to C when reporting bugs.
Comment 2 Marcin D. Mikielewicz 2007-01-18 11:50:15 UTC
For me this ebuild works fine (on ~x86).
<sha.h> is only included when 
HAVE_LIBCRYPT or HAVE_LIBMD or HAVE_LIBCRYPTO was defined
check config.h in:
/var/tmp/portage/net-p2p/ctorrent-2.2/work/ctorrent-dnh2.2/config.h
i have:
/* #undef HAVE_LIBCRYPT */
/* #undef HAVE_LIBCRYPTO */
/* #undef HAVE_LIBMD */
#define HAVE_LIBSSL 1

openssl - 0.9.8d

From configure output:
...
checking for SHA1_Init in -lssl... yes
...
checking ssl/sha.h usability... no
checking ssl/sha.h presence... no
checking for ssl/sha.h... no
...

and haven't any problem.
Comment 3 Matthias Schwarzott gentoo-dev 2007-01-18 13:07:58 UTC
Sorry jakub.
Now with LC_ALL=C and complete configure output

Relevant parts seem to be:
checking for SHA1_Init in -lssl... no
checking for SHA1_Init in -lcrypt... no
checking for SHA1_Init in -lcrypto... yes

checking ssl/sha.h usability... no
checking ssl/sha.h presence... no
checking for ssl/sha.h... no


# emerge ctorrent
...
>>> Compiling source in /var/tmp/portage/net-p2p/ctorrent-2.2/work/ctorrent-dnh2.2 ...
./configure --prefix=/usr --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --build=i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for i686-pc-linux-gnu-g++... i686-pc-linux-gnu-g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether i686-pc-linux-gnu-g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of i686-pc-linux-gnu-g++... gcc3
checking for i686-pc-linux-gnu-gcc... i686-pc-linux-gnu-gcc
checking whether we are using the GNU C compiler... yes
checking whether i686-pc-linux-gnu-gcc accepts -g... yes
checking for i686-pc-linux-gnu-gcc option to accept ANSI C... none needed
checking dependency style of i686-pc-linux-gnu-gcc... gcc3
checking for SHA1_Init in -lssl... no
checking for SHA1_Init in -lcrypt... no
checking for SHA1_Init in -lcrypto... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking how to run the C preprocessor... i686-pc-linux-gnu-gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for memory.h... (cached) yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking ssl/sha.h usability... no
checking ssl/sha.h presence... no
checking for ssl/sha.h... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether i686-pc-linux-gnu-gcc needs -traditional... no
checking for working memcmp... yes
checking return type of signal handlers... void
checking whether lstat dereferences a symlink specified with a trailing slash... yes
checking whether stat accepts an empty string... no
checking for ftruncate... yes
checking for gethostbyname... yes
checking for gettimeofday... yes
checking for getwd... yes
checking for inet_ntoa... yes
checking for memchr... yes
checking for memmove... yes
checking for memset... yes
checking for mkdir... yes
checking for select... yes
checking for socket... yes
checking for strchr... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strtol... yes
checking for strtoll... yes
checking for strnstr... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for _LARGE_FILES value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for fseeko... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
make  all-am
make[1]: Entering directory `/var/tmp/portage/net-p2p/ctorrent-2.2/work/ctorrent-dnh2.2'
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.     -O2 -march=athlon-xp -fomit-frame-pointer -pipe -MT bencode.o -MD -MP -MF ".deps/bencode.Tpo" -c -o bencode.o bencode.cpp; \
        then mv -f ".deps/bencode.Tpo" ".deps/bencode.Po"; else rm -f ".deps/bencode.Tpo"; exit 1; fi
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.     -O2 -march=athlon-xp -fomit-frame-pointer -pipe -MT bitfield.o -MD -MP -MF ".deps/bitfield.Tpo" -c -o bitfield.o bitfield.cpp; \
        then mv -f ".deps/bitfield.Tpo" ".deps/bitfield.Po"; else rm -f ".deps/bitfield.Tpo"; exit 1; fi
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.     -O2 -march=athlon-xp -fomit-frame-pointer -pipe -MT btconfig.o -MD -MP -MF ".deps/btconfig.Tpo" -c -o btconfig.o btconfig.cpp; \
        then mv -f ".deps/btconfig.Tpo" ".deps/btconfig.Po"; else rm -f ".deps/btconfig.Tpo"; exit 1; fi
if i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I.     -O2 -march=athlon-xp -fomit-frame-pointer -pipe -MT btcontent.o -MD -MP -MF ".deps/btcontent.Tpo" -c -o btcontent.o btcontent.cpp; \
        then mv -f ".deps/btcontent.Tpo" ".deps/btcontent.Po"; else rm -f ".deps/btcontent.Tpo"; exit 1; fi
btcontent.cpp:13:17: error: sha.h: No such file or directory
btcontent.cpp: In function 'void Sha1(char*, size_t, unsigned char*)':
btcontent.cpp:62: error: 'SHA_CTX' was not declared in this scope
btcontent.cpp:62: error: expected `;' before 'context'
btcontent.cpp:63: error: 'context' was not declared in this scope
btcontent.cpp:63: error: 'SHA1_Init' was not declared in this scope
btcontent.cpp:64: error: 'SHA1_Update' was not declared in this scope
btcontent.cpp:65: error: 'SHA1_Final' was not declared in this scope
make[1]: *** [btcontent.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/net-p2p/ctorrent-2.2/work/ctorrent-dnh2.2'
make: *** [all] Error 2

!!! ERROR: net-p2p/ctorrent-2.2 failed.
Call stack:
  ebuild.sh, line 1618:   Called dyn_compile
  ebuild.sh, line 975:   Called qa_call 'src_compile'
  environment, line 3425:   Called src_compile
  ebuild.sh, line 649:   Called die

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at '/var/log/portage/net-p2p:ctorrent-2.2:20070118-130526.log'.
Comment 4 Raúl Porcel (RETIRED) gentoo-dev 2007-01-18 15:24:42 UTC
Works for me too :/
Comment 5 TGL 2007-01-18 23:25:10 UTC
The issue relates to LDFLAGS=-Wl,--as-needed:
 - without this flag, the configure script detects that SHA_Init is in libssl, because this one is tested first and is linked to libcrypto, which provides SHA_Init.
 - with this flag, the test on libssl fails, because the lib is excluded from linking since it is not actually used, and then the configure script finds SHA_Init in libcrypto.

This difference is not, by itself, a problem.
But then comes btcontent.cpp and btfiles.cpp, which do that:
  #if defined(HAVE_LIBCRYPT) || defined(HAVE_LIBMD) || defined(HAVE_LIBCRYPTO)
  #include <sha.h>
  #elif defined(HAVE_LIBSSL)
  #include <openssl/sha.h>
  #endif
It means that when it's libcrypto which is detected, they will not include the header from openssl.

I will attach a patch which fixed that for me.  I'm not sure it won't break on other configurations/systems though: is there any "libcrypto" around which would not be from openssl?

PS: can someone (reporter or assignee) mark this report as blocking bug #129413? Thanks.
Comment 6 TGL 2007-01-18 23:25:55 UTC
Created attachment 107399 [details, diff]
files/ctorrent-2.2-as-needed.patch
Comment 7 TGL 2007-01-18 23:26:19 UTC
Created attachment 107400 [details, diff]
ctorrent-2.2-ebuild.patch
Comment 8 Matthias Schwarzott gentoo-dev 2007-01-19 23:43:54 UTC
With that patch applied it compiles with --as-needed.
Comment 9 Raúl Porcel (RETIRED) gentoo-dev 2007-01-20 14:23:21 UTC
Fixed, thanks