sapnwrfc

 view release on metacpan or  search on metacpan

lib/SAPNW/Makefile.PL  view on Meta::CPAN

use ExtUtils::MakeMaker;

# FIND POSSIBLE RFC INSTALLATIONS
my @POSSIBLE_RFC_DIRS = qw(/usr/sap/nwrfcsdk /usr/local /usr);
my $EMBED_MANIFEST= 0;

# the ADDITIONAL_LIBS needs to be modified for each OS flavour - the nwrfcsdk
# has the information regarding where libs and incs resides for each
# system type

# This SHOULD work for most cases (well at least Win32, and Linux)
my $ADDITIONAL_LIBS = '-lm -ldl -lrt -lpthread ';

# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
#  inorder for the linktype dynamic to work, perl must be built with
#  threads, and the rfc library included - see running Configure for perl

use File::Basename qw(dirname basename);
use Getopt::Long;
use vars qw($opt_source $opt_addlibs $opt_embed_manifest $opt_help);

&GetOptions("source=s", \$opt_source, "addlibs=s", \$opt_addlibs, "embed-manifest", \$opt_embed_manifest, "help", \$opt_help);

$EMBED_MANIFEST = 1 if $opt_embed_manifest;

if($^O eq 'MSWin32') {
  $ADD_FLAGS = " -DWIN32";
#  $ADD_FLAGS .= " -D_DEBUG";
  $ADD_FLAGS .= " -D_CONSOLE";
  $ADD_FLAGS .= " -DUNICODE";
  $ADD_FLAGS .= " -D_UNICODE";
  $ADD_FLAGS .= " -DSAPwithUNICODE ";
  $ADD_FLAGS .= " -DSAPonNT ";
  $ADD_FLAGS .= " -DSAP_PLATFORM_MAKENAME=ntintel ";

lib/SAPNW/Makefile.PL  view on Meta::CPAN

    #print STDERR "c_o: $section\n";
	}
  return $section;
}


# add the manifest for win32
sub MY::dynamic_lib { 
  my $self = shift; 
  my $section = $self->MM::dynamic_lib;
	if ($^O =~ /MSWin32/i && $EMBED_MANIFEST){
	  $section .= "\tcd ..\\..\\blib\\arch\\auto\\SAPNW\\Connection\n";
	  $section .= "\tmt.exe -outputresource:Connection.dll;2 -manifest Connection.dll.manifest\n";
	  $section .= "\tcd ..\\..\\..\\..\\..\\lib\\SAPNW\n";
	}
  if ($^O !~ /(MSWin32|hpux|solaris)/i){
	  $section =~ s/(\$\(INST_DYNAMIC\)\: )/$1\$\(BASEEXT\)\.i /s;
	#  print STDERR "dynamic_lib: $section\n";
	}
	return $section;
}



( run in 1.129 second using v1.01-cache-2.11-cpan-71847e10f99 )