source "drivers/acpi/Kconfig"
 
+config X86_APM_BOOT
+       bool
+       default y
+       depends on APM || APM_MODULE
+
 menuconfig APM
        tristate "APM (Advanced Power Management) BIOS support"
        depends on X86_32 && PM_SLEEP && !X86_VISWS
 
 targets                := vmlinux.bin setup.bin setup.elf zImage bzImage
 subdir-        := compressed
 
-setup-y                += a20.o apm.o cmdline.o copy.o cpu.o cpucheck.o edd.o
+setup-y                += a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
 setup-y                += header.o main.o mca.o memory.o pm.o pmjump.o
-setup-y                += printf.o string.o tty.o video.o version.o voyager.o
+setup-y                += printf.o string.o tty.o video.o version.o
+setup-$(CONFIG_X86_APM_BOOT) += apm.o
+setup-$(CONFIG_X86_VOYAGER) += voyager.o
 
 # The link order of the video-*.o modules can matter.  In particular,
 # video-vga.o *must* be listed first, followed by video-vesa.o.
 
 
 #include "boot.h"
 
-#ifdef CONFIG_X86_VOYAGER
-
 int query_voyager(void)
 {
        u8 err;
        copy_from_fs(data_ptr, di, 7);  /* Table is 7 bytes apparently */
        return 0;
 }
-
-#endif /* CONFIG_X86_VOYAGER */