Giter VIP home page Giter VIP logo

c_plus_plus's Introduction

This was created for testing my patch for C++ perl modules. It runs with
dynamic and static extensions under OS/2.

It should work with gcc and dynamic build out of the box. With other 
compilers you should find a different mean to convince MakeMaker to 
compile the file as C++. With gcc I just put '-x c++' into INC (yuck ;-)
of Makefile.PL. Try to peruse different buttons of MakeMaker.

The patch is in the file `patch'.

After the patch is applied you can compile perlmain.c with C++ compiler
and use it with static and dynamic C++ modules. You may force 
a particular way of perl compile in build directory by editing the
corresponding line in `cflags', similar to this (for gcc):

    perlmain) cc="$cc -x c++";;

It is possible to build static C++ extensions, probably something like what is
below (CC=CC on 'make' line) should work. With gcc you do it like this:

make static
make perlmain.o CC="gcc -x c++"
make perl

(if on OS/2, substitute `make perlmain.obj').

Dynamic build of example C++ extension:

Apply patch, remake perl, install it (or copy h2xs, xsubpp and all other 
relevant files (like Miniperl.pm) to appropriate locations). Do this in
perl build directory:

patch < ...../patch
sh writemain.SH
make
make test
make install

Keep in mind that perlmain.c is autogenerated by writemain that is
autogenerated by writemain.SH, but the last rule is not in makefiles.
Similarly with Miniperl.pm and minimod.PL, but this time the rule is
there. The above sequence most probably does all the black magic ;-0.

Then run

perl Makefile.PL
make
make test

If you do not have gcc, probably you should run something like

make CC=CC INC=

c_plus_plus's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.