more build tweaks for bsd
authorGood Guy <good1.2guy@gmail.com>
Fri, 6 Jul 2018 03:59:25 +0000 (21:59 -0600)
committerGood Guy <good1.2guy@gmail.com>
Fri, 6 Jul 2018 03:59:25 +0000 (21:59 -0600)
cinelerra-5.1/Makefile.am
cinelerra-5.1/bsd.bld
cinelerra-5.1/bsd.patch
cinelerra-5.1/cinelerra/formattools.C
cinelerra-5.1/cinelerra/interlacemodes.C
cinelerra-5.1/cinelerra/recordmonitor.C
cinelerra-5.1/cinelerra/videodevice.C
cinelerra-5.1/configure.ac

index 9b78846c3ec2ca32d7ccfdd8a801d25e7044cb6d..99124da13fca1a16a9151978f3de5d0b137d0437 100644 (file)
@@ -23,16 +23,17 @@ clean-generic:
 
 inst_sh := $(CURDIR)/inst.sh
 
-install:       binstall $(sinstall)
+install:       bin_install $(MAK_INSTALLS)
 
-uninstall:     buninstall $(suninstall)
+uninstall:     bin_uninstall $(MAK_UNINSTALLS)
 
 .PHONY:        binstall cinstall cuninstall dinstall
 export mkinstalldirs install_sh inst_sh
 
 # install to bin
-binstall:      install-recursive
-       cp -a COPYING README models Cinelerra_factory ffmpeg msg info tips bin/.
+bin_install:   install-recursive
+       cp -a COPYING README models Cinelerra_factory ffmpeg msg info tips \
+               lv2_blacklist.txt bin/.
        sed -e 's/\<cin\>/$(WANT_CIN)/g' < image/cin.desktop \
                > "bin/applications/$(WANT_CIN).desktop"
        cp -a image/cin.svg "bin/pixmaps/$(WANT_CIN)".svg
@@ -43,47 +44,69 @@ binstall:   install-recursive
          cp -a $$d bin/plugins/picon/.; \
        done
        -cp -a db/utils/new_db "bin/cin_db"
-       cp -av lv2_blacklist.txt bin/.
 
-buninstall:
+bin_uninstall:
        rm -rf bin
 
 # with system_build
-cinstall:
-       cd bin; $(inst_sh) "$(DESTDIR)$(bindir)" "$(WANT_CIN)" \
-               cin_db zmpeg3{cat,cc2txt,ifochk,show,toc}
-       cd bin; $(inst_sh) "$(DESTDIR)$(WANT_CINLIB_DIR)" \
-               bdwrite cutads lv2ui
-       -cd bin; $(inst_sh) "$(DESTDIR)$(WANT_CINLIB_DIR)" \
-               hveg2enc mpeg2enc mplex mplexlo
+sys_install: $(CIN_INSTALLS)
+       cd bin; $(inst_sh) "$(DESTDIR)$(bindir)" "$(WANT_CIN)" bdwrite
        cd bin; $(inst_sh) "$(DESTDIR)$(datadir)/$(WANT_CIN)" \
-               COPYING README models Cinelerra_factory ffmpeg msg info tips doc \
-               lv2 lv2_blacklist.txt
+               COPYING README models Cinelerra_factory ffmpeg msg info tips doc
        cd bin/locale; $(inst_sh) "$(DESTDIR)$(localedir)" .
        cd bin/plugins; $(inst_sh) "$(DESTDIR)$(WANT_PLUGIN_DIR)" .
-       cd bin/ladspa; $(inst_sh) "$(DESTDIR)$(WANT_LADSPA_DIR)" .
        cd bin/applications; $(inst_sh) "$(DESTDIR)$(datadir)/applications" .
        cd bin/pixmaps; $(inst_sh) "$(DESTDIR)$(datadir)/pixmaps" .
 
-cuninstall:
+sys_uninstall: $(CIN_UNINSTALLS)
        rm -f "$(DESTDIR)$(bindir)/$(WANT_CIN)"
