ffmpeg: execute with more options - command-line

I installed FFMPEG using apt-get. It comes by default compiled with some options:
configuration: --enable-gpl --enable-pp --enable-swscaler --enable-pthreads
--enable-libvorbis --enable-libtheora --enable-libogg --enable-libgsm
--enable-dc1394 --disable-debug --enable-shared --prefix=/usr
How can I execute it and add more options without recompiling it? I'm looking for a way to execute including the option: -enable libspeex1.

You don't. Changing those options requires recompiling.

Related

How build 64-bit version of libpq from source code?

I'm trying connect to PostgreSQL from C-code, and i have to build libpq from source, because i'm on AIX. I followed the steps in this comment
Where do i get libpq source?
but in result i got a 32-bit version of libpq.a, how build 64-bit version?
Compiling on AIX is harder than on other platforms...
Always create a script which you gradually improve till you get a working version. Possible start:
#!/bin/sh
#assuming gcc
GCCLIB=$(dirname $(gcc -maix64 -pthread -print-file-name=libgcc_s.a))
export CFLAGS='-maix64 -mtune=native -pthread'
export CPPFLAGS='-D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_ALL_SOURCE'
export LDFLAGS="-maix64 -Wl,-brtl -Wl,-blibpath:/usr/local/lib64:${GCCLIB}:/usr/lib -L/usr/local/lib64 -pthread"
export OBJECT_MODE=64
./configure --prefix=/usr/local \
--libdir=/usr/local/lib64 \
--enable-shared \
--enable-static \
2>&1 | tee log.configure
make all 2>&1 | tee log.make.all
make install 2>&1 | tee log.make.install
The -q64 compiler option enables 64 bit (there is info in the compiler docs)
A quick google search of xlC 64 bit gives this link which you might find helpful.
http://northstar-www.dartmouth.edu/doc/ibmcxx/en_US/doc/complink/tasks/tubld64a.htm

Cannot build gtk on windows

I have an installation of minGW which works well for building straightfowrd C++ programs.
Now I am installing GTK, following the instructions here: http://www.gtk.org/download/win32_tutorial.php
I have grabbed a GTK hellow world program from here: https://developer.gnome.org/gtk-tutorial/stable/c39.html#SEC-HELLOWORLD
but when I try to build it, using this command
C:\Users\James\code\smartone>gcc -o hello.exe gtk_hello_world.c -mms-bitfields
IC:/gtk/include/gtk-3.0 -IC:/gtk/include/cairo -IC:/gtk/include/pango-1.0 -IC:/
tk/include/atk-1.0 -IC:/gtk/include/cairo -IC:/gtk/include/pixman-1 -IC:/gtk/in
lude -IC:/gtk/include/freetype2 -IC:/gtk/include -IC:/gtk/include/libpng15 -IC:
gtk/include/gdk-pixbuf-2.0 -IC:/gtk/include/libpng15 -IC:/gtk/include/glib-2.0
IC:/gtk/lib/glib-2.0/include -LC:/gtk/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshe
l32 -lole32 -Wl,-luuid -lpangocairo-1.0 -lpangoft2-1.0 -lfreetype -lfontconfig
lpangowin32-1.0 -lgdi32 -lpango-1.0 -lm -latk-1.0 -lcairo-gobject -lcairo -lgdk
pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0
I get these errors
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: skipping incompatible C:/gtk/lib/libgtk-3.dll.a when searching
for -lgtk-3
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: skipping incompatible C:/gtk/lib/libgtk-3.dll.a when searching
for -lgtk-3
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mi
ngw32/bin/ld.exe: cannot find -lgtk-3
... etc, etc, etc
What have I missed?
You are using a 64 bits compiler. Build with your 64 bits compiler in 32 bits mode with gcc's -m32 option.

How can build postgresql with LOCK_DEBUG enabled?

I have been strugglling to build posqlgresql 9.1 with trace_locks on so I can check the memory addresses used by the locks, but after a couple of days effort, I still haven't made any progress.
to compile:
./configure --prefix=/usr/local/pgsql --enable-depend --enable-cassert --enable-debug
make
make install
According to postgresql documentation, LOCK_DEBUG should be set at compile time,
./configure --prefix=/usr/local/pgsql --enable-depend --enable-cassert --enable-debug LOCK_DEBUG='on'
but it doesn't seem like working.
Please help! Thanks!!!
I think you just want to get -DLOCK_DEBUG into the compiler flags, try it like this:
./configure \
--prefix=/usr/local/pgsql \
--enable-depend --enable-cassert \
--enable-debug \
CPPFLAGS='-DLOCK_DEBUG'
I added the backslashes to make it easier to read, you can use this if you want it all in one line:
./configure --prefix=/usr/local/pgsql --enable-depend --enable-cassert --enable-debug CPPFLAGS='-DLOCK_DEBUG'
You can find examples of similar things in the installation documentation, just search for "CFLAGS":
You can specify environment variables on the configure command line, for example:
./configure CC=/opt/bin/gcc CFLAGS='-O2 -pipe'

