`RandomChance` type, and two new item fields: `MagicEffectChance`, `MagicEffectDuration`
[k8-i-v-a-n.git] / Jamrules.configure
blobbed4974ae528e2aabfa4317b1d5387b0f294d963
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   "imlib2"  USE_IMLIB2  "auto"  "use imlib2"
7   "opengl"  USE_OPENGL  "auto"  "use OpenGL renderer"
8   "libpng"  USE_LIBPNG  "auto"  "use LibPNG to load graphics (this won't disable pcx)"
9   #
10   "wizard"        USE_WIZARD        "auto"  "disable 'wizard' mode"
11   "global-saves"  USE_GLOBAL_SAVES  "auto"  "enable saves in \$HOME"
12   "pngshots"      USE_PNG_SHOTS     "tan"  "disable png savegame shots (use IPU)"
16 rule -configure-preinit- {
17   #USE_WIZARD
21 rule -configure- {
22   -configure-pkg-config-necessary-
23     "SDL"  "sdl < 2"
24   ;
26   local has-prefix = ;
27   for local ca in $(JAMCONFIGARGS) {
28     if [ Match '^--prefix=.+$' : $(ca) ] {
29       has-prefix = tan ;
30       break ;
31     }
32   }
34   if $(has-prefix) {
35     # this is 'install' version, fix options
36     if $(USE_WIZARD) == "auto" { USE_WIZARD = ; }
37     if $(USE_GLOBAL_SAVES) == "auto" { USE_GLOBAL_SAVES = tan ; }
38   } else {
39     if $(USE_WIZARD) == "auto" { USE_WIZARD = tan ; }
40     if $(USE_GLOBAL_SAVES) == "auto" { USE_GLOBAL_SAVES = ; }
41   }
42   #Echo "PREFIX:" $(has-prefix) ;
43   #Echo "USE_WIZARD:" $(USE_WIZARD) ;
44   #Echo "USE_GLOBAL_SAVES:" $(USE_GLOBAL_SAVES) ;
46   if ! $(USE_SOUND) {
47     -configure-add-line- "# sound disabled" ;
48     -configure-add-line- "DEFINES += DISABLE_SOUND ;" ;
49   } else {
50     -configure-pkg-config- "SDL Mixer" : SDL_mixer : : "DEFINES += DISABLE_SOUND ;" ;
51     -configure-pkg-config- "ALSA" : alsa : "DEFINES += ENABLE_ALSA ;" : ;
52   }
53   if ! $(USE_OPENGL) {
54     -configure-add-line- "# OpenGL disabled" ;
55     -configure-add-line- "DEFINES += DISABLE_OPENGL ;" ;
56   } else {
57     -configure-pkg-config- "OpenGL" : gl :  : "DEFINES += DISABLE_OPENGL ;" ;
58   }
59   #
60   if ! $(USE_ZLIB) {
61     -configure-add-line- "# ZLib disabled" ;
62   } else {
63     if ! [ -configure-pkg-config- "ZLib" : zlib : "DEFINES += USE_ZLIB ;" ] { USE_ZLIB = ; }
64   }
65   #
66   # libpng 1.6
67   if $(USE_LIBPNG) {
68     if ! [ -configure-pkg-config- "libpng" : "libpng >= 1.6" ] {
69       if ! [ -configure-pkg-config- "libpng16" : "libpng16 >= 1.6" ] {
70         USE_LIBPNG = ;
71       }
72     }
73   }
74   if ! $(USE_LIBPNG) {
75     -configure-add-line- "# libpng disabled" ;
76     if ! $(USE_IMLIB2) {
77       -configure-add-line- "# imlib2 disabled" ;
78     } else {
79       #if ! [ -configure-pkg-config- "imlib2" : imlib2 : "DEFINES += HAVE_IMLIB2 ;" ] { USE_IMLIB2 = ; }
80     }
81     Exit "FATAL: LibPNG 1.6 not found!" ;
82   } else {
83     -configure-add-line- "DEFINES += HAVE_LIBPNG ;" ;
84   }
85   #
86   ### if $(HAVE_LIBPNG) {
87   ###   Echo "MSG: libpng found" ;
88   ###   lib-config "pkg-config libpng" ;
89   ###   DEFINES += HAVE_LIBPNG ;
90   ### }
91   #
92   if $(OSPLAT) = 'X86_64' {
93     Echo "MSG: 64bit arches aren't supported. forcing 32-bit build." ;
94     -configure-add-line- "# 64shit found" ;
95     -configure-add-line- "CFLAGS.all += -m32 ;" ;
96     -configure-add-line- "LINKFLAGS.all += -m32 ;" ;
97   }
99   -configure-add-line- "# other options" ;
100   if $(USE_WIZARD) {
101     Echo "CFG: wizard mode enabled" ;
102     -configure-add-line- "DEFINES += WIZARD ;" ;
103   }
104   #
105   if $(USE_GLOBAL_SAVES) {
106     Echo "CFG: using saves in \$HOME" ;
107   } else {
108     Echo "CFG: using local saves" ;
109     -configure-add-line- "DEFINES += LOCAL_SAVES ;" ;
110   }
111   #
112   if $(USE_ZLIB) {
113     Echo "CFG: support for compressed saves turned on" ;
114   }
115   # USE_LIBPNG
116   if $(USE_PNG_SHOTS) {
117     Echo "CFG: savegame screenshots will be in PNG format" ;
118   } else {
119     Echo "CFG: savegame screenshots will be in internal format" ;
120     -configure-add-line- "DEFINES += SGAME_SHOTS_IPU ;" ;
121   }
125 configure ;