@@ -28,56 +28,65 @@ JL_DLLEXPORT const char *jl_get_default_sysimg_path(void)
2828}
2929
3030
31- jl_options_t jl_options = { 0 , // quiet
32- -1 , // banner
33- NULL , // julia_bindir
34- NULL , // julia_bin
35- NULL , // cmds
36- NULL , // image_file (will be filled in below)
37- NULL , // cpu_target ("native", "core2", etc...)
38- 0 , // nthreads
39- 0 , // nprocs
40- NULL , // machine_file
41- NULL , // project
42- 0 , // isinteractive
43- 0 , // color
44- JL_OPTIONS_HISTORYFILE_ON , // history file
45- 0 , // startup file
46- JL_OPTIONS_COMPILE_DEFAULT , // compile_enabled
47- 0 , // code_coverage
48- 0 , // malloc_log
49- 2 , // opt_level
50- 0 , // opt_level_min
31+ static int jl_options_initialized = 0 ;
32+
33+ JL_DLLEXPORT void jl_init_options (void )
34+ {
35+ if (jl_options_initialized )
36+ return ;
37+ jl_options =
38+ (jl_options_t ){ 0 , // quiet
39+ -1 , // banner
40+ NULL , // julia_bindir
41+ NULL , // julia_bin
42+ NULL , // cmds
43+ NULL , // image_file (will be filled in below)
44+ NULL , // cpu_target ("native", "core2", etc...)
45+ 0 , // nthreads
46+ 0 , // nprocs
47+ NULL , // machine_file
48+ NULL , // project
49+ 0 , // isinteractive
50+ 0 , // color
51+ JL_OPTIONS_HISTORYFILE_ON , // history file
52+ 0 , // startup file
53+ JL_OPTIONS_COMPILE_DEFAULT , // compile_enabled
54+ 0 , // code_coverage
55+ 0 , // malloc_log
56+ 2 , // opt_level
57+ 0 , // opt_level_min
5158#ifdef JL_DEBUG_BUILD
52- 2 , // debug_level [debug build]
59+ 2 , // debug_level [debug build]
5360#else
54- 1 , // debug_level [release build]
61+ 1 , // debug_level [release build]
5562#endif
56- JL_OPTIONS_CHECK_BOUNDS_DEFAULT , // check_bounds
57- JL_OPTIONS_DEPWARN_OFF , // deprecation warning
58- 0 , // method overwrite warning
59- 1 , // can_inline
60- JL_OPTIONS_POLLY_ON , // polly
61- NULL , // trace_compile
62- JL_OPTIONS_FAST_MATH_DEFAULT ,
63- 0 , // worker
64- NULL , // cookie
65- JL_OPTIONS_HANDLE_SIGNALS_ON ,
66- JL_OPTIONS_USE_SYSIMAGE_NATIVE_CODE_YES ,
67- JL_OPTIONS_USE_COMPILED_MODULES_YES ,
68- NULL , // bind-to
69- NULL , // output-bc
70- NULL , // output-unopt-bc
71- NULL , // output-o
72- NULL , // output-asm
73- NULL , // output-ji
74- NULL , // output-code_coverage
75- 0 , // incremental
76- 0 , // image_file_specified
77- JL_OPTIONS_WARN_SCOPE_ON , // ambiguous scope warning
78- 0 , // image-codegen
79- 0 , // rr-detach
80- };
63+ JL_OPTIONS_CHECK_BOUNDS_DEFAULT , // check_bounds
64+ JL_OPTIONS_DEPWARN_OFF , // deprecation warning
65+ 0 , // method overwrite warning
66+ 1 , // can_inline
67+ JL_OPTIONS_POLLY_ON , // polly
68+ NULL , // trace_compile
69+ JL_OPTIONS_FAST_MATH_DEFAULT ,
70+ 0 , // worker
71+ NULL , // cookie
72+ JL_OPTIONS_HANDLE_SIGNALS_ON ,
73+ JL_OPTIONS_USE_SYSIMAGE_NATIVE_CODE_YES ,
74+ JL_OPTIONS_USE_COMPILED_MODULES_YES ,
75+ NULL , // bind-to
76+ NULL , // output-bc
77+ NULL , // output-unopt-bc
78+ NULL , // output-o
79+ NULL , // output-asm
80+ NULL , // output-ji
81+ NULL , // output-code_coverage
82+ 0 , // incremental
83+ 0 , // image_file_specified
84+ JL_OPTIONS_WARN_SCOPE_ON , // ambiguous scope warning
85+ 0 , // image-codegen
86+ 0 , // rr-detach
87+ };
88+ jl_options_initialized = 1 ;
89+ }
8190
8291static const char usage [] = "julia [switches] -- [programfile] [args...]\n" ;
8392static const char opts [] =
0 commit comments