Additional include directory given by pkg-config (#1118)

* Update include example in README

* Update pkg-config installed via CMake

Gives the include directory to enable the use of:
 #include <hiredis/hiredis.h>

but keeps the existing include dir. for backwards compatibility.

Example:
> pkg-config hiredis --cflags
-D_FILE_OFFSET_BITS=64 -I/usr/local/include/hiredis -I/usr/local/include

* Update pkg-config installed via Make

Gives the include directory to enable the use of:
  #include <hiredis/hiredis.h>
but keeps the existing include path for backwards compatibility.

Example:
> pkg-config hiredis --cflags
-D_FILE_OFFSET_BITS=64 -I/usr/local/include/hiredis -I/usr/local/include
This commit is contained in:
Bjorn Svensson 2022-09-19 19:49:55 +02:00 committed by GitHub
parent bd9ccb8c47
commit 722e3409c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View File

@ -275,20 +275,22 @@ $(PKGCONFNAME): hiredis.h
@echo prefix=$(PREFIX) > $@ @echo prefix=$(PREFIX) > $@
@echo exec_prefix=\$${prefix} >> $@ @echo exec_prefix=\$${prefix} >> $@
@echo libdir=$(PREFIX)/$(LIBRARY_PATH) >> $@ @echo libdir=$(PREFIX)/$(LIBRARY_PATH) >> $@
@echo includedir=$(PREFIX)/$(INCLUDE_PATH) >> $@ @echo includedir=$(PREFIX)/include >> $@
@echo pkgincludedir=$(PREFIX)/$(INCLUDE_PATH) >> $@
@echo >> $@ @echo >> $@
@echo Name: hiredis >> $@ @echo Name: hiredis >> $@
@echo Description: Minimalistic C client library for Redis. >> $@ @echo Description: Minimalistic C client library for Redis. >> $@
@echo Version: $(HIREDIS_MAJOR).$(HIREDIS_MINOR).$(HIREDIS_PATCH) >> $@ @echo Version: $(HIREDIS_MAJOR).$(HIREDIS_MINOR).$(HIREDIS_PATCH) >> $@
@echo Libs: -L\$${libdir} -lhiredis >> $@ @echo Libs: -L\$${libdir} -lhiredis >> $@
@echo Cflags: -I\$${includedir} -D_FILE_OFFSET_BITS=64 >> $@ @echo Cflags: -I\$${pkgincludedir} -I\$${includedir} -D_FILE_OFFSET_BITS=64 >> $@
$(SSL_PKGCONFNAME): hiredis_ssl.h $(SSL_PKGCONFNAME): hiredis_ssl.h
@echo "Generating $@ for pkgconfig..." @echo "Generating $@ for pkgconfig..."
@echo prefix=$(PREFIX) > $@ @echo prefix=$(PREFIX) > $@
@echo exec_prefix=\$${prefix} >> $@ @echo exec_prefix=\$${prefix} >> $@
@echo libdir=$(PREFIX)/$(LIBRARY_PATH) >> $@ @echo libdir=$(PREFIX)/$(LIBRARY_PATH) >> $@
@echo includedir=$(PREFIX)/$(INCLUDE_PATH) >> $@ @echo includedir=$(PREFIX)/include >> $@
@echo pkgincludedir=$(PREFIX)/$(INCLUDE_PATH) >> $@
@echo >> $@ @echo >> $@
@echo Name: hiredis_ssl >> $@ @echo Name: hiredis_ssl >> $@
@echo Description: SSL Support for hiredis. >> $@ @echo Description: SSL Support for hiredis. >> $@

View File

@ -609,8 +609,8 @@ unaffected so no additional dependencies are introduced.
First, you'll need to make sure you include the SSL header file: First, you'll need to make sure you include the SSL header file:
```c ```c
#include "hiredis.h" #include <hiredis/hiredis.h>
#include "hiredis_ssl.h" #include <hiredis/hiredis_ssl.h>
``` ```
You will also need to link against `libhiredis_ssl`, **in addition** to You will also need to link against `libhiredis_ssl`, **in addition** to

View File

@ -9,4 +9,4 @@ Name: hiredis
Description: Minimalistic C client library for Redis. Description: Minimalistic C client library for Redis.
Version: @PROJECT_VERSION@ Version: @PROJECT_VERSION@
Libs: -L${libdir} -lhiredis Libs: -L${libdir} -lhiredis
Cflags: -I${pkgincludedir} -D_FILE_OFFSET_BITS=64 Cflags: -I${pkgincludedir} -I${includedir} -D_FILE_OFFSET_BITS=64