configure: Enable use-xattr or use-xattr-ref automatically.

The previous commit only checked that they worked if the user
enabled them, but now they will be enabled automatically if the
underlying filesystem supports them.

The ReadMe.Compiling has been updated accordingly.
This commit is contained in:
Augustin Cavalier 2017-12-05 16:58:11 -05:00
parent a5c952db0d
commit fc2c93fbec
2 changed files with 44 additions and 46 deletions

View File

@ -1,16 +1,16 @@
Building Haiku
==========================
This is a overview into the process of building HAIKU from source.
An online version is available at <https://haiku-os.org/guides/building/>.
An online version is available at <https://www.haiku-os.org/guides/building/>.
Official releases of Haiku are at <https://haiku-os.org/get-haiku>.
Official releases of Haiku are at <https://www.haiku-os.org/get-haiku>.
The (unstable) nightly builds are available at <https://download.haiku-os.org/>.
We currently support the following platforms:
* Haiku
* Linux
* FreeBSD
* Mac OS X
* macOS
Required Software
----------------------------
@ -20,18 +20,17 @@ Tools provided within Haiku's repositories:
The tools to compile Haiku will vary, depending on the platform that you are
using to build Haiku. When building from Haiku, all of the necessary
development tools are included in official releases (e.g. R1 alpha4) and in the
development tools are included in official releases (e.g. R1/alpha4) and in the
nightly builds.
* `git`
* `ssh` (for developers with commit access)
* `gcc`/`g++` and binutils (`as`, `ld`, etc., required by GCC)
* (GNU) `make`
* `bison` (2.4 or better)
* `flex` and `lex` (usually a mini shell script invoking `flex`)
* `makeinfo` (part of `texinfo`, only needed for building GCC 4)
* `autoheader` (part of `autoconf`, needed for building GCC)
* `automake`
* `automake` (needed for building GCC)
* `gawk`
* `nasm`
* `wget`
@ -52,7 +51,7 @@ If you want to compile Haiku for ARM, you will also need:
* `mkimage` (<http://www.denx.de/wiki/U-Boot/WebHome>)
* Mtools (<https://gnu.org/software/mtools/intro.html>)
### On Mac OS X
### On macOS
Disk Utility can create a case-sensitive disk image of at least 3 GiB in size.
The following ports need to be installed:
@ -119,32 +118,38 @@ update the source tree very frequently, you may want to execute `configure`
after each update just to be on the safe side.
Depending on your goal, there are several different ways to configure Haiku.
You can either call configure from within your Haiku trunk folder. That will
prepare a folder named 'generated', which will contain the compiled objects.
The first way is to call configure from within your Haiku checkout's root. That
will prepare a folder named 'generated', which will contain the compiled objects.
Another option is to manually created one or more `generated.*` folders and run
configure from within them. For example, imagine the following directory setup:
```
buildtools-trunk/
haiku-trunk/
haiku-trunk/generated.x86gcc2
buildtools/
haiku/
haiku/generated.x86gcc2
```
### Configure a GCC 2.95 Hybrid, from a non-Haiku platform
### Configure a GCC 2.95/GCC 5 Hybrid, from a non-Haiku platform
```bash
cd haiku-trunk/generated.x86gcc2
../configure --use-xattr-ref \
cd haiku/generated.x86gcc2
../configure \
--build-cross-tools x86_gcc2 ../../buildtools/ \
--build-cross-tools x86
```
### Configure a GCC 2.95 Hybrid, from Haiku
### Configure an x86_64 (GCC 5) build, from a non-Haiku platform
```
cd haiku-trunk/generated.x86gcc2
cd haiku/generated.x86_64
../configure --build-cross-tools x86_64 ../../buildtools/
```
### Configure a GCC 2.95/GCC 5 Hybrid, from Haiku
```
cd haiku/generated.x86gcc2
../configure --target-arch x86_gcc2 --target-arch x86
```
Additional information about GCC Hybrids can be found on the website,
<https://haiku-os.org/guides/building/gcc-hybrid>.
<https://www.haiku-os.org/guides/building/gcc-hybrid>.
### Configure options
The various runtime options for configure are documented in its onscreen help
@ -231,7 +236,7 @@ BootManager
```
### On Emulated Hardware
For emulated hardware you should build disk image (see above). How to set up
For emulated hardware you should build a disk image (see above). How to set up
this image depends on your emulator. If you use QEMU, you can usually just
provide the path to the image as command line argument to the `qemu`
executable.

45
configure vendored
View File

@ -90,12 +90,13 @@ options:
--use-gcc-graphite Build with GCC Graphite engine for loop
optimizations. (Only for GCC 4+.)
--use-32bit Use -m32 flag on 64bit host gcc compiler.
--use-xattr Use Linux/*BSD's native extended file attributes
for Haiku extended attributes.
--use-xattr-ref Use the generic Haiku attribute emulation, but use
Linux/*BSD's native extended attributes to make it
more robust (i.e. attribute mix-ups become
less likely.)
--no-full-xattr Do not use Linux/*BSD/Darwin's native extended file
attributes as Haiku attributes. If they are still
available, they will be used to store hashes for
the attribute emulation layer.
--no-xattr Do not use Linux/*BSD/Darwin's native extended file
attributes for Haiku extended attributes at all,
even if they are available.
--with-gdb <gdb sources dir>
specify the path to a GDB source dir, to build
GDB for each arch we build the cross-tools for.
@ -515,8 +516,8 @@ HAIKU_DISTRO_COMPATIBILITY=default
TARGET_PLATFORM=haiku
HAIKU_USE_GCC_PIPE=0
HAIKU_HOST_USE_32BIT=0
HAIKU_HOST_USE_XATTR=0
HAIKU_HOST_USE_XATTR_REF=0
HAIKU_HOST_USE_XATTR=
HAIKU_HOST_USE_XATTR_REF=
HAIKU_HOST_BUILD_ONLY=0
HOST_EXTENDED_REGEX_SED="sed -r"
HOST_GCC_LD=`$CC -print-prog-name=ld`
@ -583,7 +584,9 @@ if [ "$1" = "--update" ]; then
exit 1
fi
cd $lastPwd
if [ -n "$lastEnv" ]; then
export $lastEnv
fi
$lastConfig $lastArgs
exit $?
fi
@ -706,8 +709,8 @@ while [ $# -gt 0 ] ; do
--use-gcc-pipe) HAIKU_USE_GCC_PIPE=1; shift 1;;
--use-gcc-graphite) useGccGraphiteDefault=1; shift 1;;
--use-32bit) HAIKU_HOST_USE_32BIT=1; shift 1;;
--use-xattr) HAIKU_HOST_USE_XATTR=1; shift 1;;
--use-xattr-ref) HAIKU_HOST_USE_XATTR_REF=1; shift 1;;
--no-full-xattr)HAIKU_HOST_USE_XATTR=0; shift 1;;
--no-xattr) HAIKU_HOST_USE_XATTR_REF=0; shift 1;;
--with-gdb) gdbSources=$2; shift 2;;
*) echo Invalid argument: \`$1\'; exit 1;;
esac
@ -744,27 +747,17 @@ if [ $caseInsensitive != 0 ]; then
fi
# check xattr support
if [ $HOST_PLATFORM != "haiku_host" ] && [ $HAIKU_HOST_USE_XATTR != 0 ] \
|| [ $HAIKU_HOST_USE_XATTR_REF != 0 ]; then
if [ $HAIKU_HOST_USE_XATTR != 0 ] && [ $HAIKU_HOST_USE_XATTR_REF != 0 ]; then
echo "$0: error: both --use-xattr and --use-xattr-ref cannot be specified."
exit 1
fi
if [ $HOST_PLATFORM != "haiku_host" ] && [ -z $HAIKU_HOST_USE_XATTR_REF ]; then
check_native_xattrs
attrSupport=$?
if [ $attrSupport = 2 ]; then
0; # all is well, we don't need to do anything
if [ $attrSupport = 2 ] && [ -z $HAIKU_HOST_USE_XATTR ]; then
HAIKU_HOST_USE_XATTR=1
elif [ $attrSupport = 1 ]; then
if [ $HAIKU_HOST_USE_XATTR != 0 ]; then
echo "$0: error: full extended attributes requested but host" \
"only has support for xattr-ref."
exit 1
fi
else
echo "$0: error: host platform has no support for extended attributes."
exit 1
HAIKU_HOST_USE_XATTR_REF=1
fi
fi
if [ -z $HAIKU_HOST_USE_XATTR ]; then HAIKU_HOST_USE_XATTR=0; fi
if [ -z $HAIKU_HOST_USE_XATTR_REF ]; then HAIKU_HOST_USE_XATTR_REF=0; fi
# determine how to invoke sed with extended regexp support for non-GNU sed
if [ $HOST_PLATFORM = "darwin" ]; then