From 44f00f9fb43039d0ec2b180712028658276f5943 Mon Sep 17 00:00:00 2001 From: Mario Juric Date: Thu, 16 Mar 2023 21:25:42 -0700 Subject: [PATCH 1/2] miscell.cpp: update conda PREFIX workaround --- miscell.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/miscell.cpp b/miscell.cpp index 6668f7a8..214cf08d 100644 --- a/miscell.cpp +++ b/miscell.cpp @@ -119,6 +119,7 @@ void ensure_config_directory_exists() // Going forward it'd be good to reqork Find_Orb to search for data in // default directories if local copies don't exist #include "prefix.h" +static char PREFIX_STATIC[500] = PREFIX; void ensure_config_directory_exists() { if (!use_config_directory) @@ -127,7 +128,9 @@ void ensure_config_directory_exists() // The c_str() magic in the next line allows conda-build's prefix // replacer to work as expected. // See https://github.com/conda/conda-build/issues/1674 for details. - std::string prefix = std::string(PREFIX).c_str(); + // Modified on 2023-03-17 to add PREFIX_STATIC as compilers have + // gotten too clever & the existing workaround stopped working. + std::string prefix = std::string(PREFIX_STATIC).c_str(); if (prefix == "~") { // backwards compatibility; do nothing. From 26ca4306cd16f2d7693dfd17f9d6c44f7b6968c0 Mon Sep 17 00:00:00 2001 From: Mario Juric Date: Fri, 17 Mar 2023 08:35:51 -0700 Subject: [PATCH 2/2] rename getstrex.c to getstrex.cpp, compile it with $CXX getstrex.c is a C file, and could be compiled with the C compiler. However, the rest of the makefile is only set up for the C++ compiler (specifically, the logic that builds CXX flags). Rather than build CFLAGS in exactly the same way, we'll "promote" getstrex.c to C++. Without this change, the makefile is broken with tools that externally set CC and CFLAGS (e.g., conda-build). --- getstrex.c => getstrex.cpp | 0 makefile | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename getstrex.c => getstrex.cpp (100%) diff --git a/getstrex.c b/getstrex.cpp similarity index 100% rename from getstrex.c rename to getstrex.cpp diff --git a/makefile b/makefile index 6fdd0110..a0edbf8b 100644 --- a/makefile +++ b/makefile @@ -194,8 +194,8 @@ findorb.o: findorb.cpp clipfunc.o: clipfunc.cpp $(CXX) $(CXXFLAGS) $(CURSES_FLAGS) $< -getstrex.o: getstrex.c - $(CC) $(CXXFLAGS) $(CURSES_FLAGS) $< +getstrex.o: getstrex.cpp + $(CXX) $(CXXFLAGS) $(CURSES_FLAGS) $< $(FO_EXE): fo.o $(OBJS) $(RES_FILENAME) $(CXX) -o $(FO_EXE) fo.o $(OBJS) $(LIBS) $(RES_FILENAME) $(LDFLAGS)