2009-08-15 01:54:27 +08:00
|
|
|
/* Note that this file is not used as of GFortran 4.5, and exists here
|
|
|
|
only for backwards compatibility. */
|
|
|
|
|
2004-05-13 14:41:07 +08:00
|
|
|
#include "libgfortran.h"
|
|
|
|
|
|
|
|
/* The main Fortran program actually is a function, called MAIN__.
|
|
|
|
We call it from the main() function in this file. */
|
|
|
|
void MAIN__ (void);
|
|
|
|
|
|
|
|
/* Main procedure for fortran programs. All we do is set up the environment
|
|
|
|
for the Fortran program. */
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
/* Set up the runtime environment. */
|
2009-06-15 00:52:49 +08:00
|
|
|
set_args (argc, argv);
|
gfortran.h (gfc_option_t): Add flag_backtrace field.
* gfortran.h (gfc_option_t): Add flag_backtrace field.
* lang.opt: Add -fbacktrace option.
* invoke.texi: Document the new option.
* trans-decl.c (gfc_build_builtin_function_decls): Add new
option to the call to set_std.
* options.c (gfc_init_options, gfc_handle_option): Handle the
new option.
* runtime/backtrace.c: New file.
* runtime/environ.c (variable_table): New GFORTRAN_ERROR_BACKTRACE
environment variable.
* runtime/compile_options.c (set_std): Add new argument.
* runtime/main.c (store_exe_path, full_exe_path): New functions.
* runtime/error.c (sys_exit): Add call to show_backtrace.
* libgfortran.h (options_t): New backtrace field.
(store_exe_path, full_exe_path, show_backtrace): New prototypes.
* configure.ac: Add checks for execinfo.h, execvp, pipe, dup2,
close, fdopen, strcasestr, getrlimit, backtrace, backtrace_symbols
and getppid.
* Makefile.am: Add runtime/backtrace.c.
* fmain.c (main): Add call to store_exe_path.
* Makefile.in: Renegerate.
* config.h.in: Renegerate.
* configure: Regenerate.
From-SVN: r122954
2007-03-15 20:39:47 +08:00
|
|
|
|
2004-05-13 14:41:07 +08:00
|
|
|
/* Call the Fortran main program. Internally this is a function
|
|
|
|
called MAIN__ */
|
|
|
|
MAIN__ ();
|
|
|
|
|
|
|
|
/* Bye-bye! */
|
|
|
|
return 0;
|
|
|
|
}
|