tool: use ccache in gccx, if available
[nit.git] / c_src / clib / nit_main.c
index b578658..1f955cd 100644 (file)
@@ -79,10 +79,13 @@ void exithandler(int s) {
 }
 void initialize_gc_option(void) {
        /* GC default */
+       char *def;
 #ifdef WITH_LIBGC
        gc_option = boehm;
+       def = "boehm";
 #else
        gc_option = nitgc;
+       def = "nitgc";
 #endif
 
        /* Process GC runtime selection */
@@ -92,14 +95,21 @@ void initialize_gc_option(void) {
 #ifdef WITH_LIBGC
                        gc_option = boehm;
 #else
-               fprintf(stderr, "Compiled without Boehm GC support. Using default.\n");
+               fprintf(stderr, "Compiled without Boehm GC support. Using default '%s'.\n", def);
 #endif
                } else if (strcmp(opt, "nitgc")==0) {
                        gc_option = nitgc;
                } else if (strcmp(opt, "large")==0) {
                        gc_option = large;
+               } else if (strcmp(opt, "help")==0) {
+                       fprintf(stderr, "NIT_GC_OPTION accepts 'nitgc'"
+#ifdef WITH_LIBGC
+                                       ", 'boehm'"
+#endif
+                                       ", 'large'. Default is '%s'.\n", def);
+                       exit(1);
                } else {
-                       fprintf(stderr, "Invalid GC option in NIT_GC_OPTION environment variable. Using default.\n");
+                       fprintf(stderr, "Invalid GC option in NIT_GC_OPTION environment variable. Using default '%s'.\n", def);
                }
        }