Closed NuLL3rr0r closed 3 years ago
I'm not sure what the problem is here.. The compiler errors seem to be indicating it can't find ./LuaJIT/src/libluajit.a
, I am wondering if maybe the problem comes from line 38 of the makefile where it's got CXX=clang
? I can't remember why that was added in..
The compiler output doesn't seem to indicate anything to do with trying to compile anything else yet, so hopefully not an issue with trying to compile anything in parallel.
It doesn't appear to be much different in that regard to this earlier Makefile after merging a previous PR from you though so I'm not sure..
I did merge a PR from someone changing LINK
to LDFLAGS
, maybe LINK
already has stuff defined for it on FreeBSD and Gentoo?
Hmmm, I just replaced every LDFLAGS with LINK and it worked on FreeBSD. FreeBSD ports system and Gentoo's portage have some defaults determined elsewhere (e.g. through make.conf). I am not sure if LINK has some value to no.
Here is the patch file (ignore the %%LOCALBASE%% it is required by FreeBSD):
--- Makefile.orig 2021-03-07 20:18:20 UTC
+++ Makefile
@@ -3,14 +3,14 @@ objects=nsm.o ConsoleColor.o DateTimeInfo.o Directory.
cppfiles=nsm.cpp ConsoleColor.cpp DateTimeInfo.cpp Directory.cpp Expr.cpp ExprtkFns.cpp Filename.cpp FileSystem.cpp Getline.cpp GitInfo.cpp hashtk/HashTk.cpp Lolcat.cpp LuaFns.cpp Lua.cpp NumFns.cpp Pagination.cpp Parser.cpp Path.cpp ProjectInfo.cpp Quoted.cpp StrFns.cpp SystemInfo.cpp Title.cpp TrackedInfo.cpp Variables.cpp WatchList.cpp
DESTDIR?=
-PREFIX?=/usr/local
+PREFIX?=%%LOCALBASE%%
BINDIR=${DESTDIR}${PREFIX}/bin
LIBDIR=${DESTDIR}${PREFIX}/lib
CXX?=g++
CXXFLAGS+=-std=c++11 -Wall -Wextra -pedantic -O3 -Dexprtk_disable_caseinsensitivity
#CXXFLAGS=-std=c++11 -Wall -Wextra -Werror -pedantic -O3
-LDFLAGS+=-pthread
+LINK+=-pthread
ifeq ($(OS),Windows_NT)
detected_OS := Windows
@@ -22,7 +22,7 @@ ifeq ($(CXX),clang)
ifeq ($(OS),FreeBSD)
else
CXXFLAGS+= -Qunused-arguments -lstdc++
- LDFLAGS+= -lm
+ LINK+= -lm
endif
endif
@@ -71,66 +71,66 @@ ifeq ($(BUNDLED),0)
WAS_UNBUNDLED=1
ifneq ($(LUA_VERSION),)
CXXFLAGS+= -D__BUNDLED__ -D__LUA_VERSION_5_3__
- LDFLAGS+= -LLua-5.3/src -llua
+ LINK+= -LLua-5.3/src -llua
else
CXXFLAGS+= -D__BUNDLED__ -D__LUAJIT_VERSION_2_1__
- LDFLAGS+= -LLuaJIT/src -llua51
+ LINK+= -LLuaJIT/src -llua51
endif
else ifeq ($(LUA_VERSION),x)
ifeq ($(detected_OS),FreeBSD) # FreeBSD
CXXFLAGS+= -D__LUA_VERSION_x__
- LDFLAGS+= -L/usr/local/lib -llua -lm -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua -lm -ldl
else # *nix
CXXFLAGS+= -D__LUA_VERSION_x__
- LDFLAGS+= -L/usr/local/lib -llua -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua -ldl
endif
else ifeq ($(LUA_VERSION),5.4)
ifeq ($(detected_OS),FreeBSD) # FreeBSD
CXXFLAGS+= -D__LUA_VERSION_5_4__
- LDFLAGS+= -L/usr/local/lib -llua-5.4 -lm -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.4 -lm -ldl
else # *nix
CXXFLAGS+= -D__LUA_VERSION_5_4__
- LDFLAGS+= -L/usr/local/lib -llua-5.4 -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.4 -ldl
endif
else ifeq ($(LUA_VERSION),5.3)
ifeq ($(detected_OS),FreeBSD) # FreeBSD
CXXFLAGS+= -D__LUA_VERSION_5_3__
- LDFLAGS+= -L/usr/local/lib -llua-5.3 -lm -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.3 -lm -ldl
else # *nix
CXXFLAGS+= -D__LUA_VERSION_5_3__
- LDFLAGS+= -L/usr/local/lib -llua-5.3 -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.3 -ldl
endif
else ifeq ($(LUA_VERSION),5.2)
ifeq ($(detected_OS),FreeBSD) # FreeBSD
CXXFLAGS+= -D__LUA_VERSION_5_2__
- LDFLAGS+= -L/usr/local/lib -llua-5.2 -lm -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.2 -lm -ldl
else # *nix
CXXFLAGS+= -D__LUA_VERSION_5_2__
- LDFLAGS+= -L/usr/local/lib -llua-5.2 -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.2 -ldl
endif
else ifeq ($(LUA_VERSION),5.1)
ifeq ($(detected_OS),FreeBSD) # FreeBSD
CXXFLAGS+= -D__LUA_VERSION_5_1__
- LDFLAGS+= -L/usr/local/lib -llua-5.1 -lm -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.1 -lm -ldl
else # *nix
CXXFLAGS+= -D__LUA_VERSION_5_1__
- LDFLAGS+= -L/usr/local/lib -llua-5.1 -ldl
+ LINK+= -L%%LOCALBASE%%/lib -llua-5.1 -ldl
endif
else ifeq ($(LUAJIT_VERSION),2.0)
ifeq ($(detected_OS),FreeBSD) # FreeBSD
CXXFLAGS+= -D__LUAJIT_VERSION_2_0__
- LDFLAGS+= -ldl -lm -L/usr/local/lib -lluajit-5.1
+ LINK+= -ldl -lm -L%%LOCALBASE%%/lib -lluajit-5.1
else # *nix
CXXFLAGS+= -D__LUAJIT_VERSION_2_0__
- LDFLAGS+= -ldl -L/usr/local/lib -lluajit-5.1
+ LINK+= -ldl -L%%LOCALBASE%%/lib -lluajit-5.1
endif
else
ifeq ($(detected_OS),FreeBSD) # FreeBSD
CXXFLAGS+= -D__LUAJIT_VERSION_2_1__
- LDFLAGS+= -ldl -lm -L/usr/local/lib -lluajit-5.1
+ LINK+= -ldl -lm -L%%LOCALBASE%%/lib -lluajit-5.1
else # *nix
CXXFLAGS+= -D__LUAJIT_VERSION_2_1__
- LDFLAGS+= -ldl -L/usr/local/lib -lluajit-5.1
+ LINK+= -ldl -L%%LOCALBASE%%/lib -lluajit-5.1
endif
endif
else
@@ -138,24 +138,24 @@ else
ifeq ($(LUA_VERSION),5.3)
CXXFLAGS+= -D__BUNDLED__ -D__LUA_VERSION_5_3__
ifeq ($(detected_OS),Windows) # Windows
- LDFLAGS+= -LLua-5.3/src -llua
- #LDFLAGS+= -LLua-5.3/src -llua
+ LINK+= -LLua-5.3/src -llua
+ #LINK+= -LLua-5.3/src -llua
else ifeq ($(detected_OS),FreeBSD) # FreeBSD
- LDFLAGS+= -LLua-5.3/src -llua -ldl -lm
+ LINK+= -LLua-5.3/src -llua -ldl -lm
else # *nix/Vercel
- LDFLAGS+= -LLua-5.3/src -llua -ldl
+ LINK+= -LLua-5.3/src -llua -ldl
endif
else
CXXFLAGS+= -D__BUNDLED__ -D__LUAJIT_VERSION_2_1__
ifeq ($(detected_OS),Windows) # Windows
- LDFLAGS+= -LLuaJIT/src -llua51
- #LDFLAGS+= -L. -llua51
+ LINK+= -LLuaJIT/src -llua51
+ #LINK+= -L. -llua51
else ifeq ($(detected_OS),FreeBSD) # FreeBSD
- LDFLAGS+= ./LuaJIT/src/libluajit.a -ldl -lm
- #LDFLAGS+= -ldl -lm -LLuaJIT/src -lluajit
+ LINK+= ./LuaJIT/src/libluajit.a -ldl -lm
+ #LINK+= -ldl -lm -LLuaJIT/src -lluajit
else # *nix/Vercel
- LDFLAGS+= ./LuaJIT/src/libluajit.a -ldl
- #LDFLAGS+= -ldl -LLuaJIT/src -lluajit
+ LINK+= ./LuaJIT/src/libluajit.a -ldl
+ #LINK+= -ldl -LLuaJIT/src -lluajit
endif
endif
endif
@@ -220,10 +220,10 @@ HashTk.o: hashtk/HashTk.cpp hashtk/HashTk.h
nsm: $(objects)
ifeq ($(detected_OS),Windows) # Windows
- $(CXX) $(CXXFLAGS) $(objects) -o nsm $(LDFLAGS)
+ $(CXX) $(CXXFLAGS) $(objects) -o nsm $(LINK)
copy nsm.exe nift.exe
else
- $(CXX) $(CXXFLAGS) $(objects) -o nsm $(LDFLAGS)
+ $(CXX) $(CXXFLAGS) $(objects) -o nsm $(LINK)
cp nsm nift
endif
This is my Gentoo's value for those variables (nothing for LINK):
$ emerge --info | grep -si link
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
$ emerge --info | grep -si ldflags
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
I'll fix it up for future versions, so hopefully not an issue again. @teknokatze might be worth noting this for the future, using LDFLAGS
isn't cross platform without just adding in extra unnecessary fluff. It's a bit like the political correctness nutjobs wanting to change things like master branch
while also throwing out historical accuracy on the topic and making inaccurate claims about the possibility of any y2k/epochalypse
fallout from that. Neither of those are typically very helpful for the war to end rape and hold people accountable for their actions (like the nazis and serial killers of the past) either. I am under very strict orders from very high and very low places to be a danger to the rapist society, not a danger to those inflicted with suffering and misery by the evil people on this planet (the kind which are referred to much differently in the right places behind the scenes, not just orders).
One-hundred percent agree. Do you have an estimation for when the next release is going to happen? If it takes long, as a workaround I can submit it to FreeBSD ports with my own patch for the time being, until the next release happens.
I'll try to think of a few things to add in and get that done in the next few days..
For the future? Even if I made a mistake, which between sending in the patch and you committing it takes too long to remember, after such a generic garbage message I tell you as myself and not as part of the orgs I work in, refrain from contacting me again.
I'm not sure what you consider to be garbage about my comment, I was merely informing you about why it ended up being problematic from a cross platform point of view. I can't stand interacting with people who aren't interested in learning especially when it's an issue they have caused themselves so good riddance.
NuLl3rr0r this should now be fixed with the current commit, I haven't released it as its own version yet.
Thanks. There's no need to rush for another release if you don't have to. I submitted it with a patch to the FreeBSD ports tree and updated my Gentoo portage's overlay with the same patch. So, Gentoo and FreeBSD users now are able to use the latest versions from their respective package managers. I guess it can be closed now.
I had to put some breaking changes in which I think we're worth it in the long term. Eg. $ in front of exprt grave accent expressions so it doesn't mess with grave accents in bash etc. Given it's an extension shell and extension scripting language.. and I got rid of looking for @ in functionstein because it had problems with eg. having @ in Bitbucket clone urls even for https and SSH clone urls for most got providers.
As usual, I tried to update the Gentoo ebuild and the FreeBSD ports, but I get the following error:
FreeBSD:
Gentoo:
I guess somehow Make tries to build in parallel (while still, that file does not exist).