global srcdir
global ld_library_path
global shlib_ext
- global SHARED_OPTION
global ALGOL68_UNDER_TEST
set gccpath ${paths}
- set libio_dir ""
set flags ""
set ld_library_path "."
set shlib_ext [get_shlib_extension]
- set SHARED_OPTION ""
verbose "shared lib extension: $shlib_ext"
# We need to add options to locate libga68.
}
if { $gccpath != "" } {
- # Path to libga68.spec.
- append flags "-B${gccpath}/libga68 "
if { [file exists "${gccpath}/libga68/.libs/libga68.a"] \
|| [file exists "${gccpath}/libga68/.libs/libga68.${shlib_ext}"] } {
if { $target_wants_B_option } {
}
append ld_library_path ":${gccpath}/libga68/.libs"
}
- # Static linking is default. If only the shared lib is available adjust
- # flags to always use it. If both are available, set SHARED_OPTION which
- # will be added to PERMUTE_ARGS
- if { [file exists "${gccpath}/libga68/src/.libs/libga68.${shlib_ext}"] } {
- if { [file exists "${gccpath}/libga68/src/.libs/libga68.a"] } {
- set SHARED_OPTION "-shared-libga68"
- } else {
-# append flags "-shared-libga68 "
- }
- }
if [file exists "${gccpath}/libiberty/libiberty.a"] {
append flags "-L${gccpath}/libiberty "
}
global TESTING_IN_BUILD_TREE
global gcc_warning_prefix
global gcc_error_prefix
+ global TEST_ALWAYS_FLAGS
+ global algol68_init_set_ALGOL68_UNDER_TEST
# We set LC_ALL and LANG to C so that we get the same error messages as expected.
setenv LC_ALL C
setenv LANG C
- if ![info exists ALGOL68_UNDER_TEST] then {
+ # ALGOL68_UNDER_TEST as set below contains $specpath, which depends on
+ # the used multilib config. Thus, its value may need to be reset;
+ # that's tracked via algol68_init_set_ALGOL68_UNDER_TEST.
+ if { ![info exists ALGOL68_UNDER_TEST]
+ || [info exists algol68_init_set_ALGOL68_UNDER_TEST] } then {
if [info exists TOOL_EXECUTABLE] {
set ALGOL68_UNDER_TEST $TOOL_EXECUTABLE
} else {
if { [is_remote host] || ! [info exists TESTING_IN_BUILD_TREE] } {
set ALGOL68_UNDER_TEST [transform ga68]
} else {
- set ALGOL68_UNDER_TEST [findfile $base_dir/../../ga68 "$base_dir/../../ga68 -B$base_dir/../../" [findfile $base_dir/ga68 "$base_dir/ga68 -B$base_dir/" [transform ga68]]]
+ if [info exists TOOL_OPTIONS] {
+ set specpath [get_multilibs ${TOOL_OPTIONS}]
+ } else {
+ set specpath [get_multilibs]
+ }
+ set algol68_init_set_ALGOL68_UNDER_TEST 1
+ set ALGOL68_UNDER_TEST [findfile $base_dir/../../ga68 "$base_dir/../../ga68 -B$base_dir/../../ -B$specpath/libga68/" [findfile $base_dir/ga68 "$base_dir/ga68 -B$base_dir/" [transform ga68]]]
}
}
}
set gcc_warning_prefix "warning:"
set gcc_error_prefix "(fatal )?error:"
- verbose "algol68 is initialized" 3
-}
-
-#
-# algol68_target_compile -- compile a source file
-#
-
-proc algol68_target_compile { source dest type options } {
- global tmpdir
- global gluefile wrap_flags
- global ALWAYS_ALGOL68FLAGS
- global ALGOL68_UNDER_TEST
- global individual_timeout
- global TEST_ALWAYS_FLAGS
-
- # HACK: guard against infinite loops in the compiler
- set individual_timeout 20
-
- if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
- lappend options "libs=${gluefile}"
- lappend options "ldflags=${wrap_flags}"
- }
-
set ALWAYS_ALGOL68FLAGS ""
# TEST_ALWAYS_FLAGS are flags that should be passed to every
verbose -log "ALWAYS_ALGOL68FLAGS set to $ALWAYS_ALGOL68FLAGS"
+ verbose "algol68 is initialized" 3
+}
+
+#
+# algol68_target_compile -- compile a source file
+#
+
+proc algol68_target_compile { source dest type options } {
+ global tmpdir
+ global gluefile wrap_flags
+ global ALWAYS_ALGOL68FLAGS
+ global ALGOL68_UNDER_TEST
+ global TEST_ALWAYS_FLAGS
+ global individual_timeout
+
+ # HACK: guard against infinite loops in the compiler
+ set individual_timeout 20
+
+ if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
+ lappend options "libs=${gluefile}"
+ lappend options "ldflags=${wrap_flags}"
+ }
+
lappend options "timeout=[timeout_value]"
lappend options "compiler=$ALGOL68_UNDER_TEST"