mdw-cross
3 years agoetc/common-cross-config.site: Use `-fno-integrated-as'. master
Mark Wooding [Sun, 19 Jul 2020 22:41:38 +0000 (23:41 +0100)]
etc/common-cross-config.site: Use `-fno-integrated-as'.

The current documentation suggests this, and it seems to work.  Not sure
why this has changed.

3 years agosrc/cross.in: Check for `ccache' correctly.
Mark Wooding [Sun, 19 Jul 2020 22:40:44 +0000 (23:40 +0100)]
src/cross.in: Check for `ccache' correctly.

Apparently dash(1) thinks `type' on its own is successful, which is why
it seemed to work for me.

3 years agosrc/mdw-cross.in: Add the cross-built libraries to the runtime search path.
Mark Wooding [Fri, 15 Nov 2019 17:12:27 +0000 (17:12 +0000)]
src/mdw-cross.in: Add the cross-built libraries to the runtime search path.

Libtool sets the `RPATH' in binaries, but libraries linked using plain
`ld' don't by default, and then there is sadness.

3 years agoetc/common-cross-config.site: Search our `include' and `lib' directories.
Mark Wooding [Fri, 15 Nov 2019 17:11:56 +0000 (17:11 +0000)]
etc/common-cross-config.site: Search our `include' and `lib' directories.

3 years agosrc/crosstool.in: Introduce new tools to invoke the chosen compiler.
Mark Wooding [Wed, 22 Apr 2020 21:46:50 +0000 (22:46 +0100)]
src/crosstool.in: Introduce new tools to invoke the chosen compiler.

4 years agoDecide automatically whether to use GCC or Clang.
Mark Wooding [Wed, 22 Apr 2020 21:42:48 +0000 (22:42 +0100)]
Decide automatically whether to use GCC or Clang.

The default policy is to prefer GCC, but fall back to Clang if we can't
find it.  This can be influenced by the environment variable
`$CROSS_COMPILER'.

As part of this, move setting `CC', etc. from `android-cross-
config.site' to `common-cross-config.site'.

4 years agosrc/cross.in: Use `type' to search through the path.
Mark Wooding [Wed, 22 Apr 2020 21:37:59 +0000 (22:37 +0100)]
src/cross.in: Use `type' to search through the path.

Why didn't I do that the first time?

4 years agoetc/android-cross-config.site: Provide defaults for `clang' locations.
Mark Wooding [Wed, 22 Apr 2020 21:36:39 +0000 (22:36 +0100)]
etc/android-cross-config.site: Provide defaults for `clang' locations.

Not necessary here, but I have plans.

4 years agoetc/android-cross-config.site: Remove interstitial spaces.
Mark Wooding [Wed, 22 Apr 2020 21:19:13 +0000 (22:19 +0100)]
etc/android-cross-config.site: Remove interstitial spaces.

They're all provided by `$CROSS_COMPILER_PREFIX' and `$CROSS_clang_FLAGS'.

4 years agoetc/android-cross-config.site: Use the correct tool for `$CXX'.
Mark Wooding [Wed, 22 Apr 2020 21:21:22 +0000 (22:21 +0100)]
etc/android-cross-config.site: Use the correct tool for `$CXX'.

4 years agoetc/android-cross-config.site: Fix environment-variable typo.
Mark Wooding [Wed, 22 Apr 2020 21:16:31 +0000 (22:16 +0100)]
etc/android-cross-config.site: Fix environment-variable typo.

That's a strange one.

4 years agolinux-cross-setup.sh.in: Put a leading space on `$CROSS_clang_FLAGS'.
Mark Wooding [Wed, 22 Apr 2020 21:17:26 +0000 (22:17 +0100)]
linux-cross-setup.sh.in: Put a leading space on `$CROSS_clang_FLAGS'.

4 years agomdw/cross.in, Makefile: Rename to simply `cross'.
Mark Wooding [Wed, 22 Apr 2020 21:12:33 +0000 (22:12 +0100)]
mdw/cross.in, Makefile: Rename to simply `cross'.

  * Rename the main program to `cross'.
  * Rename the environment variable to `$CROSS_BUILDENV'.
  * Change the generated-file banner to mention `CROSS', not `mdw-cross'.

4 years agosrc/crosstool.in: Don't establish `$crosstool' if we don't need it.
Mark Wooding [Wed, 22 Apr 2020 21:38:56 +0000 (22:38 +0100)]
src/crosstool.in: Don't establish `$crosstool' if we don't need it.

The code ends up longer, but it's less confusing this way.

4 years agosrc/cross-run.in: Delete pointless `Data::Dumper' import.
Mark Wooding [Wed, 22 Apr 2020 21:15:43 +0000 (22:15 +0100)]
src/cross-run.in: Delete pointless `Data::Dumper' import.

4 years agoetc/android.sh: Don't expect to find the NDK relative to an SDK path.
Mark Wooding [Wed, 22 Apr 2020 18:59:22 +0000 (19:59 +0100)]
etc/android.sh: Don't expect to find the NDK relative to an SDK path.

Establishing a simple well-known path to the NDK root covers all the
possibilities.

4 years agosrc/cross-run.in: Fix usage message.
Mark Wooding [Wed, 18 Sep 2019 21:25:04 +0000 (22:25 +0100)]
src/cross-run.in: Fix usage message.

4 years agoSupport Clang as a `cross-tool' and use it under Android.
Mark Wooding [Wed, 18 Sep 2019 18:50:03 +0000 (19:50 +0100)]
Support Clang as a `cross-tool' and use it under Android.

Add the necessary machinery to use Clang instead.  Annoyingly, the
Android NDK doesn't name its Clang wrappers with the usual GNU
architecture triples, so there's an exciting amount of hacking to be
done.

