I am currently trying to port dash for my OS, and I am stuck with the following compilation error :
Code: Select all
In file included from /usr/include/sys/stat.h:107,
from /usr/include/fcntl.h:38,
from mkinit.c:50:
/usr/include/bits/stat.h:117: error: redefinition of ‘struct stat’
In file included from /usr/include/fcntl.h:38,
from mkinit.c:50:
/usr/include/sys/stat.h:502: error: redefinition of ‘stat’
/usr/include/sys/stat.h:453: note: previous definition of ‘stat’ was here
/usr/include/sys/stat.h:509: error: redefinition of ‘lstat’
/usr/include/sys/stat.h:460: note: previous definition of ‘lstat’ was here
/usr/include/sys/stat.h:516: error: redefinition of ‘fstat’
/usr/include/sys/stat.h:467: note: previous definition of ‘fstat’ was here
In file included from /usr/include/fcntl.h:205,
from mkinit.c:50:
/usr/include/bits/fcntl2.h:74: error: redefinition of ‘open’
/usr/include/bits/fcntl2.h:42: note: previous definition of ‘open’ was here
- the headers the compiler uses do not seem to be the good ones (they are located in "/usr/include" and not in "/usr/local/cross/i586-pc-myos/include") ;
- multiple definitions of structs and functions.
However, when I compile my own programs with my OS specific compiler (i586-pc-myos-gcc), it does use the headers in "/usr/local/cross/i586-pc-myos/include".
I have made some changes in the shell.h file, replacing '#define JOBS 1' by '#define JOBS 0' and '#define BSD 1' by '#define BSD 0'.
The PATH environment is set properly, and I can see that the compiler used to build is the good one. I configured in the following way before building (in dash-0.5.7 directory) :
Code: Select all
./configure --host=i586-pc-myos --prefix=/usr/local/cross/dash
EDIT : I have also set the JOBS variable to 0 in "builtins.def.in".