1 -configure-enable-disable-vars- +=
2 "postgres" USE_PGSQL "auto" "use PostgreSQL"
3 "mysql" USE_MYSQL "auto" "use MySQL"
4 "monetdb" USE_MONETDB "auto" "use MonetDB"
5 "firebird" USE_FBSQL "auto" "use Firebird"
8 rule -custom-pkg-find- {
10 local cmd = [ Command "whereis -b $(2) | awk '{print $2}'" : parse-output ] ;
11 Echo 'checking for' $(1) '... ' : -n ;
13 r = [ Command $(2) --version : exit-code no-output ] ;
25 Echo 'checking for' $(1) '... ' : -n ;
26 if [ Command pkg-config --exists $(1) : exit-code no-output ] == 0 {
34 rule -configure-test-gmp- {
36 -configure-test-compile-cc- "libgmp" :
40 "mpz_init_set_str(x, "1234567", 10);"
51 local pp = [ Command "echo $(PREFIX) | sed \"s/\\//\\\\\\\\\\\//g\"" : dummy ] ;
52 Command "sed -e \"s/@prefix/\\$(pp)/\" ./src/libdbcli.pc.in > ./src/libdbcli.pc" ;
53 -configure-pkg-config-necessary-
60 if [ -custom-pkg-find- postgres : pg_config ] == 1 {
61 pg_include_dir = [ Command pg_config --includedir : parse-output no-space-break no-tab-break no-cr-break ] ;
62 -configure-add-line- "CFLAGS.all += -I$(pg_include_dir) ;" ;
63 pg_lib_dir = [ Command pg_config --libdir : parse-output no-space-break no-tab-break no-cr-break ] ;
64 -configure-add-line- "LINKLIBS.all += -L$(pg_lib_dir) -lpq -lpgtypes ;" ;
65 -configure-add-line- "SubInclude TOP src pg ;" ;
66 -configure-add-line- "SubInclude TOP include pg ;" ;
67 if [ -configure-test-gmp- ] == 1 {
68 -configure-add-line- "LINKLIBS.all += -lgmp -lm ;" ;
70 PGSQL_VER = [ Command pg_config --version : parse-output no-space-break no-tab-break no-cr-break ] ;
72 -configure-add-line- "SubInclude TOP test pg ;" ;
75 Exit "libgmp not found" ;
83 if [ -custom-pkg-find- mysql : mysql_config ] == 1 {
84 mysql_include_dir = [ Command mysql_config --include : parse-output no-space-break no-tab-break no-cr-break ] ;
85 -configure-add-line- "CFLAGS.all += $(mysql_include_dir) ;" ;
86 mysql_libs = [ Command mysql_config --libs : parse-output no-space-break no-tab-break no-cr-break ] ;
87 -configure-add-line- "LINKLIBS.all += $(mysql_libs) ;" ;
88 -configure-add-line- "SubInclude TOP src mysql ;" ;
89 -configure-add-line- "SubInclude TOP include mysql ;" ;
91 MYSQL_VER = [ Command mysql_config --version : parse-output no-space-break no-tab-break no-cr-break ] ;
98 if [ -pkg-find- monetdb-mapi ] == 1 {
99 mdb_include = [ Command pkg-config --cflags monetdb-mapi : parse-output no-space-break no-tab-break no-cr-break ] ;
100 mdb_libs = [ Command pkg-config --libs monetdb-mapi : parse-output no-space-break no-tab-break no-cr-break ] ;
101 -configure-add-line- "CFLAGS.all += $(mdb_include) ;" ;
102 -configure-add-line- "LINKLIBS.all += $(mdb_libs) ;" ;
103 -configure-add-line- "SubInclude TOP src mdb ;" ;
104 -configure-add-line- "SubInclude TOP include mdb ;" ;
105 HAVE_MONETDB = 'yes' ;
106 MONETDB_VER = [ Command pkg-config --modversion monetdb-mapi : parse-output no-space-break no-tab-break no-cr-break ] ;
108 -configure-add-line- "SubInclude TOP test mdb ;" ;
116 if [ -custom-pkg-find- firebird : fb_config ] == 1 {
117 fbsql_cflags = [ Command fb_config --cflags : parse-output no-space-break no-tab-break no-cr-break ] ;
118 fbsql_libs = [ Command fb_config --libs : parse-output no-space-break no-tab-break no-cr-break ] ;
119 -configure-add-line- "CFLAGS.all += $(fbsql_cflags) ;" ;
120 -configure-add-line- "LINKLIBS.all += $(fbsql_libs) ;" ;
121 -configure-add-line- "SubInclude TOP src gds ;" ;
122 -configure-add-line- "SubInclude TOP include gds ;" ;
124 FBSQL_VER = [ Command fb_config --version : parse-output no-space-break no-tab-break no-cr-break ] ;
126 -configure-add-line- "SubInclude TOP test gds ;" ;
132 -configure-add-line- "CFLAGS.all += -O0 -g3 ;" ;
134 -configure-add-line- "set-profile ;" ;
137 Command "$(TOP)/config.sh $(TOP) $(PREFIX) $(HAVE_PGSQL) $(HAVE_MYSQL) $(HAVE_MONETDB) $(HAVE_FBSQL)" ;
139 Echo 'Database interfaces:' ;
140 Echo ' PostgreSql ' $(PGSQL_VER) ;
141 Echo ' MySql ' $(MYSQL_VER) ;
142 Echo ' MonetDB ' $(MONETDB_VER) ;
143 Echo ' Firebird ' $(FBSQL_VER) ;