Markus Rechberger / Perl / swig
 
StartSeite | MarkusRechberger/ Perl/ | Neues | TestSeite | ForumSeite | Teilnehmer | Kategorien | Index | Hilfe | Einstellungen | Ändern

Veränderung (letzte Änderung) (keine anderen Diffs, Normalansicht)

Verändert: 1c1,56
Beschreibe hier die neue Seite.
wenn ich mal zeit und lust hab werd ich mir swig bezüglich perl weiter ansehn vielleicht schreibt mir's ja wer andrer fertig...

3. compiling using MakeMaker?

Makefile.PL

[[Code]
use ExtUtils?::MakeMaker?;
WriteMakefile?(
'NAME' => 'ccode',
'OBJECT' => 'ccode.o ccode_wrap.o'
);

perl Makefile.PL

make
]

manual way:

[[Code]
3. compiling (+ figuring out the configuration of perl)
[[Code]
# perl -e 'use Config; print $Config{ccflags};'
-{D REENTRANT}? -{D GNU SOURCE}? -{DTHREADS HAVE PIDS}? -DDEBIAN -fno-strict-aliasing -I/
usr/local/include -{D LARGEFILE SOURCE}? -{D FILE OFFSET BITS}?=64
]

[[Code]
gcc -{D REENTRANT}? -{D GNU SOURCE}? -{DTHREADS HAVE PIDS}? -DDEBIAN -fno-strict-aliasing
-I/usr/local/include -{D LARGEFILE SOURCE}? -{D FILE OFFSET BITS}?=64 -c sample.c sa
mple_wrap.c -I /usr/lib/perl/5.8.4/CORE
]

creates:
sample.o sample_wrap.o

4. linking
[[Code]
ld -G sample.o sample_wrap.o -o sample.so
]

5. installation
[[Code]
cp sample.so /usr/local/lib/perl/5.8.4
cp sample.pm /usr/local/lib/perl/5.8.4
]
]

6. testing
[[Code]
perl <<EOF
> use sample;
> samplec::printtext;
> EOF
hello world

wenn ich mal zeit und lust hab werd ich mir swig bezüglich perl weiter ansehn vielleicht schreibt mir's ja wer andrer fertig...

3. compiling using MakeMaker?

Makefile.PL

use ExtUtils::MakeMaker;
WriteMakefile(
        'NAME' => 'ccode',
        'OBJECT' => 'ccode.o ccode_wrap.o'
);

perl Makefile.PL

make

manual way:

3. compiling (+ figuring out the configuration of perl)
# perl -e 'use Config; print $Config{ccflags};'
-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/
usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
gcc -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing
 -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -c sample.c sa
mple_wrap.c -I /usr/lib/perl/5.8.4/CORE
creates: sample.o sample_wrap.o 4. linking
ld -G sample.o sample_wrap.o -o sample.so
5. installation
cp sample.so /usr/local/lib/perl/5.8.4
cp sample.pm /usr/local/lib/perl/5.8.4

6. testing [[Code] perl <<EOF > use sample; > samplec::printtext; > EOF hello world


StartSeite | MarkusRechberger/ Perl/ | Neues | TestSeite | ForumSeite | Teilnehmer | Kategorien | Index | Hilfe | Einstellungen | Ändern
Text dieser Seite ändern (zuletzt geändert: 23. Mai 2005 8:15 (diff))
Suchbegriff: gesucht wird
im Titel
im Text