'g'o should not miss items in corners anymore
[k8-i-v-a-n.git] / Jamrules.configure
blob2f157eadc8974e18c5c0875e66a0536a36813dc6
1 PROJECT_NAME = I.V.A.N. ;
3 -configure-enable-disable-vars- +=
4   "sound"   USE_SOUND   "auto"  "enable sound"
5   "zlib"    USE_ZLIB    "auto"  "use ZLib"
6   "opengl"  USE_OPENGL  "auto"  "use OpenGL renderer"
7   #
8   "wizard"        USE_WIZARD        "auto"  "disable 'wizard' mode"
9   "global-saves"  USE_GLOBAL_SAVES  "auto"  "enable saves in \$HOME"
13 rule -configure-preinit- {
14   #USE_WIZARD
18 rule -configure- {
19   if $(OSPLAT) = 'X86_64' {
20     Echo "MSG: 64bit arches aren't supported. forcing 32-bit build." ;
21     -configure-add-line- "# 64shit found" ;
22     -configure-add-line- "CFLAGS.all += -m32 ;" ;
23     -configure-add-line- "LINKFLAGS.all += -m32 ;" ;
24   }
26   -configure-pkg-config-necessary-
27     "SDL"  "sdl < 2"
28     "OpenGL" gl
29   ;
31   # libpng 1.6
32   if ! [ -configure-pkg-config- "libpng" : "libpng >= 1.6" ] {
33     if ! [ -configure-pkg-config- "libpng16" : "libpng16 >= 1.6" ] {
34       Exit "FATAL: LibPNG 1.6 not found!" ;
35     }
36   }
38   local has-prefix = ;
39   for local ca in $(JAMCONFIGARGS) {
40     if [ Match '^--prefix=.+$' : $(ca) ] {
41       has-prefix = tan ;
42       break ;
43     }
44   }
46   if $(has-prefix) {
47     # this is 'install' version, fix options
48     if $(USE_WIZARD) == "auto" { USE_WIZARD = ; }
49     if $(USE_GLOBAL_SAVES) == "auto" { USE_GLOBAL_SAVES = tan ; }
50   } else {
51     if $(USE_WIZARD) == "auto" { USE_WIZARD = tan ; }
52     if $(USE_GLOBAL_SAVES) == "auto" { USE_GLOBAL_SAVES = ; }
53   }
54   #Echo "PREFIX:" $(has-prefix) ;
55   #Echo "USE_WIZARD:" $(USE_WIZARD) ;
56   #Echo "USE_GLOBAL_SAVES:" $(USE_GLOBAL_SAVES) ;
58   if ! $(USE_SOUND) {
59     -configure-add-line- "# sound disabled" ;
60     -configure-add-line- "DEFINES += DISABLE_SOUND ;" ;
61   } else {
62     -configure-pkg-config- "SDL Mixer" : SDL_mixer : : "DEFINES += DISABLE_SOUND ;" ;
63     -configure-pkg-config- "ALSA" : alsa : "DEFINES += ENABLE_ALSA ;" : ;
64   }
65   #
66   if ! $(USE_ZLIB) {
67     -configure-add-line- "# ZLib disabled" ;
68   } else {
69     if ! [ -configure-pkg-config- "ZLib" : zlib : "DEFINES += USE_ZLIB ;" ] { USE_ZLIB = ; }
70   }
71   #
73   -configure-add-line- "# other options" ;
74   if $(USE_WIZARD) {
75     Echo "CFG: wizard mode enabled" ;
76     -configure-add-line- "DEFINES += WIZARD ;" ;
77   }
78   #
79   if $(USE_GLOBAL_SAVES) {
80     Echo "CFG: using saves in \$HOME" ;
81   } else {
82     Echo "CFG: using local saves" ;
83     -configure-add-line- "DEFINES += LOCAL_SAVES ;" ;
84   }
85   #
86   if $(USE_ZLIB) {
87     Echo "CFG: support for compressed saves turned on" ;
88   }
92 configure ;