From adca9ffd3dea76774443a81c148cf946cf388a08 Mon Sep 17 00:00:00 2001 From: Murray Stokely Date: Fri, 29 Mar 2002 23:03:17 +0000 Subject: [PATCH] Only build and link the pccard module on architectures that support it (and that have room for pccardd on mfsroot.flp). --- usr.sbin/sade/Makefile | 6 +++++- usr.sbin/sade/main.c | 2 ++ usr.sbin/sade/menus.c | 2 ++ usr.sbin/sade/sade.h | 3 +++ usr.sbin/sysinstall/Makefile | 6 +++++- usr.sbin/sysinstall/main.c | 2 ++ usr.sbin/sysinstall/menus.c | 2 ++ usr.sbin/sysinstall/sysinstall.h | 3 +++ usr.sbin/sysinstall/tcpip.c | 2 ++ 9 files changed, 26 insertions(+), 2 deletions(-) diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile index ec921e026fe..2320d95189e 100644 --- a/usr.sbin/sade/Makefile +++ b/usr.sbin/sade/Makefile @@ -6,10 +6,14 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c \ disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \ ftp.c globals.c http.c index.c install.c installUpgrade.c keymap.c \ label.c main.c makedevs.c media.c menus.c misc.c modules.c \ - mouse.c msg.c network.c nfs.c options.c package.c pccard.c \ + mouse.c msg.c network.c nfs.c options.c package.c \ system.c tape.c tcpip.c termcap.c ttys.c ufs.c usb.c user.c \ variable.c wizard.c keymap.h +.if ${MACHINE_ARCH} == "i386" +SRCS+= pccard.c +.endif + CFLAGS+= -I${.CURDIR}/../../gnu/lib/libdialog -I. .if ${MACHINE} == "pc98" CFLAGS+= -DPC98 diff --git a/usr.sbin/sade/main.c b/usr.sbin/sade/main.c index db56dc0c56d..144a61735de 100644 --- a/usr.sbin/sade/main.c +++ b/usr.sbin/sade/main.c @@ -111,10 +111,12 @@ main(int argc, char **argv) } /* Initialize PC-card, if we haven't already done so. */ +#ifdef PCCARD_ARCH if (!pvariable_get("pccardInitialize")) { pccardInitialize(); pvariable_set("pccardInitialize=1"); } +#endif /* Initialize USB, if we haven't already done so. */ if (!pvariable_get("usbInitialize")) { diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index eb89024cf32..3a197b63202 100644 --- a/usr.sbin/sade/menus.c +++ b/usr.sbin/sade/menus.c @@ -1292,12 +1292,14 @@ DMenu MenuStartup = { checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, +#ifdef PCCARD_ARCH { " pccard", "Enable PCCARD (AKA PCMCIA) services (also laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "pccard_enable=YES" }, { " pccard mem", "Set PCCARD memory address (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_mem" }, { " pccard ifconfig", "List of PCCARD ethernet devices to configure", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_ifconfig" }, +#endif { " usbd", "Enable USB daemon (detect USB attach / detach)", dmenuVarCheck, dmenuToggleVariable, NULL, "usbd_enable=YES" }, { " usbd flags", "Set default flags to usbd (if enabled)", diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 7ee69c158a7..a0b26a5a55e 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -54,6 +54,9 @@ /*** Defines ***/ +#if defined(__i386__) || defined(PC98) +#define PCCARD_ARCH 1 /* Support PCCARD installations */ +#endif /* device limits */ #define DEV_NAME_MAX 64 /* The maximum length of a device name */ #define DEV_MAX 100 /* The maximum number of devices we'll deal with */ diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile index ec921e026fe..2320d95189e 100644 --- a/usr.sbin/sysinstall/Makefile +++ b/usr.sbin/sysinstall/Makefile @@ -6,10 +6,14 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c \ disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \ ftp.c globals.c http.c index.c install.c installUpgrade.c keymap.c \ label.c main.c makedevs.c media.c menus.c misc.c modules.c \ - mouse.c msg.c network.c nfs.c options.c package.c pccard.c \ + mouse.c msg.c network.c nfs.c options.c package.c \ system.c tape.c tcpip.c termcap.c ttys.c ufs.c usb.c user.c \ variable.c wizard.c keymap.h +.if ${MACHINE_ARCH} == "i386" +SRCS+= pccard.c +.endif + CFLAGS+= -I${.CURDIR}/../../gnu/lib/libdialog -I. .if ${MACHINE} == "pc98" CFLAGS+= -DPC98 diff --git a/usr.sbin/sysinstall/main.c b/usr.sbin/sysinstall/main.c index db56dc0c56d..144a61735de 100644 --- a/usr.sbin/sysinstall/main.c +++ b/usr.sbin/sysinstall/main.c @@ -111,10 +111,12 @@ main(int argc, char **argv) } /* Initialize PC-card, if we haven't already done so. */ +#ifdef PCCARD_ARCH if (!pvariable_get("pccardInitialize")) { pccardInitialize(); pvariable_set("pccardInitialize=1"); } +#endif /* Initialize USB, if we haven't already done so. */ if (!pvariable_get("usbInitialize")) { diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index eb89024cf32..3a197b63202 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -1292,12 +1292,14 @@ DMenu MenuStartup = { checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, +#ifdef PCCARD_ARCH { " pccard", "Enable PCCARD (AKA PCMCIA) services (also laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "pccard_enable=YES" }, { " pccard mem", "Set PCCARD memory address (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_mem" }, { " pccard ifconfig", "List of PCCARD ethernet devices to configure", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_ifconfig" }, +#endif { " usbd", "Enable USB daemon (detect USB attach / detach)", dmenuVarCheck, dmenuToggleVariable, NULL, "usbd_enable=YES" }, { " usbd flags", "Set default flags to usbd (if enabled)", diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 7ee69c158a7..a0b26a5a55e 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -54,6 +54,9 @@ /*** Defines ***/ +#if defined(__i386__) || defined(PC98) +#define PCCARD_ARCH 1 /* Support PCCARD installations */ +#endif /* device limits */ #define DEV_NAME_MAX 64 /* The maximum length of a device name */ #define DEV_MAX 100 /* The maximum number of devices we'll deal with */ diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index ef862d4f6d8..48e62aff3b0 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -575,10 +575,12 @@ tcpOpenDialog(Device *devp) ipaddr, extras, netmask); variable_set2(ifn, temp, 1); } +#ifdef PCCARD_ARCH pccard = variable_get("_pccard_install"); if (pccard && strcmp(pccard, "YES") == 0 && ipv4_enable) { variable_set2("pccard_ifconfig", temp, 1); } +#endif if (use_rtsol) variable_set2(VAR_IPV6_ENABLE, "YES", 1); if (!use_dhcp) -- 2.45.2