diff --git a/cobc/cobc.c b/cobc/cobc.c index 1de39f3f9..63880aa69 100644 --- a/cobc/cobc.c +++ b/cobc/cobc.c @@ -387,6 +387,8 @@ static char *cobc_include; /* -I... */ static char *cobc_ldflags; /* -Q / COB_LDFLAGS */ static char *cb_depend_target; /* -MT ... */ +static int cb_build_inplace = 0; + static size_t cobc_cflags_size; static size_t cobc_libs_size; static size_t cobc_lib_paths_size; @@ -4459,6 +4461,7 @@ process_filename (const char *filename) fn->translate = cobc_main_strdup (output_name); } else if (save_all_src || save_temps || save_c_src + || cb_build_inplace || cb_compile_level == CB_LEVEL_TRANSLATE) { fn->translate = cobc_main_stradd_dup (fbasename, ".c"); } else { @@ -8963,6 +8966,9 @@ finish_setup_compiler_env (void) if (getenv ("COBC_GEN_DUMP_COMMENTS")) { cb_wants_dump_comments = 1; } + if (getenv("COBC_BUILD_INPLACE")){ + cb_build_inplace = 1; + } } diff --git a/tests/testsuite.src/used_binaries.at b/tests/testsuite.src/used_binaries.at index 047196055..6fd5ab960 100644 --- a/tests/testsuite.src/used_binaries.at +++ b/tests/testsuite.src/used_binaries.at @@ -1035,4 +1035,6 @@ AT_DATA([prog2.cob], [ AT_CHECK([$COBC -m --include "$PWD/file.h" -fstatic-call prog2.cob], [0], [], []) +AT_CHECK([COBC_BUILD_INPLACE=1 $COBC -m --include "file.h" -fstatic-call prog2.cob], [0], [], []) + AT_CLEANUP