1 diff --git a/cinelerra-5.1/Makefile.devel b/cinelerra-5.1/Makefile.devel
2 index a12d8f2b..9aac014a 100644
3 --- a/cinelerra-5.1/Makefile.devel
4 +++ b/cinelerra-5.1/Makefile.devel
5 @@ -4,7 +4,7 @@ TOPDIR := $(CURDIR)
7 export CFLAGS_ := $(CFLAGS)
9 -cpus:=$(shell grep -c "^proc" /proc/cpuinfo)
10 +cpus:=$(shell sysctl -n hw.ncpu)
11 jobs:=-j$(shell echo $$(($(cpus) + $(cpus)/2 +2)))
12 MAKEJ := $(MAKE) $(jobs)
14 diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
15 index 18590e3a..5eead290 100644
16 --- a/cinelerra-5.1/cinelerra/Makefile
17 +++ b/cinelerra-5.1/cinelerra/Makefile
18 @@ -395,6 +395,7 @@ LIBS += -lfontconfig -lfreetype
19 LIBS += -lavcodec -lavdevice -lavfilter -lavformat -lavresample -lavutil
20 LIBS += -lswresample -lswscale
21 LIBS += -lvpx -lwebp -lwebpmux
22 +LIBS += -lintl -liconv -lexecinfo
24 LIBS += $(if $(filter fftw,$(static_pkgs)), -lfftw3)
25 LIBS += $(if $(filter flac,$(static_pkgs)), -lFLAC)
26 @@ -414,7 +415,7 @@ LIBS += $(if $(filter x265,$(static_pkgs)), -lx265)
27 LIBS += $(if $(filter libvpx,$(static_pkgs)), -lvpx)
30 -LIBS += -lGL -lGLU -lGLX
33 ifneq ($(WANT_XFT),no)
35 @@ -476,6 +477,7 @@ LV2OBJS = \
39 + -I/usr/local/include \
43 @@ -523,15 +525,15 @@ all: $(OUTPUT) $(CUTADS) $(BDWRITE) $(LV2UI)
44 $(OUTPUT): $(OBJS) $(THEME_DATA) $(DCRAW) $(LIBRARIES)
45 $(LINKER) `cat $(OBJDIR)/objs`
46 $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G))
47 - $(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
48 + #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT))
49 ln -f -s ../bin/$(WANT_CIN) ci
51 ifneq ($(WANT_COMMERCIAL),no)
52 $(CUTADS): $(CUTOBJS) $(CUTLIBS) $(LIBRARIES)
53 - @echo g++ -o $@ $(CUTOBJS)
54 - @g++ $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS) $(LIBS)
55 + @echo $(CXX) -o $@ $(CUTOBJS)
56 + @$(CXX) $(CFLAGS) -pthread -o $@ $(CUTOBJS) $(CUTLIBS) $(LIBS)
57 $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(CUTADS) $(CUTADS).debuginfo)
58 - $(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS))
59 + #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(CUTADS))
62 cp -av $(OBJDIR)/cutads $(BINDIR)/.
63 @@ -540,18 +542,18 @@ install: install-cutads
66 $(BDWRITE): $(BDWOBJS) $(LIBRARIES)
67 - @echo g++ -o $@ $(BDWOBJS)
68 - @g++ $(CFLAGS) -pthread -o $@ $(BDWOBJS) $(LIBS)
69 + @echo $(CXX) -o $@ $(BDWOBJS)
70 + @$(CXX) $(CFLAGS) -pthread -o $@ $(BDWOBJS) $(LIBS)
71 $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(BDWRITE) $(BDWRITE).debuginfo)
72 - $(if $(findstring -ggdb,$(CFLAGS)),,strip $(BDWRITE))
73 + #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(BDWRITE))
76 cp -av $(OBJDIR)/bdwrite $(BINDIR)/.
77 install: install-bdwrite
79 ydiff: ydiff.C $(LIBRARIES)
80 - @echo g++ -o $@ ydiff.C
81 - @g++ $(CFLAGS) ydiff.C -o $@ $(LIBS)
82 + @echo $(CXX) -o $@ ydiff.C
83 + @$(CXX) $(CFLAGS) ydiff.C -o $@ $(LIBS)
87 @@ -585,7 +587,7 @@ $(OBJDIR)/lv2ui: $(LV2OBJS)
88 @echo $(CXX) \`cat $(OBJDIR)/c_flags\` $^ -o $@
89 @$(CXX) `cat $(OBJDIR)/c_flags` $^ -o $@ $(LIBS) $(GTK2_LIBS)
90 $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(LV2UI) $(LV2UI).debuginfo)
91 - $(if $(findstring -ggdb,$(CFLAGS)),,strip $(LV2UI))
92 + #$(if $(findstring -ggdb,$(CFLAGS)),,strip $(LV2UI))
96 diff --git a/cinelerra-5.1/cinelerra/bdcreate.C b/cinelerra-5.1/cinelerra/bdcreate.C
97 index 27f728ad..9215090d 100644
98 --- a/cinelerra-5.1/cinelerra/bdcreate.C
99 +++ b/cinelerra-5.1/cinelerra/bdcreate.C
104 -#include <sys/stat.h>
105 -#include <sys/statfs.h>
106 +#include <sys/param.h>
107 +#include <sys/mount.h>
111 diff --git a/cinelerra-5.1/cinelerra/bdwrite.C b/cinelerra-5.1/cinelerra/bdwrite.C
112 index 6a2b4ca3..78cf9bef 100644
113 --- a/cinelerra-5.1/cinelerra/bdwrite.C
114 +++ b/cinelerra-5.1/cinelerra/bdwrite.C
120 +#include <sys/endian.h>
122 #include <sys/stat.h>
123 // work arounds (centos)
124 diff --git a/cinelerra-5.1/cinelerra/cutads.C b/cinelerra-5.1/cinelerra/cutads.C
125 index ac58d56a..f6690cf2 100644
126 --- a/cinelerra-5.1/cinelerra/cutads.C
127 +++ b/cinelerra-5.1/cinelerra/cutads.C
130 #define fail(s) do { printf("fail %s%s:%d\n",__func__,#s,__LINE__); return 1; } while(0)
132 -/* missing from system headers, no /usr/include <linux/ioprio.h>
133 - * IOPRIO_WHO_PROCESS, IOPRIO_CLASS_SHIFT, IOPRIO_CLASS_IDLE */
134 -enum { IOPRIO_CLASS_NONE, IOPRIO_CLASS_RT, IOPRIO_CLASS_BE, IOPRIO_CLASS_IDLE, };
135 -#define IO_CLASS(n) (((int)(n)) << 13)
136 -#define IO_WHO_PROCESS 1
137 -#include <sys/syscall.h>
138 -#include <asm/unistd.h>
140 // commercial edge detection:
141 // must have audio < min_audio
142 // and within +- check_margin seconds of low audio
143 @@ -55,11 +47,6 @@ class Video;
147 -static int ioprio_set(int which, int who, int ioprio)
149 - return syscall(SYS_ioprio_set, which, who, ioprio);
152 static inline int clip(int v, int mn, int mx)
154 return v<mn ? mn : v>mx ? mx : v;
155 @@ -617,7 +604,6 @@ class Scan
156 const char *asset_path;
157 static void set_priority(int pr, int io) {
158 setpriority(PRIO_PROCESS, 0, pr); // lowest cpu priority
159 - ioprio_set(IO_WHO_PROCESS, 0, IO_CLASS(io));
161 class low_priority { public:
162 low_priority() { set_priority(19, IOPRIO_CLASS_IDLE); }
163 diff --git a/cinelerra-5.1/cinelerra/dvdcreate.C b/cinelerra-5.1/cinelerra/dvdcreate.C
164 index 1014baf5..f38094e9 100644
165 --- a/cinelerra-5.1/cinelerra/dvdcreate.C
166 +++ b/cinelerra-5.1/cinelerra/dvdcreate.C
171 -#include <sys/stat.h>
172 -#include <sys/statfs.h>
173 +#include <sys/param.h>
174 +#include <sys/mount.h>
177 #define DVD_PAL_4x3 0
178 diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C
179 index 13e1b457..9cc2f116 100644
180 --- a/cinelerra-5.1/cinelerra/file.C
181 +++ b/cinelerra-5.1/cinelerra/file.C
182 @@ -1594,7 +1594,10 @@ int File::record_fd()
183 void File::get_exe_path(char *result, char *bnp)
185 // Get executable path, basename
186 - int len = readlink("/proc/self/exe", result, BCTEXTLEN-1);
187 + char exe_path[BCTEXTLEN];
188 + sprintf(exe_path,"/proc/%d/file",getpid());
189 + int len = readlink(exe_path, result, BCTEXTLEN-1);
193 char *ptr = strrchr(result, '/');
194 diff --git a/cinelerra-5.1/cinelerra/indexfile.C b/cinelerra-5.1/cinelerra/indexfile.C
195 index 3d21d2af..f3064199 100644
196 --- a/cinelerra-5.1/cinelerra/indexfile.C
197 +++ b/cinelerra-5.1/cinelerra/indexfile.C
200 #include <sys/types.h>
201 #include <sys/stat.h>
202 -#include <linux/iso_fs.h>
203 +#include <isofs/cd9660/iso.h>
205 // check for isofs volume_id for dvd/cdrom
207 diff --git a/cinelerra-5.1/configure.ac b/cinelerra-5.1/configure.ac
208 index 1157b0a3..8c5ba61a 100644
209 --- a/cinelerra-5.1/configure.ac
210 +++ b/cinelerra-5.1/configure.ac
211 @@ -16,8 +16,18 @@ CFG_CFLAGS+=" -Wno-unused-result"
212 CFG_CFLAGS+=" -Wno-stringop-overflow"
213 CFG_CFLAGS+=" -Wno-format-truncation"
214 CFG_CFLAGS+=" -Wno-format-overflow"
215 +CFG_CFLAGS+=" -Wno-unknown-warning-option"
216 CFG_CFLAGS+=" -Wno-parentheses"
217 CFG_CFLAGS+=" -Wno-stringop-truncation"
218 +CFG_CFLAGS+=" -Wno-gnu-designator"
219 +CFG_CFLAGS+=" -Wno-missing-braces"
220 +CFG_CFLAGS+=" -Wno-overloaded-virtual"
221 +CFG_CFLAGS+=" -Wno-self-assign-field"
222 +CFG_CFLAGS+=" -Wno-sometimes-uninitialized"
223 +CFG_CFLAGS+=" -Wno-tautological-pointer-compare"
224 +CFG_CFLAGS+=" -Wno-unused-function"
225 +CFG_CFLAGS+=" -Wno-unused-private-field"
226 +CFG_CFLAGS+=" -Wno-infinite-recursion"
227 CFG_CFLAGS+=" -D__STDC_CONSTANT_MACROS"
228 CFG_CFLAGS+=" -D__STDC_LIMIT_MACROS"
229 CFG_CFLAGS+=" -DPNG_SKIP_SETJMP_CHECK=1"
230 @@ -127,7 +137,7 @@ AC_SUBST(MAK_INSTALLS)
231 AC_SUBST(MAK_UNINSTALLS)
233 if test "x$WANT_JOBS" = "xauto"; then
234 - CPUS=`grep -c "^proc" /proc/cpuinfo`
235 + CPUS=`sysctl -n hw.ncpu`
236 WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
239 diff --git a/cinelerra-5.1/db/tdb.h b/cinelerra-5.1/db/tdb.h
240 index 8ee88002..9a17091e 100644
241 --- a/cinelerra-5.1/db/tdb.h
242 +++ b/cinelerra-5.1/db/tdb.h
243 @@ -32,7 +32,7 @@ inline void operator delete[](void *t,size_t n) { free(t); }
252 diff --git a/cinelerra-5.1/guicast/bclistbox.h b/cinelerra-5.1/guicast/bclistbox.h
253 index f5994d53..c73169bb 100644
254 --- a/cinelerra-5.1/guicast/bclistbox.h
255 +++ b/cinelerra-5.1/guicast/bclistbox.h
256 @@ -185,7 +185,9 @@ public:
258 // take_focus - used by the suggestion box to keep it from taking focus from the
260 - int activate(int take_focus = 1);
261 + int activate() { return activate(1); }
262 + int activate(int take_focus);
264 int activate(int x, int y, int w=-1, int h=-1);
267 diff --git a/cinelerra-5.1/guicast/bcpan.h b/cinelerra-5.1/guicast/bcpan.h
268 index 40f5971f..73d47586 100644
269 --- a/cinelerra-5.1/guicast/bcpan.h
270 +++ b/cinelerra-5.1/guicast/bcpan.h
271 @@ -93,7 +93,8 @@ public:
274 static int rdtoxy(int &x, int &y, int a, int virtual_r);
275 - int activate(int popup_x = -1, int popup_y = -1);
276 + int activate(int popup_x, int popup_y);
277 + int activate() { return activate(-1,-1); }
281 diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C
282 index 1e927303..165883de 100644
283 --- a/cinelerra-5.1/guicast/bcresources.C
284 +++ b/cinelerra-5.1/guicast/bcresources.C
289 +#include <sys/sysctl.h>
290 #include <X11/extensions/XShm.h>
291 #include <fontconfig/fontconfig.h>
292 #include <fontconfig/fcfreetype.h>
293 @@ -297,23 +298,12 @@ int BC_Resources::machine_cpus = 1;
295 int BC_Resources::get_machine_cpus()
298 - FILE *proc = fopen("/proc/cpuinfo", "r");
300 - char string[BCTEXTLEN], *cp;
301 - while(!feof(proc) && fgets(string, sizeof(string), proc) ) {
302 - if( !strncasecmp(string, "processor", 9) &&
303 - (cp = strchr(string, ':')) != 0 ) {
304 - int n = atol(cp+1) + 1;
305 - if( n > cpus ) cpus = n;
307 - else if( !strncasecmp(string, "cpus detected", 13) &&
308 - (cp = strchr(string, ':')) != 0 )
315 + size_t len = sizeof(ncpu);
318 + if( sysctl(mib, 2, &ncpu, &len, 0, 0) ) ncpu = 1;
322 void BC_Resources::new_vframes(int n, VFrame *vframes[], ...)
323 @@ -695,7 +685,7 @@ new_vframes(20,default_medium_7segment,
324 generic_button_margin = 15;
325 draw_clock_background=1;
332 diff --git a/cinelerra-5.1/guicast/bcsignals.C b/cinelerra-5.1/guicast/bcsignals.C
333 index ed50cfb1..f1b894ba 100644
334 --- a/cinelerra-5.1/guicast/bcsignals.C
335 +++ b/cinelerra-5.1/guicast/bcsignals.C
337 #include <sys/stat.h>
339 #include <sys/ioctl.h>
340 -#include <sys/prctl.h>
341 #include <sys/types.h>
343 +#define dirent64 dirent
344 +#define readdir64 readdir
346 BC_Signals* BC_Signals::global_signals = 0;
347 static int signal_done = 0;
349 @@ -279,18 +281,6 @@ static void handle_exit(int signum)
351 void BC_Signals::set_sighup_exit(int enable)
354 -// causes SIGHUP to be generated when parent dies
355 - signal(SIGHUP, handle_exit);
356 - prctl(PR_SET_PDEATHSIG, SIGHUP, 0,0,0);
357 -// prevents ^C from signalling child when attached to gdb
359 - if( isatty(0) ) ioctl(0, TIOCNOTTY, 0);
362 - signal(SIGHUP, signal_entry);
363 - prctl(PR_SET_PDEATHSIG, 0,0,0,0);
367 BC_Signals::BC_Signals()
368 @@ -383,11 +373,13 @@ const char* BC_Signals::sig_to_str(int number)
369 #include <sys/wait.h>
372 +#define SC_(r)sc_##r
384 @@ -473,26 +465,5 @@ static void handle_dump(int n, siginfo_t * info, void *sc)
387 if( fp != stdout ) fclose(fp);
388 - char cmd[1024], *cp = cmd;
389 - cp += sprintf(cp, "exec gdb /proc/%d/exe -p %d --batch --quiet "
390 - "-ex \"thread apply all info registers\" "
391 - "-ex \"thread apply all bt full\" "
392 - "-ex \"quit\"", pid, pid);
394 - cp += sprintf(cp," >> \"%s\"", fn);
395 - cp += sprintf(cp," 2>&1");
396 -//printf("handle_dump:: pid=%d, cmd='%s' fn='%s'\n",pid,cmd,fn);
399 - fprintf(stderr,"** can't start gdb, dump abondoned\n");
404 - fprintf(stderr,"** dump complete\n");
407 - char *const argv[4] = { (char*) "/bin/sh", (char*) "-c", cmd, 0 };
408 - execvp(argv[0], &argv[0]);
411 diff --git a/cinelerra-5.1/guicast/filesystem.C b/cinelerra-5.1/guicast/filesystem.C
412 index ebc2007d..9d6452cb 100644
413 --- a/cinelerra-5.1/guicast/filesystem.C
414 +++ b/cinelerra-5.1/guicast/filesystem.C
419 +#define dirent64 dirent
420 +#define readdir64 readdir
422 #include "filesystem.h"
424 diff --git a/cinelerra-5.1/guicast/thread.C b/cinelerra-5.1/guicast/thread.C
425 index dff53e61..321ab4fc 100644
426 --- a/cinelerra-5.1/guicast/thread.C
427 +++ b/cinelerra-5.1/guicast/thread.C
428 @@ -55,13 +55,6 @@ void* Thread::entrypoint(void *parameters)
429 pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
430 thread->cancel_enabled = false;
432 -// Set realtime here seince it doesn't work in start
433 - if( thread->realtime && getuid() == 0 ) {
434 - struct sched_param param = { sched_priority : 1 };
435 - if(pthread_setschedparam(thread->tid, SCHED_RR, ¶m) < 0)
436 - perror("Thread::entrypoint pthread_attr_setschedpolicy");
440 thread->finished = true;
441 if( !thread->synchronous ) {
442 diff --git a/cinelerra-5.1/guicast/thread.h b/cinelerra-5.1/guicast/thread.h
443 index 216ecd2b..8ebec237 100644
444 --- a/cinelerra-5.1/guicast/thread.h
445 +++ b/cinelerra-5.1/guicast/thread.h
448 #include <sys/syscall.h>
450 -static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
451 +static inline long gettid() { return (long)pthread_self(); }
453 // The thread does not autodelete by default.
454 // If autodelete is 1 the thread autodeletes.
455 diff --git a/cinelerra-5.1/plugins/Makefile b/cinelerra-5.1/plugins/Makefile
456 index 6ed357c7..56081181 100644
457 --- a/cinelerra-5.1/plugins/Makefile
458 +++ b/cinelerra-5.1/plugins/Makefile
459 @@ -31,7 +31,6 @@ DIRS = $(OPENCV_OBJS) \
467 @@ -161,6 +160,8 @@ DIRS = $(OPENCV_OBJS) \
474 PLUGIN_DIR = $(BINDIR)/plugins
475 DATA = $(PLUGIN_DIR)/fonts $(PLUGIN_DIR)/shapes
476 diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C
477 index fefbbdb1..045e96d4 100644
478 --- a/cinelerra-5.1/plugins/titler/titler.C
479 +++ b/cinelerra-5.1/plugins/titler/titler.C
485 -#include <byteswap.h>
486 +#include <sys/endian.h>
488 #include <sys/stat.h>
489 #include <fontconfig/fontconfig.h>