What I don't have yet is a principled way to configure which compiler
should get chosen for a given build.

4 years agobin/cross-run.in: Pass `-k', `-n' and `-s' flags through to `make'.
Mark Wooding [Sun, 8 Sep 2019 17:18:20 +0000 (18:18 +0100)]
bin/cross-run.in: Pass `-k', `-n' and `-s' flags through to `make'.

5 years agoetc/common-cross-config.site: Set `ac_tool_prefix' explicitly.
Mark Wooding [Sat, 22 Dec 2018 10:38:52 +0000 (10:38 +0000)]
etc/common-cross-config.site: Set `ac_tool_prefix' explicitly.

Autoconf will set this from the host alias provided on the command line,
but this is done before reading the `config.site' file, so we must do
this by hand here.

Otherwise, `configure' only finds the generic versions of the tools,
which will work if `binutils-multiarch' is installed, but not otherwise.

5 years agosrc/cross-run.in: New tool to run command in multiple cross-build envs.
Mark Wooding [Wed, 19 Dec 2018 12:41:41 +0000 (12:41 +0000)]
src/cross-run.in: New tool to run command in multiple cross-build envs.

Possibly in parallel.  (Ab)uses GNU make for the parallelism, so that
descendent `make's share the available job slots properly.

5 years agoMakefile: Emit a `etc/config.sh' snippet about target architectures.
Mark Wooding [Sat, 22 Dec 2018 09:27:48 +0000 (09:27 +0000)]
Makefile: Emit a `etc/config.sh' snippet about target architectures.

Not needed yet, but may come in handy later.

5 years agoetc/android-cross-config.site: Use `ccache' if available.
Mark Wooding [Fri, 21 Dec 2018 23:03:19 +0000 (23:03 +0000)]
etc/android-cross-config.site: Use `ccache' if available.

This got lost in the refactoring.  Put it back.

5 years agoMakefile, bin/ -> src/: Substitute scripts rather than chasing symlinks.
Mark Wooding [Wed, 19 Dec 2018 12:39:59 +0000 (12:39 +0000)]
Makefile, bin/ -> src/: Substitute scripts rather than chasing symlinks.

Move the original scripts to `src/' and leave placeholders, and have the
Makefile do seddery on them to create the `bin/' versions.

5 years agoMakefile: Use `SED' as the build-step label when hacking setup scripts.
Mark Wooding [Wed, 19 Dec 2018 12:37:39 +0000 (12:37 +0000)]
Makefile: Use `SED' as the build-step label when hacking setup scripts.

Also, introduce a line break to match future additions.

5 years agoMakefile: Ensure that output directory exists before generating output.
Mark Wooding [Sat, 22 Dec 2018 09:22:46 +0000 (09:22 +0000)]
Makefile: Ensure that output directory exists before generating output.

5 years agoMakefile: Add silent-rules machinery for completely silent actions.
Mark Wooding [Sat, 22 Dec 2018 09:29:58 +0000 (09:29 +0000)]
Makefile: Add silent-rules machinery for completely silent actions.

5 years agolinux-*-setup.sh.in: Add the cross tree's `bin' directory to `PATH'.
Mark Wooding [Thu, 13 Dec 2018 19:50:25 +0000 (19:50 +0000)]
linux-*-setup.sh.in: Add the cross tree's `bin' directory to `PATH'.

5 years agoandroid-cross-setup.sh.in: Explicitly export the `PATH'.
Mark Wooding [Thu, 13 Dec 2018 19:50:09 +0000 (19:50 +0000)]
android-cross-setup.sh.in: Explicitly export the `PATH'.

5 years ago*-cross-setup.sh.in: Set `PKG_CONFIG_PATH' correctly.
Mark Wooding [Wed, 12 Dec 2018 17:41:03 +0000 (17:41 +0000)]
*-cross-setup.sh.in: Set `PKG_CONFIG_PATH' correctly.

This got screwed by the recent refactoring.  Oops.

5 years agoBring `native' architectures into the collection.
Mark Wooding [Mon, 26 Nov 2018 13:16:49 +0000 (13:16 +0000)]
Bring `native' architectures into the collection.

Also fix Android `cross-gcc'.  And other stuff.

5 years agoRearrange everything.
Mark Wooding [Sat, 24 Nov 2018 17:58:14 +0000 (17:58 +0000)]
Rearrange everything.

  * Have `setup.sh' define `CROSS_ARCH', which is the GNU triplet for
    the target architecture.  This is then exported and can be used by
    `config.site' to define further things.

  * Factor out the common machinery between Android and Linux
    `config.site' files.  This is, in fact, exactly the Linux
    `config.site', so have `mdw-cross' select this as a default if
    nothing more specific can be found.

  * Factor out the common machinery for Android `config.site' files,
    which was basically all of it.

  * Move the compiler flags into the new `android-cross-config.site'
    file.

  * Replace `$ANDROID_CC' by `$CROSS_ARCH-gcc'.  Factor out the
    mandatory compiler flags into `$CROSS_gcc_FLAGS', and generalize this
    so that we also set `$CROSS_gxx_FLAGS' for C++.

  * Introduce a new program `crosstool' intended to be invoked via a
    symlink, which just execs the appropriate cross-toolchain tool with
    any necessary extra flags.  Include a bunch of useful symlinks and
    have `mdw-cross' hook them onto the path.

  * Add a Makefile to build the `...-setup.sh' files for each target
    architecture from skeletons.  The Makefile is unnecessarily hairy
    but I like them that way.

5 years agoInitial version.
Mark Wooding [Thu, 22 Nov 2018 16:10:25 +0000 (16:10 +0000)]
Initial version.