Make option O_NOLOC renamed to O_NOLC

This commit is contained in:
Arun Prakash Jana 2021-05-24 22:38:08 +05:30
parent fdeba8a87e
commit db8079f552
No known key found for this signature in database
GPG key ID: A75979F35C080412
3 changed files with 19 additions and 18 deletions

View file

@ -14,7 +14,7 @@ CFLAGS_OPTIMIZATION ?= -O3
O_DEBUG := 0 # debug binary O_DEBUG := 0 # debug binary
O_NORL := 0 # no readline support O_NORL := 0 # no readline support
O_PCRE := 0 # link with PCRE library O_PCRE := 0 # link with PCRE library
O_NOLOC := 0 # no locale support O_NOLC := 0 # no locale support
O_NOMOUSE := 0 # no mouse support O_NOMOUSE := 0 # no mouse support
O_NOBATCH := 0 # no built-in batch renamer O_NOBATCH := 0 # no built-in batch renamer
O_NOFIFO := 0 # no FIFO previewer support O_NOFIFO := 0 # no FIFO previewer support
@ -34,9 +34,9 @@ endif
ifneq ($(filter norl,$(MAKECMDGOALS)),) ifneq ($(filter norl,$(MAKECMDGOALS)),)
O_NORL := 1 O_NORL := 1
endif endif
ifneq ($(filter noloc,$(MAKECMDGOALS)),) ifneq ($(filter nolc,$(MAKECMDGOALS)),)
O_NORL := 1 O_NORL := 1
O_NOLOC := 1 O_NOLC := 1
endif endif
ifeq ($(strip $(O_DEBUG)),1) ifeq ($(strip $(O_DEBUG)),1)
@ -57,8 +57,8 @@ ifeq ($(strip $(O_PCRE)),1)
LDLIBS += -lpcre LDLIBS += -lpcre
endif endif
ifeq ($(strip $(O_NOLOC)),1) ifeq ($(strip $(O_NOLC)),1)
CPPFLAGS += -DNOLOCALE CPPFLAGS += -DNOLC
endif endif
ifeq ($(strip $(O_NOMOUSE)),1) ifeq ($(strip $(O_NOMOUSE)),1)
@ -143,7 +143,7 @@ $(BIN): $(SRC) $(HEADERS)
# targets for backwards compatibility # targets for backwards compatibility
debug: $(BIN) debug: $(BIN)
norl: $(BIN) norl: $(BIN)
noloc: $(BIN) nolc: $(BIN)
install-desktop: $(DESKTOPFILE) install-desktop: $(DESKTOPFILE)
$(INSTALL) -m 0755 -d $(DESTDIR)$(DESKTOPPREFIX) $(INSTALL) -m 0755 -d $(DESTDIR)$(DESKTOPPREFIX)

View file

@ -12,7 +12,7 @@ CFLAGS_OPTIMIZATION ?= -O3
O_DEBUG := 0 # debug binary O_DEBUG := 0 # debug binary
O_NORL := 0 # no readline support O_NORL := 0 # no readline support
O_PCRE := 0 # link with PCRE library O_PCRE := 0 # link with PCRE library
O_NOLOC := 0 # no locale support O_NOLC := 0 # no locale support
O_NOMOUSE := 0 # no mouse support O_NOMOUSE := 0 # no mouse support
O_NOBATCH := 0 # no built-in batch renamer O_NOBATCH := 0 # no built-in batch renamer
O_NOFIFO := 0 # no FIFO previewer support O_NOFIFO := 0 # no FIFO previewer support
@ -32,13 +32,13 @@ endif
ifneq ($(filter norl,$(MAKECMDGOALS)),) ifneq ($(filter norl,$(MAKECMDGOALS)),)
O_NORL := 1 O_NORL := 1
endif endif
ifneq ($(filter noloc,$(MAKECMDGOALS)),) ifneq ($(filter nolc,$(MAKECMDGOALS)),)
O_NORL := 1 O_NORL := 1
O_NOLOC := 1 O_NOLC := 1
endif endif
ifeq ($(strip $(O_DEBUG)),1) ifeq ($(strip $(O_DEBUG)),1)
CPPFLAGS += -DDBGMODE CPPFLAGS += -DDEBUG
CFLAGS += -g CFLAGS += -g
LDLIBS += -lrt LDLIBS += -lrt
endif endif
@ -56,8 +56,8 @@ ifeq ($(strip $(O_PCRE)),1)
LDLIBS += -lpcre LDLIBS += -lpcre
endif endif
ifeq ($(strip $(O_NOLOC)),1) ifeq ($(strip $(O_NOLC)),1)
CPPFLAGS += -DNOLOCALE CPPFLAGS += -DNOLC
endif endif
ifeq ($(strip $(O_NOMOUSE)),1) ifeq ($(strip $(O_NOMOUSE)),1)
@ -154,7 +154,7 @@ $(BIN): $(OBJS)
# targets for backwards compatibility # targets for backwards compatibility
debug: $(BIN) debug: $(BIN)
norl: $(BIN) norl: $(BIN)
noloc: $(BIN) nolc: $(BIN)
install: all install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin
@ -170,6 +170,7 @@ strip: $(BIN)
$(STRIP) $^ $(STRIP) $^
static: static:
# regular static binary
make O_STATIC=1 strip make O_STATIC=1 strip
mv $(BIN) $(BIN)-static mv $(BIN) $(BIN)-static

View file

@ -76,7 +76,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <libgen.h> #include <libgen.h>
#include <limits.h> #include <limits.h>
#ifndef NOLOCALE #ifndef NOLC
#include <locale.h> #include <locale.h>
#endif #endif
#include <stdio.h> #include <stdio.h>
@ -2447,7 +2447,7 @@ static int xstricmp(const char * const s1, const char * const s2)
} }
/* Handle 1. all non-numeric and 2. both same numeric value cases */ /* Handle 1. all non-numeric and 2. both same numeric value cases */
#ifndef NOLOCALE #ifndef NOLC
return strcoll(s1, s2); return strcoll(s1, s2);
#else #else
return strcasecmp(s1, s2); return strcasecmp(s1, s2);
@ -3470,7 +3470,7 @@ static void resetdircolor(int flags)
* Adjust string length to maxcols if > 0; * Adjust string length to maxcols if > 0;
* Max supported str length: NAME_MAX; * Max supported str length: NAME_MAX;
*/ */
#ifdef NOLOCALE #ifdef NOLC
static char *unescape(const char *str, uint_t maxcols) static char *unescape(const char *str, uint_t maxcols)
{ {
char * const wbuf = g_buf; char * const wbuf = g_buf;
@ -3813,7 +3813,7 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
if (!ind) if (!ind)
++namecols; ++namecols;
#ifndef NOLOCALE #ifndef NOLC
addwstr(unescape(ent->name, namecols)); addwstr(unescape(ent->name, namecols));
#else #else
addstr(unescape(ent->name, MIN(namecols, ent->nlen) + 1)); addstr(unescape(ent->name, MIN(namecols, ent->nlen) + 1));
@ -8012,7 +8012,7 @@ int main(int argc, char *argv[])
return EXIT_FAILURE; return EXIT_FAILURE;
} }
#ifndef NOLOCALE #ifndef NOLC
/* Set locale */ /* Set locale */
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
#ifdef PCRE #ifdef PCRE