www.zeroshell.org Forum Index www.zeroshell.org
Linux Distribution for server and embedded devices
 
 SearchSearch  RegisterRegister  UsergroupsUsergroups 
 ProfileProfile  Log inLog in  Log in to check your private messagesPrivate Message 

Development Environment (gcc, g++ and header files)

 
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell
View previous topic :: View next topic  
Author Message
fulvio
Site Admin


Joined: 01 Nov 2006
Posts: 1070

PostPosted: Thu Sep 22, 2016 7:55 pm    Post subject: Development Environment (gcc, g++ and header files) Reply with quote

Hi,

a Zeroshell Development Environment is available to be installed from the Package Manager.
It requires Zeroshell 3.3.2+ and allows to build applications starting from the source packages. It also allows to compile customized Kernel versions or just single Kernel driver modules better supporting your hardware.

Regards
Fulvio
Back to top
View user's profile Send private message Send e-mail
iulyb



Joined: 02 Jun 2016
Posts: 72

PostPosted: Fri Sep 23, 2016 2:00 pm    Post subject: Reply with quote

Hi,
Is it possible to not need a licence to download this packages only?

Most people have a virtual dev environment that is not used in production. Also most of the times this is blown away and recreated.
Back to top
View user's profile Send private message
iulyb



Joined: 02 Jun 2016
Posts: 72

PostPosted: Sat Oct 22, 2016 4:47 pm    Post subject: Reply with quote

Hi,
I downloaded and installed this packages in order to compile a newer version of hostapd that is 4 years old. I am a bit disappointed because I didn't see any instructions and then right after installing them:

Code:
root@dev ~> gcc -v
bash: /usr/bin/gcc: Permission denied


Obvious PATH is missing.
Code:
root@dev linux> df     
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   774884     11200    763684   2% /
/dev/sr0                274328    274328         0 100% /cdrom
shm                     774884         0    774884   0% /dev/shm
/dev/sda4             10364472   1571576   8243368  17% /DB
/DB/_DB.001           10364472   1571576   8243368  17% /Database
unionfs               11139356   2346460   8243368  23% /DB/devel/mnt/etc
unionfs               11139356   2346460   8243368  23% /DB/devel/mnt/root
unionfs               10638800   1845904   8243368  19% /DB/devel/mnt/usr
unionfs               11139356   2346460   8243368  23% /DB/devel/mnt/opt
unionfs               11139356   2346460   8243368  23% /DB/devel/mnt/run
unionfs               10638800   1845904   8243368  19% /DB/devel/mnt/bin
unionfs               10638800   1845904   8243368  19% /DB/devel/mnt/lib
unionfs               10638800   1845904   8243368  19% /DB/devel/mnt/sbin
/dev                    770548         0    770548   0% /DB/devel/mnt/dev
/tmp                    774884     11200    763684   2% /DB/devel/mnt/tmp
/DB                   10364472   1571576   8243368  17% /DB/devel/mnt/DB
/Database             10364472   1571576   8243368  17% /DB/devel/mnt/Database
/var                    774884     11200    763684   2% /DB/devel/mnt/var
/DB/src               10364472   1571576   8243368  17% /DB/devel/mnt/src
/DB/src               10364472   1571576   8243368  17% /src
/DB/myapp             10364472   1571576   8243368  17% /DB/devel/mnt/myapp
/DB/myapp             10364472   1571576   8243368  17% /myapp



After adding path (have no clear idea if is the right one)..
Code:
root@dev ~> PATH=/DB/devel/mnt/usr/bin/:$PATH
root@dev ~> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/DB/devel/mnt/usr/bin/../libexec/gcc/i686-pc-linux-gnu/4.9.2/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ./configure --prefix=/usr --enable-languages=c,c++
Thread model: posix
gcc version 4.9.2 (GCC)


This looks ok, now let-s try to compile something..

Code:
root@dev ~> cd /src/linux
root@dev linux> make
  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep.c:106:23: fatal error: sys/types.h: No such file or directory
 #include <sys/types.h>
                       ^
compilation terminated.
scripts/Makefile.host:91: recipe for target 'scripts/basic/fixdep' failed
make[1]: *** [scripts/basic/fixdep] Error 1
Makefile:439: recipe for target 'scripts_basic' failed
make: *** [scripts_basic] Error 2
root@dev linux>


