configure fails with: checking OpenSSL header version... 9070cf (OpenSSL 0.9.7l 28 Sep 2006) checking OpenSSL library version... 90807f (OpenSSL 0.9.8g 19 Oct 2007) checking whether OpenSSL's headers match the library... no The CPPFLAGS are not included in building these tests, but the library is, so it mixes up /usr/include/openssl with /opt/local/gentoo/usr/lib. Reproducible: Always Portage 2.2.00.9583-prefix (default-prefix/darwin/macos/10.5/x86, gcc-4.0.1, unavailable, 9.2.2 i386) ================================================================= System uname: 9.2.2 i386 i386 Timestamp of tree: Sun, 30 Mar 2008 18:28:20 +0000 distcc 2.18.5-Apple.1 powerpc-apple-darwin9.0 (protocols 1 and 2) (default port 3632) [disabled] app-shells/bash: 3.2_p33 dev-lang/python: 2.5.1-r5 sys-devel/autoconf: 2.61-r01.1 sys-devel/automake: 1.10.1 sys-devel/libtool: 1.5.26 ACCEPT_KEYWORDS="~x86-macos" CBUILD="i686-apple-darwin9" CFLAGS="-O2 -pipe -march=native" CHOST="i686-apple-darwin9" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo" CPPFLAGS="-I/opt/local/gentoo/usr/include" CXXFLAGS="-O2 -pipe -march=native" DISTDIR="/opt/local/gentoo/usr/portage/distfiles" EPREFIX="/opt/local/gentoo" FEATURES="collision-protect distlocks metadata-transfer nostrip parallel-fetch preserve-libs sfperms strict unmerge-orphans userfetch" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo" LANG="en_GB.UTF-8" LDFLAGS="-Wl,-search_paths_first -L/opt/local/gentoo/usr/lib -L/opt/local/gentoo/lib" PKGDIR="/opt/local/gentoo/usr/portage/packages" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages" PORTAGE_TMPDIR="/opt/local/gentoo/var/tmp" PORTDIR="/opt/local/gentoo/usr/portage" SYNC="svn://overlays.gentoo.org/proj/alt/trunk/prefix-overlay" USE="aqua coreaudio cracklib midi mmx mmxext ncurses nls objc objc++ prefix readline sse sse2 ssl unicode x86-macos zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="Darwin" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" Unset: CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
seems to me like you are post emerge --sync, is that correct?