Error compiling hostapd

Hi, I am willing to hack hostapd and got en error:

Code:
:/root/work/wpa/hostapd # cp defconfig .config
:/root/work/wpa/hostapd # gmake
../src/ap/iapp.c:46:30: warning: netpacket/packet.h: No such file or directory
../src/ap/iapp.c: In function 'iapp_init':
../src/ap/iapp.c:394: error: storage size of 'addr' isn't known
../src/ap/iapp.c:424: error: 'struct ifreq' has no member named 'ifr_ifindex'
../src/ap/iapp.c:468: error: 'SOL_IP' undeclared (first use in this function)
../src/ap/iapp.c:468: error: (Each undeclared identifier is reported only once
../src/ap/iapp.c:468: error: for each function it appears in.)
../src/ap/iapp.c:475: error: 'PF_PACKET' undeclared (first use in this function)
../src/ap/iapp.c:483: error: 'AF_PACKET' undeclared (first use in this function)
../src/ap/iapp.c:394: warning: unused variable 'addr'
../src/ap/iapp.c: In function 'iapp_deinit':
../src/ap/iapp.c:522: error: 'SOL_IP' undeclared (first use in this function)
gmake: *** [../src/ap/iapp.o] Error 1
 
cpu82 said:
Try using make(1)(): # cd /usr/src/contrib/wpa/hostapd/ && make
Code:
:/root/work/wpa2/wpa/hostapd # make
"Makefile", line 1: Need an operator
"Makefile", line 3: Need an operator
"Makefile", line 5: Need an operator
"Makefile", line 7: Need an operator
"Makefile", line 16: Need an operator
"Makefile", line 18: Need an operator
"Makefile", line 19: Need an operator
"Makefile", line 21: Need an operator
"Makefile", line 23: Need an operator
"Makefile", line 24: Need an operator
"Makefile", line 26: Missing dependency operator
"Makefile", line 28: Need an operator
"Makefile", line 30: Need an operator
"Makefile", line 33: Need an operator
"Makefile", line 63: Need an operator
 
Please, show the output line of % uname -a

Try using gmake(1)() as previously @ShelLuser has proposed.

Check that you have uncommented this line in /usr/src/contrib/wpa/hostapd/defconfig
Code:
CONFIG_IAPP=y

Furthermore, run # make clean before you try to compile it again.
 
Last edited by a moderator:
Code:
# uname -a
FreeBSD borys 9.1-RELEASE FreeBSD 9.1-RELEASE #0: Tue Oct  1 19:58:59 EEST 2013     root@:/usr/obj/usr/src/sys/GENERIC  amd64

gmake clean

Code:
# gmake
../src/ap/iapp.c:46:30: warning: netpacket/packet.h: No such file or directory
../src/ap/iapp.c: In function 'iapp_init':
../src/ap/iapp.c:394: error: storage size of 'addr' isn't known
../src/ap/iapp.c:424: error: 'struct ifreq' has no member named 'ifr_ifindex'
../src/ap/iapp.c:468: error: 'SOL_IP' undeclared (first use in this function)
../src/ap/iapp.c:468: error: (Each undeclared identifier is reported only once
../src/ap/iapp.c:468: error: for each function it appears in.)
../src/ap/iapp.c:475: error: 'PF_PACKET' undeclared (first use in this function)
../src/ap/iapp.c:483: error: 'AF_PACKET' undeclared (first use in this function)
../src/ap/iapp.c:394: warning: unused variable 'addr'
../src/ap/iapp.c: In function 'iapp_deinit':
../src/ap/iapp.c:522: error: 'SOL_IP' undeclared (first use in this function)
gmake: *** [../src/ap/iapp.o] Error 1

CONFIG_IAPP=y uncommented in .config
 
Seems that he need populate his /usr/src again. So, your next step is download the complete source tree using svn(1)() method as is well explained in section A.5. Using Subversion of the FreeBSD Handbook.
Code:
# mv /usr/src /usr/src.old
# svn checkout https://svn0.us-west.freebsd.org/base/releng/9.1/ /usr/src
 
wblock@ said:
The base system can be built without devel/gmake, and /usr/sbin/hostapd is part of the base.

Thanks for your input, @wblock@. Also, per take a look to /usr/src/usr.sbin/wpa/hostapd/Makefile anyone can guess that is a generic Makefile for *BSD make(1)().

Therefore, only the net/hostapd uses gmake(1)() instead make(1)() to be build.
Code:
[CMD]% make build-depends-list -C /usr/ports/net/hostapd/[/CMD]
/usr/ports/devel/gmake
 
Last edited by a moderator:
wblock@ said:
The base system can be built without devel/gmake, and /usr/sbin/hostapd is part of the base.
True, I've also been pondering about this.

I get the impression that the whole source code is included in the source tree, but that the actual building isn't done using its own Makefile but another higher up in the tree. For example; many sections come with their own configure file (see /usr/sys/contrib/opie for example) but those cannot be used on a readonly file system.

Yet those parts also get build, and without problems.
 
Back
Top