-       rm -f "$(DESTDIR)$(bindir)"/zmpeg3{cat,cc2txt,ifochk,show,toc}
-       rm -f "$(DESTDIR)$(bindir)/cin_db"
        rm -rf "$(DESTDIR)$(WANT_CINLIB_DIR)"
        rm -rf "$(DESTDIR)$(datadir)/$(WANT_CIN)"
        rm -rf "$(DESTDIR)$(localedir)"/*/"LC_MESSAGES/$(WANT_CIN).mo"
        rm -rf "$(DESTDIR)$(WANT_PLUGIN_DIR)"
-       rm -rf "$(DESTDIR)$(WANT_LADSPA_DIR)"
        rm -f "$(DESTDIR)$(datadir)/applications/$(WANT_CIN).desktop"
        rm -f "$(DESTDIR)$(datadir)/pixmaps/$(WANT_CIN)".{svg,xpm}
 
 # without system_build
-dinstall:
+dvl_install:
        cp Makefile.devel Makefile
 
-duninstall:
+dvl_uninstall:
        rm -f Makefile
 
+# with-libzmpeg3
+zmp_install:
+       cd bin; $(inst_sh) "$(DESTDIR)$(bindir)" \
+               zmpeg3{cat,cc2txt,ifochk,show,toc}
+       cd bin; $(inst_sh) "$(DESTDIR)$(WANT_CINLIB_DIR)" \
+               hveg2enc mpeg2enc mplex mplexlo
+
+zmp_uninstall:
+       rm -f "$(DESTDIR)$(bindir)"/zmpeg3{cat,cc2txt,ifochk,show,toc}
+
+# with-commercial
+com_install:
+       cd bin; $(inst_sh) "$(DESTDIR)$(bindir)" cin_db
+       cd bin; $(inst_sh) "$(DESTDIR)$(WANT_CINLIB_DIR)" cutads
+
+com_uninstall:
+       rm -f "$(DESTDIR)$(bindir)/cin_db"
+
+# with-ladspa
+lad_install:
+       cd bin/ladspa; $(inst_sh) "$(DESTDIR)$(WANT_LADSPA_DIR)" .
+
+lad_uninstall:
+       rm -rf "$(DESTDIR)$(WANT_LADSPA_DIR)"
+
+# with-lv2
+lv2_install:
+       cd bin; $(inst_sh) "$(DESTDIR)$(WANT_CINLIB_DIR)" lv2ui
+       cd bin; $(inst_sh) "$(DESTDIR)$(datadir)/$(WANT_CIN)" \
+               lv2 lv2_blacklist.txt
+
+lv2_uninstall:
+
 val-%:
        @echo $($(subst val-,,$@))
 
index e765a0dc832d63d831b444b17305e988a1c1b5ec..3707579c1cda9a2824f3da1e20fbb585b2e99b2e 100755 (executable)
@@ -9,7 +9,7 @@ alias make=gmake
 ./autogen.sh
 CC=clang CXX=clang++ CFLAGS="-g -O2 -DFFMPEG3" ./configure --with-single-user \
     --disable-static-build --without-lv2 --disable-lame --disable-twolame \
-    --with-oss --without-gl --without-firewire --without-dv --without-dvb \
-    --without-video4linux2 --without-xxf86vm --without-ladspa-build \
+    --with-oss --without-alsa --without-gl --without-firewire --without-dv \
+    --without-dvb --without-video4linux2 --without-xxf86vm --without-ladspa-build \
     --without-libzmpeg --without-commercial --without-thirdparty
 gmake 2>&1 | tee log
index 1af225122f8f4115f85039dac18d501edfec34ee..f6841bdaf29a02c2c48f6144488c92abd8e6500a 100644 (file)
@@ -1,3 +1,16 @@
+diff --git a/cinelerra-5.1/Makefile.devel b/cinelerra-5.1/Makefile.devel
+index a12d8f2b..f892f648 100644
+--- a/cinelerra-5.1/Makefile.devel
++++ b/cinelerra-5.1/Makefile.devel
+@@ -4,7 +4,7 @@ TOPDIR := $(CURDIR)
+ CFLAGS ?= -ggdb
+ export CFLAGS_ := $(CFLAGS)
+-cpus:=$(shell grep -c "^proc" /proc/cpuinfo)
++cpus:=$(shell sysctl -n hw.ncpu)
+ jobs:=-j$(shell echo $$(($(cpus) + $(cpus)/2 +2)))
+ MAKEJ := $(MAKE) $(jobs)
 diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile
 index 18590e3a..a60c71d1 100644
 --- a/cinelerra-5.1/cinelerra/Makefile
@@ -216,6 +229,15 @@ index 6fba32bb..ccdb683b 100644
  
  AC_DEFUN([CHECK_WITH], [
  AC_ARG_WITH([$1],
+@@ -126,7 +137,7 @@ AC_SUBST(MAK_INSTALLS)
+ AC_SUBST(MAK_UNINSTALLS)
+ if test "x$WANT_JOBS" = "xauto"; then
+-  CPUS=`grep -c "^proc" /proc/cpuinfo`
++  CPUS=`sysctl -n hw.ncpu`
+   WANT_JOBS=`expr $CPUS + $CPUS / 2 + 2`
+ fi
 diff --git a/cinelerra-5.1/db/tdb.h b/cinelerra-5.1/db/tdb.h
 index 8ee88002..9a17091e 100644
 --- a/cinelerra-5.1/db/tdb.h
@@ -259,10 +281,48 @@ index 40f5971f..73d47586 100644
        float* get_values();
  
 diff --git a/cinelerra-5.1/guicast/bcresources.C b/cinelerra-5.1/guicast/bcresources.C
-index e3400600..3cf616f8 100644
+index e3400600..b32d0a6f 100644
 --- a/cinelerra-5.1/guicast/bcresources.C
 +++ b/cinelerra-5.1/guicast/bcresources.C
-@@ -695,7 +695,7 @@ new_vframes(20,default_medium_7segment,
+@@ -38,6 +38,7 @@
+ #include <iconv.h>
+ #include <sys/ipc.h>
+ #include <sys/shm.h>
++#include <sys/sysctl.h>
+ #include <X11/extensions/XShm.h>
+ #include <fontconfig/fontconfig.h>
+ #include <fontconfig/fcfreetype.h>
+@@ -297,23 +298,12 @@ int BC_Resources::machine_cpus = 1;
+ int BC_Resources::get_machine_cpus()
+ {
+-      int cpus = 1;
+-      FILE *proc = fopen("/proc/cpuinfo", "r");
+-      if( proc ) {
+-              char string[BCTEXTLEN], *cp;
+-              while(!feof(proc) && fgets(string, sizeof(string), proc) ) {
+-                      if( !strncasecmp(string, "processor", 9) &&
+-                          (cp = strchr(string, ':')) != 0 ) {
+-                              int n = atol(cp+1) + 1;
+-                              if( n > cpus ) cpus = n;
+-                      }
+-                      else if( !strncasecmp(string, "cpus detected", 13) &&
+-                          (cp = strchr(string, ':')) != 0 )
+-                              cpus = atol(cp+1);
+-              }
+-              fclose(proc);
+-      }
+-      return cpus;
++      int mib[2], ncpu;
++      size_t len = sizeof(ncpu);
++      mib[0] = CTL_HW;
++      mib[1] = HW_NCPU;
++      if( sysctl(mib, 2, &ncpu, &len, 0, 0) ) ncpu = 1;
++      return ncpu;
+ }
+ void BC_Resources::new_vframes(int n, VFrame *vframes[], ...)
+@@ -695,7 +685,7 @@ new_vframes(20,default_medium_7segment,
        generic_button_margin = 15;
        draw_clock_background=1;
  
@@ -271,7 +331,7 @@ index e3400600..3cf616f8 100644
        shm_reply = 1;
  
  // Initialize
-@@ -1681,6 +1681,87 @@ BC_FontEntry *BC_Resources::find_fontentry(const char *displayname, int style,
+@@ -1681,6 +1671,87 @@ BC_FontEntry *BC_Resources::find_fontentry(const char *displayname, int style,
        return style_match;
  }
  
@@ -359,7 +419,7 @@ index e3400600..3cf616f8 100644
  size_t BC_Resources::encode(const char *from_enc, const char *to_enc,
        char *input, int input_length, char *output, int output_length)
  {
-@@ -1688,10 +1769,12 @@ size_t BC_Resources::encode(const char *from_enc, const char *to_enc,
+@@ -1688,10 +1759,12 @@ size_t BC_Resources::encode(const char *from_enc, const char *to_enc,
        iconv_t cd;
        char *outbase = output;
  
@@ -374,7 +434,7 @@ index e3400600..3cf616f8 100644
                to_enc = "UTF-8";
  
        if(input_length < 0)
-@@ -1701,32 +1784,45 @@ size_t BC_Resources::encode(const char *from_enc, const char *to_enc,
+@@ -1701,32 +1774,45 @@ size_t BC_Resources::encode(const char *from_enc, const char *to_enc,
  
        if(strcmp(from_enc, to_enc) && inbytes)
        {
index 487019980b867314b802ed947da6ff9c076bc903..312f39c8bb218776556fb6584ec28f4c883855ec 100644 (file)
@@ -27,7 +27,9 @@
 #include "filesystem.h"
 #include "formattools.h"
 #include "language.h"
+#ifdef HAVE_DV
 #include "libdv.h"
+#endif
 #include "libmjpeg.h"
 #include "maxchannels.h"
 #include "mwindow.h"
@@ -260,11 +262,12 @@ void FormatTools::update_driver(int driver)
                        format_text->update(File::formattostr(asset->format));
 
                        switch(driver) {
+#ifdef HAVE_DV
                        case CAPTURE_IEC61883:
                        case CAPTURE_FIREWIRE:
                                locked_compressor = (char*)CODEC_TAG_DVSD;
                                break;
-
+#endif
                        case VIDEO4LINUX2JPEG:
                                locked_compressor = (char*)CODEC_TAG_MJPEG;
                                break;
index 4a1118ad931dda9bc18aa98257d1d4567b7c141d..cb2c74d6e1e4f239a58cd2b2ddc8428dfc336617 100644 (file)
 #define HAVE_STDINT_H
 #endif /* HAVE_STDINT_H */
 
