configure: checking for timegm()
[k8lowj.git] / Jamrules.configure
blob37f52d0895540db3f9103ca64f91c72bb0a9167c
1 PROJECT_NAME = k8logjam ;
3 # "auto": check with pkg-config or so, show '--disable-xxx'
4 # "": disabled by default, show '--enable-xxx'
5 # non-empty string: enabled by default, show '--disable-xxx'
6 -configure-enable-disable-vars- +=
7   #"cli"       USE_CLI       ""      "build cli-only version"
8   "sqlite"    USE_SQLITE    "auto"  "don't use sqlite"
9   "gtkhtml"   USE_GTKHTML   "auto"  "don't use GTKHTML"
10   "gtkspell"  USE_GTKSPELL  "auto"  "don't use GTKSpell"
11   "svg"       USE_RSVG      "auto"  "don't use librsvg"
12   "curl"      USE_CURL      "auto"  "don't use libcurl"
13   "dock"      USE_DOCK      "tan"   "disable dock icon"
14   "timegm"    USE_TIMEGM    "auto"  "don't use timegm()"
18 rule -configure-test-timegm- {
19   return [
20     -configure-test-compile-cc- "timegm()" :
21       "#include <stdlib.h>"
22       "#include <time.h>"
23       "int main() {"
24       "struct tm _tm = { 0 };"
25       "_tm.tm_year = 2000;"
26       "_tm.tm_mon = 1;"
27       "_tm.tm_mday = 1;"
28       "timegm(&_tm);"
29       "return 0;"
30       "}"
31   ] ;
35 rule -configure- {
36   USE_CLI = ;
37   -configure-pkg-config-necessary-
38     "GLib"    "glib-2.0 >= 2.30.0"
39     "GObject" "gobject-2.0 >= 2.30.0"
40     "LibXML2" "libxml-2.0 >= 2.9"
41   ;
42   if ! $(USE_CLI) {
43     -configure-pkg-config-necessary-
44       "GTK+2"   "gtk+-2.0"
45       "X11"     "x11"
46     ;
47     -configure-add-line- "DEFINES += HAVE_GTK HAVE_LIBXML ;" ;
48   }
50   if $(USE_SQLITE) { -configure-pkg-config- "SQLite3" : "sqlite3" : "DEFINES += HAVE_SQLITE3 ;" ; }
51   if ! $(USE_CLI) {
52     if $(USE_GTKSPELL) { -configure-pkg-config- "GTKSpell" : "gtkspell-2.0" : "DEFINES += HAVE_GTKSPELL ;" ; }
53     if $(USE_GTKHTML) { -configure-pkg-config- "libgtkhtml3.30" : "libgtkhtml-3.30" : "DEFINES += HAVE_GTKHTML330 HAVE_GTKHTML ;" ; }
54     if $(USE_RSVG) {
55       if ! [-configure-pkg-config- "librsvg" : "librsvg-2.0 > 2.2.3" : "DEFINES += HAVE_LIBRSVG ;" ] { USE_RSVG = ; } else { USE_RSVG = "tan" ; }
56     }
57     -configure-add-line- "USE_RSVG =" $(USE_RSVG) ";" ;
58   }
60   if $(USE_CURL) {
61     if ! [ -configure-pkg-config- "libcurl" : "libcurl >= 7.30" : "DEFINES += HAVE_CURL ;" ] { USE_CURL = ; }
62   }
64   if ! $(USE_CURL) {
65     Echo "WARNING: libcurl wasn't found! using VERY LIMITED LibXML http code!" ;
66   }
68   if $(USE_TIMEGM) = "auto" {
69     USE_TIMEGM = [ -configure-test-timegm- ] ;
70   }
71   -configure-add-line- "# timegm()" ;
72   if $(USE_TIMEGM) {
73     Echo "CFG: timegm() enabled" ;
74     -configure-add-line- "DEFINES += HAVE_TIMEGM ;" ;
75   } else {
76     Echo "CFG: timegm() disabled" ;
77     -configure-add-line- "# timegm() disabled" ;
78   }
80   if ! $(USE_CLI) {
81     -configure-add-line- "# dock" ;
82     if $(USE_DOCK) {
83       Echo "CFG: dock icon enabled" ;
84       -configure-add-line- "DEFINES += USE_DOCK ;" ;
85     } else {
86       Echo "CFG: dock icon disabled" ;
87       -configure-add-line- "# dock disabled" ;
88     }
89   }
91   #-configure-add-line- "# other autocrap shit" ;
92   #-configure-add-line- "DEFINES += HAVE_GTK_MULTIHEAD ;" ;
94   if $(USE_CLI) {
95     Echo "CFG: building CLI version" ;
96   } else {
97     Echo "CFG: building GUI version" ;
98   }
102 configure ;