Re: Installing Javascript.pm on XP
by syphilis (Archbishop) on Aug 05, 2009 at 02:03 UTC
|
My guess is the files are in the wrong location
There's nothing wrong with leaving them where they are, but the Makefile.PL needs to be able to find them. Going through the Makefile.PL, it looks as though you can tell the Makefile.PL process most (if not all) of what it needs to know by setting environment variables - eg set the JS_INC environment variable to the location of the missing header (.h) files, and the JS_LIB environment variable to the location of the javascript library (.a) files.
Specifying INC and LIBS on the command line, as already mentioned by Anonymous Monk, might also work - though I can't be sure that the Makefile.PL won't clobber information that's being passed along by that method.
Cheers, Rob | [reply] |
|
|
Hey, thanks for the responses.
I went into Makefile.PL and manually edited the JS_INC and JS_LIB keys in the %ENV hash to the correct folders. Also it was originally giving me "-ljs", and I changed that to "-ljs32" Now when I run Makefile.PL it returns this to the command prompt:
gcc -LC:\strawberry\js\src\WINNT5.1_OPT.OBJ -ljs32 -o C:\DOCUME~1\Steve\LOCALS~1\Temp\UCzBT5mwxB -IC:\strawberry\js\src test_js.c
jsapi.h and other .h files are located in C:\strawberry\js\src
js32.lib is located in C:\strawberry\js\src\WINNT5.1_OPT.OBJ
Now it seems to know where the files are, but it's giving me a looong list of errors and warnings. Too long to copy all of it on here but here's a sample
In file included from JavaScript_Env.h:17,
from test_js.c:2:
C:/strawberry/js/src/jsxml.h:59: error: field `declared' declared as a
+ function
C:/strawberry/js/src/jsxml.h:110: error: `JSIdentityOp' declared as fu
+nction returning a function
C:/strawberry/js/src/jsxml.h:164: error: syntax error before "uint16"
C:/strawberry/js/src/jsxml.h:164: warning: no semicolon at end of stru
+ct or union
C:/strawberry/js/src/jsxml.h:165: warning: data definition has no type
+ or storage class
C:/strawberry/js/src/jsxml.h:178: error: conflicting types for 'u'
C:/strawberry/js/src/jsfun.h:65: error: previous declaration of 'u' wa
+s here
C:/strawberry/js/src/jsxml.h:181: error: syntax error before '}' token
C:/strawberry/js/src/jsxml.h:254: error: `js_GetFunctionNamespace' dec
+lared as function returning a function
C:/strawberry/js/src/jsxml.h:257: error: `js_GetDefaultXMLNamespace' d
+eclared as function returning a function
C:/strawberry/js/src/jsxml.h:260: error: `js_SetDefaultXMLNamespace' d
+eclared as function returning a function
C:/strawberry/js/src/jsxml.h:268: error: `js_IsXMLName' declared as fu
+nction returning a function
C:/strawberry/js/src/jsxml.h:271: error: `js_ToAttributeName' declared
+ as function returning a function
C:/strawberry/js/src/jsxml.h:287: error: `js_GetAnyName' declared as f
+unction returning a function
C:/strawberry/js/src/jsxml.h:290: error: `js_FindXMLProperty' declared
+ as function returning a function
C:/strawberry/js/src/jsxml.h:293: error: `js_GetXMLProperty' declared
+as function returning a function
C:/strawberry/js/src/jsxml.h:296: error: `js_GetXMLFunction' declared
+as function returning a function
C:/strawberry/js/src/jsxml.h:299: error: `js_SetXMLProperty' declared
+as function returning a function
C:/strawberry/js/src/jsxml.h:302: error: `js_GetXMLDescendants' declar
+ed as func tion returning a function
C:/strawberry/js/src/jsxml.h:305: error: `js_DeleteXMLListElements' de
+clared as function returning a function
C:/strawberry/js/src/jsxml.h:308: error: syntax error before "jsbyteco
+de"
C:/strawberry/js/src/jsxml.h:308: error: `js_FilterXMLList' declared a
+s function returning a function
C:/strawberry/js/src/jsopcode.h:239: warning: array 'js_EscapeMap' ass
+umed to have one element
I think all the header files are causing errors. | [reply] [d/l] [select] |
|
|
Best to show us the *first* error (and the pre-amble leading up to it), as that's the important part. All other errors are often just a follow-on effect that is fixed when the first error is fixed.
Cheers, Rob
| [reply] |
Re: Installing Javascript.pm on XP
by Herkum (Parson) on Aug 05, 2009 at 03:27 UTC
|
The nice thing about Strawberry is that you can use ppm to install modules. Try using that and hope that someone has already compiled the module.
| [reply] |
|
|
Yes - and it *is* available from the bribes repository:
ppm install http://www.bribes.org/perl/ppm/JavaScript.ppd
Cheers, Rob | [reply] [d/l] |
|
|
yes but the repo bribes is not for 5.12 on win32. Update possible?
| [reply] |
|
|
www.bribes.org Perl 5.10 repository [ v 1.11 ]
www.bribes.org Perl 5.8 repository [ v 1.11 ]
| [reply] [d/l] |
|
|
| [reply] |
|
|
I was under the imression that an important aspect of Strawberry Perl was to free Windows users from having to rely on pre-compiled modules?
It is.
The problem, SpiderMonkey doesn't build easy on win32/mingw,
there are no binaries available, and you can't build JavaScript without SpiderMonkey.
| [reply] |
Re: Installing Javascript.pm on XP
by Anonymous Monk on Aug 05, 2009 at 01:30 UTC
|
Assuming C:\strawberry\je\js32.lib
(or js32.a) and C:\strawberry\js\src\jsapi.h,
try perl Makefile.PL INC=-IC:\strawberry\js\src LIBS="-LC:\strawberry\js
+-ljs32"
| [reply] [d/l] |
|
|
CPATH
C_INCLUDE_PATH
CPLUS_INCLUDE_PATH
OBJC_INCLUDE_PATH
set LD_LIBRARY_PATH
| [reply] [d/l] |
Re: Installing Javascript.pm on XP
by Anonymous Monk on Aug 05, 2009 at 07:28 UTC
|
Where did you get SpiderMonkey? | [reply] |
|
|
Addressing some of the comments:
- The long list of errors was caused by one of the first errors as syphilis said. Makefile.PL was outputting '#define XP_PC' to Javascript_Env.h, and the first error said that I needed to define "XP_BEOS, XP_OS2, XP_WIN, or XP_UNIX". So I changed 'XP_PC' in Makefile.pl to 'XP_WIN' and now I only get this.
C:\strawberry\cpan\build\JavaScript-1.12-mJTECJ>perl Makefile.pl
Set up gcc environment - 3.4.5 (mingw-vista special r3)
C:\DOCUME~1\Steve\LOCALS~1\Temp/ccciHYlf.o:test_js.c:(.text+0x2b): und
+efined reference to `JS_GetImplementationVersion'
collect2: ld returned 1 exit status
Failed compiling test_js.c. ABORTING
- I built SpiderMonkey 1.7 following the instructions here. I first downloaded the Mozilla Build environment and Visual C++ 9. Then I used the start-msvc9.bat in the mozilla-build folder (I think this is minGW) and followed the instructions on the web page to build the optimized/non-debug Spidermonkey. I think it worked as there is a shell (js.exe) in the ../jd/src folder that can read print("Hello world").
I stopped using minGW because when I tried to run Makefile.pl I was prompted that I needed perl version 5.8 and minGW only had 5.6.1 or something. So I'm now just using the windows command prompt.
- Finally, I tried the Javascript.pm from the repository and it seems to work great. I needed it for another module that was dependant on Javascript.pm. I guess that is problem solved, but I'd still be curious about getting it right the hard way.
Thanks for the help. | [reply] [d/l] |
|
|
| [reply] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
I stopped using minGW because when I tried to run Makefile.pl I was prompted that I needed perl version 5.8 and minGW only had 5.6.1 or something. So I'm now just using the windows command prompt.
I can't make much out of that. It sounds like perl-5.6.1 was found, but perl-5.8.x is needed - however, that would have nothing to do with MinGW (or any other compiler).
When you ran 'perl Makefile.PL' which version of perl was being run (running 'perl -v' will tell you) ? Do you have more than one perl installed on your machine ?
Also, the actual output of 'perl Makefile.PL' might help us determine the problem and solution.
Cheers, Rob
| [reply] |
|
|
|
|
|
|
|
|
|