Now what? .. Base libraries are missing..
Code:
root@dev linux> echo $LD_LIBRARY_PATH
/myapp/lib:/opt/devel/lib
root@dev linux> ls /opt/devel/lib
ls: /opt/devel/lib: No such file or directory


So no libraries..
Code:
root@dev linux> cat /etc/ld.so.conf
/usr/local/lib
/opt/lib
/usr/local/ssl/lib
/usr/local/lib/libnetfilter_conntrack


After adding /DB/devel/mnt/lib: we get in ldconfig libuuid.so.1 -> libuuid.so.1.3.0 ..............

This is still not enough
Code:

root@dev hostapd> make
In file included from main.c:9:0:
/DB/jb/hostapd-2.6/src/utils/includes.h:19:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
Makefile:1036: recipe for target 'main.o' failed
make: *** [main.o] Error 1


Then I realized that is a file and not a library so..
Code:
root@dev hostapd> find / -name stdlib.h
/src/linux-4.4.13-ZS/arch/powerpc/boot/stdlib.h
/DB/devel/mnt/src/linux-4.4.13-ZS/arch/powerpc/boot/stdlib.h
/DB/devel/mnt/usr/local/include/isc/stdlib.h
/DB/devel/mnt/usr/include/stdlib.h
/DB/devel/mnt/usr/include/bits/stdlib.h
/DB/devel/mnt/usr/include/c++/4.9.2/tr1/stdlib.h
/DB/devel/rw/usr/local/include/isc/stdlib.h
/DB/devel/rw/usr/include/stdlib.h
/DB/devel/rw/usr/include/bits/stdlib.h
/DB/devel/rw/usr/include/c++/4.9.2/tr1/stdlib.h
/DB/src/linux-4.4.13-ZS/arch/powerpc/boot/stdlib.h
     
root@dev hostapd> ls -al /usr/include
lr-xr-xr-x    1 root     root           26 Jul  4 19:32 /usr/include -> /devel/headers/usr/include
root@dev hostapd> ls /devel/headers/usr/   
src


OOPS this looks like a bug. There is no include dir under /devel/headers/usr/ We can come up with something.. but which?

Code:
root@dev hostapd> ln -s /DB/devel/mnt/usr/include /devel/headers/usr/include


Again:
Code:
root@dev hostapd> make
cc: error trying to exec 'as': execvp: No such file or directory
Makefile:1036: recipe for target 'main.o' failed
make: *** [main.o] Error 1


Google after this error reveals that is a binutils error.
https://decibel.ni.com/content/message/119562
I already spent like 10 hours with something that was supposed to work out of the box.

Edit1: Did more hacking..
Code:
root@dev linux-4.4.13-ZS> find / -name as   
/DB/devel/mnt/usr/local/i686-pc-linux-gnu/bin/as
/DB/devel/mnt/usr/local/bin/as
/DB/devel/rw/usr/local/i686-pc-linux-gnu/bin/as
/DB/devel/rw/usr/local/bin/as


More stuff on path...
Code:
root@dev linux> PATH=/DB/devel/mnt/usr/local/bin/:$PATH

Then:
Code:
root@dev hostapd-2.6> cd hostapd/
root@dev hostapd> make
  CC  main.c
  CC  config_file.c
  CC  ../src/ap/hostapd.c
  CC  ../src/ap/wpa_auth_glue.c
  CC  ../src/ap/drv_callbacks.c
  CC  ../src/ap/ap_drv_ops.c
  CC  ../src/ap/utils.c
  CC  ../src/ap/authsrv.c
  CC  ../src/ap/ieee802_1x.c
  CC  ../src/ap/ap_config.c
  CC  ../src/ap/eap_user_db.c
  CC  ../src/ap/ieee802_11_auth.c
  CC  ../src/ap/sta_info.c
  CC  ../src/ap/wpa_auth.c
  CC  ../src/ap/tkip_countermeasures.c
-------------------------------
CC  ../src/drivers/driver_hostap.c
../src/drivers/driver_nl80211.c:17:31: fatal error: netlink/genl/genl.h: No such file or directory
 #include <netlink/genl/genl.h>
                               ^
compilation terminated.


Yes.. finally this error is more likely in line with what I wanted to see in the first place. I will deal with this later.
Have no idea if the added paths, includes and libraries are the right ones so I am open to suggestions.
At a minimum I need a script to do that, unless is already included and I missed it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group