Deprecated: Function set_magic_quotes_runtime() is deprecated in /home4/mfoster/public_html/cb/forums/include/common.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 31

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 32

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 33

Warning: Cannot modify header information - headers already sent by (output started at /home4/mfoster/public_html/cb/forums/include/common.php:62) in /home4/mfoster/public_html/cb/forums/header.php on line 34
Cross-Browser.com / [XC] for Linux?

Cross-Browser.com

X Library Forums

You are not logged in.

Announcement

New user registration is currently disabled.

#1 June 25, 2007 12:27:40 pm

ChrisNelson
Member
Registered: June 22, 2007
Posts: 73

[XC] for Linux?

I really need to run xc on Linux for my build process.  I know the source is there but has anyone already ported it?

Offline

 

#2 June 25, 2007 3:24:05 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: [XC] for Linux?

Hi Chris,

If anyone has ported it they haven't informed me. Hopefully some day I'll have a Linux setup here at home, but for now I don't.

For reference, in the XC revision history, for the rev dated 31Oct06, I have:

Wrote stricmp and uitoa to remove some non-ansi functions. Current non-ansi usage (all from io.h): struct _finddata_t, _findfirst, _findnext, _findclose. It should be relatively easy to port to some *nix now.


If you decide to port it yourself I would be glad to offer any advice I could.

Btw... the current XC version (1.05) has a bug I just discovered over the weekend. I already have a fix for it (see the rev history) and it will be released in the X 4.16 distribution file which should be ready soon.

Thanks! smile

Offline

 

#3 July 3, 2007 3:21:08 pm

ChrisNelson
Member
Registered: June 22, 2007
Posts: 73

Re: [XC] for Linux?

MikeFoster wrote:

If anyone has ported it they haven't informed me. Hopefully some day I'll have a Linux setup here at home, but for now I don't.
...
If you decide to port it yourself I would be glad to offer any advice I could.


I searched all of /usr/include for any file that had struct _finddata_t and couldn't find anything.  For any other Linux users who care, I did:

gcc xc.c -Wall -I/usr/include/xmlsec1/xmlsec -I/usr/include/libxml2 -I/usr/include/xmlsec1


On Fedora Core 4 and got:

xc.c: In function ?get_valid_symbols?:
xc.c:475: error: storage size of ?fd? isn?t known
xc.c:481: warning: implicit declaration of function ?_findfirst?
xc.c:497: warning: implicit declaration of function ?_findclose?
xc.c:578: warning: implicit declaration of function ?_findnext?
xc.c:475: warning: unused variable ?fd?

Offline

 

#4 July 3, 2007 10:09:49 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: [XC] for Linux?

Hi Chris,

I'm not 100% sure, but I think the corresponding functions may be: opendir, readdir and perhaps also stat.

I'm still trying to find out more.

Btw... a new version of XC (1.06) has just been released. It has an important bug fix.

Offline

 

#5 July 10, 2007 3:28:27 am

gebura
Member
From: France
Registered: June 20, 2007
Posts: 25
Website

Re: [XC] for Linux?

Well

