[Note: I'm not on this list, and will most likely forget all about this in
the next week or so.]

My Linux system is a bit strange in that I try to put all
libraries/applications that use X under /usr/X11R6 (I'm strange).

This caused SDL_Perl-2.1.2 to give me that annoying bug:
Can't use an undefined value as an ARRAY reference at make/lib/SDL/Build.pm 
line 154.

This is the patch that I use locally.

It serves two parts:

1) Shows how to add new paths when you too have libraries in strange places
   (the adding of the SDL directory)
2) Exposes a bug in GL and smpeg handling within SDL_Perl:
   * GL headers are supposed to be included as <GL/foo.h>, not <foo.h> (so
     no need to look for an include/GL directory)
   * smpeg.h is included as smpeg.h in Build.PL, but smpeg/smpeg.h in the .xs
     (so no need to look for an include/smpeg directory)

Cheers,
mrc

patch -p1 << \EOF
diff -ru SDL_Perl-2.1.2.orig/Build.PL SDL_Perl-2.1.2/Build.PL
--- SDL_Perl-2.1.2.orig/Build.PL        2004-09-23 17:36:56.000000000 -0700
+++ SDL_Perl-2.1.2/Build.PL     2005-02-10 22:59:14.000000000 -0800
@@ -90,15 +90,15 @@
        },
        smpeg       => {
                define    => 'HAVE_SMPEG',
-               header    => 'smpeg.h',
+               header    => 'smpeg/smpeg.h',
        },
        GL          => {
                define => 'HAVE_GL',  
-               header => 'gl.h'
+               header => 'GL/gl.h'
        },
        GLU         => {
                define => 'HAVE_GLU', 
-               header => 'glu.h'
+               header => 'GL/glu.h'
        },
 );
 
diff -ru SDL_Perl-2.1.2.orig/make/lib/SDL/Build/Linux.pm 
SDL_Perl-2.1.2/make/lib/SDL/Build/Linux.pm
--- SDL_Perl-2.1.2.orig/make/lib/SDL/Build/Linux.pm     2004-09-23 
17:36:56.000000000 -0700
+++ SDL_Perl-2.1.2/make/lib/SDL/Build/Linux.pm  2005-02-10 22:59:30.000000000 
-0800
@@ -6,20 +6,13 @@
 {
        return (
        '/usr/local/include'       => '/usr/local/lib',
-       '/usr/local/include/gl'    => '/usr/local/lib',
-       '/usr/local/include/GL'    => '/usr/local/lib',
        '/usr/local/include/SDL'   => '/usr/local/lib',
-       '/usr/local/include/smpeg' => '/usr/local/lib',
 
        '/usr/include'              => '/usr/lib',
-       '/usr/include/gl'           => '/usr/lib',
-       '/usr/include/GL'           => '/usr/lib',
        '/usr/include/SDL'          => '/usr/lib',
-       '/usr/include/smpeg'        => '/usr/lib',
 
        '/usr/X11R6/include'        => '/usr/X11R6/lib',
-       '/usr/X11R6/include/gl'     => '/usr/X11R6/lib',
-       '/usr/X11R6/include/GL'     => '/usr/X11R6/lib',
+       '/usr/X11R6/include/SDL'    => '/usr/X11R6/lib',
        );
 }
 
diff -ru SDL_Perl-2.1.2.orig/src/OpenGL.xs SDL_Perl-2.1.2/src/OpenGL.xs
--- SDL_Perl-2.1.2.orig/src/OpenGL.xs   2004-09-23 17:36:56.000000000 -0700
+++ SDL_Perl-2.1.2/src/OpenGL.xs        2005-02-10 22:59:14.000000000 -0800
@@ -12,8 +12,8 @@
 
 #include <SDL.h>
 
-#include <gl.h>
-#include <glu.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
 
 #ifdef USE_THREADS
 #define HAVE_TLS_CONTEXT
diff -ru SDL_Perl-2.1.2.orig/src/SDL.xs SDL_Perl-2.1.2/src/SDL.xs
--- SDL_Perl-2.1.2.orig/src/SDL.xs      2004-09-23 17:36:56.000000000 -0700
+++ SDL_Perl-2.1.2/src/SDL.xs   2005-02-10 22:59:14.000000000 -0800
@@ -27,11 +27,11 @@
 #endif
 
 #ifdef HAVE_GL
-#include <gl.h>
+#include <GL/gl.h>
 #endif
 
 #ifdef HAVE_GLU
-#include <glu.h>
+#include <GL/glu.h>
 #endif
 
 #ifdef HAVE_SDL_NET
EOF

-- 
     Mike Castle      [EMAIL PROTECTED]      www.netcom.com/~dalgoda/
    We are all of us living in the shadow of Manhattan.  -- Watchmen
fatal ("You are in a maze of twisty compiler features, all different"); -- gcc

Reply via email to