-#include "mjpegtools/yuv4mpeg.h"
+#define Y4M_UNKNOWN -1
+#define Y4M_ILACE_NONE          0   /* non-interlaced, progressive frame */
+#define Y4M_ILACE_TOP_FIRST     1   /* interlaced, top-field first       */
+#define Y4M_ILACE_BOTTOM_FIRST  2   /* interlaced, bottom-field first    */
+#define Y4M_ILACE_MIXED         3   /* mixed, "refer to frame header"    */
+
 #include "interlacemodes.h"
 
 // AUTO FIX METHOD ====================
index 16a4da866deca509bbd550dd5fd23dd9b0234301..aa10ec0d26e045b69f3e9af8b5dfc2b5062054d0 100644 (file)
@@ -25,7 +25,9 @@
 #include "condition.h"
 #include "cursors.h"
 #include "devicedvbinput.h"
+#ifdef HAVE_DV
 #include "libdv.h"
+#endif
 #include "edl.h"
 #include "edlsession.h"
 #include "keys.h"
index e8de98ca9862c70759c74203a61cefe0112504a7..0a9c77995dae8a059e9c116dbb84d21f68a50f25 100644 (file)
@@ -29,7 +29,9 @@
 #include "edl.h"
 #include "edlsession.h"
 #include "file.inc"
