add support for "machinearch" internal variable. if "machinearch"

is different than the "machinename" internal variable, read
machinearch's files.${machinearch} and add it to the list of files
for the machine.  Also, regardless of whether or not they're different,
create a ${machinearch} sylink (or directory) pointing to the machinearch
include files (or containing them).
This commit is contained in:
cgd 1994-01-08 10:33:43 +00:00
parent 957ce06f24
commit 2dae0c7cb0
8 changed files with 56 additions and 12 deletions

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)config.h 5.14 (Berkeley) 7/1/91
* $Id: config.h,v 1.10 1993/10/15 23:26:39 cgd Exp $
* $Id: config.h,v 1.11 1994/01/08 10:33:43 cgd Exp $
*/
/*
@ -135,6 +135,7 @@ struct config {
*/
int machine;
char *machinename;
char *machinearch;
#define MACHINE_VAX 1
#define MACHINE_TAHOE 2
#define MACHINE_HP300 3

View File

@ -104,7 +104,7 @@
* SUCH DAMAGE.
*
* from: @(#)config.y 5.14 (Berkeley) 7/1/91
* $Id: config.y,v 1.9 1993/12/01 05:56:39 deraadt Exp $
* $Id: config.y,v 1.10 1994/01/08 10:33:53 cgd Exp $
*/
#include "config.h"
@ -147,21 +147,27 @@ Config_spec:
if (!strcmp($2, "vax")) {
machine = MACHINE_VAX;
machinename = "vax";
machinearch = machinename;
} else if (!strcmp($2, "tahoe")) {
machine = MACHINE_TAHOE;
machinename = "tahoe";
machinearch = machinename;
} else if (!strcmp($2, "hp300")) {
machine = MACHINE_HP300;
machinename = "hp300";
machinearch = "m68k";
} else if (!strcmp($2, "i386")) {
machine = MACHINE_I386;
machinename = "i386";
machinearch = machinename;
} else if (!strcmp($2, "pc532")) {
machine = MACHINE_PC532;
machinename = "pc532";
machinearch = machinename;
} else if (!strcmp($2, "pmax")) {
machine = MACHINE_PMAX;
machinename = "pmax";
machinearch = machinename;
} else
yyerror("Unknown machine type");
} |

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)main.c 5.17 (Berkeley) 7/1/91";*/
static char rcsid[] = "$Id: main.c,v 1.7 1993/10/14 01:22:31 deraadt Exp $";
static char rcsid[] = "$Id: main.c,v 1.8 1994/01/08 10:33:57 cgd Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -151,15 +151,20 @@ usage: fputs("usage: config [-gkp] sysname\n", stderr);
* and similarly for "machine".
*/
{
char xxx[80];
char xxx[200];
#ifndef NO_SYMLINK
(void) sprintf(xxx, "../../include", machinename);
(void) sprintf(xxx, "../../include");
(void) symlink(xxx, path("machine"));
(void) sprintf(xxx, "../../../%s/include", machinearch);
(void) symlink(xxx, path(machinearch));
#else
sprintf (xxx, "/bin/rm -rf %s; /bin/cp -r ../include %s",
path("machine"), path("machine"));
system (xxx);
sprintf (xxx, "/bin/rm -rf %s; /bin/cp -r ../../%s/include %s",
path(machinearch), machinearch, path(machinearch));
system (xxx);
#endif
}
makefile(); /* build Makefile */

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)mkmakefile.c 5.33 (Berkeley) 7/1/91";*/
static char rcsid[] = "$Id: mkmakefile.c,v 1.18 1993/10/14 01:22:35 deraadt Exp $";
static char rcsid[] = "$Id: mkmakefile.c,v 1.19 1994/01/08 10:34:01 cgd Exp $";
#endif /* not lint */
/*
@ -239,12 +239,22 @@ read_files()
read_file(fname,1,0);
(void) sprintf(fname, "files.%s", machinename);
read_file(fname,1,0);
if (strcmp(machinearch, machinename)) {
(void) sprintf(fname, "../../%s/conf/files.%s", machinearch,
machinearch);
read_file(fname,1,0);
}
(void) sprintf(fname, "files.%s", raise(ident));
read_file(fname,0,1);
(void) strcpy(fname, "../../../conf/options");
read_file(fname,0,0);
(void) sprintf(fname, "options.%s", machinename);
read_file(fname,0,0);
if (strcmp(machinearch, machinename)) {
(void) sprintf(fname, "../../%s/conf/options.%s", machinearch,
machinearch);
read_file(fname,0,0);
}
(void) sprintf(fname, "options.%s", raise(ident));
read_file(fname,0,1);
}

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)config.h 5.14 (Berkeley) 7/1/91
* $Id: config.h,v 1.10 1993/10/15 23:26:39 cgd Exp $
* $Id: config.h,v 1.11 1994/01/08 10:33:43 cgd Exp $
*/
/*
@ -135,6 +135,7 @@ struct config {
*/
int machine;
char *machinename;
char *machinearch;
#define MACHINE_VAX 1
#define MACHINE_TAHOE 2
#define MACHINE_HP300 3

