Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: Blending perl and C (two approaches)

by mwah (Hermit)
on Oct 28, 2007 at 21:27 UTC ( [id://647745]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Blending perl and C (two approaches)
in thread Blending perl and C (two approaches)

The perl-relevant part of the Makefile under Linux or *BSD would look like:

... VPATH = $(MYSOURCES) : $(MYTOOLS) ... #Linux + Freebsd: use the magic configurator "ExtUtils::Embed" PERLCC=`perl -MExtUtils::Embed -e perl_inc` PERLLD=`perl -MExtUtils::Embed -e ldopts -- -std` PLSTATIC= # -static # if static libperl.a, set this to -static, otherwise to (none) CXXFLAGS=-O3 COMPILE.cxx=$(CXX) $(CFLAGS) $(CXXFLAGS) $(PERLCC) -I$(MYHEADERS) -c .cxx.o: $(COMPILE.cxx) $< -o $(@F) $(EXE): $(F_MYSOURCE) $(F_MYTOOLS) Makefile $(CXX) -o $@ $(F_MYSOURCE) $(F_MYTOOLS) $(PERLLD) $(PLSTATIC) -lst +dc++ -s ...

The 'MYHEADERS', 'F_MYSOURCE', 'F_MYTOOLS' etc. designate the apps source files and directories (and are set elsewhere), the Perl-stuff goes into 'PERLCC' (headers) and 'PERLLD' (libs).

This will magically construct a perl.lib linked app ;-).

Regards

mwa

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://647745]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-03-28 10:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found