/usr/local/CPAN/Astro-WCS-LibWCS/Makefile.PL


use ExtUtils::MakeMaker;

my ($inc, $libs);

if (exists $ENV{WCSTOOLS}) {
  $inc = "-I$ENV{WCSTOOLS}/libwcs";
  $libs = "-L$ENV{WCSTOOLS}/libwcs -lwcs -lm";
}
elsif (exists $ENV{WCSTOOLS_INC} && exists $ENV{WCSTOOLS_LIB} ) {
  $inc = $ENV{WCSTOOLS_INC};
  $libs = $ENV{WCSTOOLS_LIB};
}
else {
  warn("WCSTOOLS environment variable not found, assuming /usr/local/wcstools\n");
  $inc = "-I/usr/local/wcstools/libwcs";
  $libs = "-L/usr/local/wcstools/libwcs -lwcs -lm";
}


# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
	      'NAME'	=> 'Astro::WCS::LibWCS',
	      'VERSION_FROM' => 'LibWCS.pm', # finds $VERSION
	      'LIBS' => [$libs],
	      'INC' => $inc,
	      'DEFINE'	=> '',     # e.g., '-DHAVE_SOMETHING' 
	      'OBJECT' => 'LibWCS.o util.o',
	     );