2 use ExtUtils::MakeMaker;
5 # unfortunately MakeMaker thinks it is clever
6 # with forcing several compiler and/or linker flags
7 # However, this behavior is a real pain in the a**
8 # when crosscompiling and therefore we need to adjust
9 # some things prior to the call of WriteMakefile()
11 my $CCFLAGS = $Config{'ccflags'};
12 my $OPTIMIZE = $Config{'optimize'};
14 # Perl is built with -Wdeclaration-after-statement on RHEL5 - this isn't
15 # meaningful for C++ - it only emits a warning but it's easy to fix.
16 $CCFLAGS =~ s/(?:^|\s+)-Wdeclaration-after-statement(?:\s+|$)/ /;
18 # The generated code causes "variable may be used uninitialized" warnings
19 # if Perl was built with -Wall.
20 $CCFLAGS =~ s/(^|\s+)-Wall(\s+|$)/$1-Wall -Wno-uninitialized$2/;
22 # add CPP/CXX flags if they exist
23 $CCFLAGS .= ' ' . $var{CPPFLAGS} if exists $var{CPPFLAGS};
24 $CCFLAGS .= ' ' . $var{CXXFLAGS} if exists $var{CXXFLAGS};
26 # add CXXFLAGS and AM_CXXFLAGS as shell variables
27 $CCFLAGS .= ' $(AM_CXXFLAGS) $(CXXFLAGS) -I../../H';
29 # we also need to strip some compiler flags from 'optimize'
30 # since architecture features of the host system may interfere
31 # with the target architecture when crooscompiling
32 $OPTIMIZE =~ s/-march=[a-zA-Z0-9_\-]+//g;
33 $OPTIMIZE =~ s/-mtune=[a-zA-Z0-9_\-]+//g;
35 # print "CCFLAGS:\t", $CCFLAGS, "\n";
36 # print "OPTIMIZE:\t", $OPTIMIZE, "\n";
39 MAKEFILE => "Makefile.perl",
43 OPTIMIZE => $OPTIMIZE,
44 MYEXTLIB => "../../lib/libRNA.a",
46 PM => {"RNA.pm", '$(INST_LIBDIR)/RNA.pm'},
47 OBJECT => "RNA_wrap.o",
48 dynamic_lib => {OTHERLDFLAGS => '$(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) @OPENMP_CFLAGS@'},
49 AUTHOR => 'Ivo Hofacker <ivo@tbi.univie.ac.at>',
50 VERSION => '@VERSION@'