+#ifdef HAVE_DV
 #include "libdv.h"
+#endif
 #include "libmjpeg.h"
 #include "mainmenu.h"
 #include "mutex.h"
@@ -349,11 +351,12 @@ void VideoDevice::fix_asset(Asset *asset, int driver)
 // Fix asset using legacy routine
        const char *vcodec = 0;
        switch(driver) {
+#ifdef HAVE_DVB
        case CAPTURE_IEC61883:
        case CAPTURE_FIREWIRE:
                vcodec = CODEC_TAG_DVSD;
                break;
-
+#endif
        case VIDEO4LINUX2JPEG:
                vcodec = CODEC_TAG_MJPEG;
                break;
index 6fba32bb011683640a4571ce010b7517555a2eb0..94f9b38249bbae0b4bd56ff03a40b440f33a4d77 100644 (file)
@@ -70,8 +70,6 @@ if test "x$WANT_CINBIN_BUILD" = "xyes"; then
   test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR='$$CIN_PATH'
   test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR='$$CIN_LIB/plugins'
   test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR='$$CIN_LIB/ladspa'
-  sinstall=dinstall
-  suninstall=duninstall
 else
   lcldir=`test "x$prefix" = "xNONE" && prefix=$ac_default_prefix; \
     test "x$exec_prefix" = "xNONE" && exec_prefix="${prefix}"; \
@@ -94,11 +92,38 @@ else
   test "x$WANT_CINLIB_DIR" = "xauto" && WANT_CINLIB_DIR="$usrlib/$WANT_CIN"
   test "x$WANT_PLUGIN_DIR" = "xauto" && WANT_PLUGIN_DIR="$WANT_CINLIB_DIR/plugins"
   test "x$WANT_LADSPA_DIR" = "xauto" && WANT_LADSPA_DIR="$WANT_CINLIB_DIR/ladspa"
-  sinstall=cinstall
-  suninstall=cuninstall
 fi
-AC_SUBST(sinstall)
-AC_SUBST(suninstall)
+
+CIN_INSTALLS=""
+CIN_UNINSTALLS=""
+if test "x$WANT_LIBZMPEG" = "xyes"; then
+  CIN_INSTALLS+=" zmp_install"
+  CIN_UNINSTALLS+=" zmp_uninstall"
+fi
+if test "x$WANT_COMMERCIAL" = "xyes"; then
+  CIN_INSTALLS+=" com_install"
+  CIN_UNINSTALLS+=" com_uninstall"
+fi
+if test "x$WANT_LADSPA_BUILD" = "xyes"; then
+  CIN_INSTALLS+=" lad_install "
+  CIN_UNINSTALLS+=" lad_uninstall "
+fi
+if test "x$WANT_LV2" = "xyes"; then
+  CIN_INSTALLS+=" lv2_install "
+  CIN_UNINSTALLS+=" lv2_uninstall "
+fi
+AC_SUBST(CIN_INSTALLS)
+AC_SUBST(CIN_UNINSTALLS)
+
+if test "x$WANT_CINBIN_BUILD" = "xyes"; then
+  MAK_INSTALLS="dvl_install"
+  MAK_UNINSTALLS="dvl_uninstall"
+else
+  MAK_INSTALLS=" sys_install"
+  MAK_UNINSTALLS="sys_uninstall"
+fi
+AC_SUBST(MAK_INSTALLS)
+AC_SUBST(MAK_UNINSTALLS)
 
 if test "x$WANT_JOBS" = "xauto"; then
   CPUS=`grep -c "^proc" /proc/cpuinfo`