From 027c921cfc87c5768839394459eab7127d0e29c6 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sun, 25 Mar 2012 15:55:36 -0700 Subject: [PATCH] More robust and correct readline support and fix to VMS build for HP2100 --- descrip.mms | 2 +- makefile | 22 +++++++++++----------- scp.c | 2 ++ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/descrip.mms b/descrip.mms index 11a2ac7c..8eaeab75 100644 --- a/descrip.mms +++ b/descrip.mms @@ -371,7 +371,7 @@ HP2100_SOURCE1 = $(HP2100_DIR)HP2100_STDDEV.C,$(HP2100_DIR)HP2100_DP.C,\ $(HP2100_DIR)HP2100_CPU6.C,$(HP2100_DIR)HP2100_CPU7.C HP2100_LIB2 = $(LIB_DIR)HP2100L2-$(ARCH).OLB HP2100_SOURCE2 = $(HP2100_DIR)HP2100_FP1.C,$(HP2100_DIR)HP2100_BACI.C,\ - $(HP2100_DIR)HP2100_MPX.C,$(HP2100_DIR)HP2100_PIF.C \ + $(HP2100_DIR)HP2100_MPX.C,$(HP2100_DIR)HP2100_PIF.C,\ $(HP2100_DIR)HP2100_DI.C,$(HP2100_DIR)HP2100_DI_DA.C,\ $(HP2100_DIR)HP_DISCLIB.C .IFDEF ALPHA_OR_IA64 diff --git a/makefile b/makefile index 6ee1e4c4..615d45e3 100644 --- a/makefile +++ b/makefile @@ -32,13 +32,11 @@ # CC Command (and platform available options). (Poor man's autoconf) # # building the pdp11, or any vax simulator could use networking support +BUILD_SINGLE := $(MAKECMDGOALS) $(BLANK_SUFFIX) ifneq (,$(or $(findstring pdp11,$(MAKECMDGOALS)),$(findstring vax,$(MAKECMDGOALS)),$(findstring all,$(MAKECMDGOALS)))) NETWORK_USEFUL = true ifneq (,$(findstring all,$(MAKECMDGOALS))$(word 2,$(MAKECMDGOALS))) BUILD_MULTIPLE = s - BUILD_SINGLE := $(MAKECMDGOALS) $(BUILD_SINGLE) - else - BUILD_SINGLE := $(MAKECMDGOALS) $(BUILD_SINGLE) endif else ifeq ($(MAKECMDGOALS),) @@ -210,8 +208,8 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) else $(error using libpcap: $(call find_lib,$(PCAPLIB)) missing pcap.h) endif - LIBEXT = $(LIBEXTSAVE) endif + LIBEXT = $(LIBEXTSAVE) endif ifneq (,$(findstring USE_NETWORK,$(NETWORK_CCDEFS))$(findstring USE_SHARED,$(NETWORK_CCDEFS))) # Given we have libpcap components, consider other network connections as well @@ -344,14 +342,16 @@ ifneq (3,$(GCC_MAJOR_VERSION)) CFLAGS_O += -Wno-unused-result endif endif -BUILD_FEATURES := $(BUILD_FEATURES). GCC Version: $(GCC_VERSION) -$(info ***) -$(info *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) being built with:) -$(info *** $(BUILD_FEATURES).) -ifneq (,$(NETWORK_FEATURES)) - $(info *** $(NETWORK_FEATURES).) +ifeq (clean,$(MAKECMDGOALS)) + BUILD_FEATURES := $(BUILD_FEATURES). GCC Version: $(GCC_VERSION) + $(info ***) + $(info *** $(BUILD_SINGLE)Simulator$(BUILD_MULTIPLE) being built with:) + $(info *** $(BUILD_FEATURES).) + ifneq (,$(NETWORK_FEATURES)) + $(info *** $(NETWORK_FEATURES).) + endif + $(info ***) endif -$(info ***) ifneq ($(DONT_USE_ROMS),) ROMS_OPT = -DDONT_USE_INTERNAL_ROM else diff --git a/scp.c b/scp.c index d9ebd0b6..54bcaf53 100644 --- a/scp.c +++ b/scp.c @@ -3987,6 +3987,8 @@ if (!initialized) { handle = dlopen("libreadline." __STR(HAVE_DLOPEN), RTLD_NOW|RTLD_GLOBAL); if (!handle) handle = dlopen("libreadline." __STR(HAVE_DLOPEN) ".6", RTLD_NOW|RTLD_GLOBAL); + if (!handle) + handle = dlopen("libreadline." __STR(HAVE_DLOPEN) ".5", RTLD_NOW|RTLD_GLOBAL); if (handle) { p_readline = dlsym(handle, "readline"); p_add_history = dlsym(handle, "add_history");