Monday, April 09, 2012

Gotcha of the Day: Building Handbrake on CentOS

Building Handbrake on CentOS started off painlessly enough. I just followed the instructions here. But then I ran into this compilation error:

set -e; cd ./contrib/libvorbis/aotuv-b6.03_20110424/; rm -fr aclocal.m4 autom4te.cache configure; autoreconf -I m4 -fiv; CC=/usr/bin/gcc CFLAGS="" CXX=/usr/bin/g++ CXXFLAGS="" CPPFLAGS="" LDFLAGS="" PKG_CONFIG_PATH="/home/ben/util/src/HandBrake-0.9.6/build/contrib/lib/pkgconfig" ./configure --prefix=/home/ben/util/src/HandBrake-0.9.6/build/contrib/ --disable-dependency-tracking --disable-shared --enable-static --with-ogg=/home/ben/util/src/HandBrake-0.9.6/build/contrib/ HAVE_PKG_CONFIG="no"
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force 
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: running: /usr/bin/autoconf --include=m4 --force
configure.ac:215: error: possibly undefined macro: AC_ADD_CFLAGS
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
make: *** [contrib/libvorbis/.stamp.configure] Error 1

A Google and Forum search turned up no reports of anyone else with this issue. Yet, even the latest version of the source code from SVN turned up the same issue.

The fix turned out to be as follows. I edited the file:

 ./contrib/libvorbis/module.defs

and changed:

 LIBVORBIS.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache configure; autoreconf -I m4 -fiv;

to:

LIBVORBIS.CONFIGURE.bootstrap = rm -fr aclocal.m4 autom4te.cache configure; sh autogen.sh;

(and yes, that trailing ';' is necessary)

Not sure why I'm the only one running into this. But, regardless, here's a fix.

12 comments:

  1. Anonymous2:38 PM

    This helped me so thanks I now have Handbrake0.9.6
    running on centos 6. Once I made change you outlined above I received an ogg not found error This was resolved by downloading and compiling libogg-1.3.0

    so nice one!

    ReplyDelete
  2. Anonymous5:41 PM

    Wow. I've been banging my head against the wall for months trying to solve this. Thanks. If it makes you feel any better you're not the only one having this problem.

    ReplyDelete
  3. Anonymous8:08 AM

    Thanks for the solution! Worked like a charm, and handbrake is compiled now :)

    ReplyDelete
  4. Thanks - glad to help!

    ReplyDelete
  5. Anonymous5:46 AM

    HALLA-FREAKIN-LOU-YUH!!!! Thank you so much for the fix. I had overlooked the OTHER contrib directory and would have never figured this one out on my own. I got a few more errors due to missing *-devel rpms but success would not be denied! Why this problem doesn't seem to be more widespread is interesting.

    ReplyDelete
  6. Here's another thank you! I've been wrestling with this on Oracle Linux 6.3 for the past week. Now I have my handbrake back - hurrah!

    ReplyDelete
  7. Anonymous3:12 AM

    Thanks so much for sharing this tip, you're saving us all a heck of a lot of time!

    ReplyDelete
  8. Anonymous3:14 PM

    You made my day! Beer on me. :)

    ReplyDelete
  9. Anonymous9:37 AM

    thanks!

    ReplyDelete
  10. Anonymous6:00 PM

    This problem is still there on CentOS 6.4 (updated from 6.3) and HandBrake 0.9.8 as of Mar 29th, 2013. (Your blog doesn't show dates on comments, only times. You might want to fix that. :))

    I also needed to install the following additional packages:

    libnotify-devel-0.5.0-1.el6.x86_64
    gstreamer-plugins-base-devel-0.10.29-2.el6.x86_64
    gstreamer-devel-0.10.29-1.el6.x86_64
    libgudev1-devel-147-2.46.el6.x86_64
    webkitgtk-devel-1.2.6-2.el6_0.x86_64
    gtk2-devel-2.18.9-12.el6.x86_64
    glib2-devel-2.22.5-7.el6.x86_64
    bzip2-devel-1.0.5-7.el6_0.x86_64
    libogg-devel-1.1.4-2.1.el6.x86_64
    fribidi-devel-0.19.2-2.el6.x86_64
    epel-release-6-8.noarch
    centos-release-cr-6-0.el6.centos.x86_64

    I think I got all of the above right; the list is based on "rpm -qa --last". There are many others due to dependencies, but they're not listed.

    These fixes should be part of HB methinks. I already have a couple of bug reports into them (for OSX) so another one in this regard will be easy.

    Thanks for your help!

    ReplyDelete
  11. Anonymous4:25 AM

    Thx man... perfect!

    ReplyDelete
  12. Anonymous4:59 AM

    haha,0.9.9 is all right.

    ReplyDelete