Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

builds should look in the build tree for header files first #27

Open
jhgit opened this issue Jul 1, 2021 · 1 comment
Open

builds should look in the build tree for header files first #27

jhgit opened this issue Jul 1, 2021 · 1 comment

Comments

@jhgit
Copy link

jhgit commented Jul 1, 2021

In the course of building libvmdk-20210418 while libvmdk-20200926 was already installed, I encountered the following error due to the build including the installed /usr/local/include/libvmdk/definitions.h:

--- pyvmdk_la-pyvmdk_disk_types.lo ---
libtool: compile:  cc -DHAVE_CONFIG_H -I. -I../common -I/usr/local/include/python3.8 -I/usr/local/include/py
thon3.8 -I/usr/local/include -I../include -I../common -I../libcerror -I../libcdata -I../libclocale -I../libc
split -I../libuna -I../libcfile -I../libcpath -I../libbfio -O2 -pipe -fstack-protector-strong -fno-strict-al
iasing -Wall -MT pyvmdk_la-pyvmdk_disk_types.lo -MD -MP -MF .deps/pyvmdk_la-pyvmdk_disk_types.Tpo -c pyvmdk_
disk_types.c  -fPIC -DPIC -o .libs/pyvmdk_la-pyvmdk_disk_types.o
pyvmdk_disk_types.c:149:18: error: use of undeclared identifier 'LIBVMDK_DISK_TYPE_FLAT_2GB_EXTENT'; did you
 mean 'LIBVMDK_DISK_TYPE_2GB_EXTENT_FLAT'?
                        LIBVMDK_DISK_TYPE_FLAT_2GB_EXTENT );
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        LIBVMDK_DISK_TYPE_2GB_EXTENT_FLAT
/usr/local/include/libvmdk/definitions.h:68:2: note: 'LIBVMDK_DISK_TYPE_2GB_EXTENT_FLAT' declared here
        LIBVMDK_DISK_TYPE_2GB_EXTENT_FLAT,
        ^
pyvmdk_disk_types.c:163:18: error: use of undeclared identifier 'LIBVMDK_DISK_TYPE_SPARSE_2GB_EXTENT'; did y
ou mean 'LIBVMDK_DISK_TYPE_2GB_EXTENT_FLAT'?
                        LIBVMDK_DISK_TYPE_SPARSE_2GB_EXTENT );
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                        LIBVMDK_DISK_TYPE_2GB_EXTENT_FLAT
/usr/local/include/libvmdk/definitions.h:68:2: note: 'LIBVMDK_DISK_TYPE_2GB_EXTENT_FLAT' declared here
        LIBVMDK_DISK_TYPE_2GB_EXTENT_FLAT,
        ^
2 errors generated.
*** [pyvmdk_la-pyvmdk_disk_types.lo] Error code 1

The arguments for the configure stage were:

  $ ./configure --enable-python --with-libintl-prefix=/usr/local --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --disable-silent-rules --infodir=/usr/local/share/info/ --build=amd64-portbld-freebsd11.4

The -I/usr/local/include comes from CPPFLAGS. The relevant build target in pyvmdk/Makefile is:

pyvmdk_la-pyvmdk_disk_types.lo: pyvmdk_disk_types.c
        $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pyvmdk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pyvmdk_la-pyvmdk_disk_types.lo -MD -MP -MF $(DEPDIR)/pyvmdk_la-pyvmdk_disk_types.Tpo -c -o pyvmdk_la-pyvmdk_disk_types.lo `test -f 'pyvmdk_disk_types.c' || echo '$(srcdir)/'`pyvmdk_disk_types.c
        $(AM_V_at)$(am__mv) $(DEPDIR)/pyvmdk_la-pyvmdk_disk_types.Tpo $(DEPDIR)/pyvmdk_la-pyvmdk_disk_types.Plo

Currently pyvmdk/Makefile.am defines AM_CFLAGS which comes after CPPFLAGS in the compile command.

@jhgit
Copy link
Author

jhgit commented Jul 1, 2021

patch-pyvmdk_Makefile.am.txt

Attached is a patch to ensure the paths in the build tree are searched for header files before the headers installed for the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant