# [SOLVED]wpa_supplicant won't emerge

## Adrien

Hi!   :Smile: 

I'm building a small system, the "tinygentoo" way and have a problem when I try to emerge wpa_supplicant.

Actually, compilation fails for all these versions of the package  0.5.7 (~)0.5.8 (~)0.5.10 with this error message:

```
Delacroix / # ROOT=/tinygentoo emerge -avN wpa_supplicant

[...]

i386-gentoo-linux-uclibc-gcc -Os -pipe -I. -I../utils -I../hostapd -I/usr/include/madwifi -DCONFIG_BACKEND_FILE -DCONFIG_DRIVER_HOSTAP -DCONFIG_DRIVER_WEXT -DCONFIG_DRIVER_PRISM54 -DCONFIG_DRIVER_MADWIFI -DCONFIG_DRIVER_ATMEL -DCONFIG_DRIVER_NDISWRAPPER -DCONFIG_DRIVER_IPW -DCONFIG_DRIVER_WIRED -DEAP_TLS -DEAP_PEAP -DEAP_TTLS -DEAP_MD5 -DEAP_MSCHAPv2 -DEAP_GTC -DEAP_OTP -DEAP_LEAP -DEAP_PSK -DEAP_TLV -DEAP_PAX -DIEEE8021X_EAPOL -DCONFIG_INTERNAL_X509 -DEAP_TLS_FUNCS -DCONFIG_TLS_INTERNAL -DPKCS12_FUNCS -DCONFIG_CRYPTO_INTERNAL -DINTERNAL_AES -DINTERNAL_SHA1 -DINTERNAL_SHA256 -DINTERNAL_MD5 -DINTERNAL_MD4 -DINTERNAL_DES -DCONFIG_WIRELESS_EXTENSION -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DCONFIG_READLINE -DCONFIG_PEERKEY   -c -o driver_madwifi.o driver_madwifi.c

driver_madwifi.c:27:28: error: include/compat.h: No such file or directory

driver_madwifi.c:28:32: error: net80211/ieee80211.h: No such file or directory

driver_madwifi.c:34:39: error: net80211/ieee80211_crypto.h: No such file or directory

driver_madwifi.c:35:38: error: net80211/ieee80211_ioctl.h: No such file or directory

driver_madwifi.c: In function 'set80211priv':

driver_madwifi.c:111: error: 'IEEE80211_IOCTL_SETPARAM' undeclared (first use in this function)

driver_madwifi.c:111: error: (Each undeclared identifier is reported only once

driver_madwifi.c:111: error: for each function it appears in.)

driver_madwifi.c:112: error: 'IEEE80211_IOCTL_CHANLIST' undeclared (first use in this function)

driver_madwifi.c: In function 'set80211param':

driver_madwifi.c:155: error: 'IEEE80211_IOCTL_SETPARAM' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_set_wpa_ie':

driver_madwifi.c:175: error: 'IEEE80211_IOCTL_SETOPTIE' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_del_key':

driver_madwifi.c:186: error: storage size of 'wk' isn't known

driver_madwifi.c:192: error: 'IEEE80211_ADDR_LEN' undeclared (first use in this function)

driver_madwifi.c:194: error: 'IEEE80211_IOCTL_DELKEY' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_set_key':

driver_madwifi.c:204: error: storage size of 'wk' isn't known

driver_madwifi.c:226: error: 'IEEE80211_CIPHER_WEP' undeclared (first use in this function)

driver_madwifi.c:230: error: 'IEEE80211_CIPHER_TKIP' undeclared (first use in this function)

driver_madwifi.c:234: error: 'IEEE80211_CIPHER_AES_CCM' undeclared (first use in this function)

driver_madwifi.c:259: error: 'IEEE80211_KEY_RECV' undeclared (first use in this function)

driver_madwifi.c:262: error: 'IEEE80211_KEY_GROUP' undeclared (first use in this function)

driver_madwifi.c:264: error: 'IEEE80211_KEY_XMIT' undeclared (first use in this function)

driver_madwifi.c:264: error: 'IEEE80211_KEY_DEFAULT' undeclared (first use in this function)

driver_madwifi.c:265: error: 'IEEE80211_ADDR_LEN' undeclared (first use in this function)

driver_madwifi.c:285: error: 'IEEE80211_IOCTL_SETKEY' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_set_countermeasures':

driver_madwifi.c:293: error: 'IEEE80211_PARAM_COUNTERMEASURES' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_set_drop_unencrypted':

driver_madwifi.c:302: error: 'IEEE80211_PARAM_DROPUNENCRYPTED' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_deauthenticate':

driver_madwifi.c:309: error: storage size of 'mlme' isn't known

driver_madwifi.c:312: error: 'IEEE80211_MLME_DEAUTH' undeclared (first use in this function)

driver_madwifi.c:314: error: 'IEEE80211_ADDR_LEN' undeclared (first use in this function)

driver_madwifi.c:315: error: 'IEEE80211_IOCTL_SETMLME' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_disassociate':

driver_madwifi.c:322: error: storage size of 'mlme' isn't known

driver_madwifi.c:325: error: 'IEEE80211_MLME_DISASSOC' undeclared (first use in this function)

driver_madwifi.c:327: error: 'IEEE80211_ADDR_LEN' undeclared (first use in this function)

driver_madwifi.c:328: error: 'IEEE80211_IOCTL_SETMLME' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_associate':

driver_madwifi.c:336: error: storage size of 'mlme' isn't known

driver_madwifi.c:359: error: 'IEEE80211_PARAM_PRIVACY' undeclared (first use in this function)

driver_madwifi.c:363: error: 'IEEE80211_PARAM_WPA' undeclared (first use in this function)

driver_madwifi.c:372: error: 'IEEE80211_PARAM_ROAMING' undeclared (first use in this function)

driver_madwifi.c:385: error: 'IEEE80211_MLME_ASSOC' undeclared (first use in this function)

driver_madwifi.c:386: error: 'IEEE80211_ADDR_LEN' undeclared (first use in this function)

driver_madwifi.c:387: error: 'IEEE80211_IOCTL_SETMLME' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_set_auth_alg':

driver_madwifi.c:406: error: 'IEEE80211_AUTH_AUTO' undeclared (first use in this function)

driver_madwifi.c:408: error: 'IEEE80211_AUTH_SHARED' undeclared (first use in this function)

driver_madwifi.c:410: error: 'IEEE80211_AUTH_OPEN' undeclared (first use in this function)

driver_madwifi.c:412: error: 'IEEE80211_PARAM_AUTHMODE' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_init':

driver_madwifi.c:496: error: 'IEEE80211_PARAM_ROAMING' undeclared (first use in this function)

driver_madwifi.c:502: error: 'IEEE80211_PARAM_WPA' undeclared (first use in this function)

driver_madwifi.c: In function 'wpa_driver_madwifi_deinit':

driver_madwifi.c:528: error: 'IEEE80211_PARAM_ROAMING' undeclared (first use in this function)

driver_madwifi.c:532: error: 'IEEE80211_PARAM_PRIVACY' undeclared (first use in this function)

driver_madwifi.c:536: error: 'IEEE80211_PARAM_WPA' undeclared (first use in this function)

make: *** [driver_madwifi.o] Error 1

 *

 * ERROR: net-wireless/wpa_supplicant-0.5.8 failed.

[...]
```

