1 PROJECT_NAME = sxeditor ;
3 -configure-enable-disable-vars- +=
4 "x11" USE_X11_BACKEND "auto" "build X11 backend"
5 "tty" USE_TTY_BACKEND "tan" "build tty backend"
6 "forkpty" USE_FORK_PTY "auto" "use `forkpty()`"
7 "embedded-sqlite" USE_EMB_SQ3 "" "use embedded SQLite3 amalgamation (it must present!)"
8 "solo-dlopen" USE_SOLO_DLOPEN "tan" "allow `dlopen()` in solo mode"
9 "mimalloc" USE_MIMALLOC "" "use mi-malloc instead of system memory allocator"
12 include $(TOP)/Jamrules.configure.nasal ;
15 rule -configure-test-forkpty- {
17 -configure-test-compile-cc- "forkpty()" :
22 "forkpty(&n, 0, 0, 0);"
30 rule -configure-test-forkpty-shitos- {
32 -configure-test-compile-cc- "forkpty-shitos()" :
37 "forkpty(&n, 0, 0, 0);"
44 rule -configure-check-embedded-sq3- {
45 local ok = [ FileExists $(TOP)/src/libsq3/sqlite3.c $(TOP)/src/libsq3/sqlite3.h ] ;
58 Exit "please, set `PKG-CONFIG` envvar!" ;
61 if ! [ sys-has-command $(PKG-CONFIG) ] {
62 Exit "pkg-config required, but not found: $(PKG-CONFIG)" ;
66 ok = [ -configure-check-embedded-sq3- ] ;
68 -configure-add-line- '# embedded SQLite3' ;
69 -configure-add-line- "DEFINES += USE_EMB_SQ3 ;" ;
70 -configure-add-line- "USE_EMB_SQ3 = tan ;" ;
72 Exit "FATAL: no SQLite3 amalgamation found in $(TOP)/src/libsq3/" ;
74 Echo "Using embedded SQLite3 library." ;
76 #-configure-pkg-config-necessary-
78 # "SQLite3" "sqlite3 >= 3.34"
80 ok = [ -configure-pkg-config- "SQLite3" : "sqlite3 >= 3.34" : "DEFINES += HAVE_SQLITE3 ;\nUSE_EMB_SQ3 = \"\" ;" ] ;
83 ok = [ -configure-check-embedded-sq3- ] ;
85 -configure-add-line- '# embedded SQLite3' ;
86 -configure-add-line- "DEFINES += USE_EMB_SQ3 ;" ;
87 -configure-add-line- "USE_EMB_SQ3 = tan ;" ;
88 Echo "Using embedded SQLite3 library." ;
90 Exit "FATAL: no SQLite3 library found, and no amalgamation in $(TOP)/src/libsq3/" ;
95 -configure-add-line- '# x11 backend' ;
96 if $(USE_X11_BACKEND) {
97 ok = [ -configure-pkg-config- "XLib" : "x11" : "DEFINES += USE_X11_BACKEND ;\nUSE_X11_BACKEND = tan ;" : "USE_X11_BACKEND = \"\" ;" ] ;
99 USE_TTY_BACKEND = tan ;
102 -configure-add-line- "USE_X11_BACKEND = \"\" ;" ;
105 -configure-add-line- '# tty backend' ;
106 if $(USE_TTY_BACKEND) {
107 -configure-add-line- "DEFINES += USE_TTY_BACKEND ;\nUSE_TTY_BACKEND = tan ;" ;
109 -configure-add-line- "USE_TTY_BACKEND = \"\" ;" ;
113 USE_FPTY = [ -configure-test-forkpty- ] ;
115 USE_FPTY = [ -configure-test-forkpty-shitos- ] ;
116 USE_FPTY_LUTIL = ona ;
118 USE_FPTY_LUTIL = tan ;
121 -configure-add-line- '# forkpty' ;
122 -configure-add-line- "DEFINES += USE_FORK_PTY ;" ;
123 if $(USE_FPTY_LUTIL) {
124 -configure-add-line- "LINKLIBS.all += -lutil ;" ;
129 if $(USE_SOLO_DLOPEN) {
130 NASALCFG_DISABLE_DLOPEN = '' ;
132 NASALCFG_DISABLE_DLOPEN = tan ;
135 -configure-nasal-sqlite-already- ;
136 -configure-nasal-base- ;
137 -configure-nasal-dlopen- ;
139 -configure-add-line- '# mi-malloc' ;
141 -configure-add-line- "DEFINES += USE_MIMALLOC ;" ;
142 -configure-add-line- "USE_MIMALLOC = tan ;" ;
143 -configure-add-line- "CFLAGS.all += -pthread ;" ;
144 -configure-add-line- "LINKFLAGS.all += -pthread ;" ;
145 Echo "MESSAGE: using mi-malloc" ;
147 -configure-add-line- "USE_MIMALLOC = \"\" ;" ;