Skip to contentSkip to conversation

hw/char/parallel: Make it possible to compile also without CONFIG_PARALLEL

PATCH New Thomas Huth 1 participant 1 message Mar 11, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 hw/char/parallel: Make it possible to compile also without CONFIG_PARALLEL

For the downstream distribution of QEMU, we want to compile without CONFIG_PARALLEL. Commit 9157eee1b1c076ff3 already moved the function parallel_hds_isa_init() (which is still required for linking) into a file that is included anyway, but commit bb3d5ea858e7f888563a moved it to a separate file which is only compiled again if CONFIG_PARALLEL is set. To be able to link QEMU again without CONFIG_PARALLEL, the file should be considered for linking for all targets that have CONFIG_ISA_BUS. And while we're at it, add a proper comment in there with the rationale for the separate file.

---
v2:
- Include parallel-isa.o only for CONFIG_ISA_BUS (since it depends on ISA)
- Do not rename the file anymore
- Removed the check via object_class_by_name() - otherwise user might get confused if the specify one parallel port which is then silently ignored

 hw/char/Makefile.objs  | 2 +-
 hw/char/parallel-isa.c | 3 +++
 hw/i386/Kconfig        | 3 +--
 3 files changed, 5 insertions(+), 3 deletions(-)
hw/char/Makefile.objs +1 -1
index c4947d7..cf086e7 100644
@@ -2,7 +2,7 @@ common-obj-$(CONFIG_IPACK) += ipoctal232.o
 common-obj-$(CONFIG_ESCC) += escc.o
 common-obj-$(CONFIG_NRF51_SOC) += nrf51_uart.o
 common-obj-$(CONFIG_PARALLEL) += parallel.o
-common-obj-$(CONFIG_PARALLEL) += parallel-isa.o
+common-obj-$(CONFIG_ISA_BUS) += parallel-isa.o
 common-obj-$(CONFIG_PL011) += pl011.o
 common-obj-$(CONFIG_SERIAL) += serial.o
 common-obj-$(CONFIG_SERIAL_ISA) += serial-isa.o
hw/char/parallel-isa.c +3 -0
index 639e179..a043832 100644
@@ -1,6 +1,9 @@
 /*
  * QEMU Parallel PORT (ISA bus helpers)
  *
+ * These functions reside in a separate file since they also might be
+ * required for linking when compiling QEMU without CONFIG_PARALLEL.
+ *
  * Copyright (c) 2003 Fabrice Bellard
  *
  * SPDX-License-Identifier: MIT
hw/i386/Kconfig +1 -2
index 78fd703..4e4415f 100644
@@ -9,6 +9,7 @@ config PC
     imply ISA_IPMI_KCS
     imply ISA_IPMI_BT
     imply ISA_DEBUG
+    imply PARALLEL
     imply PCI_DEVICES
     imply PVPANIC
     imply QXL
@@ -25,8 +26,6 @@ config PC
     select I82374
     select I8257
     select MC146818RTC
-    # Needed by the board code:
-    select PARALLEL
     # For ACPI builder:
     select SERIAL_ISA
     select ACPI_VMGENID
Signature · 1 line
1.8.3.1