geoffleach has asked for the wisdom of the Perl Monks concerning the following question:

I'm working on a new release of Audio::TagLib. I'd like to enable installing on Windows or Mac(Darwin). I don't have competence in or access to either. Here's what I have so far in Makefile.PL. I'd appreciate input or pointers to a tutorial. Regards.

# Configure libraries chomp(my $libs = qx{taglib-config --libs}); # Configure compile flags chomp(my $cflags = qx{taglib-config --cflags}); # Configure includes # ./include has a needed .h my $inc = " -I./include $cflags"; # Configure various os-es my ($define, $ldd); if ( $Config{'osname'} eq 'darwin' ) { $inc = ' -I/opt/local/include ' . $inc; $libs = "-L/opt/local/lib -L/System/Library/Perl/lib $libs" . ' -lperl -liconv'; $ldd = "-bundle -undefined dynamic_lookup -dynamiclib $libs"; $define = '-D_BSD_ICONV -DNO_DOXYGEN'; } elsif ( $Config{'osname'} eq 'freebsd' ) { $ldd = " -shared $libs"; $define = '-D_BSD_ICONV -DNO_DOXYGEN'; } else { # Windows?? $ldd = " -shared $libs"; $define = '-DNO_DOXYGEN'; }

Replies are listed 'Best First'.
Re: Makefile.PL for Windows, Darwin
by Corion (Patriarch) on Mar 20, 2011 at 16:09 UTC

    I think you better ask Config about what the LDDflags, CCflags and other flags for the C compiler should be, for the particular version of Perl your Makefile.PL is run under, instead of hardcoding some wild guesses.

    Update: Actually, it seems that Config doesn't really talk about what is available. Config.pm makes the output of perl -V available as a convenient hash.

      I hadn't realized that. If true, it would be ideal. Hardcoding options is indeed a very bad idea.

      The POD for Config.pm's cc* variables is somewhat obscure. Probably worth a try.

      Thanks.
Re: Makefile.PL for Windows, Darwin
by syphilis (Archbishop) on Mar 21, 2011 at 07:58 UTC
    Looks to me that the major issue on Windows will be getting the taglib library built. Are there binaries available somewhere ?

    I tried building version 1.7, but didn't get very far.
    First up, the build process is apparently capable of accommodating MS Compilers only - my attempts at using the MinGW port of gcc and mingw32-make were not at all successful. So I fired up a couple of my MS compilers and tried using cmake with them, but the attempts failed for a variety of reasons.

    I notice that the current Audio::TagLib Makefile.PL specifies that taglib-1.4 must be used. Yet, according to the website Windows support didn't commence until taglib-1.5.

    If I can get hold of a taglib library for windows, I might be able to help out.

    Cheers,
    Rob
      Hmmm ... well, it's complicated.

      The current version of Audio::Taglib indeed supports only taglib 1.4, and not very well at that.

      I'm working on support for taglib 1.5 based on the development release of Audio::Taglib that was made by the original author. When I'm comfortable with that, I'll release it and go on to taglib 1.6.3 (current Fedora 14 RPM) and then on to taglib 1.7 (sigh!)

      A Windows platform would be a big help. Perhaps you can find binaries for 1.6.3 or 1.5?