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

conf.c:21:10: fatal error: netlink/version.h: No such file or directory #107

Closed
alarig opened this issue Sep 21, 2021 · 12 comments
Closed

Comments

@alarig
Copy link

alarig commented Sep 21, 2021

Hi,

>>> Compiling source in /var/tmp/portage/net-wireless/wavemon-0.9.4/work/wavemon-0.9.4 ...
make -j6 
 CC   about_scr.c
 CC   conf.c
 CC   conf_scr.c
 CC   error.c
 CC   help_scr.c
 CC   info_scr.c
 CC   iw_if.c
conf.c:21:10: fatal error: netlink/version.h: No such file or directory
   21 | #include <netlink/version.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:29: conf.o] Error 1

netlink/version.h was with libnl-1, it is now installed under /usr/include/libnl3/netlink/netlink.h with libnl >= 3 and the configure requires libnl-cli-3.0 >= 3.2

@alarig
Copy link
Author

alarig commented Sep 21, 2021

Forcing -I/usr/include/libnl3 works

--- a/Makefile.in	2021-09-21 10:27:24.966739165 +0200
+++ b/Makefile.in	2021-09-21 10:27:57.537003815 +0200
@@ -9,7 +9,7 @@
 install-suid-root: exec_perms = 4755
 
 CC	 ?= @CC@
-CFLAGS	 ?= @CFLAGS@ @LIBNL3_CLI_CFLAGS@
+CFLAGS	 = @CFLAGS@ @LIBNL3_CLI_CFLAGS@
 CPPFLAGS ?= @CPPFLAGS@
 LDFLAGS  ?= @LDFLAGS@
 DEFS	 ?= @DEFS@

@grrtrr
Copy link
Contributor

grrtrr commented Sep 21, 2021

Hi, thanks for reporting. This seems to be an error with pkg-config.

Can you please past the output of

pkg-config libnl-cli-3.0 --cflags   # This should be -I/usr/include/libnl3
pkg-config libnl-cli-3.0 --libs     # E.g. -lnl-cli-3 -lnl-genl-3 -lnl-nf-3 -lnl-route-3 -lnl-3

@alarig
Copy link
Author

alarig commented Sep 22, 2021

pkg-config seems to have the correct outputs

alarig@pikachu ~ % pkg-config libnl-cli-3.0 --cflags
-I/usr/include/libnl3 
alarig@pikachu ~ % pkg-config libnl-cli-3.0 --libs
-lnl-cli-3 -lnl-genl-3 -lnl-nf-3 -lnl-route-3 -lnl-3 
alarig@pikachu ~ % 

I’m not very cmake-fluent, but I guess that @LIBNL3_CLI_CFLAGS@ has the correct value, it’s just not appended to the cflags by default or something like that; which removing the question-mark does.

@grrtrr
Copy link
Contributor

grrtrr commented Sep 22, 2021

Can you try these steps:?

make distclean
./configure
make -j 6

@alarig
Copy link
Author

alarig commented Sep 22, 2021

It doesn’t seem to add the -I/usr/include/libnl3 to the flags

wavemon-0.9.4 % make distclean
rm: cannot remove '/usr/bin/wavemon': Permission denied
make: *** [Makefile:62: uninstall] Error 1
zsh: exit 2     make distclean
wavemon-0.9.4 % ./configure 
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking net/if_arp.h usability... yes
checking net/if_arp.h presence... yes
checking for net/if_arp.h... yes
checking netinet/ether.h usability... yes
checking netinet/ether.h presence... yes
checking for netinet/ether.h... yes
checking net/ethernet.h usability... yes
checking net/ethernet.h presence... yes
checking for net/ethernet.h... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking ncursesw/curses.h usability... yes
checking ncursesw/curses.h presence... yes
checking for ncursesw/curses.h... yes
checking for sys/socket.h... yes
checking for linux/if.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for pow in -lm... yes
checking for pthread_create in -lpthread... yes
checking for addnwstr in -lncursesw6... no
checking for addnwstr in -lncursesw... yes
checking for cap_get_flag in -lcap... yes
checking for gettimeofday... yes
checking for ether_ntohost... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for LIBNL3_CLI... yes
checking whether gcc needs -traditional... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
configure: creating ./config.status
config.status: creating Makefile
wavemon-0.9.4 % make -j 6
 CC   conf.c
 CC   info_scr.c
 CC   iw_if.c
 CC   iw_nl80211.c
 CC   iw_scan.c
 CC   lhist_scr.c
In file included from iw_nl80211.c:10:
iw_nl80211.h:7:10: fatal error: netlink/netlink.h: No such file or directory
    7 | #include <netlink/netlink.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:29: iw_nl80211.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from lhist_scr.c:20:
iw_nl80211.h:7:10: fatal error: netlink/netlink.h: No such file or directory
    7 | #include <netlink/netlink.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:29: lhist_scr.o] Error 1
In file included from iw_scan.c:9:
iw_nl80211.h:7:10: fatal error: netlink/netlink.h: No such file or directory
    7 | #include <netlink/netlink.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from info_scr.c:20:
iw_nl80211.h:7:10: fatal error: netlink/netlink.h: No such file or directory
    7 | #include <netlink/netlink.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from iw_if.c:20:
iw_nl80211.h:7:10: fatal error: netlink/netlink.h: No such file or directory
    7 | #include <netlink/netlink.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