View File

@ -104,7 +104,7 @@
* SUCH DAMAGE.
*
* from: @(#)config.y 5.14 (Berkeley) 7/1/91
* $Id: config.y,v 1.9 1993/12/01 05:56:39 deraadt Exp $
* $Id: config.y,v 1.10 1994/01/08 10:33:53 cgd Exp $
*/
#include "config.h"
@ -147,21 +147,27 @@ Config_spec:
if (!strcmp($2, "vax")) {
machine = MACHINE_VAX;
machinename = "vax";
machinearch = machinename;
} else if (!strcmp($2, "tahoe")) {
machine = MACHINE_TAHOE;
machinename = "tahoe";
machinearch = machinename;
} else if (!strcmp($2, "hp300")) {
machine = MACHINE_HP300;
machinename = "hp300";
machinearch = "m68k";
} else if (!strcmp($2, "i386")) {
machine = MACHINE_I386;
machinename = "i386";
machinearch = machinename;
} else if (!strcmp($2, "pc532")) {
machine = MACHINE_PC532;
machinename = "pc532";
machinearch = machinename;
} else if (!strcmp($2, "pmax")) {
machine = MACHINE_PMAX;
machinename = "pmax";
machinearch = machinename;
} else
yyerror("Unknown machine type");
} |

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)main.c 5.17 (Berkeley) 7/1/91";*/
static char rcsid[] = "$Id: main.c,v 1.7 1993/10/14 01:22:31 deraadt Exp $";
static char rcsid[] = "$Id: main.c,v 1.8 1994/01/08 10:33:57 cgd Exp $";
#endif /* not lint */
#include <sys/types.h>
@ -151,15 +151,20 @@ usage: fputs("usage: config [-gkp] sysname\n", stderr);
* and similarly for "machine".
*/
{
char xxx[80];
char xxx[200];
#ifndef NO_SYMLINK
(void) sprintf(xxx, "../../include", machinename);
(void) sprintf(xxx, "../../include");
(void) symlink(xxx, path("machine"));
(void) sprintf(xxx, "../../../%s/include", machinearch);
(void) symlink(xxx, path(machinearch));
#else
sprintf (xxx, "/bin/rm -rf %s; /bin/cp -r ../include %s",
path("machine"), path("machine"));
system (xxx);
sprintf (xxx, "/bin/rm -rf %s; /bin/cp -r ../../%s/include %s",
path(machinearch), machinearch, path(machinearch));
system (xxx);
#endif
}
makefile(); /* build Makefile */

View File

@ -33,7 +33,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)mkmakefile.c 5.33 (Berkeley) 7/1/91";*/
static char rcsid[] = "$Id: mkmakefile.c,v 1.18 1993/10/14 01:22:35 deraadt Exp $";
static char rcsid[] = "$Id: mkmakefile.c,v 1.19 1994/01/08 10:34:01 cgd Exp $";
#endif /* not lint */
/*
@ -239,12 +239,22 @@ read_files()
read_file(fname,1,0);
(void) sprintf(fname, "files.%s", machinename);
read_file(fname,1,0);
if (strcmp(machinearch, machinename)) {
(void) sprintf(fname, "../../%s/conf/files.%s", machinearch,
machinearch);
read_file(fname,1,0);
}
(void) sprintf(fname, "files.%s", raise(ident));
read_file(fname,0,1);
(void) strcpy(fname, "../../../conf/options");
read_file(fname,0,0);
(void) sprintf(fname, "options.%s", machinename);
read_file(fname,0,0);
if (strcmp(machinearch, machinename)) {
(void) sprintf(fname, "../../%s/conf/options.%s", machinearch,
machinearch);
read_file(fname,0,0);
}
(void) sprintf(fname, "options.%s", raise(ident));
read_file(fname,0,1);
}