From: Chris Koeritz Date: Thu, 16 Jun 2022 22:32:45 +0000 (-0400) Subject: simplify per compiler rules and variables X-Git-Tag: 2.140.136^2~31 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=6a436408838093101395a514441bbe791bb6b61e;p=feisty_meow.git simplify per compiler rules and variables most of the specialized bits, like wxwidgets and curl, were the same for each compiler, so these have been abstracted out to common area. the individual compiler sections are now a lot tighter or maybe almost non-existent. --- diff --git a/production/feisty_meow_config.ini b/production/feisty_meow_config.ini index 89c2b07a..27135e7c 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=183 +revision=184 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 05b1f987..051d23f0 100644 --- a/scripts/clam/cpp/rules.def +++ b/scripts/clam/cpp/rules.def @@ -24,129 +24,70 @@ ifneq "$(NO_COMPILE)" "" QUIET = t endif -# implement special bits for gnu on unix. -ifeq "$(CLAM_COMPILER)" "GNU_LINUX" - ifneq "$(USE_XWIN)" "" - DEFINITIONS += __XWINDOWS__ __X__ - LIBS_USED += Xm Xt X11 Xft Xp +# add-ins for packages we use. + +# secure socket and crypto libraries. +ifneq "$(USE_SSL)" "" + LIBS_USED += ssl crypto +endif + +# pull in the curl configuration using their tool. +ifneq "$(USE_CURL)" "" + COMPILER_FLAGS += `curl-config --cflags` + LOAD_FLAG_SUFFIX += `curl-config --libs` +endif + +# x window system. +ifneq "$(USE_XWIN)" "" + DEFINITIONS += __XWINDOWS__ __X__ + LIBS_USED += +#Xm Xt X11 Xft Xp #need to separate out with a USE_MOTIF kind of thing. -LIBS_USED += Xmu - HEADER_SEARCH_PATH += /usr/include/X11 /usr/X11R6/include /usr/include/g++ - LIBRARY_SEARCH_PATH += /usr/X11R6/lib +#LIBS_USED += Xmu + HEADER_SEARCH_PATH += /usr/include/X11 /usr/X11R6/include +#/usr/include/g++ + LIBRARY_SEARCH_PATH += /usr/X11R6/lib +endif + +# generalized wxwidgets toolkit configuration. +ifneq "$(USE_WXWIDGETS)" "" + DEFINITIONS += __WXWIDGETS__ + use_unicode = + ifneq "$(findstring UNICODE, $(DEFINITIONS))" "" + use_unicode = true endif - ifneq "$(USE_SSL)" "" - LIBS_USED += ssl crypto + # decide whether to turn on the unicode flag or not. +### ifneq "$(findstring UNICODE, $(DEFINITIONS))" "" + ifneq "$(use_unicode)" "" + UNICODE_FLAG_ADD = --unicode=yes + DEFINITIONS += wxUSE_UNICODE + else + UNICODE_FLAG_ADD = --unicode=no endif - - ifneq "$(USE_WXWIDGETS)" "" - DEFINITIONS += __WXWIDGETS__ - use_unicode = - ifneq "$(findstring UNICODE, $(DEFINITIONS))" "" - use_unicode = true - endif - # decide whether to turn on the unicode flag or not. - ifneq "$(use_unicode)" "" - DEFINITIONS += wxUSE_UNICODE - UNICODE_FLAG_ADD = --unicode=yes - else - UNICODE_FLAG_ADD = --unicode=no - endif - # could add for debugging: --debug=yes - COMPILER_FLAGS += $(shell wx-config --cxxflags $(UNICODE_FLAG_ADD) ) + COMPILER_FLAGS += $(shell wx-config --cxxflags $(UNICODE_FLAG_ADD) ) + LOAD_FLAG_PREFIX += $(shell wx-config --libs $(UNICODE_FLAG_ADD) ) +endif - LOAD_FLAG_PREFIX += $(shell wx-config --libs $(UNICODE_FLAG_ADD) ) - endif +# add special bits for gnu on unix. +ifeq "$(CLAM_COMPILER)" "GNU_LINUX" - ifneq "$(USE_CURL)" "" - COMPILER_FLAGS += `curl-config --cflags` - LOAD_FLAG_SUFFIX += `curl-config --libs` - endif endif # some special code for gnu compiler on windows. ifeq "$(CLAM_COMPILER)" "GNU_WINDOWS" - ifneq "$(USE_SSL)" "" - LIBS_USED += ssl crypto - endif - - ifneq "$(USE_WXWIDGETS)" "" - DEFINITIONS += __WXWIDGETS__ - use_unicode = - ifneq "$(findstring UNICODE, $(DEFINITIONS))" "" - use_unicode = true - endif - - # decide whether to turn on the unicode flag or not. - ifneq "$(use_unicode)" "" - DEFINITIONS += wxUSE_UNICODE - UNICODE_FLAG_ADD = --unicode=yes - else - UNICODE_FLAG_ADD = --unicode=no - endif - # could add for debugging: --debug=yes - COMPILER_FLAGS += $(shell wx-config --cxxflags $(UNICODE_FLAG_ADD) ) - - LOAD_FLAG_PREFIX += $(shell wx-config --libs $(UNICODE_FLAG_ADD) ) - endif - #hmmm: LOAD_FLAG_PREFIX += -lwsock32 -lmswsock -shared - - ifneq "$(USE_CURL)" "" - COMPILER_FLAGS += `curl-config --cflags` - LOAD_FLAG_SUFFIX += `curl-config --libs` - endif - 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/ - - ifneq "$(USE_XWIN)" "" - DEFINITIONS += __XWINDOWS__ __X__ - LIBS_USED += -#Xm Xt X11 Xft Xp -#need to separate out with a USE_MOTIF kind of thing. -#LIBS_USED += Xmu - HEADER_SEARCH_PATH += /usr/include/X11 /usr/X11R6/include /usr/include/g++ - LIBRARY_SEARCH_PATH += /usr/X11R6/lib - endif - - ifneq "$(USE_SSL)" "" - LIBS_USED += crypto ssl - endif - - ifneq "$(USE_WXWIDGETS)" "" - DEFINITIONS += __WXWIDGETS__ - use_unicode = - ifneq "$(findstring UNICODE, $(DEFINITIONS))" "" - use_unicode = true - endif - - # decide whether to turn on the unicode flag or not. -### ifneq "$(findstring UNICODE, $(DEFINITIONS))" "" - ifneq "$(use_unicode)" "" - UNICODE_FLAG_ADD = --unicode=yes - DEFINITIONS += wxUSE_UNICODE - else - UNICODE_FLAG_ADD = --unicode=no - endif - - COMPILER_FLAGS += $(shell wx-config --cxxflags $(UNICODE_FLAG_ADD) ) - LOAD_FLAG_PREFIX += $(shell wx-config --libs $(UNICODE_FLAG_ADD) ) - endif - - ifneq "$(USE_CURL)" "" - COMPILER_FLAGS += `curl-config --cflags` - LOAD_FLAG_SUFFIX += `curl-config --libs` - endif + # finds the crypto code on macos. +# HEADER_SEARCH_PATH += /usr/local/opt/openssl/include +# LIBRARY_SEARCH_PATH += /usr/local/opt/openssl/lib/ endif ############################################################################### @@ -174,7 +115,8 @@ 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) $(FEISTY_MEOW_CPP_HEADERS) $(SEARCH_DIRS) +BASE_HEADER_PATH := $(CODEBASE_HEADERS) $(LOCAL_HEADERS) bork1 $(FEISTY_MEOW_CPP_HEADERS) bork2 $(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 c7fbbb4c..2eca5786 100644 --- a/scripts/clam/cpp/variables.def +++ b/scripts/clam/cpp/variables.def @@ -634,12 +634,12 @@ ifeq "$(CLAM_COMPILER)" "GNU_DARWIN" # "USE_XWIN" specifies that this project needs X window system support. #USE_XWIN = -# ifeq "x86_64" "$(ARCHITECTURE)" -# COMPILER_LIBRARY_DIR = /lib64 /usr/lib64 /usr/local/lib64 -# else + 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 + endif # DEFINITIONS += __LINUX__ linux __linux__ UNIX unix __UNIX__ __USE_GNU DEFINITIONS += UNIX unix __UNIX__ __USE_GNU diff --git a/scripts/generator/build_variables.sh b/scripts/generator/build_variables.sh index efaf36b3..dc5c45c8 100644 --- a/scripts/generator/build_variables.sh +++ b/scripts/generator/build_variables.sh @@ -55,7 +55,9 @@ source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" # outer check on whether this already was run or not. if [ -z "$BUILD_VARS_LOADED" ]; then -echo build variables were not loaded so recalculating. +#hmmm: make print only in debug mode +echo recalculating feisty meow build variables. +echo # perform some calculations to get the right paths from our parameters. if [ ! -z "$PARM_1" ]; then @@ -109,7 +111,8 @@ else fi # CLAM_BASE_CPU is a flag that distinguishes the type of processor, if necessary. -export CLAM_BASE_CPU="$(machine 2>/dev/null || arch 2>/dev/null || uname -m 2>/dev/null || echo i686)" +export CLAM_BASE_CPU="$(uname -m 2>/dev/null || arch 2>/dev/null || echo i686)" +#ugh, machine gives us an odd answer on macos. machine 2>/dev/null || # "FEISTY_MEOW_CPP_HEADERS" are folders where our C and C++ header files can be found. # we'll compute the set of folders as best we can below.