Cross Compile perl for ARM

I'm attempting to cross compile the perl interpreter for an ARM architecture (FriendlyARM Micro2440). I'm using the ARM-Linux GCC 4.4.3 cross-compiler provided by the manufacturer. The board is running Linux 2.6.
I was able to cross-compile a basic "Hello World" application successfully, and it ran on the target machine.
I've downloaded the perl v5.12.3 source. I was able to do a normal compilation of perl for Ubuntu. I'm now attempting to do a cross-compilation for the ARM board. I'm working out of the perl-5.12.3/Cross folder in the source download.
make patch succeeded, but when I run make perl it fails with this
LD_LIBRARY_PATH=/home/reed022/.local/share/Trash/files/perl-5.2.12.3 arm-linux-gcc -o miniperl \
gv.o toke.o perly.o pad.o regcomp.o dump.o util.o mg.o reentr.o mro.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o \
miniperlmain.o opmini.o perlmini.o -lnsl -ldl -lm -lcrypt -lutil -lc
LD_LIBRARY_PATH=/home/reed022/.local/share/Trash/files/perl-5.2.12.3 ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest
./miniperl: 1: Syntax error: word unexpected (expecting ")")
I think the relevant part of the output is the ./miniperl -w -Ilib -MExporter -e '<?>' || make minitest part. Though I'm not sure. It seems confusing to me that the cross-compilation environment would try to run tests, since it's targeting a different system than the one it's being built on.
I'm completely lost as where to go from here. The people I've talked to haven't had much experience with cross-compiling programs.
UPDATE
I decided to delete the perl source folder and re-extract it, thinking that the previous compilation of perl for the Ubuntu host machine might have been messing with the current cross-compilation. I'm now getting a different but similar error.
`sh cflags "optimize='-O2'" generate_uudmap.o` -fexpensive-optimizations -fomit-frame-pointer -O2 -march=armv4 -mtune=strongarm1100 generate_uudmap.c
CCCMD = arm-linux-gcc -DPERL_CORE -c -fexpensive-optimizations -fomit-frame-pointer -O2 -march=armv4 -mtune=strongarm1100 -O2 -Wall
arm-linux-gcc -o generate_uudmap generate_uudmap.o -lnsl -ldl -lm -lcrypt -lutil -lc
./generate_uudmap uudmap.h bitcount.h
./generate_uudmap: 1: Syntax error: word unexpected (expecting ")")
make[1]: *** [bitcount.h] Error 2
make[1]: Leaving directory `/home/reed022/Downloads/perl-5.12.3'
make[1]: Entering directory `/home/reed022/Downloads/perl-5.12.3'
make[1]: *** No rule to make target `more'. Stop.
make[1]: Leaving directory `/home/reed022/Downloads/perl-5.12.3'
make: *** [perl] Error 2
Apparently the way to cross compile perl is not to do it under the Cross directory. I needed to pass flags to Configure to set it up. I also needed to setup the ARM computer with an SSH server (I used dropbear). The flags I used are
sh ./Configure
-Dusecrosscompile
-Dtargethost=<IP of ARM computer>
-Dtargetuser=<user name>
-Dtargetarch=arm-linux
-Dcc=arm-linux-gcc
-Dusrinc=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/include/
-Dincpth=/opt/FriendlyARM/toolschain/4.4.3/arm-none-linux-gnueabi/include/
-Dlibpth=/opt/FriendlyARM/toolschain/4.4.3/lib
-Dtargetdir=/sdcard/perl
The easiest way to cross-compile perl for arm is to use perl-cross.
Alex Suykov developed a set of patches for perl that works around the requirement to have a target machine available. Part of the solution is avoiding make test since the host can't run cross-compiled code anyway.
I used arm-unknown-linux-uclibcgnueabi as my target (to match my buildroot toolchain), but otherwise the directions for perl 5.18.0 worked just fine.
Alex last updated the github repository on April 23, 2014, so this project is still relatively active.

FFMPEG won't configure for iPhone

I have downloaded FFMPEG via svn, and put the gas-preprocessor into usr/local/bin. But, when I try to post the following code into terminal, it says: -bash: ./configure: No such file or directory
This is the code:
./configure
--cc=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor.pl /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc'
--sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.sdk --enable-cross-compile --target-os=darwin --arch=arm --cpu=arm1176jzf-s --disable-pic --enable-gpl --enable-postproc --disable-debug --disable-stripping --enable-avfilter --enable-avfilter-lavf --extra-cflags='-arch armv6' --extra-ldflags='-arch armv6'
I am using Snow Leopard 10.6.1. What am I doing wrong?
Sometimes the shell script you're trying to run has the wrong path for the hashbang at the top of the file (which is then reported correctly but ambiguously as a missing file). Open up the configure script and check the path it's trying to run.
For example, take a look at the top of this configure script:
[on mymachine in directory sqsh-2.1.5]$ head -3 configure
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59.
If for some reason /bin/sh does not exist, you'll get a file not found error.
The error is that it's not finding "configure" in the shell's current directory. What's your current working directory when you run this?