Bug creation and email sending has been disabled, file new bugs at gcc.gnu.org/bugzilla
View | Details | Raw Unified | Return to bug 153
Collapse All | Expand All

(-)a/gcc/d/d-glue.cc (+3 lines)
Lines 50-55 Global::init (void) Link Here
50
  this->stdmsg = stdout;
50
  this->stdmsg = stdout;
51
  this->main_d = "__main.d";
51
  this->main_d = "__main.d";
52
52
53
  this->pragma_lib_filename = 0;
54
  this->pragma_lib_file_created = 0;
55
53
  memset (&this->params, 0, sizeof (Param));
56
  memset (&this->params, 0, sizeof (Param));
54
}
57
}
55
58
(-)a/gcc/d/d-lang.cc (+7 lines)
Lines 529-534 d_handle_option (size_t scode, const char *arg, int value, Link Here
529
      global.params.useUnitTests = value;
529
      global.params.useUnitTests = value;
530
      break;
530
      break;
531
531
532
    case OPT_fwrite_pragma_libs_: {
533
      // ah, let it leak!
534
      char *tmp = new char[strlen(arg)+1];
535
      strcpy(tmp, arg);
536
      global.pragma_lib_filename = (const char *)&tmp[0];
537
      } break;
538
532
    case OPT_fversion_:
539
    case OPT_fversion_:
533
      if (ISDIGIT (arg[0]))
540
      if (ISDIGIT (arg[0]))
534
	{
541
	{
(-)a/gcc/d/dfrontend/attrib.c (+10 lines)
Lines 1076-1081 void PragmaDeclaration::semantic(Scope *sc) Link Here
1076
                    ob->writestring((char *) name);
1076
                    ob->writestring((char *) name);
1077
                    ob->writenl();
1077
                    ob->writenl();
1078
                }
1078
                }
1079
                if (global.pragma_lib_filename && global.pragma_lib_file_created >= 0) {
1080
                  FILE *fo = fopen(global.pragma_lib_filename, (global.pragma_lib_file_created ? "a" : "w"));
1081
                  if (fo) {
1082
                    global.pragma_lib_file_created = 1; // file successfully created
1083
                    fprintf(fo, "-l\"%s\"\n", name);
1084
                    fclose(fo);
1085
                  } else {
1086
                    global.pragma_lib_file_created = -1; // error occured, don't try to do this anymore
1087
                  }
1088
                }
1079
                mem.free(name);
1089
                mem.free(name);
1080
            }
1090
            }
1081
        }
1091
        }
(-)a/gcc/d/dfrontend/mars.h (+4 lines)
Lines 238-243 struct Global Link Here
238
    Strings *path;        // Array of char*'s which form the import lookup path
238
    Strings *path;        // Array of char*'s which form the import lookup path
239
    Strings *filePath;    // Array of char*'s which form the file import lookup path
239
    Strings *filePath;    // Array of char*'s which form the file import lookup path
240
240
241
    // writing pragma(lib) to file
242
    const char *pragma_lib_filename; // NULL: don't write; (? "" -- stdout)
243
    int pragma_lib_file_created; // !0: append; <0: error
244
241
    const char *version;
245
    const char *version;
242
246
243
    Compiler compiler;
247
    Compiler compiler;
(-)a/gcc/d/lang.opt (+4 lines)
Lines 156-161 fversion= Link Here
156
D Joined RejectNegative
156
D Joined RejectNegative
157
-fversion=<level|ident> Compile in version code >= <level> or identified by <ident>
157
-fversion=<level|ident> Compile in version code >= <level> or identified by <ident>
158
158
159
fwrite-pragma-libs=
160
D Joined RejectNegative
161
-fwrite-pragma-libs=<filename> write all libraries from pragma(lib) to <filename>
162
159
fXf=
163
fXf=
160
D Joined RejectNegative
164
D Joined RejectNegative
161
-fXf=<filename> Write JSON file to <filename>
165
-fXf=<filename> Write JSON file to <filename>

Return to bug 153