some Makefile and hints tinkering

1. remove all window interface bits from compiler.370, and have
   the preceding include files set some variables to control
   the behavior of compiler.370 when it comes to c++.
2. some more common Makefile lines into sys/unix/hints/include/multiw-3.370.
3. make it so you can pass cppregex=1 on the Make command line to build with
   sys/share/cppregex.cpp instead of posixregex.c
4. fix sys/share/cppregex.cpp so that it will build with clang compiler
   (required an additional header include). I don't know if it would have
   worked with g++ without that change. The include can be placed into an #ifdef
   block if there's an issue with the change on other compilers.
5. Anything that needs to compile using c++ (Qt, sys/share/cppregex.cpp) can
   just ensure that CPLUSPLUS_NEEDED Makefile variable is set above the lines
   in compiler.370 to ensure that things get set up for c++. It no longer
   checks specifically for Qt. That is what sys/unix/hints/include/multiw-2.370
   does now.
This commit is contained in:
nhmall
2022-11-13 22:25:07 -05:00
parent d957d70d15
commit 3f93d54b66
8 changed files with 211 additions and 166 deletions

View File

@@ -19,7 +19,6 @@
# note: '#-INCLUDE' is not just a comment; multiw-1 contains sections 1 to 2
#-INCLUDE multiw-1.370
ifneq "$(USEMACPORTS)" "1"
HAVE_HOMEBREW := $(shell expr `which -s brew; echo $$?` = 0)
endif
@@ -27,55 +26,6 @@ ifneq "$(USEHOMEBREW)" "1"
HAVE_MACPORTS := $(shell expr `which -s port; echo $$?` = 0)
endif
# 3. If you set WANT_WIN_QT, you need to
# A) set QTDIR either here or in the environment to point to the Qt5
# library installation root. (Qt2, Qt3, Qt4 will not work)
# B) set LIBXPM to point to the Xpm library
ifndef WANT_WIN_QT
ifdef WANT_WIN_ALL
WANT_WIN_QT=1
endif
ifdef WANT_WIN_QT5
ifndef WANT_WIN_QT
WANT_WIN_QT=1
endif # not WANT_WIN_QT
endif # WANT_WIN_QT5
ifdef WANT_WIN_QT6
ifndef WANT_WIN_QT
WANT_WIN_QT=1
endif # not WANT_WIN_QT
endif # WANT_WIN_QT6
endif # not WANT_WIN_QT
ifdef WANT_WIN_QT
ifndef WANT_WIN_QT5
ifndef WANT_WIN_QT6
WANT_WIN_QT5=1
endif # not WANT_WIN_QT6
endif # not WANT_WIN_QT5
#QTDIR=/Developer/Qt
ifeq "$(HAVE_HOMEBREW)" "1"
ifdef WANT_WIN_QT5
# Qt5 installed via homebrew
QTDIR :=$(shell brew --prefix)/opt/qt@5
endif # WANT_WIN_QT5
ifdef WANT_WIN_QT6
QTDIR :=$(shell brew --prefix)/opt/qt@6
endif # WANT_WIN_QT6
endif # HAVE_HOMEBREW
ifndef QTDIR
ifeq "$(HAVE_MACPORTS)" "1"
ifdef WANT_WIN_QT5
# Qt5 installed via macports
QTDIR=/opt/local/libexec/qt5
endif # WANT_WIN_QT5
ifdef WANT_WIN_QT6
QTDIR=/opt/local/libexec/qt6
endif # WANT_WIN_QT6
endif # HAVE_MACPORTS
endif # QTDIR
endif # WANT_WIN_QT
ifndef LIBXPM
LIBXPM= -L/opt/X11/lib -lXpm
endif
@@ -87,17 +37,6 @@ endif
# you're reading this in Makefile augmented by hints, that may not be true).
#
ifeq "$(GIT)" "1"
ifndef GITSUBMODULES
GITSUBMODULES=1
endif
endif
ifeq "$(git)" "1"
ifndef GITSUBMODULES
GITSUBMODULES=1
endif
endif
#-INCLUDE multiw-2.370
# compiler.370 contains compiler detection and adjustments common
@@ -105,7 +44,31 @@ endif
#-INCLUDE compiler.370
ifdef WANT_WIN_QT
ifeq "$(HAVE_HOMEBREW)" "1"
ifdef WANT_WIN_QT5
# Qt5 installed via homebrew
QTDIR :=$(shell brew --prefix)/opt/qt@5
endif # WANT_WIN_QT5
ifdef WANT_WIN_QT6
QTDIR :=$(shell brew --prefix)/opt/qt@6
endif # WANT_WIN_QT6
endif # HAVE_HOMEBREW
ifndef QTDIR
ifeq "$(HAVE_MACPORTS)" "1"
# Qt installed via macports
ifdef WANT_WIN_QT5
QTDIR=/opt/local/libexec/qt5
endif # WANT_WIN_QT5
ifdef WANT_WIN_QT6
QTDIR=/opt/local/libexec/qt6
endif # WANT_WIN_QT6
endif # HAVE_MACPORTS
endif # QTDIR
endif # WANT_WIN_QT
# multiw-3.370 must come after compiler.370
# and after QTDIR is defined
#-INCLUDE multiw-3.370