My emerge --info output:

```
Delacroix / # emerge --info

Portage 2.1.4.4 (uclibc/x86, gcc-4.1.2, uclibc-0.9.28.3-r2, 2.6.24-gentoo-r3 x86_64)

=================================================================

System uname: 2.6.24-gentoo-r3 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+

Timestamp of tree: Tue, 18 Mar 2008 18:30:01 +0000

app-shells/bash:     3.2_p17-r1

dev-lang/python:     2.4.4-r9

dev-python/pycrypto: 2.0.1-r6

sys-apps/baselayout: 1.12.11.1

sys-apps/sandbox:    1.2.18.1-r2

sys-devel/autoconf:  2.61-r1

sys-devel/automake:  1.6.3, 1.9.6-r2, 1.10

sys-devel/binutils:  2.18-r1

sys-devel/gcc-config: 1.4.0-r4

sys-devel/libtool:   1.5.26

virtual/os-headers:  2.6.23-r3

ACCEPT_KEYWORDS="x86"

CBUILD="i386-gentoo-linux-uclibc"

CFLAGS="-Os -pipe"

CHOST="i386-gentoo-linux-uclibc"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"

CXXFLAGS="-Os -pipe"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer nodoc noinfo noman sandbox sfperms strict unmerge-orphans userfetch"

GENTOO_MIRRORS="ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://mirror.scarlet-internet.nl/pub/gentoo ftp://mirror.ovh.net/gentoo-distfiles/ ftp://ftp.rz.tu-bs.de/pub/mirror/ftp.gentoo.org/gentoo-distfiles/ ftp://pandemonium.tiscali.de/pub/gentoo/"

LANG="fr_FR@euro"

LC_ALL="fr_FR@euro"

LDFLAGS="-Wl,-z,relro"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="cli cracklib dri midi minimal mudflap ncurses openmp pcre readline reflection session spl uclibc x86 xorg zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="uclibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="dummy fbdev v4l"

Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
```