conf.c:21:10: fatal error: netlink/version.h: No such file or directory
   21 | #include <netlink/version.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:29: iw_scan.o] Error 1
make: *** [Makefile:29: iw_if.o] Error 1
make: *** [Makefile:29: info_scr.o] Error 1
make: *** [Makefile:29: conf.o] Error 1
zsh: exit 2     make -j 6
wavemon-0.9.4 % 

@grrtrr
Copy link
Contributor

grrtrr commented Sep 22, 2021

Sorry should have mentioned you need root permissions for make distclean.

The second step of make distclean removes the stored/cached configure settings.
Could you quickly check if the following makes a difference:?

sudo make distclean; ./configure && make -j6

@alarig
Copy link
Author

alarig commented Sep 22, 2021

This was a fresh extract of the archive, so the directory was all clean, but I found when it fails, if $CFLAGS exists:

alarig@pikachu wavemon-0.9.4 % export CFLAGS="-O2 -pipe -march=native -mtune=native"
alarig@pikachu wavemon-0.9.4 % make -j2                             
 CC   conf.c
 CC   conf_scr.c
conf.c:21:10: fatal error: netlink/version.h: No such file or directory
   21 | #include <netlink/version.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:29: conf.o] Error 1
make: *** Waiting for unfinished jobs....
zsh: exit 2     make -j2
alarig@pikachu wavemon-0.9.4 % export CFLAGS=""                                     
alarig@pikachu wavemon-0.9.4 % make -j2                                             
 CC   conf.c
 CC   error.c
conf.c:21:10: fatal error: netlink/version.h: No such file or directory
   21 | #include <netlink/version.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:29: conf.o] Error 1
make: *** Waiting for unfinished jobs....
zsh: exit 2     make -j2
alarig@pikachu wavemon-0.9.4 % unset CFLAGS
alarig@pikachu wavemon-0.9.4 % make -j2        
 CC   conf.c
 CC   help_scr.c
 CC   info_scr.c
 CC   iw_if.c
 CC   iw_nl80211.c
 CC   iw_scan.c
 CC   lhist_scr.c
 CC   llist.c
 CC   rfkill.c
 CC   scan_scr.c
 CC   ui.c
 CC   utils.c
cc -D_XOPEN_SOURCE_EXTENDED -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncursesw -O2 -pipe -march=native -mtune=native -pthread -I/usr/include/libnl3   -Wl,-O1 -Wl,--as-needed  wavemon.c about_scr.o conf.o conf_scr.o error.o help_scr.o info_scr.o iw_if.o iw_nl80211.o iw_scan.o lhist_scr.o llist.o rfkill.o scan_scr.o ui.o utils.o  -lncursesw -ltinfow -lm  -lnl-cli-3 -lnl-genl-3 -lnl-nf-3 -lnl-route-3 -lnl-3  -o wavemon
alarig@pikachu wavemon-0.9.4 % view Makefile
alarig@pikachu wavemon-0.9.4 % 

So it’s why my - ?= / + = works

@grrtrr
Copy link
Contributor

grrtrr commented Sep 22, 2021

Thank you for testing. This is an interaction with an old change in eeaf804.

Am able to reproduce this and am working on a fix.

@alarig
Copy link
Author

alarig commented Sep 23, 2021

Thanks a lot! Don’t hesitate to ping me if you need some tests ;)

@grrtrr
Copy link
Contributor

grrtrr commented Sep 26, 2021

Yes please - can you test if the following works for you:?

  • instead of export CFLAGS=... can you set them in configure as shown below,
  • and not set them during make?

This adds your specific CFLAGS without clobbering the existing CFLAGS:

sudo make distclean
autoconf
CFLAGS="-O2 -pipe -march=native -mtune=native" ./configure
make -j6

@alarig
Copy link
Author

alarig commented Sep 27, 2021

It complexifies a bit the ebuild, but it works! https://git.grifon.fr/alarig/SwordArMor-gentoo-overlay/commit/2456ebc5672ef9f06ece203062507d4d3c67ae4d

src_configure () {
	CFLAGS="${CFLAGS}" econf
}

src_compile() {
	unset CFLAGS
	default
}
cc -D_XOPEN_SOURCE_EXTENDED -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -I/usr/include/ncursesw -O2 -pipe -march=native -mtune=native -pthread -I/usr/include/libnl3   -Wl,-O1 -Wl,--as-needed  wavemon.c about_scr.o conf.o conf_scr.o error.o help_scr.o info_scr.o iw_if.o iw_nl80211.o iw_scan.o lhist_scr.o llist.o rfkill.o scan_scr.o ui.o utils.o  -lncursesw -ltinfow -lm  -lnl-cli-3 -lnl-genl-3 -lnl-nf-3 -lnl-route-3 -lnl-3  -o wavemon

gentoo-repo-qa-bot pushed a commit to gentoo-mirror/SwordArMor that referenced this issue Sep 27, 2021
uoaerg/wavemon#107

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
@grrtrr
Copy link
Contributor

grrtrr commented Sep 27, 2021

Thank you; I will update the documentation shortly.

The make CFLAGS are allowed to be overridden for the Debian build process.
I thought about adding this in Makefile.in, but that would have added complexity.

@grrtrr grrtrr closed this as completed in ba7746e Oct 25, 2021
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

2 participants