/* Arguments to send to the real compiler. */
struct args *compiler_args;
- setup_uncached_err();
-
- if (!getenv("CCACHE_READONLY")) {
- if (create_cachedirtag(cache_dir) != 0) {
- cc_log("failed to create %s/CACHEDIR.TAG (%s)\n",
- cache_dir, strerror(errno));
- failed();
- }
- }
+ orig_args = args_init(argc, argv);
- sloppiness = parse_sloppiness(getenv("CCACHE_SLOPPINESS"));
+ initialize();
+ find_compiler(argv);
- cc_log_argv("Command line: ", argv);
- cc_log("Hostname: %s", get_hostname());
- cc_log("Working directory: %s", get_current_working_dir());
+#ifndef _WIN32
+ signal(SIGHUP, signal_handler);
+#endif
+ signal(SIGINT, signal_handler);
+ signal(SIGTERM, signal_handler);
- if (base_dir) {
- cc_log("Base directory: %s", base_dir);
+ if (str_eq(conf->temporary_dir, "")) {
+ clean_up_internal_tempdir();
}
- if (getenv("CCACHE_UNIFY")) {
- cc_log("Unify mode enabled");
- enable_unify = true;
+ if (!str_eq(conf->log_file, "")) {
+ conf_print_items(conf, configuration_logger, NULL);
}
- if (getenv("CCACHE_NODIRECT") || enable_unify) {
- cc_log("Direct mode disabled");
- enable_direct = false;
+ if (conf->disable) {
+ cc_log("ccache is disabled");
+ failed();
}
- if (getenv("CCACHE_COMPRESS")) {
- cc_log("Compression enabled");
- enable_compression = true;
- }
+ setup_uncached_err();
+
+ cc_log_argv("Command line: ", argv);
+ cc_log("Hostname: %s", get_hostname());
- cc_log("Working directory: %s", current_working_dir);
++ cc_log("Working directory: %s", get_current_working_dir());
- if ((env = getenv("CCACHE_NLEVELS"))) {
- nlevels = atoi(env);
- if (nlevels < 1) nlevels = 1;
- if (nlevels > 8) nlevels = 8;
+ if (conf->unify) {
+ cc_log("Direct mode disabled because unify mode is enabled");
+ conf->direct_mode = false;
}
if (!cc_process_args(orig_args, &preprocessor_args, &compiler_args)) {