fe-connect build failure (Solaris 9, PGSQL 7.3.3, OpenSSL 0.9.7b) - Mailing list pgsql-bugs

From Paul Eggert
Subject fe-connect build failure (Solaris 9, PGSQL 7.3.3, OpenSSL 0.9.7b)
Date
Msg-id 200306122301.h5CN16er008764@ken.twinsun.com
Whole thread Raw
Responses Re: fe-connect build failure (Solaris 9, PGSQL 7.3.3, OpenSSL  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-bugs
I ran into the following problem building PostgreSQL 7.3.3 on Solaris
9 (sparc) using GCC 3.3 and OpenSSL 0.9.7b.

   gcc -g -Wall -Wmissing-prototypes -Wmissing-declarations -fPIC -I. -I../../../src/include -I/opt/reb/include
-I/opt/sfw/include-DFRONTEND -DSYSCONFDIR='"/opt/reb/etc/postgresql"'  -c -o fe-connect.o fe-connect.c 
   In file included from fe-connect.c:46:
   /usr/include/crypt.h:22: error: parse error before '(' token
   /usr/include/crypt.h:22: error: parse error before "const"
   gmake[4]: *** [fe-connect.o] Error 1
   gmake[4]: Leaving directory `/net/cog/project/reb/src/base/postgresql/src/interfaces/libpq'

This is the OpenSSH-versus-crypt.h compatibility issue that is discussed
in doc/FAQ_Solaris thusly:

   2) Why do I get problems when building with OpenSSL support?

   When you build PostgreSQL with OpenSSL support you might get
   compilation errors in the following files:

   src/backend/libpq/crypt.c
   src/backend/libpq/password.c
   src/interfaces/libpq/fe-auth.c
   src/interfaces/libpq/fe-connect.c

   This is because of a namespace conflict between the standard
   /usr/include/crypt.h header and the header files provided by OpenSSL.

   Upgrading your OpenSSL installation to version 0.9.6a fixes this
   problem.

Apparently the problem has come back (in limited form) in OpenSSL 0.9.7b,
the current version of OpenSSL.

I worked around the problem as follows.  However, I don't offhand see
why fe-connect.c has to include <crypt.h> at all, so perhaps a simpler
fix is to remove the #include on all platforms.

===================================================================
RCS file: src/interfaces/libpq/fe-connect.c,v
retrieving revision 7.3.3.0
retrieving revision 7.3.3.1
diff -pu -r7.3.3.0 -r7.3.3.1
--- src/interfaces/libpq/fe-connect.c    2003/01/30 19:50:07    7.3.3.0
+++ src/interfaces/libpq/fe-connect.c    2003/06/12 21:06:06    7.3.3.1
@@ -42,7 +42,7 @@
 #ifndef HAVE_STRDUP
 #include "strdup.h"
 #endif
-#ifdef HAVE_CRYPT_H
+#if defined(HAVE_CRYPT_H) && !defined(des_crypt)
 #include <crypt.h>
 #endif

pgsql-bugs by date:

Previous
From: "subbiah K"
Date:
Subject: commands
Next
From: "Durai"
Date:
Subject: Bug: ipcclean didn't work on HP-PA platform