From fb3c6dde176a2ce7a94f4ff401228b1381bb213d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 30 May 2019 11:50:58 +0200 Subject: [PATCH] Added /usr/local/include/ykpiv to CGO include path for Linux This makes it possible to build the latest version of [yubico-piv-tool](https://developers.yubico.com/yubico-piv-tool/) and install it to `/usr/local`. Without this change to the CGO parameters, the headers wouldn't be found in `/usr/local/include/ykpiv`. It's still necessary to ensure `/usr/local/lib` is mentioned in `/etc/ld.so.conf` for the linker to find the library. --- decrypt.go | 2 +- errors.go | 2 +- generate.go | 2 +- pivman.go | 2 +- sign.go | 2 +- slot.go | 2 +- ykpiv.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/decrypt.go b/decrypt.go index 85a923c..7fdac2c 100644 --- a/decrypt.go +++ b/decrypt.go @@ -24,7 +24,7 @@ package ykpiv #cgo darwin LDFLAGS: -L /usr/local/lib -lykpiv #cgo darwin CFLAGS: -I/usr/local/include/ykpiv/ #cgo linux LDFLAGS: -lykpiv -#cgo linux CFLAGS: -I/usr/include/ykpiv/ +#cgo linux CFLAGS: -I/usr/local/include/ykpiv/ -I/usr/include/ykpiv/ #include #include */ diff --git a/errors.go b/errors.go index 4bf8c25..9d61ac9 100644 --- a/errors.go +++ b/errors.go @@ -24,7 +24,7 @@ package ykpiv #cgo darwin LDFLAGS: -L /usr/local/lib -lykpiv #cgo darwin CFLAGS: -I/usr/local/include/ykpiv/ #cgo linux LDFLAGS: -lykpiv -#cgo linux CFLAGS: -I/usr/include/ykpiv/ +#cgo linux CFLAGS: -I/usr/local/include/ykpiv/ -I/usr/include/ykpiv/ #include */ import "C" diff --git a/generate.go b/generate.go index 0ec92a3..6a1285f 100644 --- a/generate.go +++ b/generate.go @@ -24,7 +24,7 @@ package ykpiv #cgo darwin LDFLAGS: -L /usr/local/lib -lykpiv #cgo darwin CFLAGS: -I/usr/local/include/ykpiv/ #cgo linux LDFLAGS: -lykpiv -#cgo linux CFLAGS: -I/usr/include/ykpiv/ +#cgo linux CFLAGS: -I/usr/local/include/ykpiv/ -I/usr/include/ykpiv/ #include #include */ diff --git a/pivman.go b/pivman.go index 34e63a6..ec59cd0 100644 --- a/pivman.go +++ b/pivman.go @@ -24,7 +24,7 @@ package ykpiv #cgo darwin LDFLAGS: -L /usr/local/lib -lykpiv #cgo darwin CFLAGS: -I/usr/local/include/ykpiv/ #cgo linux LDFLAGS: -lykpiv -#cgo linux CFLAGS: -I/usr/include/ykpiv/ +#cgo linux CFLAGS: -I/usr/local/include/ykpiv/ -I/usr/include/ykpiv/ #include #include */ diff --git a/sign.go b/sign.go index b7c78f0..7acb857 100644 --- a/sign.go +++ b/sign.go @@ -24,7 +24,7 @@ package ykpiv #cgo darwin LDFLAGS: -L /usr/local/lib -lykpiv #cgo darwin CFLAGS: -I/usr/local/include/ykpiv/ #cgo linux LDFLAGS: -lykpiv -#cgo linux CFLAGS: -I/usr/include/ykpiv/ +#cgo linux CFLAGS: -I/usr/local/include/ykpiv/ -I/usr/include/ykpiv/ #include #include */ diff --git a/slot.go b/slot.go index a81db3e..b66b07e 100644 --- a/slot.go +++ b/slot.go @@ -24,7 +24,7 @@ package ykpiv #cgo darwin LDFLAGS: -L /usr/local/lib -lykpiv #cgo darwin CFLAGS: -I/usr/local/include/ykpiv/ #cgo linux LDFLAGS: -lykpiv -#cgo linux CFLAGS: -I/usr/include/ykpiv/ +#cgo linux CFLAGS: -I/usr/local/include/ykpiv/ -I/usr/include/ykpiv/ #include #include */ diff --git a/ykpiv.go b/ykpiv.go index cf24d56..724d15f 100644 --- a/ykpiv.go +++ b/ykpiv.go @@ -27,7 +27,7 @@ package ykpiv #cgo darwin LDFLAGS: -L /usr/local/lib -lykpiv #cgo darwin CFLAGS: -I/usr/local/include/ykpiv/ #cgo linux LDFLAGS: -lykpiv -Wl,--allow-multiple-definition -#cgo linux CFLAGS: -I/usr/include/ykpiv/ +#cgo linux CFLAGS: -I/usr/local/include/ykpiv/ -I/usr/include/ykpiv/ #cgo windows CFLAGS: -I./win/include/ykpiv/ #cgo windows LDFLAGS: ./win/lib/libykpiv.dll.a #include