Opened 21 years ago

Last modified 20 years ago

#351 closed defect (fixed)

Configure message: permission denied in PostgreSQL check

Reported by: rob@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

The configure script issues a "permission denied" message during the check for
PostgreSQL.  I am running the script as a mere mortal. It's not clear if this is
a warning or error:

... [snipped] ...
checking for PostgreSQL... ./configure: /usr/local/include: permission denied
./configure: /usr/local/include: permission denied
yes
checking for Xerces C++... disabled
... [snipped] ...

Here is the command line: 
./configure \
  --prefix=/home/rob/local \
  --with-grass=/usr/local \
  --with-png=/usr/local \
  --with-libtiff=/home/rob/local \
  --with-geotiff=/home/rob/local \
  --with-jpeg=/usr/local \
  --with-pg=/usr/local/include

No errors in config.log

Change History (5)

comment:1 by warmerdam, 21 years ago

Rob,

I would like to stress people do not normally get turnaround this fast on 
bug reports!

The problem is that the --with-pg argument you are giving is a directory, when
it should be the path to the pg_config script that configure runs to find out
how to link with postgres support.  I have committed an improvement to the
error checking to give you a reasonable error message. 

Could you update from CVS and try again?  Then use the correct --with-pg arg?

Thanks,

comment:2 by rob@…, 21 years ago

Configure correctly issues error message when --with-pg=directory-name. However
when  --with-pg=s-valid-file-name, I still get same error.

Example:
./configure \
  --prefix=/home/rob/local \
  --with-grass=/usr/local \
  --with-png=/usr/local \
  --with-libtiff=/home/rob/local \
  --with-geotiff=/home/rob/local \
  --with-jpeg=/usr/local \
  --with-pg=/usr/local/include/pg_config.h
... [snip] ...
checking for OGR ... enabled
checking for PostgreSQL... ./configure: /usr/local/include/pg_config.h:
Permission denied
./configure: /usr/local/include/pg_config.h: Permission denied
yes
checking for Xerces C++... disabled
... [snip] ...

Also, it seems that -lpq is never added to the LIB list which results in
unresolved references for files like PQxxxxx. In order to resolve symbols, must
manually add -lpq to the LIB list in GDALmake.opt

... [snip] ...
(cd ogr; gmake apps)
gmake[1]: Entering directory `/home/rob/installs/gdal-cvs/ogr'
g++  ogrinfo.o -L.. -lgdal.1.1 -L/usr/local -L/usr/local/lib -ljpeg
-L/home/rob/local/lib -lgeo
tiff -L/home/rob/local/lib -ltiff -L/usr/local -L/usr/local/lib -lpng
-L/usr/local -L/usr/local
/lib -lgrass5 -lz -lm -lm -o ogrinfo
../libgdal.1.1.so: undefined reference to `PQfsize'
../libgdal.1.1.so: undefined reference to `TIFFMergeFieldInfo'
../libgdal.1.1.so: undefined reference to `PQresultErrorMessage'
../libgdal.1.1.so: undefined reference to `PQconnectdb'
../libgdal.1.1.so: undefined reference to `PQftype'
../libgdal.1.1.so: undefined reference to `lo_write'
../libgdal.1.1.so: undefined reference to `PQexec'
../libgdal.1.1.so: undefined reference to `PQsetNoticeProcessor'
../libgdal.1.1.so: undefined reference to `PQgetisnull'
../libgdal.1.1.so: undefined reference to `PQntuples'
../libgdal.1.1.so: undefined reference to `lo_read'
../libgdal.1.1.so: undefined reference to `PQclear'
../libgdal.1.1.so: undefined reference to `PQresultStatus'
../libgdal.1.1.so: undefined reference to `PQgetvalue'
../libgdal.1.1.so: undefined reference to `PQstatus'
../libgdal.1.1.so: undefined reference to `PQnfields'
../libgdal.1.1.so: undefined reference to `lo_creat'
../libgdal.1.1.so: undefined reference to `PQfname'
../libgdal.1.1.so: undefined reference to `lo_open'
../libgdal.1.1.so: undefined reference to `lo_close'
../libgdal.1.1.so: undefined reference to `PQfinish'
../libgdal.1.1.so: undefined reference to `PQerrorMessage'
gmake[1]: *** [ogrinfo] Error 1
gmake[1]: Leaving directory `/home/rob/installs/gdal-cvs/ogr'
gmake: *** [ogr-apps] Error 2
... [snip] ...

comment:3 by warmerdam, 21 years ago

You need to give the path to the pg_config script.  For instance:

 configure --with-pg=/usr/local/pgsql/bin/pg_config

I will look into additional error checking in configure.

comment:4 by warmerdam, 20 years ago

Deal with this before the 1.2.0 release.

comment:5 by warmerdam, 20 years ago

I have added a check to verify that the passed file is executable, and tried
to improve the errors when it isn't. 

Note: See TracTickets for help on using tickets.