1 -configure-enable-disable-vars- +=
2 "postgres" USE_PGSQL "auto" "use PostgreSQL"
3 "mysql" USE_MYSQL "auto" "use MySQL"
6 rule -custom-pkg-find- {
8 local cmd = [ Command "whereis -b $(2) | awk '{print $2}'" : parse-output ] ;
9 Echo 'checking for' $(1) '... ' : -n ;
11 r = [ Command $(2) --version : exit-code no-output ] ;
23 Echo 'checking for' $(1) '... ' : -n ;
24 if [ Command pkg-config --exists $(1) : exit-code no-output ] == 0 {
32 rule -configure-test-gmp- {
34 -configure-test-compile-cc- "libgmp" :
38 "mpz_init_set_str(x, "1234567", 10);"
49 -configure-pkg-config-necessary-
54 if [ -custom-pkg-find- postgres : pg_config ] == 1 {
55 pg_include_dir = [ Command pg_config --includedir : parse-output no-space-break no-tab-break no-cr-break ] ;
56 -configure-add-line- "CFLAGS.all += -I$(pg_include_dir) ;" ;
57 pg_lib_dir = [ Command pg_config --libdir : parse-output no-space-break no-tab-break no-cr-break ] ;
58 -configure-add-line- "LINKLIBS.all += -L$(pg_lib_dir) -lpq -lpgtypes ;" ;
59 -configure-add-line- "SubInclude TOP src pg ;" ;
60 -configure-add-line- "SubInclude TOP include pg ;" ;
61 if [ -configure-test-gmp- ] == 1 {
62 -configure-add-line- "LINKLIBS.all += -lgmp -lm ;" ;
65 Exit "libgmp not found" ;
71 if [ -custom-pkg-find- mysql : mysql_config ] == 1 {
72 mysql_include_dir = [ Command mysql_config --include : parse-output no-space-break no-tab-break no-cr-break ] ;
73 -configure-add-line- "CFLAGS.all += $(mysql_include_dir) ;" ;
74 mysql_libs = [ Command mysql_config --libs : parse-output no-space-break no-tab-break no-cr-break ] ;
75 -configure-add-line- "LINKLIBS.all += $(mysql_libs) ;" ;
76 -configure-add-line- "SubInclude TOP src mysql ;" ;
77 -configure-add-line- "SubInclude TOP include mysql ;" ;
81 Command "$(TOP)/config.sh $(TOP) $(PREFIX) $(HAVE_PGSQL) $(HAVE_MYSQL)" ;
83 Echo 'PostgreSql ' $(HAVE_PGSQL) ;
84 Echo 'MySql ' $(HAVE_MYSQL) ;