pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tometzky@batory.org.pl
To: pgsql-bugs@postgresql.org
Subject: BUG #6486: configure - unable to cross-compile postgresql with openssl using Fedora MinGW
Date: Thu, 23 Feb 2012 18:51:39 +0000
Message-ID: <E1S0dlT-0001ls-JY@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      6486
Logged by:          Tomasz Ostrowski
Email address:      tometzky@batory.org.pl
PostgreSQL version: 9.1.2
Operating system:   Fedora Linux 16
Description:        

Fedora MinGW is a project which allows for easy cross-compiling of Windows
binaries and libraries on Fedora Linux - much easier than with native MinGW
on Windows - just use "./configure --host=i686-pc-mingw32 && make" and
you're done. I'm using it to easily compile "libpq" and "libpqxx" for a C++
project.

I can compile PostgreSQL just fine using this but without OpenSSL support.
When I try to compile with OpenSSL on Windows Postgres expects to link with
libeay32.dll and libssleay32.dll, which aren't there, but ignores that there
are dll's for standard "crypto" and "ssl" libraries available.

To reproduce:

1. Download Fedora LiveCD iso from http://fedoraproject.org/

2. Run it in a virtual machine - for example:
	qemu-kvm -m 2048 -cdrom Fedora-16-i686-Live-Desktop.iso
You can also burn it to a CD-R or install it to a USB Thumb-drive using
"livecd-iso-to-disk" script included in this image, and start a physical
computer with it, but a virtual machine would be easier and faster.

3. Download postgresql-9.1.2.tar.bz2 to /tmp/

4. Run using "System Tools\Terminal":
	su -c 'yum -y install mingw32-gcc mingw32-openssl gcc'
	cd /tmp/
	tar xf postgresql-9.1.2.tar.bz2
	cd postgresql-9.1.2
	./configure --with-openssl --host=i686-pc-mingw32

Result:
	(...)
	checking for CRYPTO_new_ex_data in -leay32... no
	configure: error: library 'eay32' is required for OpenSSL

I've attached a proposed patch for configure.in - it uses AC_SEARCH_LIBS
instead of AC_CHECK_LIB on Windows. With this patch and after autoreconf (I
needed also to remove "autoconf 2.63 is required" check from configure.in):
	./configure --with-openssl --host=i686-pc-mingw32 && make
completed successfully and a working binary and libpq.dll using
libcrypto-10.dll and libssl-10.dll was created.

Regards
Tometzky
-- 
...although Eating Honey was a very good thing to do, there was a
moment just before you began to eat it which was better than when you
were...
                                                      Winnie the Pooh

inline patch 1: postgresql-9.1.2/configure.in (+0/-0 lines) download inline-1.patchdiff -urNP postgresql-9.1.2.orig/configure.in postgresql-9.1.2/configure.in --- postgresql-9.1.2.orig/configure.in 2011-12-01 22:47:20.000000000 +0100 +++ postgresql-9.1.2/configure.in 2012-02-23 19:24:43.708343882 +0100 @@ -945,8 +945,8 @@ AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library
'crypto' is required for OpenSSL])]) AC_CHECK_LIB(ssl, SSL_library_init, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])]) else - AC_CHECK_LIB(eay32, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'eay32' is required for OpenSSL])]) - AC_CHECK_LIB(ssleay32, SSL_library_init, [], [AC_MSG_ERROR([library 'ssleay32' is required for OpenSSL])]) + AC_CHECK_LIB(CRYPTO_new_ex_data, crypto eay32, [], [AC_MSG_ERROR([library 'crypto' or 'eay32' is required for OpenSSL])]) + AC_CHECK_LIB(SSL_library_init, ssl ssleay32, [], [AC_MSG_ERROR([library 'ssl' or 'ssleay32' is required for OpenSSL])]) fi fi

view thread (5+ messages)  latest in thread

Message-ID: <E1S0dlT-0001ls-JY@wrigleys.postgresql.org>
Permalink:  ../E1S0dlT-0001ls-JY@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1S0dlT-0001ls-JY@wrigleys.postgresql.org

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tometzky@batory.org.pl
  Subject: Re: BUG #6486: configure - unable to cross-compile postgresql with openssl using Fedora MinGW
  In-Reply-To: <E1S0dlT-0001ls-JY@wrigleys.postgresql.org>
  References: <E1S0dlT-0001ls-JY@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox