forked from OpenSIPS/opensips
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
53 lines (41 loc) · 1.42 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# WARNING: do not run this directly, it should be run by the master Makefile
include ../../Makefile.defs
auto_gen=
NAME=db_mysql.so
SCRIPTS_DIR?=../../scripts/
# set CROSS_COMPILE to true if you want to skip
# the autodetection
# CROSS_COMPILE=true
ifeq ($(CROSS_COMPILE),)
HAS_MYSQLCFG=$(shell if which mysql_config >/dev/null 2>/dev/null;then echo YES; fi)
endif
ifeq ($(HAS_MYSQLCFG),YES)
# use autodetection
DEFS += $(shell mysql_config --include)
LIBS += $(shell mysql_config --libs)
LIBS += -dl -Bsymbolic
else
# use standard know paths
# mysql.h locations (freebsd,openbsd solaris)
DEFS +=-I$(LOCALBASE)/include -I$(LOCALBASE)/mysql/include/mysql \
-I$(LOCALBASE)/mysql/include -I$(SYSBASE)/include
# libmysqlclient locations on RH/Suse, Solaris /OpenBSD, FreeBSD
# (Debian does the right thing and puts it in /usr/lib)
LIBS += -L$(SYSBASE)/lib/mysql -L$(LOCALBASE)/lib -L$(LOCALBASE)/lib/mysql \
-L$(LOCALBASE)/mysql/lib/mysql/ \
-L$(LOCALBASE)/mysql/lib \
-L$(SYSBASE)/lib64/mysql \
-lm -lmysqlclient -lz
LIBS += -dl -Bsymbolic
endif
include ../../Makefile.modules
install_module_dbschema:
mkdir -p $(data_prefix)/$(data_dir)/mysql ; \
for FILE in $(wildcard $(SCRIPTS_DIR)/mysql/*) ; do \
if [ -f $$FILE ] ; then \
$(INSTALL_TOUCH) $$FILE \
$(data_prefix)/$(data_dir)/mysql/`basename "$$FILE"` ; \
$(INSTALL_CFG) $$FILE \
$(data_prefix)/$(data_dir)/mysql/`basename "$$FILE"` ; \
fi ;\
done ; \