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

i have just upgraded to redhat 9, and was using 8.0 and the "8.1 beta" before this. i'm trying to install the CDB_File-0.92 module from CPAN. it worked correctly under 8.0, but with the beta version and now with 9, it generates the following:

> tar xvf CDB_File-0.92.tar.gz > cd CDB_File-0.92 > perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for CDB_File > make Makefile:82: *** missing separator. Stop.
looking at the Makefile it generated, i find the following...
76 INSTALLARCHLIB = /usr/lib/perl5/5.8.0/i386-linux-thread-multi 77 INSTALLSITEARCH = 78 INSTALLVENDORARCH = /usr/lib/perl5/vendor_perl/5.8 79 INSTALLBIN = /usr/bin' 80 installhtml1dir='' 81 installhtml3dir='' 82 installman1 83 INSTALLSITEBIN = /usr 84 INSTALLVENDORBIN = /usr/bin' 85 installvendorhtml1='' 86 installvendorhtml3='' 87 installvendorlib='/u 88 INSTALLSCRIPT = /usr/bin
the extraneous lines (80-82, 85-87, etc.) are physically in this order in the /usr/lib/perl5/5.8.0/i386-linux-thread-multi/Config.pm file (as installed by the "perl-5.8.0-88" RPM file included with RedHat 9.) i don't see any obvious problems with the Config.pm file itself (i.e. missing or doubled quotes, etc.)

again, the exact same thing happened with the 8.1 beta, but it worked with 8.0.

searching google finds references to making sure you have tabs instead of spaces in the Makefile itself. however, i think the Makefile itself shows the problem (there's no ":" or "=" on the line, and it doesn't start with a tab, so make doesn't know what to do with it.)

i have also noticed the same thing happening (random three- and four-line blocks of Config.pm appearing in the generated Makefile) when building other modules, such as MD5.pm and CPAN.pm.

is this a redhat-specific issue? is it a bug in ExtUtils::MakeMaker? other ideas?

update (broquaint): title change (was Makefile problem)

Replies are listed 'Best First'.
make 'missing separator' error when building CPAN modules on RedHat 8/9
by edan (Curate) on Jun 10, 2003 at 08:55 UTC

    I'm putting this down for posterity:

    Keywords: make makefile redhat 8 9 rh9 rh8 install CPAN MakeMaker missing separator UTF-8

    This is a known problem with the perl that is shipped with RedHat 8 & 9. See the following link: Redhat Bugzilla

    It is related to the fact that the default locale setting on RedHat 8/9 is "en_US.UTF-8", and that version of perl has a problem in Config.pm whereby it returns junk in "*.UTF-8" locales.

    The 'official' workaround at the time of this writing is to export LANG=C before running your perl Makefile.PL. I also came across a way to change the system-wide default locale, in case you want all the users on your box to be able to install CPAN modules, and you don't mind your default locale not being UTF-8:

    Edit the file /etc/sysconfig/i18n

    Change the line that looks like this:
    LANG="en_US.UTF-8"
    to this:
    LANG="en_US"
    (it might not be en_US for you, but you get the idea)

    This takes effect at login.

    update: Added RedHat 8, since it appears to have the same problem as RH9

    update: Please view this whole thread for the full context.

    --
    3dan
      most excellent! thanks for recording this. you just saved me hours of headaches ... Archive::Zip was giving me the same issues.
Re: problem building CDB_File-0.92 - Makefile:82: *** missing separator
by PodMaster (Abbot) on Apr 02, 2003 at 08:53 UTC
    I've encountered such problems on win32, and it means that you're using the wrong make. See what perl -V:make reports, and make sure that's what you're using (upgrade your make if need be -- same goes for ExtUtils::MakeMaker).


    MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
    I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
    ** The Third rule of perl club is a statement of fact: pod is sexy.

      > perl -V:make make='make';
      i have to assume that redhat's perl binary was built using the same version of make which they bundle in the distro, especially where most CPAN modules compile correctly.

      i tried upgrading ExtUtils::MakeMaker, and afterwards the same modules still end up creating the same bogus Makefiles.

      the more i look at it, the more it looks like it may be something wrong with how redhat built perl in the first place, and whatever it is causes a side effect for ExtUtils::MakeMaker for some modules.

      the strange thing is that most modules generate perfect Makefiles, while others seem to "almost" get what they need from Config.pm but end up grabbing more or less text than they should, and in a few cases end up with totally wrong text. example (from the same Makefile we're talking about)

      33 LDFLAGS = -L/usr/local/lib 34 LIBC = /lib/libc-2.3.1.so 35 LIB_EXT = .a' 36 libc=' 37 OBJ_EXT = ub 38 OSNAME = linux 39 OSVERS = 2.4.20-2.48smp 40 RANLIB = _
      notice line 35, whose "value" includes that single quote, a newline, and the text on the next line. the "value" came from the following chunk of Config.pm:

      839 less='less' 840 lib_ext='.a' 841 libc='/lib/libc-2.3.1.so' 842 libperl='libperl.so'
      it's like the code arbitrarily grabbed eight extra bytes. another example is just below it- line 37 of Makefile, "OBJ_EXT = ub" should say "OBJ_EXT = .o". it looks like it somehow came from the following chunk of Config.pm:

      907 nvsize='8' 908 nvtype='double' 909 o_nonblock='O_NONBLOCK' 910 obj_ext='.o' 911 old_pthread_create_joinable=''
      notice "ub" in the word "double" on line 908, which is two lines above what it should be reading (line 910.) it seems to have gotten the right NUMBER of bytes (two), but it missed by 36 bytes when grabbing the contents.

      maybe it's a subtle bug in one of redhat's libraries?

      for what it's worth, other configuration requests i've tried seem to show exactly what one would expect:

      > perl -V:lib_ext lib_ext='.a'; > perl -V:libc libc='/lib/libc-2.3.1.so'; > perl -V:obj_ext obj_ext='.o';
      very strange. hopefully somebody will have seen this before and can offer an idea on how to fix it, or work around it.
        Looks like a classic perl utf-8 problem. I thought the whole perl on Redhat 9 was borked, CPAN failed to install many, many modules. Then I tried again with export LANG=C. Problem went away. YMMV.