Compiling beta2 with openssl on XP Pro

"Tony and Bryn Reina" <[email protected]>
Newsgroups gmane.comp.db.postgresql.devel.win32
Message-ID <[email protected]>
I couldn't get beta1 with openssl (snapshot of 27August) past configure on mingw so I thought I'd just skip to beta2 and re-try. 

The snag I'm hitting is that the configure script doesn't seem to find the -lcrypto library. I'm specifying that library as /usr/local/ssl/lib from the --with-libs switch:

/configure --with-openssl --with-includes=/usr/local/include:/usr/ssl/include --with-libs=/usr/local/lib:/usr/ssl/lib

I'm assuming that to include multiple directories you add the colon (:) in between, but perhaps this is wrong (??)

In any case, when the configure script tries to compile conftest.c, it can't find -lcrypto:

configure:7321: gcc -o conftest.exe -O2 -fno-strict-aliasing  -I./src/include/port/win32 -DEXEC_BACKEND  -I/usr/local/include   -L/usr/local/lib conftest.c -lcrypto  -lz -lwsock32 -lm  >&5
c:\mingw\bin\..\lib\gcc-lib\mingw32\3.2.3\..\..\..\..\mingw32\bin\ld.exe: cannot find -lcrypto

BUT, note that only the /usr/local/include and /usr/local/lib are added to the compile command. The script seems to be missing my additional directories of /usr/local/ssl/lib and /usr/local/ssl/include.

Can someone steer me in the right direction? How do I specify multiple search directories with the configure switches?

Thanks.
-Tony

p.s. If I cut out the conftest.c code and try to compile with the above command but add the missing -L and -I switches, it finds -lcrypto but gives the error:

gcc -o conftest.exe -O2 -fno-strict-aliasing  -I./src/include/port/win32 -DEXEC_BACKEND 
 -I/usr/local/include  -I/usr/local/ssl/include -L/usr/local/lib -L/usr/local/ssl/lib  con
ftest.c -lcrypto  -lz -lwsock32 -lm
C:/DOCUME~1/Tony/LOCALS~1/Temp/ccyUbaaa.o(.text+0x15):conftest.c: undefined reference to `fdatasync'

 $ ./configure --with-openssl --with-includes=/usr/local/include:/usr/ssl/include --with-libs=/usr/local/lib:/usr/ssl/lib

## --------- ##
## Platform. ##
## --------- ##

hostname = KING
uname -m = i686
uname -r = 1.0.10(0.46/3/2)
uname -s = MINGW32_NT-5.1
uname -v = 2004-03-15 07:17

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
hostinfo               = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: .
PATH: /usr/local/bin
PATH: /mingw/bin
PATH: /bin
PATH: /c/Perl/bin/
PATH: /c/WINDOWS/system32
PATH: /c/WINDOWS
PATH: /c/WINDOWS/system32/WBEM
PATH: /c/matlab6p5/bin/win32
PATH: /c/Program Files/SSH Communications Security/SSH Secure Shell

configure:7291: checking for CRYPTO_new_ex_data in -lcrypto
configure:7321: gcc -o conftest.exe -O2 -fno-strict-aliasing  -I./src/include/port/win32 -DEXEC_BACKEND  -I/usr/local/include   -L/usr/local/lib conftest.c -lcrypto  -lz -lwsock32 -lm  >&5
c:\mingw\bin\..\lib\gcc-lib\mingw32\3.2.3\..\..\..\..\mingw32\bin\ld.exe: cannot find -lcrypto
configure:7327: $? = 1
configure: failed program was:
| /* confdefs.h.  */
| 
| #define PACKAGE_NAME "PostgreSQL"
| #define PACKAGE_TARNAME "postgresql"
| #define PACKAGE_VERSION "8.0.0beta2"
| #define PACKAGE_STRING "PostgreSQL 8.0.0beta2"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PG_VERSION "8.0.0beta2"
| #define DEF_PGPORT 5432
| #define DEF_PGPORT_STR "5432"
| #define PG_VERSION_STR "PostgreSQL 8.0.0beta2 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.2.3 (mingw special 20030504-1)"
| #define PG_KRB_SRVNAM "postgres"
| #define USE_SSL 1
| #define HAVE_LIBM 1
| #define HAVE_LIBWSOCK32 1
| #define HAVE_LIBZ 1
| #define HAVE_SPINLOCKS 1
| /* end confdefs.h.  */
| 
| /* Override any gcc2 internal prototype to avoid an error.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
|    builtin and then its argument prototype would still apply.  */
| char CRYPTO_new_ex_data ();
| int
| main ()
| {
| CRYPTO_new_ex_data ();
|   ;
|   return 0;
| }
configure:7353: result: no
configure:7363: error: library 'crypto' is required for OpenSSL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.