Compiling ReadyMedia (minidlna) on Mavericks OS X

Help
jangozo
2013-10-29
2013-11-23
  • jangozo
    jangozo
    2013-10-29

    Hi,

    I want to setup minidlna on my Mac (darwin 13.0.0) because it's the lightest and fastest DLNA server I've seen and plays effortlessly everything I've thrown at it. I had it installed before via macports but now it's not compiling anymore. I found out that minidlna is now supported on OS X, but it doesn't look so easy to setup as running "port install minidlna". I tried the binaries (minidlna_1.1.0_static.tar) but I couldn't run them probably because they weren't compiled for my version (no surprise). As the title says, I'm trying to compile minidlna but I'm getting some errors.
    Firstly after every run of the "./configure; make; make install" command I kept getting configure failure because some library is missing (ffmpeg, etc). The easiest way for me to install it is via macports so that's how I kept getting them. On the last ./configure I got this:

    /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
    Making all in po
      CC     getifaddr.o
    getifaddr.c:178:39: error: use of undeclared identifier 'IFF_SLAVE'
                            if (p->ifa_flags & (IFF_LOOPBACK | IFF_SLAVE))
                                                               ^
    1 error generated.
    make[2]: *** [getifaddr.o] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    Making install in po
    if test "minidlna" = "gettext-tools"; then \
              .././install-sh -c -d /usr/local/share/gettext/po; \
              for file in Makefile.in.in remove-potcdate.sin quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot   Makevars.template; do \
                /usr/bin/install -c -m 644 ./$file \
                                /usr/local/share/gettext/po/$file; \
              done; \
              for file in Makevars; do \
                rm -f /usr/local/share/gettext/po/$file; \
              done; \
            else \
              : ; \
            fi
      CC     getifaddr.o
    getifaddr.c:178:39: error: use of undeclared identifier 'IFF_SLAVE'
                            if (p->ifa_flags & (IFF_LOOPBACK | IFF_SLAVE))
                                                               ^
    1 error generated.
    make[1]: *** [getifaddr.o] Error 1
    make: *** [install-recursive] Error 1
    

    This looks like a bug to me and the guy here is saying some lines need to be added to the code. http://chris-labs.de/mac/2013/10/20/mac-install-minidlna-on-os-x.html

    I added them but now sudo make is giving me this:

    mac:minidlna-1.1.0 vladimir$ sudo make
    /Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
    Making all in po
      CC     metadata.o
      CC     scanner.o
      CCLD   minidlnad
    Undefined symbols for architecture x86_64:
      "_fget_le16", referenced from:
          __get_asffileinfo in tagutils.o
      "_fget_le32", referenced from:
          __get_asffileinfo in tagutils.o
      "_le16_to_cpu", referenced from:
          _utf16le_to_utf8 in textutils.o
          __asf_load_string in tagutils.o
          __asf_read_stream_object in tagutils.o
          __pick_dlna_profile in tagutils.o
      "_le32_to_cpu", referenced from:
          __asf_load_string in tagutils.o
          __asf_read_stream_object in tagutils.o
      "_le64_to_cpu", referenced from:
          __get_asffileinfo in tagutils.o
          __asf_load_string in tagutils.o
      "_strcatf", referenced from:
          _SendResp_resizedimg in upnphttp.o
          _SendResp_dlnafile in upnphttp.o
          _parse_sort_criteria in upnpsoap.o
          _BrowseContentDirectory in upnpsoap.o
          _SearchContentDirectory in upnpsoap.o
          _callback in upnpsoap.o
          _add_res in upnpsoap.o
          ...
      "_strncpyt", referenced from:
          _main in minidlna.o
          _readoptionsfile in options.o
          _GetAudioMetadata in metadata.o
          _GetImageMetadata in metadata.o
          _insert_file in scanner.o
          _start_scanner in scanner.o
          _update_if_album_art in albumart.o
          ...
      "_xasprintf", referenced from:
          _parse_nfo in metadata.o
          _GetAudioMetadata in metadata.o
          _GetImageMetadata in metadata.o
          _GetVideoMetadata in metadata.o
          __get_aacfileinfo in tagutils.o
          __get_mp3fileinfo in tagutils.o
          __get_pcmfileinfo in tagutils.o
          ...
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [minidlnad] Error 1
    make[1]: *** [all-recursive] Error 1
    make: *** [all] Error 2
    

    I'm stuck, please help.

    Regards,
    Vladimir

     
    Last edit: jangozo 2013-10-29
  • Cecil Coupe
    Cecil Coupe
    2013-10-30

    You are still missing a library or two. I don't have a Mac so I can't tell you which libs are missing from macports. You might be able to Google it up.

     
  • jangozo
    jangozo
    2013-10-30

    It turns out that the initial problem for me to install minidlna via macports was that I was missing the command line tools for Xcode. However I saw something strange which could be the root cause of the last error I showed.

    https://trac.macports.org/browser/trunk/dports/net/minidlna/Portfile

    post-patch {
    if {[string match "*clang*" ${configure.compiler}]} {
    reinplace "s|inline||g" ${worksrcpath}/utils.c ${worksrcpath}/tagutils/misc.c
            }
    

    This is the only difference from the sourceforge version and the macports version which worked. Developers please take a look.

    PS. The minidlna version from the site still didn't work after I installed the command line tools for Xcode.

     
  • py_zhu
    py_zhu
    2013-11-23

    It minidlna's bug.
    1. function was used before declared in taghandlers;
    2. inline key word may avoid generate symbols while compiling;
    3. patch is here, ignore change of metadata.c if you still use ffmpeg's old version;

    /* tagutils/tagutils.c */
    
    static taghandler taghandlers[] = {
        { "aac", _get_aactags, _get_aacfileinfo                                  },
        { "mp3", _get_mp3tags, _get_mp3fileinfo                                  },
        { "flc", _get_flctags, _get_flcfileinfo                                  },
        { "ogg", 0,            _get_oggfileinfo                                  },
        { "asf", 0,            _get_asffileinfo                                  },
        { "wav", _get_wavtags, _get_wavfileinfo                                  },
        { "pcm", 0,            _get_pcmfileinfo                                  },
        { NULL,  0 }
    };
    
    //*********************************************************************************
    #include "tagutils-misc.c"
    #include "tagutils-mp3.c"
    #include "tagutils-aac.c"
    #include "tagutils-ogg.c"
    #include "tagutils-flc.c"
    #include "tagutils-asf.c"
    #include "tagutils-wav.c"
    #include "tagutils-pcm.c"
    #include "tagutils-plist.c"
    
     
    Last edit: py_zhu 2013-11-23