compilation of programs using libu2f-host fails: pkg-config file inconsistent with includes in public u2f-host.h header #13
Comments
|
I'm also hoping to get https://lists.mindrot.org/pipermail/openssh-unix-dev/2014-December/033273.html off the ground |
|
Something went wrong with this fix. /usr/include/u2f-host/u2f-host.h:24:30: fatal error: u2f-host-version.h: No such file or directory |
|
I can't reproduce problems with this fix. |
|
I have the same kind of error:
In the Makefile, I do see |
|
so if I look at that file for pam-u2f LIBU2FHOST_CFLAGS is added to AM_CPPFLAGS and it builds fine for me. Are you running autotools yourself on the project, in that case, what's your automake version? What platform? |
|
what is the value of AM_CPPFLAGS in your makefile? |
|
When I patch u2f-host/u2f-host.h to the full path "#include <u2f-host/u2f-host-..." pam_u2f find the header file. pam_u2f: /bin/sh ./libtool --tag=CC --mode=compile gcc -DDEBUG_PAM -DPAM_DEBUG -DPACKAGE_NAME="pam_u2f" -DPACKAGE_TARNAME="pam_u2f" -DPACKAGE_VERSION="1.0.1" -DPACKAGE_STRING="pam_u2f\ 1.0.1" -DPACKAGE_BUGREPORT="yubico-devel@googlegroups.com" -DPACKAGE_URL="" -DPACKAGE="pam_u2f" -DVERSION="1.0.1" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -DHAVE_SECURITY_PAM_APPL_H=1 -DHAVE_SECURITY_PAM_MODULES_H=1 -DHAVE_SECURITY__PAM_MACROS_H=1 -DHAVE_SECURITY_PAM_MODUTIL_H=1 -DHAVE_LIBPAM=1 -I. -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -c -o pam-u2f.lo pam-u2f.c |
|
So to be clear.. The error here is that pam-u2f fails to add LIBU2FHOST_CFLAGS to the compilation directives. Exactly why this happens is unclear, but seems to be something that occurs with automake 1.15 in some configurations. |
u2f-host/u2f-host.pc.in contains
Therefore, running pkg-config --cflags results in:
This means I need to use #include <u2f-host.h> in my program. However, the file /usr/local/include/u2f-host/u2f-host.h itself contains:
…which fails, because the include path already contains the u2f-host directory, so the compiler is looking for the non-existant /usr/local/include/u2f-host/u2f-host/u2f-host-version.h file.
There are two ways to fix this:
sed -i -e 's,#include <u2f-host/,#include <,g' **/*.[ch]. This approach also requires changing the AM_CPPFLAGS line in src/Makefile.am to readAM_CPPFLAGS=-I$(top_srcdir) -I$(top_srcdir)/u2f-host -I$(top_builddir)Cflags: -I${includedir}(stripping the u2f-host suffix). This will require changes in all downstream programs unless you also ship a compatibility u2f-host.h file in ${includedir} which includes u2f-host/u2f-host.h.Not sure which approach you want to pursue, but the first one seems cleaner to me :).
Thanks!
The text was updated successfully, but these errors were encountered: