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

I was wondering if anyone has been able to compile this for perl 5.10 and if yes, could either provide me with proper instructions on how to accomplish it or share the module with me? I am not really a programmer and I have not been able to figure this out on my own for some time now. Thanks.

Replies are listed 'Best First'.
Re: Win32::Lanman for 5.10
by syphilis (Archbishop) on Nov 24, 2009 at 01:57 UTC
    Here's a starter - for which you'll need a Microsoft Compiler and SDK - and perl-5.10.0, though if you're using 5.10.1, I'm sure that could be worked around:
    First, in the lanman source distro, insert this near the beginning of plmisc.h (just below the second line of that file):
    // perl 5.10.0 build 10xx #ifdef PERL_5_10_0 #ifdef PERL_OBJECT #undef PERL_OBJECT #endif #define PERL_CALL_SINGLE #define PERL_CALL #define P_PERL #define P_PERL_SINGLE #endif
    Then set up the makefile to accommodate the existence of perl-5.10.0. This patch will do that:
    --- makefile.orig Tue Nov 24 11:03:55 2009 +++ makefile Tue Nov 24 11:43:05 2009 @@ -6,6 +6,7 @@ # # output directory for the appropriate build # +outdir10xx=.\perl.10xx.release outdir8xx=.\perl.8xx.release outdir6xx=.\perl.6xx.release outdir5xx=.\perl.5xx.release @@ -14,6 +15,7 @@ # where is the perl appropriate directory (the include header files m +ust reside # in $(outdir)\lib\core) # +perldir10xx=c:\_32\perl_vc7\5.10.0 perldir8xx=c:\perl.8xx perldir6xx=c:\perl.6xx perldir5xx=c:\perl.5xx @@ -36,7 +38,7 @@ # # where is the platform sdk installed? # -platformsdk=c:\program files\microsoft sdk +platformsdk=c:\vsnet\Vc7\PlatformSDK #platformsdk=c:\microsoft sdk # @@ -57,10 +59,11 @@ !message !endif -!if "$(cfg)" != "perl.8xx" && "$(cfg)" != "perl.6xx" && "$(cfg)" != " +perl.5xx" +!if "$(cfg)" != "perl.10xx" && "$(cfg)" != "perl.8xx" && "$(cfg)" != +"perl.6xx" && "$(cfg)" != "perl.5xx" !message !message Invalid configuration "$(cfg)" specified. Valid configuratio +ns are: !message +!message perl.10xx (for perl 5.10.0 build 8xx) !message perl.8xx (for perl 5.8.0 build 8xx) !message perl.6xx (for perl 5.6 build 6xx) !message perl.5xx (for perl 5.005_03 build 5xx) @@ -74,7 +77,36 @@ !error Invalid configuration specified. !endif -!if "$(cfg)" == "perl.8xx" +!if "$(cfg)" == "perl.10xx" + +# +# set parameters to build for (for perl 5.10.0 build 8xx) +# + +# set the output directory +outdir=$(outdir10xx) +# where is perl installed? +perldir="$(perldir10xx)" +# add per bin path to the path environment +PATH=$(perldir10xx)\bin;$(PATH) +# where is pod2html? +pod2html="$(perldir10xx)\bin\pod2html" +# where is ppm? +ppm="$(perldir10xx)\bin\ppm2" +# where do I find the perl include files and the perl510.lib? +perlsrcdir="$(perldir10xx)\lib\core" +# additional compiler settings +cpp_add_flags=/D PERL_5_10_0 +# additional linker settings +link_add_flags=perl510.lib +# dll name to create +dllname=$(prj).dll +# prefix output tar.gz file +targz_prefix= +# tar.gz file directory +targz_dir=mswin32-x86-multi-thread-5.10 + +!elseif "$(cfg)" == "perl.8xx" # # set parameters to build for (for perl 5.8.0 build 8xx)
    Your "perldir10xx" and "platformsdk" settings will almost certainly be different to mine - but the other changes should be applicable as is. (If you'd rather just get a copy of the amended makefile, /msg me your email address and I'll send it over - then you'd only have to make those alterations to "perldir10xx" and "platformsdk" and you'd be right to go.)

    Then run nmake clean cfg=perl.10xx followed by nmake cfg=perl.10xx and see how it goes. If you're using MSVC++ 6.0, that might be all you need to do.
    However, the build process doesn't succeed for me because my SDK (I have MSVC++ 7.0) doesn't have lmbrowsr.h and lmchdev.h - so I removed the call to #include those files from the files that try to #include them. (If you have MSVC++ 6.0, this may be unnecessary.)

    In lanman.cpp, there are 4 occurrences of the comment // oops, not longer supported. For each of those occurrences, I had to remove the first line following the comment. Again, you may not need to do this if you have MSVC++ 6.0.

    With that all done, the build ultimately fails with 4 "unresolved external symbols", which I haven't investigated. Which compiler do you have ?

    Another possible solution - I see that there are ppm packages for this module for 5.6 and 5.8 at the bribes rep. The maintainer of that rep uses MSVC++ 6.0, so he may be able to build a 5.10 ppm, if approached. Yet another solution would be to install a perl-5.8 (as a second perl installation) just so you can make use of the existing ppm.

    It's a pity that the source for such a useful module (by all accounts) is in such a poor state.

    Cheers,
    Rob
Re: Win32::Lanman for 5.10
by syphilis (Archbishop) on Nov 24, 2009 at 05:44 UTC
    or share the module with me?

    Well ... I've hacked up a perl-5.10 version that is quite probably usable. It does not have the NetDfsRename(), NetDfsMove(), NetEnumerateTrustedDomains() and I_NetGetDCList() functions - the first 2 of those functions are no longer supported (according to comments in the source), I don't know why I couldn't get support for the last 2.

    And it was built using MSVC++ 7.0 - ymmv. (It would be better built with MSVC++ 6.0 or MinGW if someone gets around to it.)

    Cheers,
    Rob
      Thanks for your advice. I was actually able to compile the module based on your instructions. I resolved the 4 undefined symbols by simply commenting them out anywhere I could find them. The make file worked but there were some issues in the paths, e.g. the misc folder for the ppd and pp file did not exist in my folder structure. As compiler I used VC6++ with SP5 or 6. I used the 2003 SDK.
      I've tried following these steps and they have helped, but I must have a different mix of compiler/SDK since I've no luck compiling.

      I tried Visual Studio 2005 with no luck (it complained about missing Perl modules and since I'm not a VS2005 expert, I couldn't figure out how to build the dll without it trying to link in all of the needed Perl modules).

      I then tried MSVC++ 6.0 but I must have the wrong SDK. I tried both the 2.0 SDK as well as the 3.0 SDK with no luck (2.0 complaining about NETSETUP_NAME_TYPE not defined, 3.0 complaining about sal.h missing)

      Any additional help, thoughts, suggestions, etc. would be appreciated (if a pre-compiled dll can't be provided).

      I'm trying to link against a Strawberry version of Perl (5.10.1). And I 2nd the thought that it would be very helpful if a true cpan version of this module were available.
        I'm trying to link against a Strawberry version of Perl (5.10.1)

        I can send you the version that I built if you /msg me the details of how to send it to you. It seems to work ok with my Strawberry Perl (5.10.1), but I haven't tested beyond checking that the module loads ok.

        Cheers,
        Rob
Re: Win32::Lanman for 5.10
by Herkum (Parson) on Nov 24, 2009 at 01:14 UTC
    I have never heard of a Lanman module and I would not be trying to compile it with several version of Perl (Activestate or Strawberry Perl) which invested in time in doing such work for you.