annotate test/configure.in @ 4324:1496aa09e41e SDL-1.2

Steven Noonan to sdl While trying to build the SDLMain.m included with SDL 1.2.14, with #define SDL_USE_NIB_FILE 1: /Users/steven/Development/darwinia/targets/macosx/Darwinia/SDLMain.m: In function '-[SDLMain fixMenu:withAppName:]': /Users/steven/Development/darwinia/targets/macosx/Darwinia/SDLMain.m:122: warning: 'sizeToFit' is deprecated (declared at /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSMenu.h:281) /Users/steven/Development/darwinia/targets/macosx/Darwinia/SDLMain.m: In function 'main': /Users/steven/Development/darwinia/targets/macosx/Darwinia/SDLMain.m:376: warning: 'poseAsClass:' is deprecated (declared at /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:127) /Users/steven/Development/darwinia/targets/macosx/Darwinia/SDLMain.m:376: error: 'poseAsClass:' is unavailable (declared at /Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:127) /Users/steven/Development/darwinia/targets/macosx/Darwinia/SDLMain.m:377: warning: passing argument 2 of 'NSApplicationMain' from incompatible pointer type Eric Wing to Sam I don't have time today to look at this in detail, but the problem is definitely the poseAsClass: method. This was deprecated in Obj-C 2.0 and not retained in 64-bit. I've never used this method and it has always been limited to esoteric uses. I think this is why Apple wanted to dump it (among complicating some other things they do). I have read about others getting bit by this when migrating. Long story short, there really isn't a migration path for this method. The question that then must be asked is why are we using it (what does it accomplish), and then figure out the 'proper' way of accomplishing that. Glancing at SDLMain.m, it's not obvious to me why it is there or what it is really accomplishing. My only speculation is that NSApplicationMain hardcodes something to look for NSApplication and a subclass (SDLApplication) fails for some reason (assuming that the original coder did this for good reason). Three thoughts come to mind. 1) The Info.plist has properties to control things related to the startup class and nib. NSPrincipalClass, NSMainNibFile Maybe principle class needs to be SDLApplication and we can delete the poseAs 2) I was told that 10.6 introduced new APIs to make programatic NIB wrangling and avoidance easier. Unfortunately, I don't know the specifics. 3) Instead of subclassing NSApplication in SDLMain.m, maybe we can just add a category. It looks like the following is the only thing that is done (quick glance): @interface SDLApplication : NSApplication @end @implementation SDLApplication /* Invoked from the Quit menu item */ - (void)terminate:(id)sender { /* Post a SDL_QUIT event */ SDL_Event event; event.type = SDL_QUIT; SDL_PushEvent(&event); } @end So instead, we change this to: (warning written in mail and untested) @interface NSApplication (SDLApplication) - (void) terminate:(id)sender; @end @implementation NSApplication (SDLApplication) /* Invoked from the Quit menu item */ - (void)terminate:(id)sender { /* Post a SDL_QUIT event */ SDL_Event event; event.type = SDL_QUIT; SDL_PushEvent(&event); } @end Then everywhere SDLApplication is used, we change it to NSApplication (and remove the poseAsClass line). Perhaps you could ask the bug reporter to try this solution (#3). And if that fails, maybe try #1. -Eric Steven Noonan to Sam The suggested change (diff below) seems to work fine. - Steven
author Sam Lantinga <slouken@libsdl.org>
date Mon, 12 Oct 2009 21:07:12 +0000
parents 68ee433ec474
children
rev   line source
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1 dnl Process this file with autoconf to produce a configure script.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2 AC_INIT(README)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1387
diff changeset
4 dnl Detect the canonical build and host environments
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
5 AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1387
diff changeset
6 AC_CANONICAL_HOST
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
7
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
8 dnl Check for tools
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
9
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
10 AC_PROG_CC
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
11
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
12 dnl Check for compiler environment
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
13
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
14 AC_C_CONST
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
15
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
16 dnl Figure out which math library to use
1550
31c2b8e4885e Fixed bug #166
Sam Lantinga <slouken@libsdl.org>
parents: 1387
diff changeset
17 case "$host" in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
18 *-*-cygwin* | *-*-mingw32*)
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
19 EXE=".exe"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
20 MATHLIB=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
21 SYS_GL_LIBS="-lopengl32"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
22 ;;
4164
7a4c511c980a Date: Fri, 6 Mar 2009 12:41:17 -0800
Sam Lantinga <slouken@libsdl.org>
parents: 3990
diff changeset
23 *-*-beos* | *-*-haiku*)
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
24 EXE=""
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
25 MATHLIB=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
26 SYS_GL_LIBS="-lGL"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
27 ;;
991
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
28 *-*-darwin* )
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
29 EXE=""
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
30 MATHLIB=""
4229
68ee433ec474 Whoops, this breaks building on Mac OS X 10.4
Sam Lantinga <slouken@libsdl.org>
parents: 4221
diff changeset
31 SYS_GL_LIBS="-Wl,-framework,OpenGL"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
32 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
33 *-*-aix*)
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
34 EXE=""
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
35 if test x$ac_cv_prog_gcc = xyes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
36 CFLAGS="-mthreads"
978
3b1ba22f5a28 Add support for OpenGL on Atari using OSMesa, the offscreen rendering driver from Mesa
Patrice Mandin <patmandin@gmail.com>
parents: 796
diff changeset
37 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
38 SYS_GL_LIBS=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
39 ;;
991
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
40 *-*-mint*)
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
41 EXE=""
991
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
42 MATHLIB=""
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
43 AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
44 if test "x$OSMESA_CONFIG" = "xyes"; then
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
45 OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
46 OSMESA_LIBS=`$OSMESA_CONFIG --libs`
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
47 CFLAGS="$CFLAGS $OSMESA_CFLAGS"
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
48 SYS_GL_LIBS="$OSMESA_LIBS"
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
49 else
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
50 SYS_GL_LIBS="-lOSMesa"
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
51 fi
12b13601a544 Final touches to OSMesa OpenGL support on Atari, using loadable libraries. Hope SDL 1.2.8 is out soon.
Patrice Mandin <patmandin@gmail.com>
parents: 981
diff changeset
52 ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
53 *)
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
54 EXE=""
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
55 MATHLIB="-lm"
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
56 SYS_GL_LIBS="-lGL"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
57 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
58 esac
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
59 AC_SUBST(EXE)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
60 AC_SUBST(MATHLIB)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
61
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
62 dnl Check for SDL
1387
835c1831f903 Tests require SDL 1.2.10
Sam Lantinga <slouken@libsdl.org>
parents: 1380
diff changeset
63 SDL_VERSION=1.2.10
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
64 AM_PATH_SDL($SDL_VERSION,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
65 :,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
66 AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
67 )
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
68 CFLAGS="$CFLAGS $SDL_CFLAGS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
69 LIBS="$LIBS $SDL_LIBS"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
70
3990
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
71 dnl Check for X11 path, needed for OpenGL on some systems
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
72 AC_PATH_X
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
73 if test x$have_x = xyes; then
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
74 if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
75 :
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
76 else
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
77 CFLAGS="$CFLAGS -I$ac_x_includes"
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
78 fi
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
79 if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
80 :
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
81 else
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
82 XPATH="-L$ac_x_libraries"
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
83 fi
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
84 fi
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
85
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
86 dnl Check for OpenGL
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
87 AC_MSG_CHECKING(for OpenGL support)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
88 have_opengl=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
89 AC_TRY_COMPILE([
292
eadc0746dfaf Added SDL_LockRect() and SDL_UnlockRect()
Sam Lantinga <slouken@libsdl.org>
parents: 214
diff changeset
90 #include "SDL_opengl.h"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
91 ],[
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
92 ],[
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
93 have_opengl=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
94 ])
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
95 AC_MSG_RESULT($have_opengl)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
96 if test x$have_opengl = xyes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
97 CFLAGS="$CFLAGS -DHAVE_OPENGL"
3990
1164b2b282a2 OpenGL is in the X11 directory on some systems.
Sam Lantinga <slouken@libsdl.org>
parents: 1813
diff changeset
98 GLLIB="$XPATH $SYS_GL_LIBS"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
99 else
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
100 GLLIB=""
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
101 fi
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
102 AC_SUBST(GLLIB)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
103
1380
d94b080ff6ce Completely removed dependency on automake
Sam Lantinga <slouken@libsdl.org>
parents: 1367
diff changeset
104 dnl Finally create all the generated files
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
105 AC_OUTPUT([Makefile])