diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-05-12 14:46:30 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-05-12 14:46:30 +0000 |
commit | a54a7e15d90d2a52a0d1df36db0c18b70df54073 (patch) | |
tree | a64ce08b988fc40ce16d4df8b6621bce7841158f /lib/make/setup_configuration.pl | |
parent | b7d3f2b9e7597a728a317b98d205be822ce5304a (diff) |
Preliminary support for cross-compilation.
Setting BUILD=, or HOST=, or TARGET= will pass --build=, ... to the
configure process.
If cross compiling you need to set
ENDIAN - either big or little
SIZEOF_LONG_INT
SIZEOF_INT
SIZEOF_SHORT_INT
SIZEOF_LONG_DOUBLE
SIZEOF_DOUBLE
SIZEOF_SHORT
SIZEOF_POINTER
otherwise you'll get an error.
You may also set
NULL_DEVICE
to tell it the location of the null device. If you don't set this you'll
just get a warning, and it will default to /dev/null.
This is weakly tested, as I am limited in what I can cross compile for.
Fixed semantics for DEBUG to be as in previous commit, except DEBUG=DEFINES
define CCTK_DEBUG and not DEBUG in the header files.
Partially dealt with PR 340 -- -g -O2 no longer automatically appear as
the compilation flags.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1652 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/setup_configuration.pl')
-rwxr-xr-x | lib/make/setup_configuration.pl | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/lib/make/setup_configuration.pl b/lib/make/setup_configuration.pl index a0ac978d..467bfcde 100755 --- a/lib/make/setup_configuration.pl +++ b/lib/make/setup_configuration.pl @@ -93,7 +93,9 @@ chdir "config-data" || die "Internal error - could't enter $configs_dir/$config/ &SetConfigureEnv(); -system("$configure"); +$configure_command = &DetermineConfigureCommand($configure, %ENV); + +system("$configure_command"); $retcode = $? >> 8; @@ -168,4 +170,28 @@ sub SetConfigureEnv } -sub ConfigureConfiguration +sub DetermineConfigureCommand +{ + my($configure, %env) = @_; + my($configure_command); + + $configure_command = "$configure"; + + if($ENV{"BUILD"}) + { + $configure_command .= " --build=". $ENV{"BUILD"}; + } + + if($ENV{"TARGET"}) + { + $configure_command .= " --target=". $ENV{"TARGET"}; + } + + if($ENV{"HOST"}) + { + $configure_command .= " --host=". $ENV{"HOST"}; + } + + return $configure_command; +} + |