From: Chris Tusa Subject: Add makefiles/Makefile.hammerhead XNEdit's top-level Makefile is target-based (`make `, matching a file `makefiles/Makefile.`) - there is no uname-autodetect path to adapt, only per-platform templates to add to. None of the shipped templates fit Hammerhead: Makefile.solaris hardcodes illumos paths that don't exist here (/usr/openwin/include, /usr/sfw/lib/64) and links -lsocket -lnsl (not used/needed on Hammerhead's libc); the `:sh=`-based pkg-config assignment it uses is also not portable GNU make syntax. Base this instead on the shape of Makefile.linux, pointed at /usr/local (our port prefix) and using $(shell pkg-config ...) throughout, plus the GCC14 old-C flags (-fpermissive -fcommon) and the usual illumos header-gating defines. diff --git a/makefiles/Makefile.hammerhead b/makefiles/Makefile.hammerhead new file mode 100644 index 0000000..0000000 --- /dev/null +++ b/makefiles/Makefile.hammerhead @@ -0,0 +1,26 @@ +# Makefile.hammerhead - Hammerhead (illumos-derivative, GNU toolchain) port. +# Modeled on Makefile.linux: Motif/X11/Xft/fontconfig all live under +# /usr/local (our $PREFIX) rather than /usr/X11R6 or illumos's +# /usr/openwin - use pkg-config throughout instead of hardcoded paths. +# +# GCC14 old-C compat: XNEdit/Xlt/Microline are classic pre-2015-idiom C - +# -fpermissive demotes GCC14's new implicit-decl/incompatible-pointer/ +# int-conversion errors back to warnings; -fcommon undoes GCC10+'s +# -fno-common default (tentative-definition multiple-definition errors). +# -D__EXTENSIONS__ / -D_POSIX_PTHREAD_SEMANTICS unlock the usual +# illumos-hidden POSIX/SysV prototypes and _r signatures. +CC=gcc +AR=ar + +C_OPT_FLAGS?=-O + +CFLAGS=$(C_OPT_FLAGS) -std=gnu99 -I/usr/local/include -DUSE_LPR_PRINT_CMD \ + -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS -fpermissive -fcommon \ + $(shell pkg-config --cflags xft fontconfig) + +ARFLAGS=-urs + +LIBS=$(LD_OPT_FLAGS) -L/usr/local/lib -R/usr/local/lib -lXm -lXt -lX11 \ + -lXext -lXrender -lm -lpthread $(shell pkg-config --libs xft fontconfig) + +include Makefile.common