X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=binaries%2Fsrc%2FViennaRNA%2Finterfaces%2FPerl%2FMakefile.PL.in;fp=binaries%2Fsrc%2FViennaRNA%2Finterfaces%2FPerl%2FMakefile.PL.in;h=8875f2c883586e5adb20e582eb859a5207282d2f;hb=7522ace91fc0804a9719dbac9f68bc8154da3132;hp=0000000000000000000000000000000000000000;hpb=8116c0444fe98e8eb21bcdd8ded06e1429085823;p=jabaws.git diff --git a/binaries/src/ViennaRNA/interfaces/Perl/Makefile.PL.in b/binaries/src/ViennaRNA/interfaces/Perl/Makefile.PL.in new file mode 100644 index 0000000..8875f2c --- /dev/null +++ b/binaries/src/ViennaRNA/interfaces/Perl/Makefile.PL.in @@ -0,0 +1,51 @@ +# File : Makefile.PL +use ExtUtils::MakeMaker; +use Config; + +# unfortunately MakeMaker thinks it is clever +# with forcing several compiler and/or linker flags +# However, this behavior is a real pain in the a** +# when crosscompiling and therefore we need to adjust +# some things prior to the call of WriteMakefile() + +my $CCFLAGS = $Config{'ccflags'}; +my $OPTIMIZE = $Config{'optimize'}; + +# Perl is built with -Wdeclaration-after-statement on RHEL5 - this isn't +# meaningful for C++ - it only emits a warning but it's easy to fix. +$CCFLAGS =~ s/(?:^|\s+)-Wdeclaration-after-statement(?:\s+|$)/ /; + +# The generated code causes "variable may be used uninitialized" warnings +# if Perl was built with -Wall. +$CCFLAGS =~ s/(^|\s+)-Wall(\s+|$)/$1-Wall -Wno-uninitialized$2/; + +# add CPP/CXX flags if they exist +$CCFLAGS .= ' ' . $var{CPPFLAGS} if exists $var{CPPFLAGS}; +$CCFLAGS .= ' ' . $var{CXXFLAGS} if exists $var{CXXFLAGS}; + +# add CXXFLAGS and AM_CXXFLAGS as shell variables +$CCFLAGS .= ' $(AM_CXXFLAGS) $(CXXFLAGS) -I../../H'; + +# we also need to strip some compiler flags from 'optimize' +# since architecture features of the host system may interfere +# with the target architecture when crooscompiling +$OPTIMIZE =~ s/-march=[a-zA-Z0-9_\-]+//g; +$OPTIMIZE =~ s/-mtune=[a-zA-Z0-9_\-]+//g; + +# print "CCFLAGS:\t", $CCFLAGS, "\n"; +# print "OPTIMIZE:\t", $OPTIMIZE, "\n"; + +WriteMakefile( + MAKEFILE => "Makefile.perl", + NAME => "RNA", + LIBS => ["-lm"], + CCFLAGS => $CCFLAGS, + OPTIMIZE => $OPTIMIZE, + MYEXTLIB => "../../lib/libRNA.a", + LD => '${CXX}', + PM => {"RNA.pm", '$(INST_LIBDIR)/RNA.pm'}, + OBJECT => "RNA_wrap.o", + dynamic_lib => {OTHERLDFLAGS => '$(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @OPENMP_CFLAGS@'}, + AUTHOR => 'Ivo Hofacker ', + VERSION => '@VERSION@' +);