Skip to content

Commit

Permalink
Make sure config.h exists when running configure for the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
lutoma committed Jul 7, 2021
1 parent d018c7c commit e674314
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,20 @@ FIND=$(command -v gfind || command -v find)
# Update submodules
git submodule update --init 1> /dev/null

# Get files
# Make sure config.h exists on first build
if [ ! -f ".config" ]; then
util/kconfiglib/alldefconfig.py
fi

if [ ! -f "src/lib/config.h" ]; then
util/kconfiglib/genconfig.py --header-path src/lib/config.h
fi

# Get architecture from config
arch=`sed -rn 's/\#define CONFIG_ARCH "([^"]+)"/\1/p' src/lib/config.h`


# Get files
extensions="\.\(c\|asm\|s\|psf\)"
arch_files=`$FIND -L src -type f -iregex "^.*$arch-.*$extensions" | tr '\n' ' '`
files=`$FIND -L src -type f -iregex "^[^\-]*$extensions" | tr '\n' ' '`
Expand Down
3 changes: 2 additions & 1 deletion docs/compiling.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ In addition to the toolchain, the [NASM](https://www.nasm.us/) assembler is also
Once you have that in place, you can compile Xelix using:

```bash
./configure

# Optional, if you want to customize settings:
make menuconfig

./configure
make
```

Expand Down

0 comments on commit e674314

Please sign in to comment.