Opened 7 years ago

Closed 4 years ago

Last modified 3 years ago

#3470 closed enhancement (fixed)

gdal.pc would be useful

Reported by: Ari Jolma Owned by: Mateusz Łoskot
Priority: normal Milestone: 1.11.0
Component: ConfigBuild Version: unspecified
Severity: normal Keywords:
Cc:

Description

Many libraries report their requirements in pkg-config files (see http://pkg-config.freedesktop.org/wiki/). gdal-config is fine, but it requires shell, which is not always available. Thus a gdal.pc, which is installed into /usr/local/lib/pkgconfig, would be great.

Attachments (1)

gdal-pkg-config-support.patch (1.6 KB) - added by Mateusz Łoskot 6 years ago.
Prototype of gdal.pc implementation

Download all attachments as: .zip

Change History (8)

comment:1 Changed 6 years ago by Mateusz Łoskot

Owner: changed from warmerdam to Mateusz Łoskot

Changed 6 years ago by Mateusz Łoskot

Prototype of gdal.pc implementation

comment:2 Changed 6 years ago by Mateusz Łoskot

I have never written any pkg-config file, so this is my first one and I expect it's not completely right, but it seems to work for me:

mloskot@dog: gdal$ pkg-config --modversion gdal
1.9.0

mloskot@dog: gdal$ pkg-config --libs gdal
-L/home/mloskot/dev/gdal/_svn/trunk/gdal -L/usr/local/lib -lgdal -lgeos_c -lsqlite3 -lexpat -lz -lpthread -lm -lrt -ldl  

mloskot@dog: gdal$ pkg-config --cflags gdal
-I/home/mloskot/dev/gdal/_svn/trunk/gdal/port -I/home/mloskot/dev/gdal/_svn/trunk/gdal/gcore -I/home/mloskot/dev/gdal/_svn/trunk/gdal/alg -I/home/mloskot/dev/gdal/_svn/trunk/gdal/ogr -I/home/mloskot/dev/gdal/_svn/trunk/gdal/ogr/ogrsf_frmts  

mloskot@dog: gdal$ pkg-config --variable=datadir gdal
/home/mloskot/dev/gdal/_svn/trunk/gdal/data

mloskot@dog: gdal$ pkg-config --print-variables gdal
CONFIG_VERSION
exec_prefix
CONFIG_CFLAGS
CONFIG_LIBS
datadir
prefix
libdir
includedir
CONFIG_DATA
CONFIG_PREFIX

comment:3 Changed 4 years ago by pierriko

This would realy help the use of GDAL on Unixes (Mac/Linux?) where pkg-config is available !

/usr/lib/pkgconfig/GDAL.pc

name=gdal
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${exec_prefix}/include
datadir=${prefix}/share/${name}

Name: lib${name}
Description: Geospatial Data Abstraction Library
Version: 1.10.0
Libs: -L${libdir} -l${name}
Cflags: -I${includedir}/${name}

comment:4 Changed 4 years ago by Even Rouault

Milestone: 2.0
Resolution: fixed
Status: newclosed

r26453 "Add pkg-config gdal.pc (adapted from mloskot's patch, #3470)"

The change is to use the installation prefix instead of the build directory

comment:5 Changed 4 years ago by pierriko

Good news! Thanks!

comment:6 Changed 4 years ago by Mateusz Łoskot

Thanks!

comment:7 Changed 3 years ago by Even Rouault

Milestone: 2.01.11.0
Note: See TracTickets for help on using tickets.