Tuesday, May 27, 2014

Makefile - Checking Build Compiler Version

Building executable from sources is made easy by Makefiles. If a build has to be done by checking the version of the build compiler, then the Makefile can be altered for that.

For example, building C sources using GCC compiler. If the C sources require the C++11 standard supported compiler, then the GCC compiler to be used should be greater than or equal to GCC-4.7. If the build environment has the GCC of version lesser than 4.7, then the build will fail.

For this case, the Makefile can be altered with the following check for GCC version:

GCCMAJORVERSIONGTE4 := $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 4)
GCCMINORVERSIONGTE7 := $(shell expr `gcc -dumpversion | cut -f2 -d.` \>= 7)

all:
ifeq ($(GCCMAJORVERSIONGTE4)$(GCCMINORVERSIONGTE7), 11)
        @echo BUILD
else
        @echo NO BUILD
endif

Wednesday, February 26, 2014

Taglist - A VIM Plugin for browsing the source code

Browsing the source codes in VIM can be made easy using the plugin "Taglist". It supports many programming languages like C, C++, C#, Python, Java etc. (for the complete list refer An intro on Taglist).

Download and install the taglist plugin for VIM from,
http://vim-taglist.sourceforge.net/

After installing the plugin, we can set taglist variables in the '~/.vimrc' file based on our requirement. For the details on taglist variables, refer taglist usage.

Some taglist variables in my '~/.vimrc',

"Set to automatically open the taglist window on VIM startup
let Tlist_Auto_Open = 1
"Set for the vim to exit when only the taglist window is present
let Tlist_Exit_OnlyWindow = 1
"Set for reducing the number of empty lines in the taglist window
let Tlist_Compact_Format = 1

Thursday, December 19, 2013

Playing .mkv files with DTS audio codec on Sony Bravia

I have already blogged on how to play mkv files on "Sony Bravia HD 3D LED KDL-40HX750" TV. But for playing mkv files with DTS audio codec, there is one extra step we have to do before converting the mkv files to the m2ts files.

We need to convert the DTS audio codec inside the mkv file to AC3 audio codec. This is because, the DTS audio codec is not supported by the Sony Bravia KDL-40HX750. I used the script mkvdts2ac3.sh by Jake Wharton and Chris Hoekstra. This script converts the DTS track in the mkv file to AC3 track. And the usage of this script is very simple.

Get the script mkvdts2ac3.sh (on my ubuntu 12.04 LTS) as follows:

wget https://raw.github.com/JakeWharton/mkvdts2ac3/master/mkvdts2ac3.sh

Give the mkv file with the DTS audio codec as the input to the script as shown below:

The conversion starts and gets completed by displaying the summary on the conversion process as shown below:

Now the mkv file can be converted to the m2ts file with only the AC3 audio codec.

Thus obtained m2ts file can be played on "Sony Bravia HD 3D LED KDL-40HX750" TV.