maxdev1 / ghost

Ghost, a micro-kernel based hobby operating system.
http://ghostkernel.org/
GNU General Public License v3.0
560 stars 57 forks source link

Error while building ../build.sh: 12: ../ghost.sh: Bad substitution #10

Closed JustVic closed 5 years ago

JustVic commented 7 years ago

While building getting this error:

/ghost/source/libuser$ ./build.sh all ./build.sh: 12: ../ghost.sh: Bad substitution

maxdev1 commented 7 years ago

What shell did you use? Try it again with /bin/bash.

JustVic commented 7 years ago

I use debian and bash and nothing special.

vic@debian:~$ echo $SHELL /bin/bash

JustVic commented 7 years ago

I try it with /bin/bash:

vic@debian:~/ghost/source/libuser$ /bin/bash ./build.sh all target: all error: missing required tool 'changes'

And it seems work. But what tool is 'changes'? I don't find it.

maxdev1 commented 7 years ago

This tool is in /tools/changes. Why are you building everything yourself? You should use the toolchain.sh in root. Take a look at this page: https://github.com/maxdev1/ghost/blob/master/documentation/misc/compilation.adoc

JustVic commented 7 years ago

Thanks a lot. It's my mistake I had wrong version of automake. I installed right version and build toolchain further... to the next error.

./toolchan.sh

... Building GCC Configuration Building core Installing core Building target libgcc Build failed

ghost-build.log:

In file included from ../../../gcc-4.9.1/libgcc/libgcc2.c:27:0: ../../../gcc-4.9.1/libgcc/../gcc/tsystem.h:87:19: fatal error: stdio.h: No such file or directory

include

Sorry for my incompetence. I'll check what else I'm doing wrong.

maxdev1 commented 7 years ago

@JustVic seems you found a way to fix this?

cmunaro commented 7 years ago

Hi, I am stuck to the same error I use ubuntu 16.04

bash toolchain.sh

... Building GCC Configuration Building core Installing core Building target libgcc Build failed

ghost-build.log:

In file included from ../../../gcc-4.9.1/libgcc/libgcc2.c:27:0: ../../../gcc-4.9.1/libgcc/../gcc/tsystem.h:87:19: fatal error: stdio.h: No such file or directory

include

JustVic commented 7 years ago

I rebuild it on 32-bit only system and for building allways use "/bin/bash" (/bin/bash toolchain.sh) to make sure that is run by bash.

JustVic commented 7 years ago

As I see stdio.h must to be copied when installing libc headers. Maybe try to run "/bin/bash build.sh install-headers" in libc directory.

cmunaro commented 7 years ago

Thanks you! It solved my problem but I had another problem: ghost.h was not found so i executed build.sh install-header in libapi folder and after re-run toolchain.sh, gcc was successfully compiled. Unfortunately, now I have another problem: /bin/bash toolchain.sh ... Building GCC Configuration Building core Installing core Building target libgcc Installing target libgcc Building libc Build failed

And into libc/ghost-build.log build.sh: 12: ../ghost.sh: Bad substitution build.sh: 12: ../ghost.sh: Bad substitution Furthermore I found the same error in every ghost-build.log created by other script *.sh

cmunaro commented 7 years ago

I finally solved by replacing each "sh build.sh" in toolchain.sh with "/bin/bash build.sh"

bluethefoxyt commented 7 years ago

@maxdev1 can i compile in windows

maxdev1 commented 7 years ago

@bluethefoxyt yes, you must use Cygwin. Look at the document about compiling in the documentation folder.