glib-mkenums in glib 2

As many of you will know, GTK's MSVC project files have gotten quite a long way out of date now (presumably since Tor's departure, which was a great pity).  I'm trying to bring mine up-to-date so that they'll build from the latest GIT sources.  I'm starting with glib which is currently at version 2.35 I believe.

Along the way I thought I might as well make use of MSVC's ability to launch external programs and scripts which can be run before (and even during) the build process.  My hope was that I'd be able to make a Visual Studio project file that would do everything needed to build glib - including building those files that need to be auto-generated.  Everything seems to have worked fine, except for glib-mkenums.  glib-mkenums is a perl script that needs to get run from time to time to ensure that gio/gioenumtypes.c and gio/gioenumtypes.h are up-to-date.

Taking he header file as an example, it seems as if this command line should work:-

perl glib-mkenums --template <path_to_gioenumtypes.h.template>  >  <path_to_gioenumtypes.h>

Obviously, in the real example, those paths are the actual paths.  However, in fact, it consistently gives me this error output:-

/* Generated data (by glib-mkenums) */

Use of uninitialized value $_[0] in substitution (s///) at E:/Program Files/Perl/lib/File/ line 338.
fileparse(): need a valid pathname at glib-mkenums line 259

I'm not sure where Perl is up to these days but I'm running version 5.12.1.  Do I need to update Perl to a newer version or can anyone suggests anything else that might be causing this error?

I'm not hugely familiar with Perl but FWIW, here's how the script looks around line 259 of glib-mkenums:

if (length($fhead)) {
    my $prod = $fhead;
    my $base = basename ($ARGV[0]);   /* <---  THIS IS LINE 259 !! */

    $prod =~ s/\@filename\@/$ARGV[0]/g;
    $prod =~ s/\@basename\@/$base/g;
    $prod =~ s/\\a/\a/g; $prod =~ s/\\b/\b/g; $prod =~ s/\\t/\t/g; $prod =~ s/\\n/\n/g;
    $prod =~ s/\\f/\f/g; $prod =~ s/\\r/\r/g;
    chomp ($prod);
    print "$prod\n";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]