rhboot / efibootmgr

efibootmgr development tree
GNU General Public License v2.0
519 stars 99 forks source link

efivar.h: No such file or directory #28

Closed mmokrejs closed 9 years ago

mmokrejs commented 9 years ago

Hi, I tried current snapshot fetched as the .zip file but it fails to find some header:

efibootmgr-master# make
cc  -DEFIBOOTMGR_VERSION=\"0.11.0\" -Wsign-compare -Wall -Werror -g -D_FILE_OFFSET_BITS=64 -Isrc/lib -Isrc/include   -c -o src/lib/disk.o src/lib/disk.c
cc  -DEFIBOOTMGR_VERSION=\"0.11.0\" -Wsign-compare -Wall -Werror -g -D_FILE_OFFSET_BITS=64 -Isrc/lib -Isrc/include   -c -o src/lib/efi.o src/lib/efi.c
cc  -DEFIBOOTMGR_VERSION=\"0.11.0\" -Wsign-compare -Wall -Werror -g -D_FILE_OFFSET_BITS=64 -Isrc/lib -Isrc/include   -c -o src/lib/efichar.o src/lib/efichar.c
cc  -DEFIBOOTMGR_VERSION=\"0.11.0\" -Wsign-compare -Wall -Werror -g -D_FILE_OFFSET_BITS=64 -Isrc/lib -Isrc/include   -c -o src/lib/gpt.o src/lib/gpt.c
In file included from src/lib/efichar.c:29:0:
src/include/efi.h:32:20: fatal error: efivar.h: No such file or directory
compilation terminated.
In file included from src/include/gpt.h:30:0,
                 from src/lib/disk.c:32:
src/include/efi.h:32:20: fatal error: efivar.h: No such file or directory
compilation terminated.
src/lib/efi.c:26:20: fatal error: efivar.h: No such file or directory
compilation terminated.
In file included from src/include/gpt.h:30:0,
                 from src/lib/gpt.c:38:
src/include/efi.h:32:20: fatal error: efivar.h: No such file or directory
compilation terminated.
make: *** [src/lib/efichar.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [src/lib/efi.o] Error 1
make: *** [src/lib/disk.o] Error 1
make: *** [src/lib/gpt.o] Error 1
efibootmgr-maste# find . -name efivar.h
efibootmgr-maste#

Maybe time to update the INSTALL file? ;-)

CaptainFlint commented 9 years ago

You need efivar library for building efibootmgr. A notice should be added to the INSTALL file, I agree.

mmokrejs commented 9 years ago

Maybe also add a check into Makefile? Ideally use configure to generate the Makefile ... but I cannot help with that. ;-)

cbrune commented 9 years ago

With the latest efivar and latest efibootmgr it looks like the file is /usr/include/efivar/efivar.h, which means I had to had to add -I/usr/include/efivar to CFLAGS for efibootmgr to compile.

vathpela commented 9 years ago

These have been fixed in the dp branch with commits ada1a1cf and 6a971bd0 , which change the makefile to use pkg-config to find its dependencies, and add appropriate notes in INSTALL, respectively.

The dp branch will be merged before the next release.

Thanks for this feedback!

mmokrejs commented 9 years ago

Provide compilers have by default '-I/usr/include' already defined, why don't you use:

#include <efivar/efivar.h>

but force

#include "efivar.h"

which in turn means user has to pass -I/usr/include/efivar to a preprocessor?

vathpela commented 9 years ago

We already need pkg-config to let consumers know they need e.g. -ldl , so there's really not any reason not to use it for include paths as well - and that lets us make efivar.h include other things from efivar without having to worry about what the correct paths/include types are.

You could certainly do it another way, but I'd already written this one, and I'm not seeing much advantage either way.