fix for https://github.com/Attnam/ivan/issues/120
[k8-i-v-a-n.git] / Jamrules.configure
blob41e9ec18c82027601a7980406d7309899ecec0e2
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   #
8   "wizard"        USE_WIZARD        "auto"  "disable 'wizard' mode"
9   "global-saves"  USE_GLOBAL_SAVES  "auto"  "enable saves in \$HOME"
10   "pngshots"      USE_PNG_SHOTS     "tan"  "disable png savegame shots (use IPU)"
14 rule -configure-preinit- {
15   #USE_WIZARD
19 rule -configure- {
20   -configure-pkg-config-necessary-
21     "SDL"  "sdl < 2"
22   ;
24   local has-prefix = ;
25   for local ca in $(JAMCONFIGARGS) {
26     if [ Match '^--prefix=.+$' : $(ca) ] {
27       has-prefix = tan ;
28       break ;
29     }
30   }
32   if $(has-prefix) {
33     # this is 'install' version, fix options
34     if $(USE_WIZARD) == "auto" { USE_WIZARD = ; }
35     if $(USE_GLOBAL_SAVES) == "auto" { USE_GLOBAL_SAVES = tan ; }
36   } else {
37     if $(USE_WIZARD) == "auto" { USE_WIZARD = tan ; }
38     if $(USE_GLOBAL_SAVES) == "auto" { USE_GLOBAL_SAVES = ; }
39   }
40   #Echo "PREFIX:" $(has-prefix) ;
41   #Echo "USE_WIZARD:" $(USE_WIZARD) ;
42   #Echo "USE_GLOBAL_SAVES:" $(USE_GLOBAL_SAVES) ;
44   if ! $(USE_SOUND) {
45     -configure-add-line- "# sound disabled" ;
46     -configure-add-line- "DEFINES += DISABLE_SOUND ;" ;
47   } else {
48     -configure-pkg-config- "SDL Mixer" : SDL_mixer : : "DEFINES += DISABLE_SOUND ;" ;
49   }
50   #
51   if ! $(USE_ZLIB) {
52     -configure-add-line- "# ZLib disabled" ;
53   } else {
54     if ! [ -configure-pkg-config- "ZLib" : zlib : "DEFINES += USE_ZLIB ;" ] { USE_ZLIB = ; }
55   }
56   #
57   if ! $(USE_IMLIB2) {
58     -configure-add-line- "# imlib2 disabled" ;
59   } else {
60     if ! [ -configure-pkg-config- "imlib2" : imlib2 : "DEFINES += HAVE_IMLIB2 ;" ] { USE_IMLIB2 = ; }
61   }
62   #
63   ### if $(HAVE_LIBPNG) {
64   ###   Echo "MSG: libpng found" ;
65   ###   lib-config "pkg-config libpng" ;
66   ###   DEFINES += HAVE_LIBPNG ;
67   ### }
68   #
69   -configure-add-line- "# other options" ;
70   if $(USE_WIZARD) {
71     Echo "CFG: wizard mode enabled" ;
72     -configure-add-line- "DEFINES += WIZARD ;" ;
73   }
74   #
75   if $(USE_GLOBAL_SAVES) {
76     Echo "CFG: using saves in \$HOME" ;
77   } else {
78     Echo "CFG: using local saves" ;
79     -configure-add-line- "DEFINES += LOCAL_SAVES ;" ;
80   }
81   #
82   if $(USE_ZLIB) {
83     Echo "CFG: support for compressed saves turned on" ;
84   }
85   # USE_LIBPNG
86   if $(USE_IMLIB2) && $(USE_PNG_SHOTS) {
87     Echo "CFG: savegame screenshots will be in PNG format" ;
88   } else {
89     Echo "CFG: savegame screenshots will be in internal format" ;
90     -configure-add-line- "DEFINES += SGAME_SHOTS_IPU ;" ;
91   }
95 configure ;