Friday, September 7, 2012

Building cdrkit for Windows

K3b_Oxygen_800px.pngcdrkit is another CD/DVD burning tool that was spun off from the cdrtools project. Some say cdrkit is inferior to cdrtools, but I haven't found a problem with cdrkit yet. Although I prefer cdrtools to cdrkit, I'd like to give cdrkit a try. To build cdrkit with MinGW, I had to compile some libraries first.




  1. zlib

    First, I compiled zlib:


    tar xzvf zlib-1.2.7.tar.gz
    cd zlib-1.2.7
    make -f win32/Makefile.gcc
    cp -iv zlib1.dll /mingw/bin
    cp -iv zconf.h zlib.h /mingw/include
    cp -iv libz.a /mingw/lib
    cp -iv libz.dll.a /mingw/lib


  2. POSIX threads for Win32

    New genisoimage seems to use pthread for making checksums. I compiled pthread like this:


    make clean GC
    cp -iv pthreadGC2.dll /mingw/bin
    cp -iv pthread.h semaphore.h sched.h /mingw/include/
    cp -iv libpthreadGC2.a /mingw/lib
    cp -iv libpthreadGC2.a /mingw/lib/libpthread.a


  3. PCRE

    Then, I compile PCRE:



    ./configure --prefix=/mingw --enable-pcre16 --enable-unicode-properties
    make
    make install
    cp /mingw/include/pcreposix.h /mingw/include/regex.h
    cp /mingw/lib/libpcreposix.a /mingw/lib/libregex.a
    cp /mingw/lib/libpcreposix.dll.a /mingw/lib/libregex.dll.a


  4. libmagic

    I built the open-source file command. I configured it like this:



    ./configure --prefix=/mingw


    Then, I added the following lines to config.h:



    #define WIN32 1
    #define MAGIC "magic"


    Compile libmagic:



    make && make install


    I got an error trying to build file.exe, so I modified src/Makefile:


    file_LDADD = libmagic.la /mingw/lib/libpcreposix.dll.a


  5. libiconv

    I built libiconv like this:


    ./configure --prefix=/mingw
    make
    make install


  6. CMake

    Then, I built CMake.


    ./bootstrap --prefix=/mingw
    make
    make install


  7. cdrkit

    I unpacked the cdrkit source and applied the patch that I found at the mailing list. Here are the modified patches of mine.





    I used the command below to applied the patch.



    patch -p1 -l < ../cdrkit-1.1.9-mingw.patch


    Then, I compiled cdrkit:



    cmake -G "MSYS Makefiles"
    make

    After successful build, I copied the executable files (*.exe) to my folder.




Issues and Fixes



  1. I got an error linking genisoimage. I edited genisoimage/CMakeLists.txt to resolve the issue:



    IF(USE_MAGIC)
    ADD_DEFINITIONS(-DUSE_MAGIC)
    LIST(APPEND EXTRA_LIBS "shlwapi")
    SET(MAGICLIBS magic)
    ENDIF(USE_MAGIC)


  2. I got errors compiling sha256.* and sha512.*. I made the following changes.



    • I removed all lines that read #include <endian.h>.
    • Assume the target machine is little endian.
    • change all occurrences of __THROW to __attribute__ ((__nothrow__)).


  3. The code in genisoimage/checksum.c gave me errors linking with pthread-w32. To fix it, I replaced a->thread with (a->thread).p.



  4. I found that genisoimage and readom still used /dev/null. I changed it to NUL in genisoimage.c and readom.c.





Download my cdrkit Build


Here's my cdrkit build for Windows.




Related Links




No comments:

Post a Comment

About This Blog

KBlog logo This blog is about current events and issues concerning general population. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

icon
Powered By Blogger