Debian Codegraph @

src/modules/db_mysql/Makefile

raw
1 #
2 # WARNING: do not run this directly, it should be run by the main Makefile
3
4 include ../../Makefile.defs
5 auto_gen=
6 NAME=db_mysql.so
7
8 # set CROSS_COMPILE to true if you want to skip
9 # the autodetection
10 # CROSS_COMPILE=true
11
12 ifeq ($(CROSS_COMPILE),)
13 MYSQLCFG=$(shell which mysql_config)
14 ifeq ($(MYSQLCFG),)
15 MYSQLCFG=$(shell which mysql_config5)
16 endif
17 # If no Mysql - do we have MariaDB?
18 ifeq ($(MYSQLCFG),)
19 MYSQLCFG=$(shell which mariadb_config)
20 endif
21 endif
22
23 ifneq ($(MYSQLCFG),)
24 # use autodetection
25 DEFS += $(shell $(MYSQLCFG) --include)
26 LIBS = $(shell $(MYSQLCFG) --libs)
27 else
28 # mysql.h locations (freebsd,openbsd solaris)
29 DEFS +=-I$(LOCALBASE)/include \
30 -I$(LOCALBASE)/include/mysql \
31 -I$(LOCALBASE)/mysql/include
32 # libmysqlclient locations on RH/Suse, Solaris /OpenBSD, FreeBSD
33 # (Debian does the right thing and puts it in /usr/lib)
34 LIBS=-L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \
35 -L$(LOCALBASE)/mysql/lib/mysql/ \
36 -L$(LOCALBASE)/mysql/lib \
37 -lmysqlclient -lz
38 endif
39
40 ifneq (,$(filter sip-router ser, $(INSTALL_FLAVOUR)))
41 MOD_INSTALL_SHARE= ../../scripts/mysql/my_create.sql \
42 ../../scripts/mysql/my_data.sql \
43 ../../scripts/mysql/my_drop.sql
44 else ifeq ($(INSTALL_FLAVOUR),kamailio)
45 #TODO
46 endif
47
48 include ../../Makefile.modules
49
50 ifneq (,$(filter sip-router ser, $(INSTALL_FLAVOUR)))
51 # extra install for ser and sip-router
52
53 install-mysql-script: $(bin_prefix)/$(bin_dir)
54 sed -e "s#^DEFAULT_SCRIPT_DIR.*#DEFAULT_SCRIPT_DIR=\"$(share_prefix)/$(share_dir)\"#g" \
55 < ../../../misc/scripts/mysql/$(SCR_NAME)_mysql.sh > \
56 $(bin_prefix)/$(bin_dir)/$(MAIN_NAME)_mysql.sh
57 chmod 755 $(bin_prefix)/$(bin_dir)/$(MAIN_NAME)_mysql.sh
58
59 install-scripts: install-mysql-script
60
61 else ifeq ($(INSTALL_FLAVOUR),kamailio)
62 # extra install for kamailio
63
64 install-mysql-scripts: $(bin_prefix)/$(bin_dir)
65 MYSQLON=yes $(MAKE) -C ../../../utils/kamctl/ install-modules
66
67 install-scripts: install-mysql-scripts
68
69 endif # INSTALL_FLAVOUR