From ffded9f6f8d5c79bfc12c3d41c19caf4e2d078af Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 17 Jun 2022 11:48:58 -0400 Subject: [PATCH] updates to get builds working on certain platforms... that were stashing a weird EOL in our cpp headers (looking at you snapple). --- production/feisty_meow_config.ini | 4 +- scripts/clam/cpp/rules.def | 4 +- scripts/clam/cpp/variables.def | 248 ++++++++------------------- scripts/generator/build_variables.sh | 20 +-- 4 files changed, 79 insertions(+), 197 deletions(-) diff --git a/production/feisty_meow_config.ini b/production/feisty_meow_config.ini index 27135e7c..7b091c72 100644 --- a/production/feisty_meow_config.ini +++ b/production/feisty_meow_config.ini @@ -3,7 +3,7 @@ # specifies the version of the code that is being constructed here. major=2 minor=140 -revision=184 +revision=186 build=420 # specifies the remainder of the version record info. @@ -18,7 +18,7 @@ web_site=http://feistymeow.org # if DEBUG is not empty, then code is built with more debugging information. DEBUG=t # if NOISY is non-empty, there will be more information emitted during builds. -NOISY=t +#NOISY=t # if this is turned on, then all warnings are turned on and they are # considered errors. diff --git a/scripts/clam/cpp/rules.def b/scripts/clam/cpp/rules.def index 051d23f0..2ceb622f 100644 --- a/scripts/clam/cpp/rules.def +++ b/scripts/clam/cpp/rules.def @@ -84,7 +84,6 @@ endif ############################################################################### ifeq "$(CLAM_COMPILER)" "GNU_DARWIN" - # finds the crypto code on macos. # HEADER_SEARCH_PATH += /usr/local/opt/openssl/include # LIBRARY_SEARCH_PATH += /usr/local/opt/openssl/lib/ @@ -115,8 +114,7 @@ OBJECTS = $(TEMP_OBJ4) ACTUAL_OBJECTS = $(OBJECTS) $(EXTRA_OBJECTS) # Updates the search path for the compiler and local libraries. -BASE_HEADER_PATH := $(CODEBASE_HEADERS) $(LOCAL_HEADERS) bork1 $(FEISTY_MEOW_CPP_HEADERS) bork2 $(SEARCH_DIRS) - +BASE_HEADER_PATH = $(CODEBASE_HEADERS) $(LOCAL_HEADERS) $(strip $(FEISTY_MEOW_CPP_HEADERS)) $(SEARCH_DIRS) HEADER_SEARCH_PATH += $(BASE_HEADER_PATH) $(COMPILER_HEADER_DIR) LIBRARY_SEARCH_PATH += $(LOCAL_LIBRARIES) $(HOOPLE_LIBRARIES) \ diff --git a/scripts/clam/cpp/variables.def b/scripts/clam/cpp/variables.def index 2eca5786..0ba91e04 100644 --- a/scripts/clam/cpp/variables.def +++ b/scripts/clam/cpp/variables.def @@ -21,52 +21,6 @@ include variables.def ############################################################################### -#export CLAM_BINARIES = $(CLAM_SCRIPTS)/../bin - -############################################################################### - -## # CLAM_BASE_CPU is a flag that distinguishes the type of processor, if necessary. -## export CLAM_BASE_CPU -## #CLAM_BASE_CPU := m68k = motorola 68000 series | m68340 = motorola 68340 -## # | x86 = intel x86 | ppc = power pc | arm = ARM core -## -## # set the CPU to a default if it has not been set previously. -## ifeq "$(CLAM_BASE_CPU)" "" -## CLAM_BASE_CPU := $(shell machine 2>/dev/null || arch 2>/dev/null || uname -m 2>/dev/null || echo i686) -## endif - -## # CLAM_COMPILER is a flag that specifies the compiler that will be used to build -## # code. It is mainly used within CLAM itself for determining the proper -## # compiler flags. -## export CLAM_COMPILER -## #CLAM_COMPILER := GNU_LINUX | GNU_ARM_LINUX | GNU_DARWIN | GNU_WINDOWS -## -## # choose a default compiler if none was specified. -## ifeq "$(CLAM_COMPILER)" "" -## ifeq "$(OPERATING_SYSTEM)" "UNIX" -## ifeq "$(CLAM_OS_SUBCLASS)" "darwin" -## CLAM_COMPILER := GNU_DARWIN -## else -## CLAM_COMPILER := GNU_LINUX -## endif -## endif -## ifeq "$(OPERATING_SYSTEM)" "WIN32" -## CLAM_COMPILER := GNU_WINDOWS -## endif -## ifeq "$(CLAM_COMPILER)" "" -## # if we get into this case, we have no idea how to set the default -## # compiler. you may need to change the above logic for guessing it -## # anyhow. but we will go with our favorite default. -## CLAM_COMPILER := GNU_LINUX -## endif -## endif - -# CLAM_COMPILER_VERSION specifies the version of a particular compiler, if this is -# needed to distinguish how the code is built. -export CLAM_COMPILER_VERSION - -############################################################################### - # "TYPE" is the kind of product being generated by this project. this is # used to decide where to put the final products of compilation. this is a # variable in the user makefile. @@ -210,19 +164,6 @@ export STATIC_LIBRARY_DIR = $(TARGETS_STORE) # the binaries are added to access the system_helper.h file. HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)/versions $(FEISTY_MEOW_BINARIES) -## # "FEISTY_MEOW_CPP_HEADERS" are locations where the HOOPLE headers can be found. -## ifeq "$(FEISTY_MEOW_CPP_HEADERS)" "" -## #seems like some of this is redundant with earlier 3rdparty exploring. -## LOCUS_LIBRARY_HEADERS = $(shell bash -c '\ -## if [ -d "$(FEISTY_MEOW_APEX)/nucleus" ]; then \ -## echo "$(FEISTY_MEOW_APEX)/nucleus" "$(FEISTY_MEOW_APEX)/octopi" "$(FEISTY_MEOW_APEX)/graphiq" ; \ -## else \ -## echo ""; \ -## fi | tr "\\\\" / | sed -e "s/\([a-zA-Z]\):\/\([^ ]*\)/\/cygdrive\/\1\/\2/g" ') -## # above assumes cygwin support for windows! was assuming msys support. -## FEISTY_MEOW_CPP_HEADERS := $(shell $(FIND) $(LOCUS_LIBRARY_HEADERS) -mindepth 1 -maxdepth 1 -type d ) -## endif - # "LOCAL_HEADERS" are overrides that go first in the header search path. LOCAL_HEADERS = $(THIRD_PARTY_DIR) @@ -408,23 +349,25 @@ DYNLIB_ENDING = .so # Compiler Dependent Flags # -## # "CLAM_COMPILER_ROOT_DIR" is the top-level for the C++ compiler location. -## export CLAM_COMPILER_ROOT_DIR +# "CLAM_COMPILER_ROOT_DIR" is the top-level for the C++ compiler location. # "COMPILER_HEADER_DIR" is where the compiler headers are. -export COMPILER_HEADER_DIR # "COMPILER_LIBRARY_DIR" is where archived libraries are. # "CC" is the name of the C++ compiler to be used. +export COMPILER_HEADER_DIR # These flags may be useful across multiple compilers. # -# SSL brings in the OpenSSL libraries. -USE_SSL= +# "USE_SSL" brings in the OpenSSL libraries. +#USE_SSL = + +# "USE_CURL" provides access to the curl library. +#USE_CURL = -# CURL provides access to the curl library. -USE_CURL= +# "USE_WXWIDGETS" enables wxwidget library support. +#USE_WXWIDGETS = -# Enables wxwidget library support. -USE_WXWIDGETS= +# "USE_XWIN" specifies that this project needs X window system support. +#USE_XWIN = ifneq "$(OMIT_VERSIONS)" "" DEFINITIONS += NO_VERSION @@ -437,26 +380,21 @@ endif ifeq "$(CLAM_COMPILER)" "GNU_LINUX" # Unix GNU compiler... CC = g++ -# CLAM_COMPILER_ROOT_DIR = / PLATFORM_ADD_IN = linux_ -## ARCHITECTURE = $(shell machine 2>/dev/null || arch 2>/dev/null || echo i686) - -## export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) - DEFINITIONS += _FILE_OFFSET_BITS=64 DEPENDENCY_DEFINITIONS += NO_VERSION +#hmmm: uggh, can we clean up this huge list of dep adds somehow? DEPENDENCY_ADDITIONS = -X/usr/include -X/usr/include/c++/$(CLAM_COMPILER_VERSION) -X/usr/include/c++/$(CLAM_COMPILER_VERSION)/tr1 -X/usr/local/include -X/usr/include/linux -X/usr/include/wx-2.8 -X/usr/lib/gcc/i586-suse-linux/$(CLAM_COMPILER_VERSION)/include -X/usr/lib/gcc/i486-linux-gnu/$(CLAM_COMPILER_VERSION)/include -X/usr/lib/gcc/i686-linux-gnu/$(CLAM_COMPILER_VERSION)/include -X/usr/lib/gcc/x86_64-linux-gnu/$(COMPILER_VERION)/include -X/usr/include/x86_64-linux-gnu -X/usr/include/i386-linux-gnu - # "USE_XWIN" specifies that this project needs X window system support. - #USE_XWIN = - - ifeq "x86_64" "$(CLAM_BASE_CPU)" - COMPILER_LIBRARY_DIR = /lib64 /usr/lib64 /usr/local/lib64 - else - COMPILER_LIBRARY_DIR = /lib /usr/lib /usr/local/lib - endif +# ifeq "x86_64" "$(CLAM_BASE_CPU)" +# COMPILER_LIBRARY_DIR = /lib64 /usr/lib64 /usr/local/lib64 +# else +# COMPILER_LIBRARY_DIR = /lib /usr/lib /usr/local/lib +# endif DEFINITIONS += __LINUX__ linux __linux__ UNIX unix __UNIX__ __USE_GNU + +#hmmm: move to an x win enabling area. # X Window System not enabled by default. #DEFINITIONS += __XWINDOWS__ @@ -470,6 +408,8 @@ ifeq "$(CLAM_COMPILER)" "GNU_LINUX" # space on end is significant. LINKER_OUTPUT_FLAG = -o LINK_TOOL = g++ + + COMPILER_FLAGS += -shared-libgcc -fPIC # compiler flags for gcc: # -finline-functions: inline functions as needed. # -fPIC: generate position independent code. @@ -480,8 +420,6 @@ ifeq "$(CLAM_COMPILER)" "GNU_LINUX" # -shared-libgcc: use the shared library version of compiler libraries. # -fno-exceptions: do not support exception handling and stack unwinding. - COMPILER_FLAGS += -shared-libgcc -fPIC - ifeq "$(DEBUG)" "" # COMPILER_FLAGS += -finline-functions endif @@ -518,6 +456,54 @@ endif ############################################################################ +ifeq "$(CLAM_COMPILER)" "GNU_DARWIN" + # Darwin kernel GNU compiler... really more general macos (MacOS) here these days. + CC = g++ + PLATFORM_ADD_IN = darwin + DEFINITIONS += _FILE_OFFSET_BITS=64 + + DEPENDENCY_DEFINITIONS += NO_VERSION +# DEPENDENCY_ADDITIONS = -X/usr/include -X/usr/include/c++/$(CLAM_COMPILER_VERSION) -X/usr/include/c++/$(CLAM_COMPILER_VERSION)/tr1 -X/usr/local/include -X/usr/include/linux -X/usr/include/wx-2.8 -X/usr/lib/gcc/i586-suse-linux/$(CLAM_COMPILER_VERSION)/include -X/usr/lib/gcc/i486-linux-gnu/$(CLAM_COMPILER_VERSION)/include + DEPENDENCY_ADDITIONS = -X/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include + + COMPILER_HEADER_DIR := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include +#/usr/local/include /usr/include +#old /System/Library/Frameworks/Foundation.framework/Versions/C/Headers +#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include +#/Library/Developer/CommandLineTools/usr/include + +# ifeq "x86_64" "$(CLAM_BASE_CPU)" +# COMPILER_LIBRARY_DIR = /lib64 /usr/lib64 /usr/local/lib64 +# else +# COMPILER_LIBRARY_DIR = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib +##/usr/lib /usr/local/lib +# endif + + DEFINITIONS += UNIX unix __UNIX__ __USE_GNU + + LIBRARY_TOOL = ar + LIB_PREFIX = lib + # special flags for getting rid of warnings on fd_set. + LOAD_FLAG_PREFIX=-Wl,-U,___darwin_check_fd_set_overflow + + CREATE_LIBRARY_FLAG += -r + # space on end is significant. + LINKER_OUTPUT_FLAG = -o + LINK_TOOL = g++ + + # mac specific flags + COMPILER_FLAGS += -Wno-nullability-completeness +#trying this one again, which had been turned off. + COMPILER_FLAGS += -fgnu-runtime + + ifneq "$(DEBUG)" "" + # add in debugging flags. +# COMPILER_FLAGS += -g3 -O0 + endif +endif + +############################################################################ + ifeq "$(CLAM_COMPILER)" "GNU_ARM_LINUX" # ARM-linux GNU compiler... @@ -526,11 +512,7 @@ ifeq "$(CLAM_COMPILER)" "GNU_ARM_LINUX" CC = $(CLAM_COMPILER_ROOT_DIR)/bin/g++ PLATFORM_ADD_IN = linux_ - -## export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) - SNAPGEAR_ROOT_DIR = $(HOME)/snapgear - DEPENDENCY_DEFINITIONS += NO_VERSION COMPILER_HEADER_DIR = $(SNAPGEAR_ROOT_DIR)/linux-2.4.x/include @@ -570,14 +552,6 @@ endif ifeq "$(CLAM_COMPILER)" "GNU_WINDOWS" # GNU compiler for MS Windoze... CC = g++ -## CLAM_COMPILER_ROOT_DIR = / - -## ARCHITECTURE = $(shell machine 2>/dev/null || arch 2>/dev/null || echo i686) -##hmmm: below fixes nothing! argh! -## ARCHITECTURE = i386 - -## export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) - # RC := $(CLAM_COMPILER_ROOT_DIR)/bin/windres PLATFORM_ADD_IN = w32_ @@ -587,15 +561,11 @@ ifeq "$(CLAM_COMPILER)" "GNU_WINDOWS" COMPILER_LIBRARY_DIR = $(CLAM_COMPILER_ROOT_DIR)/lib DEFINITIONS += __GNU_WINDOWS__ _Windows _WINDOWS WIN32 __WIN32__ __FLAT__ VC_EXTRALEAN WIN32_LEAN_AND_MEAN ATL_NO_LEAN_AND_MEAN _WIN32 -###NOOOOOO __USE_W32_SOCKETS -#__cplusplus -#__USE_GNU LIBRARY_TOOL = ar LIBRARY_PATH_FLAG = -L LIB_PREFIX = lib LIB_ENDING = .a -# LOAD_FLAG_PREFIX += -lpthread LOAD_FLAG_PREFIX += -mwindows CREATE_LIBRARY_FLAG += -r # space on end is significant. @@ -604,85 +574,9 @@ ifeq "$(CLAM_COMPILER)" "GNU_WINDOWS" MIDL = midl -Oicf $(MIDL_DEFS) $(HEADER_SEARCH_PATH:%=-I% ) $(DEFINITIONS:%=-D% ) MIDL_DEFS = -no_robust # some lovely definitions used by some of the mfc and other ms code. - DEPENDENCY_DEFINITIONS += __cplusplus __MINGW32__ _WIN32 _CHAR_UNSIGNED M_I86 _M_I86 _M_IX86=500 _WIN32_WINNT=0x501 __RPC_WIN32__ __RPCNDR_H_VERSION__ __RPCPROXY_H_VERSION__ TARGET_IS_NT40_OR_LATER PGM_SETCHILD _MFC_VER=0x0600 - -endif - -############################################################################ - -ifeq "$(CLAM_COMPILER)" "GNU_DARWIN" - # Darwin kernel GNU compiler... really more general macos (MacOS) here these days. - CC = g++ -## CLAM_COMPILER_ROOT_DIR = / - PLATFORM_ADD_IN = darwin -## ARCHITECTURE = $(shell machine 2>/dev/null || arch 2>/dev/null || echo i686) + DEPENDENCY_DEFINITIONS += __cplusplus __MINGW32__ _WIN32 _CHAR_UNSIGNED M_I86 _M_I86 _M_IX86=500 _WIN32_WINNT=0x501 __RPC_WIN32__ __RPCNDR_H_VERSION__ __RPCPROXY_H_VERSION__ TARGET_IS_NT40_OR_LATER PGM_SETCHILD +#hmmm: yuck; re-evaluate need for the above dep defs. -## export CLAM_COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(CLAM_COMPILER) $(CLAM_COMPILER_ROOT_DIR) ) - - DEFINITIONS += _FILE_OFFSET_BITS=64 - - DEPENDENCY_DEFINITIONS += NO_VERSION -# DEPENDENCY_ADDITIONS = -X/usr/include -X/usr/include/c++/$(CLAM_COMPILER_VERSION) -X/usr/include/c++/$(CLAM_COMPILER_VERSION)/tr1 -X/usr/local/include -X/usr/include/linux -X/usr/include/wx-2.8 -X/usr/lib/gcc/i586-suse-linux/$(CLAM_COMPILER_VERSION)/include -X/usr/lib/gcc/i486-linux-gnu/$(CLAM_COMPILER_VERSION)/include - DEPENDENCY_ADDITIONS = -X/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - - COMPILER_HEADER_DIR := /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -#/usr/local/include /usr/include -#old /System/Library/Frameworks/Foundation.framework/Versions/C/Headers -#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -#/Library/Developer/CommandLineTools/usr/include - - # "USE_XWIN" specifies that this project needs X window system support. - #USE_XWIN = - - ifeq "x86_64" "$(CLAM_BASE_CPU)" - COMPILER_LIBRARY_DIR = /lib64 /usr/lib64 /usr/local/lib64 - else - COMPILER_LIBRARY_DIR = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -#/usr/lib /usr/local/lib - endif - -# DEFINITIONS += __LINUX__ linux __linux__ UNIX unix __UNIX__ __USE_GNU - DEFINITIONS += UNIX unix __UNIX__ __USE_GNU - # X Window System not enabled by default. - #DEFINITIONS += __XWINDOWS__ - - LIBRARY_TOOL = ar - LIB_PREFIX = lib -# LOAD_FLAG_PREFIX += -Xlinker -#mac has no o3??? -#-O3 - # special flags for getting rid of warnings on fd_set. - LOAD_FLAG_PREFIX=-Wl,-U,___darwin_check_fd_set_overflow - -# -Xlinker --print-map : shows what went in and why. -# -Xlinker -O3 : linker optimization - CREATE_LIBRARY_FLAG += -r - # space on end is significant. - LINKER_OUTPUT_FLAG = -o - LINK_TOOL = g++ -# COMPILER_FLAGS += -shared-libgcc -fPIC -#old: -Wl,-export-dynamic -# ifeq "$(DEBUG)" "" -# COMPILER_FLAGS += -finline-functions -# endif -# ifneq "$(STRICT_WARNINGS)" "" -# COMPILER_FLAGS += -Wall -Werror -Wextra -pedantic-errors -Wno-long-long -# endif -# LIBS_USED += dl pthread rt -#mac no like these libs - # dl=dynamic library. - # pthread=thread libraries. - # rt=real time libraries for shared memory. - - # mac specific flags - COMPILER_FLAGS += -Wno-nullability-completeness -#trying this one again, which had been turned off. - COMPILER_FLAGS += -fgnu-runtime - - ifneq "$(DEBUG)" "" - # add in debugging flags. -# COMPILER_FLAGS += -g3 -O0 - endif endif ############################################################################ diff --git a/scripts/generator/build_variables.sh b/scripts/generator/build_variables.sh index 0fc028fb..bd2afb03 100644 --- a/scripts/generator/build_variables.sh +++ b/scripts/generator/build_variables.sh @@ -123,8 +123,7 @@ if [ -d "$FEISTY_MEOW_APEX/nucleus" ]; then else export LOCUS_LIBRARY_HEADERS= fi - ####blech! maybe not needed now? was involved above. | tr "\\\\" / | sed -e "s/\([a-zA-Z]\):\/\([^ ]*\)/\/cygdrive\/\1\/\2/g" ') -export FEISTY_MEOW_CPP_HEADERS=$(find $LOCUS_LIBRARY_HEADERS -mindepth 1 -maxdepth 1 -type d | grep -v "\.settings" ) +export FEISTY_MEOW_CPP_HEADERS=$(find $LOCUS_LIBRARY_HEADERS -mindepth 1 -maxdepth 1 -type d | grep -v "\.settings") # the root name of the version file. This is currently irrelevant on # non-windoze platforms. @@ -166,17 +165,6 @@ export BUILD_TOP="$FEISTY_MEOW_APEX" # code needed to produce the executables for feisty meow. export PRODUCTION_STORE="$BUILD_TOP/production" -## set up the top-level for all build creations and logs and such. -#export FEISTY_MEOW_GENERATED_STORE="$TMP/generated-feisty_meow" -#if [ ! -d "$FEISTY_MEOW_GENERATED_STORE" ]; then -# mkdir -p "$FEISTY_MEOW_GENERATED_STORE" -#fi -## set up our effluent outsourcing valves. -#export TEMPORARIES_PILE="$FEISTY_MEOW_GENERATED_STORE/temporaries" -#if [ ! -d "$TEMPORARIES_PILE" ]; then -# mkdir -p "$TEMPORARIES_PILE" -#fi - # this variable points at a folder where we store the generated products of # the build, such as the binaries and installer packages. export RUNTIME_PATH="$FEISTY_MEOW_GENERATED_STORE/runtime" @@ -259,8 +247,10 @@ if [ -z "$got_bad" ]; then fi # pick the executable's file ending based on the platform. - if [ "$OPERATING_SYSTEM" == "UNIX" ]; then export EXE_ENDING=; - elif [ "$OPERATING_SYSTEM" == "WIN32" ]; then export EXE_ENDING=.exe; + if [ "$OPERATING_SYSTEM" == "UNIX" ]; then + export EXE_ENDING="" + elif [ "$OPERATING_SYSTEM" == "WIN32" ]; then + export EXE_ENDING=".exe" else echo "The OPERATING_SYSTEM variable is unset or unknown. Bailing out." fi -- 2.34.1