diff --git a/usr.sbin/sade/dispatch.c b/usr.sbin/sade/dispatch.c index 357cd6031ac6..e065df853056 100644 --- a/usr.sbin/sade/dispatch.c +++ b/usr.sbin/sade/dispatch.c @@ -76,7 +76,9 @@ static struct _word { { "distSetMinimum", distSetMinimum }, { "distSetEverything", distSetEverything }, { "distSetSrc", distSetSrc }, +#ifndef X_AS_PKG { "distSetXF86", distSetXF86 }, +#endif { "distExtractAll", distExtractAll }, { "docBrowser", docBrowser }, { "docShowDocument", docShowDocument }, diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index 68c13e07581d..3a226f38edfa 100644 --- a/usr.sbin/sade/menus.c +++ b/usr.sbin/sade/menus.c @@ -60,6 +60,7 @@ clearSrc(dialogMenuItem *self) return DITEM_SUCCESS | DITEM_REDRAW; } +#ifndef X_AS_PKG static int setX11Misc(dialogMenuItem *self) { @@ -108,6 +109,7 @@ clearX11Fonts(dialogMenuItem *self) XF86FontDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } +#endif /* !X_AS_PKG */ #define _IS_SET(dist, set) (((dist) & (set)) == (set)) @@ -162,11 +164,15 @@ checkDistMinimum(dialogMenuItem *self) static int checkDistEverything(dialogMenuItem *self) { - return Dists == DIST_ALL && CRYPTODists == DIST_CRYPTO_ALL && \ - _IS_SET(SrcDists, DIST_SRC_ALL) && \ - _IS_SET(XF86Dists, DIST_XF86_ALL) && \ - _IS_SET(XF86ServerDists, DIST_XF86_SERVER_ALL) && \ + return Dists == DIST_ALL && CRYPTODists == DIST_CRYPTO_ALL && + _IS_SET(SrcDists, DIST_SRC_ALL) && +#ifndef X_AS_PKG + _IS_SET(XF86Dists, DIST_XF86_ALL) && + _IS_SET(XF86ServerDists, DIST_XF86_SERVER_ALL) && _IS_SET(XF86FontDists, DIST_XF86_FONTS_ALL); +#else + 1; +#endif } static int @@ -218,7 +224,9 @@ DMenu MenuIndex = { { " Dists, User", "Select average user distribution.", checkDistUser, distSetUser }, { " Dists, X User", "Select average X user distribution.", checkDistXUser, distSetXUser }, { " Distributions, Adding", "Installing additional distribution sets", NULL, distExtractAll }, +#ifndef X_AS_PKG { " Distributions, XFree86","XFree86 distribution menu.", NULL, distSetXF86 }, +#endif { " Documentation", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { " Doc, README", "The distribution README file.", NULL, dmenuDisplayFile, NULL, "README" }, { " Doc, Early Adopter's", "Early Adopter's Guide to FreeBSD 5.0.", NULL, dmenuDisplayFile, NULL, "EARLY" }, @@ -280,10 +288,12 @@ DMenu MenuIndex = { { " Upgrade", "Upgrade an existing system.", NULL, installUpgrade }, { " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" }, { " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, +#ifndef X_AS_PKG { " XFree86, Fonts", "XFree86 Font selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { " XFree86, Server", "XFree86 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, #if defined(__i386__) && defined(PC98) { " XFree86, PC98 Server", "XFree86 PC98 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server }, +#endif #endif { NULL } }, }; @@ -1101,6 +1111,7 @@ DMenu MenuXDesktops = { { NULL } }, }; +#ifndef X_AS_PKG DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 Distribution", @@ -1279,6 +1290,7 @@ Mono servers are particularly well-suited to most LCD displays).", { NULL } } }; #endif +#endif /* !X_AS_PKG */ DMenu MenuDiskDevices = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 4b4754187d3c..e8653c73090a 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -372,9 +372,11 @@ extern Device *mediaDevice; /* Where we're getting our distribution from */ extern unsigned int Dists; /* Which distributions we want */ extern unsigned int CRYPTODists; /* Which naughty distributions we want */ extern unsigned int SrcDists; /* Which src distributions we want */ +#ifndef X_AS_PKG extern unsigned int XF86Dists; /* Which XFree86 dists we want */ extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ +#endif extern int BootMgr; /* Which boot manager to use */ extern int StatusLine; /* Where to print our status messages */ extern DMenu MenuInitial; /* Initial installation menu */ @@ -418,12 +420,13 @@ extern DMenu MenuDiskDevices; /* Disk type devices */ extern DMenu MenuSubDistributions; /* Custom distribution menu */ extern DMenu MenuSrcDistributions; /* Source distribution menu */ extern DMenu MenuXF86; /* XFree86 main menu */ +#ifndef X_AS_PKG extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectPC98Server; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ -extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ +#endif extern DMenu MenuXDesktops; /* Disk devices menu */ extern DMenu MenuHTMLDoc; /* HTML Documentation menu */ extern DMenu MenuUsermgmt; /* User management menu */ @@ -531,7 +534,9 @@ extern int distSetXUser(dialogMenuItem *self); extern int distSetMinimum(dialogMenuItem *self); extern int distSetEverything(dialogMenuItem *self); extern int distSetSrc(dialogMenuItem *self); +#ifndef X_AS_PKG extern int distSetXF86(dialogMenuItem *self); +#endif extern int distExtractAll(dialogMenuItem *self); /* dmenu.c */ diff --git a/usr.sbin/sysinstall/dispatch.c b/usr.sbin/sysinstall/dispatch.c index 357cd6031ac6..e065df853056 100644 --- a/usr.sbin/sysinstall/dispatch.c +++ b/usr.sbin/sysinstall/dispatch.c @@ -76,7 +76,9 @@ static struct _word { { "distSetMinimum", distSetMinimum }, { "distSetEverything", distSetEverything }, { "distSetSrc", distSetSrc }, +#ifndef X_AS_PKG { "distSetXF86", distSetXF86 }, +#endif { "distExtractAll", distExtractAll }, { "docBrowser", docBrowser }, { "docShowDocument", docShowDocument }, diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index 5fd52acb9fcb..e89a3acf5a1b 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -45,9 +45,11 @@ unsigned int Dists; unsigned int CRYPTODists; unsigned int SrcDists; +#ifndef X_AS_PKG unsigned int XF86Dists; unsigned int XF86ServerDists; unsigned int XF86FontDists; +#endif typedef struct _dist { char *my_name; @@ -60,9 +62,11 @@ typedef struct _dist { extern Distribution DistTable[]; extern Distribution CRYPTODistTable[]; extern Distribution SrcDistTable[]; +#ifndef X_AS_PKG extern Distribution XF86DistTable[]; extern Distribution XF86FontDistTable[]; extern Distribution XF86ServerDistTable[]; +#endif /* The top-level distribution categories */ static Distribution DistTable[] = { @@ -86,7 +90,9 @@ static Distribution DistTable[] = { #endif { "ports", "/usr", &Dists, DIST_PORTS, NULL }, { "local", "/", &Dists, DIST_LOCAL, NULL }, +#ifndef X_AS_PKG { "XF86336", "/usr", &Dists, DIST_XF86, XF86DistTable }, +#endif { NULL }, }; @@ -123,6 +129,7 @@ static Distribution SrcDistTable[] = { { NULL }, }; +#ifndef X_AS_PKG /* The XFree86 distribution */ static Distribution XF86DistTable[] = { { "XF86336", "/usr/X11R6", &XF86Dists, DIST_XF86_FONTS, XF86FontDistTable }, @@ -200,6 +207,7 @@ static Distribution XF86FontDistTable[] = { { "Xfsrv", "/usr/X11R6", &XF86FontDists, DIST_XF86_FONTS_SERVER, NULL }, { NULL }, }; +#endif /* !X_AS_PKG */ static int distMaybeSetPorts(dialogMenuItem *self); @@ -215,18 +223,24 @@ distVerifyFlags(void) } else if ((Dists & DIST_CRYPTO) && !CRYPTODists) CRYPTODists |= DIST_CRYPTO_ALL; +#ifndef X_AS_PKG if (XF86Dists & DIST_XF86_SET) XF86ServerDists |= DIST_XF86_SERVER_VGA16; if (XF86ServerDists) XF86Dists |= DIST_XF86_SERVER; if (XF86FontDists) XF86Dists |= DIST_XF86_FONTS; - if (XF86Dists || XF86ServerDists || XF86FontDists) { + if (XF86Dists || XF86ServerDists || XF86FontDists) Dists |= DIST_XF86; +#endif + if (isDebug()) { + msgDebug("Dist Masks: Dists: %0x, CRYPTO: %0x, Srcs: %0x\n", Dists, + CRYPTODists, SrcDists); +#ifndef X_AS_PKG + msgDebug("XServer: %0x, XFonts: %0x, XDists: %0x\n", XF86ServerDists, + XF86FontDists, XF86Dists); +#endif } - if (isDebug()) - msgDebug("Dist Masks: Dists: %0x, CRYPTO: %0x, Srcs: %0x\nXServer: %0x, XFonts: %0x, XDists: %0x\n", - Dists, CRYPTODists, SrcDists, XF86ServerDists, XF86FontDists, XF86Dists); } int @@ -235,9 +249,11 @@ distReset(dialogMenuItem *self) Dists = 0; CRYPTODists = 0; SrcDists = 0; +#ifndef X_AS_PKG XF86Dists = 0; XF86ServerDists = 0; XF86FontDists = 0; +#endif return DITEM_SUCCESS | DITEM_REDRAW; } @@ -257,6 +273,12 @@ distConfig(dialogMenuItem *self) if ((cp = variable_get(VAR_DIST_SRC)) != NULL) SrcDists = atoi(cp); +#ifdef X_AS_PKG + if (variable_get(VAR_DIST_X11) != NULL || + variable_get(VAR_DIST_XSERVER) != NULL || + variable_get(VAR_DIST_XFONTS) != NULL) + Dists |= DIST_XF86; +#else if ((cp = variable_get(VAR_DIST_X11)) != NULL) XF86Dists = atoi(cp); @@ -265,6 +287,7 @@ distConfig(dialogMenuItem *self) if ((cp = variable_get(VAR_DIST_XFONTS)) != NULL) XF86FontDists = atoi(cp); +#endif distVerifyFlags(); return DITEM_SUCCESS | DITEM_REDRAW; } @@ -273,13 +296,14 @@ static int distSetX(void) { Dists |= DIST_XF86; +#ifndef X_AS_PKG XF86Dists = DIST_XF86_BIN | DIST_XF86_SET | DIST_XF86_CFG | DIST_XF86_LIB | DIST_XF86_PROG | DIST_XF86_MAN | DIST_XF86_DOC | DIST_XF86_SERVER | DIST_XF86_FONTS; XF86ServerDists = DIST_XF86_SERVER_SVGA | DIST_XF86_SERVER_VGA16; XF86FontDists = DIST_XF86_FONTS_MISC; -#ifndef X_AS_PKG return distSetXF86(NULL); -#endif +#else return DITEM_SUCCESS; +#endif } int @@ -374,9 +398,11 @@ distSetEverything(dialogMenuItem *self) Dists = DIST_ALL | DIST_XF86; SrcDists = DIST_SRC_ALL; CRYPTODists = DIST_CRYPTO_ALL; +#ifndef X_AS_PKG XF86Dists = DIST_XF86_ALL; XF86ServerDists = DIST_XF86_SERVER_ALL; XF86FontDists = DIST_XF86_FONTS_ALL; +#endif i = distMaybeSetPorts(self); distVerifyFlags(); return i; @@ -514,6 +540,7 @@ distSetSrc(dialogMenuItem *self) return i | DITEM_RESTORE; } +#ifndef X_AS_PKG int distSetXF86(dialogMenuItem *self) { @@ -525,6 +552,7 @@ distSetXF86(dialogMenuItem *self) distVerifyFlags(); return i | DITEM_RESTORE; } +#endif static Boolean got_intr = FALSE; @@ -902,7 +930,6 @@ distExtractAll(dialogMenuItem *self) if(Dists & DIST_XF86) want_x_package = 1; Dists &= ~DIST_XF86; - /*Dists &= ~(DIST_XF86 | XF86Dists | XF86ServerDists | XF86FontDists);*/ #endif /* Try for 3 times around the loop, then give up. */ diff --git a/usr.sbin/sysinstall/dist.h b/usr.sbin/sysinstall/dist.h index 2ab968827e61..4847977e1d0c 100644 --- a/usr.sbin/sysinstall/dist.h +++ b/usr.sbin/sysinstall/dist.h @@ -62,6 +62,7 @@ #define DIST_SRC_BIN 0x08000 #define DIST_SRC_ALL 0x0FFFF +#ifndef X_AS_PKG /* Subtypes for XFree86 distribution */ #define DIST_XF86_BIN 0x0001 #define DIST_XF86_CFG 0x0002 @@ -119,6 +120,7 @@ #define DIST_XF86_FONTS_SERVER 0x0020 #define DIST_XF86_FONTS_ALL 0x003F #define DIST_XF86_ALL 0x1FFFF +#endif /* Canned distribution sets */ #define _DIST_USER \ diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index 68c13e07581d..3a226f38edfa 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -60,6 +60,7 @@ clearSrc(dialogMenuItem *self) return DITEM_SUCCESS | DITEM_REDRAW; } +#ifndef X_AS_PKG static int setX11Misc(dialogMenuItem *self) { @@ -108,6 +109,7 @@ clearX11Fonts(dialogMenuItem *self) XF86FontDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } +#endif /* !X_AS_PKG */ #define _IS_SET(dist, set) (((dist) & (set)) == (set)) @@ -162,11 +164,15 @@ checkDistMinimum(dialogMenuItem *self) static int checkDistEverything(dialogMenuItem *self) { - return Dists == DIST_ALL && CRYPTODists == DIST_CRYPTO_ALL && \ - _IS_SET(SrcDists, DIST_SRC_ALL) && \ - _IS_SET(XF86Dists, DIST_XF86_ALL) && \ - _IS_SET(XF86ServerDists, DIST_XF86_SERVER_ALL) && \ + return Dists == DIST_ALL && CRYPTODists == DIST_CRYPTO_ALL && + _IS_SET(SrcDists, DIST_SRC_ALL) && +#ifndef X_AS_PKG + _IS_SET(XF86Dists, DIST_XF86_ALL) && + _IS_SET(XF86ServerDists, DIST_XF86_SERVER_ALL) && _IS_SET(XF86FontDists, DIST_XF86_FONTS_ALL); +#else + 1; +#endif } static int @@ -218,7 +224,9 @@ DMenu MenuIndex = { { " Dists, User", "Select average user distribution.", checkDistUser, distSetUser }, { " Dists, X User", "Select average X user distribution.", checkDistXUser, distSetXUser }, { " Distributions, Adding", "Installing additional distribution sets", NULL, distExtractAll }, +#ifndef X_AS_PKG { " Distributions, XFree86","XFree86 distribution menu.", NULL, distSetXF86 }, +#endif { " Documentation", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { " Doc, README", "The distribution README file.", NULL, dmenuDisplayFile, NULL, "README" }, { " Doc, Early Adopter's", "Early Adopter's Guide to FreeBSD 5.0.", NULL, dmenuDisplayFile, NULL, "EARLY" }, @@ -280,10 +288,12 @@ DMenu MenuIndex = { { " Upgrade", "Upgrade an existing system.", NULL, installUpgrade }, { " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" }, { " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, +#ifndef X_AS_PKG { " XFree86, Fonts", "XFree86 Font selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { " XFree86, Server", "XFree86 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, #if defined(__i386__) && defined(PC98) { " XFree86, PC98 Server", "XFree86 PC98 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server }, +#endif #endif { NULL } }, }; @@ -1101,6 +1111,7 @@ DMenu MenuXDesktops = { { NULL } }, }; +#ifndef X_AS_PKG DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 Distribution", @@ -1279,6 +1290,7 @@ Mono servers are particularly well-suited to most LCD displays).", { NULL } } }; #endif +#endif /* !X_AS_PKG */ DMenu MenuDiskDevices = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 4b4754187d3c..e8653c73090a 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -372,9 +372,11 @@ extern Device *mediaDevice; /* Where we're getting our distribution from */ extern unsigned int Dists; /* Which distributions we want */ extern unsigned int CRYPTODists; /* Which naughty distributions we want */ extern unsigned int SrcDists; /* Which src distributions we want */ +#ifndef X_AS_PKG extern unsigned int XF86Dists; /* Which XFree86 dists we want */ extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ +#endif extern int BootMgr; /* Which boot manager to use */ extern int StatusLine; /* Where to print our status messages */ extern DMenu MenuInitial; /* Initial installation menu */ @@ -418,12 +420,13 @@ extern DMenu MenuDiskDevices; /* Disk type devices */ extern DMenu MenuSubDistributions; /* Custom distribution menu */ extern DMenu MenuSrcDistributions; /* Source distribution menu */ extern DMenu MenuXF86; /* XFree86 main menu */ +#ifndef X_AS_PKG extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectPC98Server; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ -extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ +#endif extern DMenu MenuXDesktops; /* Disk devices menu */ extern DMenu MenuHTMLDoc; /* HTML Documentation menu */ extern DMenu MenuUsermgmt; /* User management menu */ @@ -531,7 +534,9 @@ extern int distSetXUser(dialogMenuItem *self); extern int distSetMinimum(dialogMenuItem *self); extern int distSetEverything(dialogMenuItem *self); extern int distSetSrc(dialogMenuItem *self); +#ifndef X_AS_PKG extern int distSetXF86(dialogMenuItem *self); +#endif extern int distExtractAll(dialogMenuItem *self); /* dmenu.c */