- if (argc != 2)
- {
- fprintf(stderr, "usage: config <sysname>\n");
- exit(1);
- }
- PREFIX = argv[1];
- if (freopen(argv[1], "r", stdin) == NULL)
- {
- perror(argv[1]);
- exit(2);
- }
- dtab = NULL;
- if (yyparse())
- exit(3);
- else
- {
- ioconf(); /* Print ioconf.c */
- ubglue(); /* Create ubglue.s */
+
+ if (argc > 1 && eq("-p", argv[1])) {
+ profiling++;
+ argc--, argv++;
+ }
+ if (argc != 2) {
+ fprintf(stderr, "usage: config [ -p ] sysname\n");
+ exit(1);
+ }
+ PREFIX = argv[1];
+ if (freopen(argv[1], "r", stdin) == NULL) {
+ perror(argv[1]);
+ exit(2);
+ }
+ dtab = NULL;
+ confp = &conf_list;
+ if (yyparse())
+ exit(3);
+ switch (machine) {
+
+ case MACHINE_VAX:
+ vax_ioconf(); /* Print ioconf.c */
+ ubglue(); /* Create ubglue.s */
+ break;
+
+ case MACHINE_TAHOE:
+ tahoe_ioconf();
+ vbglue();
+ break;
+
+ default:
+ printf("Specify machine type, e.g. ``machine vax''\n");
+ exit(1);
+ }
+ /*
+ * make symbolic links in compilation directory
+ * for "sys" (to make genassym.c work along with #include <sys/xxx>)
+ * and similarly for "machine".
+ */
+ {
+ char xxx[80];
+
+ (void) symlink("../h", path("sys"));
+ sprintf(xxx, "../%s", machinename);
+ (void) symlink(xxx, path("machine"));
+ }