Any ideas for this?   :Rolling Eyes: Last edited by Adrien on Thu Mar 20, 2008 4:56 pm; edited 1 time in total

----------

## nixnut

See https://bugs.gentoo.org/show_bug.cgi?id=182199

----------

## Adrien

 *nixnut wrote:*   

> See https://bugs.gentoo.org/show_bug.cgi?id=182199

 

Thanks nixnut!   :Smile: 

I may be silly though but what exactly is the solution to this (btw i read the whole stuff)?

----------

## Adrien

Ok, not sure the bug mentionned is related to my problem finally.

Indeed, madwifi-ng tools seems to install all the files required by wpa_supplicant:

```
 --- /tinygentoo/usr/

--- /tinygentoo/usr/bin/

>>> /tinygentoo/usr/bin/athstats

>>> /tinygentoo/usr/bin/80211stats

>>> /tinygentoo/usr/bin/athkey

>>> /tinygentoo/usr/bin/athchans

>>> /tinygentoo/usr/bin/athctrl

>>> /tinygentoo/usr/bin/athdebug

>>> /tinygentoo/usr/bin/80211debug

--- /tinygentoo/usr/include/

>>> /tinygentoo/usr/include/madwifi/

>>> /tinygentoo/usr/include/madwifi/include/

>>> /tinygentoo/usr/include/madwifi/include/compat.h

>>> /tinygentoo/usr/include/madwifi/net80211/

>>> /tinygentoo/usr/include/madwifi/net80211/_ieee80211.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_crypto.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_ioctl.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_linux.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_monitor.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_node.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_power.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_proto.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_radiotap.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_rate.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_scan.h

>>> /tinygentoo/usr/include/madwifi/net80211/ieee80211_var.h

>>> /tinygentoo/usr/include/madwifi/net80211/if_athproto.h

>>> /tinygentoo/usr/include/madwifi/net80211/if_ethersubr.h

>>> /tinygentoo/usr/include/madwifi/net80211/if_llc.h

>>> /tinygentoo/usr/include/madwifi/net80211/if_media.h

>>> /tinygentoo/usr/include/madwifi/net80211/version.h

--- /tinygentoo/sbin/

>>> /tinygentoo/sbin/wlanconfig

```

And it seems the problem is wpa_supplicant search for the files in /usr/include instead of /usr/include/madwifi/include/ ...

This only solution I'm thinking of for the moment is compiling wpa_supplicant from scratch but the thing is it doesn't seem this package is './configure capable'

Any ideas how I could ask wpa_supplicant to look into the right directory?   :Rolling Eyes: 

PS: Please note I'm a big n00b despite my high number of posts, any suggestions are more than welcome   :Smile: 

----------

## Adrien

Well, just in case someone would be interested, I used the dirtiest solution:

1- Emerged madwifi-ng into my build environment:

```
Delacroix ~ # emerge madwifi-ng 
```

2- Copied the required file into my build environment's /usr/include directory:

```
Delacroix ~ # cp /usr/include/madwifi/include/compat.h /usr/include/
```

3- Emerged wpa_supplicant for the target host:

```
Delacroix ~ # ROOT=/tinygentoo emerge wpa_supplicant
```

Filthy but it worked...  :Rolling Eyes: 

----------

