To be honest I have no idea how to make patch. :( I'm pretty much a noob at perl and programming in general.

I really don't think I changed much though. I was still running into problems with the makefile.pl. Then I just decided to use the PPM shell and typed install JavaScript and that worked. I can now use the module in perl. I don't think anything I did before was a contributing factor to whether or not the Javascript.pm from the repository worked..

Either way, the only changes I made anywhere was in Makefile.PL. The first thing I did was set the JS_INC and JS_LIB keys in the ENV hash to the correct directories. I did this by just assigning them a string value of the correct directories, so ...

$ENV{JS_INC} = "C:\\strawberry\\js\\src"; $ENV{JS_LIB} = "C:\\strawberry\\js\\src\\WINNT5.1_OPT.OBJ";

This "fix" is obviously very specific to my situation, so I don't know if it could help others that use different directories.

Also in this section of the code, I changed $lib="js" to $lib="js32", because my .lib file was called js32.lib.

if (exists $ENV{JS_LIB}) { @libs = get_paths($ENV{JS_LIB}); $ENV{DYLD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH} = $ENV{JS_LIB}; $lib = "js"; }

After that, the makefile.pl would give the correct gcc command with the correct directories, but now it would return a ton of compiling errors. and the first error was something like this:

C:\strawberry\cpan\build\JavaScript-1.12-mJTECJ>makefile.pl In file included from C:/strawberry/js/src/jspubtd.h:45, from C:/strawberry/js/src/jsapi.h:47, from JavaScript_Env.h:10, from test_js.c:2: C:/strawberry/js/src/jstypes.h:248:6: #error "Must define one of XP_BE +OS, XP_OS2, XP_WIN or XP_UNIX" C:/strawberry/js/src/jstypes.h:264:2: #error No suitable type for JSIn +t8/JSUint8 C:/strawberry/js/src/jstypes.h:277:2: #error No suitable type for JSIn +t16/JSUint16 C:/strawberry/js/src/jstypes.h:297:2: #error No suitable type for JSIn +t32/JSUint32

It was asking for XP_BEOS, XP_OS2, XP_WIN or XP_UNIX, and I saw that JavaScript_Env.h had a line that said

#define XP_PC

So I edited the Makefile.pl again so that it would now ouput 'XP_WIN' in place of 'XP_PC' to the .h file. This would no longer generate a super long list of compiling errors. Instead it started returning this:

C:\strawberry\cpan\build\JavaScript-1.12-mJTECJ>makefile.pl C:\DOCUME~1\Steve\LOCALS~1\Temp/ccQm7OVj.o:test_js.c:(.text+0x2b): und +efined ref erence to `JS_GetImplementationVersion' collect2: ld returned 1 exit status Failed compiling test_js.c. ABORTING

Those are the only changes I made. If I try to run makefile.pl now, I still get that message. I don't know what causes it or how to fix it. I'm doing this all in the cpan/build folder where cpan downloads the Makefile and other module components.


In reply to Re^4: Installing Javascript.pm on XP by dogman1
in thread Installing Javascript.pm on XP by dogman1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.