PDL::Core::Dev->
import
();
$gl_build
= 0;
$gl_msg
=
""
;
$gl_dir
=
""
;
if
($^O =~ /win32/i) {
$gl_msg
= unsupported(
'PDL::Graphics::TriD::OpenGL(Q)'
,
'win32'
);
}
else
{
@check_dirs
= (
'/lib/'
,
'/usr/lib/'
,
'/usr/local/lib/'
);
@openGL_dirs
=
grep
s/^-L//g,
split
(
' '
,
$PDL_CONFIG
{OPENGL_LIBS});
@check_dirs
= (
@check_dirs
,
@openGL_dirs
)
if
(
defined
$PDL_CONFIG
{OPENGL_LIBS} );
my
$lib
=
""
;
my
@patterns
= (
"GL.a"
,
"GL.so"
,
"MesaGL.a"
,
"MesaGL.so"
);
foreach
$dir
(
@check_dirs
) {
last
if
$gl_build
;
$h
=
"${dir}/lib"
;
map
{
$lib
=
"${h}$_"
if
-e
"${h}$_"
; }
@patterns
;
if
(
$lib
) {
$gl_dir
=
$dir
;
$gl_build
= 1;
unless
(
defined
$PDL_CONFIG
{OPENGL_DEFINE} ) {
$PDL_CONFIG
{OPENGL_DEFINE} =
'-DGLAPI=extern'
if
`strings
$lib
|
grep
mesa | head -1`;
}
}
}
$gl_msg
=
"skipping build of TriD::OpenGL(Q) modules - unable to find libs"
unless
$gl_build
;
}
@subdirs
=
qw( Rout VRML )
;
if
(
$gl_build
) {
@subdirs
= (
@subdirs
,
qw( OpenGL OpenGLQ )
); }
else
{
print
" $gl_msg\n\n"
unless
$gl_build
; }
$PDL_CONFIG
{GL_BUILD} =
$gl_build
;
WriteMakefile
(
NAME
=>
"PDL::Graphics::TriD"
,
'VERSION_FROM'
=>
'../../Basic/Core/Version.pm'
,
DIR
=> [
@subdirs
],
);