Have you try with wine ?
(for those who dont know wine is a win32 API emulator for Unix/Linux, see http://www.winehq.org/)

I have configured it to imitate winXP and:

gebura@debian:~/Desktop/libs/cross-browser.com.old/x$ wine xc/xc.exe x.xcp
Invoking /usr/lib/wine/wine.bin xc/xc.exe x.xcp ...

X Library Compiler 1.02
Distributed under the terms of the GNU LGPL

compiling x from X 4.12 ...

created x.js
Wine exited with a successful status
gebura@debian:~/Desktop/libs/cross-browser.com.old/x$


Please tell me if you want:
- That i write a short tutorial to include in xc doc (despite i think most linux user will understand this light example)
- Getting a remote system access for testing further xc release (i have to repear my server before).

But i also think that a native linux port will be great... but i could n't help you because i don't know C.

Last edited by gebura (July 10, 2007 4:53:58 am)

Offline

 

#6 July 14, 2007 5:25:29 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: [XC] for Linux?

Hi Chris,

clowncoder has ported _findfirst/_findnext to Linux! Thanks clowncoder!
I only added a few conditional compilation directives so we can compile the same file in both VC++ and GCC.

This zip includes the ".c" and ".h" files: xc10601_z1.zip. Do you need a format other than "zip"?


Hi gebura,

Hey that's great that you have XC running on Linux with Wine! That gives people another option. Yes I think it would be great to somehow document this in the XC reference.

Thanks!

Offline

 

#7 July 19, 2007 8:58:01 am

ChrisNelson
Member
Registered: June 22, 2007
Posts: 73

Re: [XC] for Linux?

MikeFoster wrote:

clowncoder has ported _findfirst/_findnext to Linux! Thanks clowncoder!
I only added a few conditional compilation directives so we can compile the same file in both VC++ and GCC.

This zip includes the ".c" and ".h" files: xc10601_z1.zip. Do you need a format other than "zip"?


Works like a charm!  Thanks.

Offline

 

#8 July 19, 2007 10:46:00 am

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: [XC] for Linux?

That's awesome! tup

Perhaps you or clowncoder could send me the executable? I would like to include it in the distribution file.

This is great news! I'm excited about this!

Also... a question for either or both of you: what command-line arguments did you pass to GCC? I guess I'm asking... is there any specific "configuration" that's required to compile the code. I would like to document this and include it in the XC reference.

I thank you both very much! big_smile

Offline

 

#9 July 19, 2007 11:05:43 am

ChrisNelson
Member
Registered: June 22, 2007
Posts: 73

Re: [XC] for Linux?

I'd send you the executable but unlike 'Windows, Linux runs on lots of hardware.  What I have if for Fedora Core 4 on Intel.  You're welcome to that.

As for options, I just did:

gcc xc.c -o xc

Offline

 

#10 July 19, 2007 11:30:36 am

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: [XC] for Linux?

Great! Please email it to supportATmfosterDOTcom.  I just need to document that it was built on Fedora Core 4 on Intel.

clowncoder, are you running on the same platform as Chris? If different, perhaps we could include both executables?

Offline

 

#11 July 19, 2007 11:36:42 am

ChrisNelson
Member
Registered: June 22, 2007
Posts: 73

Re: [XC] for Linux?

MikeFoster wrote:

Great! Please email it to supportATmfosterDOTcom.  I just need to document that it was built on Fedora Core 4 on Intel.


Done.

Offline

 

#12 July 20, 2007 10:08:25 am

gebura
Member
From: France
Registered: June 20, 2007
Posts: 25
Website

Re: [XC] for Linux?

Hello

If you want to provide an executable that can work on lot of different config, it must be static linked.

This solution make a biger and little bit slower executable, but generated executable will'nt depend on any particular version of libc or any lib used.

If you are interested to test portability i have different linux version (debian) on differents arch like alpha, sparc, sgimips...
I have also access to true Unix like solaris or xBSD.

Offline

 

#13 July 20, 2007 10:12:36 am

ChrisNelson
Member
Registered: June 22, 2007
Posts: 73

Re: [XC] for Linux?

gebura wrote:

If you want to provide an executable that can work on lot of different config, it must be static linked.


Good point.  I'll try to get to that later...

Offline

 

#14 March 31, 2008 12:18:48 pm

sigmazero13
New Member
Registered: March 31, 2008
Posts: 1

Re: [XC] for Linux?

Does anyone know if this is still available?  I tried the link in ChrisNelson's post, but the link is broken now.  I'm trying to compile this with the latest version, and am getting the same errors as the original poster.

Offline

 

#15 May 21, 2008 10:27:24 pm

Matt
New Member
Registered: May 21, 2008
Posts: 5

Re: [XC] for Linux?

Also interested in the linux compilable source.

Offline

 

#16 June 1, 2008 12:07:24 pm

Matt
New Member
Registered: May 21, 2008
Posts: 5

Re: [XC] for Linux?

For linux bash (or similar shells) badda boom badda bing...

deps.sh:

#!/bin/sh

self=`basename $0`

if [ $# -ne 1 ]; then
        echo "usage: $self file.js"
        echo "   ex: $self xfenster.js"
        exit 1
fi

file=$1

_scan_files=""
function scan {
        local jsfile=$1
        xmlfile="`basename $jsfile .js`.xml"
        for dep in `grep -IiP '<dep>.*?</dep>' $xmlfile`; do
                depfunc=`echo "$dep" | perl -p -e 's/^.*?<dep>(.*?)<\/dep>.*/$1/; chomp;'`
                depfiles=`grep -lIriP "function $depfunc" *.js`
                for depfile in $depfiles; do
                        echo "$_scan_files" | grep -iP "$depfile" 2>&1 > /dev/null
                        if [ $? -ne 0 ]; then
                                _scan_files="$_scan_files $depfiles"
                                scan $depfile
                        fi
                done
        done
}

scan $file

if [ "$_scan_files" ]; then
        echo "$_scan_files" | perl -p -e 's/^ //; s/ $//; s/ /\n/g;'
fi



xfenster.js dependencies:

matt@elsa lib $ sh deps.sh xfenster.js
xgetelementbyid.js
xresizeto.js
xwidth.js
xnum.js
xdef.js
xstr.js
xstrendswith.js
xstrreplaceend.js
xstrstartswith.js
xgetcomputedstyle.js
xcamelize.js
xheight.js
xmoveto.js
xleft.js
xtop.js
xenabledrag.js
xenabledrag2.js
xenabledrag_r6.js
xaddeventlistener.js
xaddeventlistener2.js
xaddeventlistener3.js
xaddeventlistener4.js
xremoveeventlistener.js
xremoveeventlistener2.js
xevent.js
xscrollleft.js
xscrolltop.js
xpagex.js
xpagey.js
xpreventdefault.js
xclientwidth.js
xclientheight.js



I haven't gotten further than finding the deps just yet but from what I understand you can simply do something like `cat xfenster.js dep1 dep2 ... depN > my-xfenster.js` to get a custom lib for yourself.

Let me know if there's any bugs.

Gotta love shell scripting.

Offline

 

#17 June 1, 2008 9:42:12 pm

Matt
New Member
Registered: May 21, 2008
Posts: 5

Re: [XC] for Linux?

Regarding the deps.sh script above, the latest xfenster.xml script is missing one dependency: xStopPropagation in xstoppropagation.js

Offline

 

#18 April 16, 2011 8:04:17 am

arnold24
New Member
From: NYC
Registered: April 15, 2011
Posts: 1

Re: [XC] for Linux?

MikeFoster wrote:

Hi Chris,

clowncoder has ported _findfirst/_findnext to Linux! Thanks clowncoder!
I only added a few conditional compilation directives so we can compile the same file in both VC++ and GCC.

This zip includes the ".c" and ".h" files: xc10601_z1.zip. Do you need a format other than "zip"?


Hi gebura,

Hey that's great that you have XC running on Linux with Wine! That gives people another option. Yes I think it would be great to somehow document this in the XC reference.

Thanks!



Hi, the link seems to be broken. Is it available somewhere else? Thanks!


Arnold
My site: buy to let mortgages

Offline

 

#19 April 17, 2011 2:27:16 pm

MikeFoster
Administrator
From: Alabama, USA
Registered: April 27, 2007
Posts: 874
Website

Re: [XC] for Linux?

Hi arnold24, Welcome to the forums!

Around March 2009 I split the XC project into two separate projects: XAG and XPP. See here for more details. The current download file contains their source code, in the "x/tools/prj" directory. The code will compile on both Windows and Linux.

XPP and XAG are quite simple - but still very useful. I use them at work. Actually, I had started (and almost completed) a project written in Java and using Rhino to parse the Js, but I never finished it, LOL.

Thanks!

Offline

 

Board footer

Powered by PunBB 1.2.15
Copyright © 2002–2005 Rickard Andersson

Expand Restore Select Format Eval Load