Thread: Bug #902: Build problems with 7.3.1 and 7.3.2 on SunOS (crypt.h) + Solution

Bug #902: Build problems with 7.3.1 and 7.3.2 on SunOS (crypt.h) + Solution

From
pgsql-bugs@postgresql.org
Date:
Fred Houweling (fred@fh.dropbear.id.au) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
Build problems with 7.3.1 and 7.3.2 on SunOS (crypt.h) + Solution

Long Description
Hi,
As per request from Justin Clift [justin@postgresql.org].
I think I have found a small issue,

During build at fe-connect.c the following errors occur:
gcc -L/spare1/local/lib -I/spare1/local/include -Wall -Wmissing-prototypes -Wmissing-declarations -fPIC -I.
-I../../../src/include-I/spare1/local/include  -DFRONTEND -DSYSCONFDIR='"/spare1/local/etc/postgresql"'  -c -o
fe-connect.ofe-connect.c 
In file included from fe-connect.c:47:
/usr/include/crypt.h:22: parse error before `('
/usr/include/crypt.h:22: parse error before `const'
gmake: *** [fe-connect.o] Error 1

I found that reordering the includes in fe-connect.c as bellow fixes the problem, (I uses fe-auth.c as a guide, which
compilesok) 

#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif

#include "libpq-fe.h"
#include "libpq-int.h"
#include "fe-auth.h"

uname -a
SunOS hostname 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-5_10

gcc -v
Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
gcc version 2.95.3 20010315 (release)

Also
I am linking in OpenSSL 0.9.7,
I also viewed the Solaris version of this include <crypt.h> and have found that there is nothing wrong with it.

side note:
Reading this url is mandatory on this platform.
http://techdocs.postgresql.org/installguides.php#solaris

Thanks

Fred Houweling
fred@fh.dropbear.id.au

Sample Code
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif

#include "libpq-fe.h"
#include "libpq-int.h"
#include "fe-auth.h"


No file was uploaded with this report

Re: Bug #902: Build problems with 7.3.1 and 7.3.2 on SunOS (crypt.h)

From
Bruce Momjian
Date:
Patch attached and applied. Thanks.  Should I backpatch to 7.3.X?  Is it
safe?

---------------------------------------------------------------------------

pgsql-bugs@postgresql.org wrote:
> Fred Houweling (fred@fh.dropbear.id.au) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> Build problems with 7.3.1 and 7.3.2 on SunOS (crypt.h) + Solution
>
> Long Description
> Hi,
> As per request from Justin Clift [justin@postgresql.org].
> I think I have found a small issue,
>
> During build at fe-connect.c the following errors occur:
> gcc -L/spare1/local/lib -I/spare1/local/include -Wall -Wmissing-prototypes -Wmissing-declarations -fPIC -I.
-I../../../src/include-I/spare1/local/include  -DFRONTEND -DSYSCONFDIR='"/spare1/local/etc/postgresql"'  -c -o
fe-connect.ofe-connect.c 
> In file included from fe-connect.c:47:
> /usr/include/crypt.h:22: parse error before `('
> /usr/include/crypt.h:22: parse error before `const'
> gmake: *** [fe-connect.o] Error 1
>
> I found that reordering the includes in fe-connect.c as bellow fixes the problem, (I uses fe-auth.c as a guide, which
compilesok) 
>
> #ifdef HAVE_CRYPT_H
> #include <crypt.h>
> #endif
>
> #include "libpq-fe.h"
> #include "libpq-int.h"
> #include "fe-auth.h"
>
> uname -a
> SunOS hostname 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-5_10
>
> gcc -v
> Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3/specs
> gcc version 2.95.3 20010315 (release)
>
> Also
> I am linking in OpenSSL 0.9.7,
> I also viewed the Solaris version of this include <crypt.h> and have found that there is nothing wrong with it.
>
> side note:
> Reading this url is mandatory on this platform.
> http://techdocs.postgresql.org/installguides.php#solaris
>
> Thanks
>
> Fred Houweling
> fred@fh.dropbear.id.au
>
> Sample Code
> #ifdef HAVE_CRYPT_H
> #include <crypt.h>
> #endif
>
> #include "libpq-fe.h"
> #include "libpq-int.h"
> #include "fe-auth.h"
>
>
> No file was uploaded with this report
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/interfaces/libpq/fe-connect.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/interfaces/libpq/fe-connect.c,v
retrieving revision 1.225
diff -c -c -r1.225 fe-connect.c
*** src/interfaces/libpq/fe-connect.c    10 Mar 2003 22:28:21 -0000    1.225
--- src/interfaces/libpq/fe-connect.c    17 Mar 2003 17:57:29 -0000
***************
*** 22,27 ****
--- 22,34 ----
  #include <ctype.h>
  #include <time.h>

+ #ifndef HAVE_STRDUP
+ #include "strdup.h"
+ #endif
+ #ifdef HAVE_CRYPT_H
+ #include <crypt.h>
+ #endif
+
  #include "libpq-fe.h"
  #include "libpq-int.h"
  #include "fe-auth.h"
***************
*** 40,54 ****
  #endif

  #include "libpq/ip.h"
-
-
- #ifndef HAVE_STRDUP
- #include "strdup.h"
- #endif
- #ifdef HAVE_CRYPT_H
- #include <crypt.h>
- #endif
-
  #include "mb/pg_wchar.h"


--- 47,52 ----