xref: /OK3568_Linux_fs/buildroot/package/oracle-mysql/oracle-mysql.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# oracle-mysql
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunORACLE_MYSQL_VERSION_MAJOR = 5.1
8*4882a593SmuzhiyunORACLE_MYSQL_VERSION = $(ORACLE_MYSQL_VERSION_MAJOR).73
9*4882a593SmuzhiyunORACLE_MYSQL_SOURCE = mysql-$(ORACLE_MYSQL_VERSION).tar.gz
10*4882a593SmuzhiyunORACLE_MYSQL_SITE = http://dev.mysql.com/get/Downloads/MySQL-$(ORACLE_MYSQL_VERSION_MAJOR)
11*4882a593SmuzhiyunORACLE_MYSQL_INSTALL_STAGING = YES
12*4882a593SmuzhiyunORACLE_MYSQL_DEPENDENCIES = ncurses
13*4882a593SmuzhiyunORACLE_MYSQL_AUTORECONF = YES
14*4882a593SmuzhiyunORACLE_MYSQL_LICENSE = GPL-2.0
15*4882a593SmuzhiyunORACLE_MYSQL_LICENSE_FILES = README COPYING
16*4882a593SmuzhiyunORACLE_MYSQL_SELINUX_MODULES = mysql
17*4882a593SmuzhiyunORACLE_MYSQL_PROVIDES = mysql
18*4882a593SmuzhiyunORACLE_MYSQL_CONFIG_SCRIPTS = mysql_config
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun# Unix socket. This variable can also be consulted by other buildroot packages
21*4882a593SmuzhiyunMYSQL_SOCKET = /run/mysql/mysql.sock
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunORACLE_MYSQL_CONF_ENV = \
24*4882a593Smuzhiyun	ac_cv_sys_restartable_syscalls=yes \
25*4882a593Smuzhiyun	ac_cv_path_PS=/bin/ps \
26*4882a593Smuzhiyun	ac_cv_path_HOSTNAME=/bin/hostname \
27*4882a593Smuzhiyun	ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null" \
28*4882a593Smuzhiyun	ac_cv_have_decl_HAVE_IB_ATOMIC_PTHREAD_T_GCC=yes \
29*4882a593Smuzhiyun	ac_cv_have_decl_HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS=no \
30*4882a593Smuzhiyun	ac_cv_have_decl_HAVE_IB_GCC_ATOMIC_BUILTINS=yes \
31*4882a593Smuzhiyun	mysql_cv_new_rl_interface=yes
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunORACLE_MYSQL_CONF_OPTS = \
34*4882a593Smuzhiyun	--without-ndb-binlog \
35*4882a593Smuzhiyun	--without-docs \
36*4882a593Smuzhiyun	--without-man \
37*4882a593Smuzhiyun	--without-libedit \
38*4882a593Smuzhiyun	--with-readline \
39*4882a593Smuzhiyun	--with-low-memory \
40*4882a593Smuzhiyun	--enable-thread-safe-client \
41*4882a593Smuzhiyun	--with-unix-socket-path=$(MYSQL_SOCKET) \
42*4882a593Smuzhiyun	--disable-mysql-maintainer-mode
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun# host-oracle-mysql only installs what is needed to build mysql, i.e. the
45*4882a593Smuzhiyun# gen_lex_hash tool, and it only builds the parts that are needed to
46*4882a593Smuzhiyun# create this tool
47*4882a593SmuzhiyunHOST_ORACLE_MYSQL_DEPENDENCIES = host-zlib host-ncurses
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunHOST_ORACLE_MYSQL_CONF_OPTS = \
50*4882a593Smuzhiyun	--with-embedded-server \
51*4882a593Smuzhiyun	--disable-mysql-maintainer-mode
52*4882a593Smuzhiyun
53*4882a593Smuzhiyundefine HOST_ORACLE_MYSQL_BUILD_CMDS
54*4882a593Smuzhiyun	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/include my_config.h
55*4882a593Smuzhiyun	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/mysys libmysys.a
56*4882a593Smuzhiyun	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/strings libmystrings.a
57*4882a593Smuzhiyun	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/vio libvio.a
58*4882a593Smuzhiyun	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/dbug libdbug.a
59*4882a593Smuzhiyun	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/regex libregex.a
60*4882a593Smuzhiyun	$(HOST_MAKE_ENV) $(MAKE) -C $(@D)/sql gen_lex_hash
61*4882a593Smuzhiyunendef
62*4882a593Smuzhiyun
63*4882a593Smuzhiyundefine HOST_ORACLE_MYSQL_INSTALL_CMDS
64*4882a593Smuzhiyun	$(INSTALL) -m 0755 $(@D)/sql/gen_lex_hash $(HOST_DIR)/bin/
65*4882a593Smuzhiyunendef
66*4882a593Smuzhiyun
67*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPENSSL),y)
68*4882a593SmuzhiyunORACLE_MYSQL_DEPENDENCIES += openssl
69*4882a593Smuzhiyunendif
70*4882a593Smuzhiyun
71*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ZLIB),y)
72*4882a593SmuzhiyunORACLE_MYSQL_DEPENDENCIES += zlib
73*4882a593SmuzhiyunORACLE_MYSQL_CONF_OPTS += --with-zlib-dir=$(STAGING_DIR)/usr
74*4882a593Smuzhiyunelse
75*4882a593SmuzhiyunORACLE_MYSQL_CONF_OPTS += --without-zlib-dir
76*4882a593Smuzhiyunendif
77*4882a593Smuzhiyun
78*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_ORACLE_MYSQL_SERVER),y)
79*4882a593SmuzhiyunORACLE_MYSQL_DEPENDENCIES += host-oracle-mysql host-bison
80*4882a593Smuzhiyun
81*4882a593SmuzhiyunORACLE_MYSQL_CONF_OPTS += \
82*4882a593Smuzhiyun	--localstatedir=/var/mysql \
83*4882a593Smuzhiyun	--with-atomic-ops=up \
84*4882a593Smuzhiyun	--with-embedded-server \
85*4882a593Smuzhiyun	--without-query-cache \
86*4882a593Smuzhiyun	--without-plugin-partition \
87*4882a593Smuzhiyun	--without-plugin-daemon_example \
88*4882a593Smuzhiyun	--without-plugin-ftexample \
89*4882a593Smuzhiyun	--without-plugin-archive \
90*4882a593Smuzhiyun	--without-plugin-blackhole \
91*4882a593Smuzhiyun	--without-plugin-example \
92*4882a593Smuzhiyun	--without-plugin-federated \
93*4882a593Smuzhiyun	--without-plugin-ibmdb2i \
94*4882a593Smuzhiyun	--without-plugin-innobase \
95*4882a593Smuzhiyun	--without-plugin-innodb_plugin \
96*4882a593Smuzhiyun	--without-plugin-ndbcluster
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun# Debugging is only available for the server, so no need for
99*4882a593Smuzhiyun# this if-block outside of the server if-block
100*4882a593Smuzhiyunifeq ($(BR2_ENABLE_RUNTIME_DEBUG),y)
101*4882a593SmuzhiyunORACLE_MYSQL_CONF_OPTS += --with-debug=full
102*4882a593Smuzhiyunelse
103*4882a593SmuzhiyunORACLE_MYSQL_CONF_OPTS += --without-debug
104*4882a593Smuzhiyunendif
105*4882a593Smuzhiyun
106*4882a593Smuzhiyundefine ORACLE_MYSQL_USERS
107*4882a593Smuzhiyun	mysql -1 nobody -1 * /var/mysql - - MySQL daemon
108*4882a593Smuzhiyunendef
109*4882a593Smuzhiyun
110*4882a593Smuzhiyundefine ORACLE_MYSQL_ADD_FOLDER
111*4882a593Smuzhiyun	$(INSTALL) -d $(TARGET_DIR)/var/mysql
112*4882a593Smuzhiyunendef
113*4882a593Smuzhiyun
114*4882a593SmuzhiyunORACLE_MYSQL_POST_INSTALL_TARGET_HOOKS += ORACLE_MYSQL_ADD_FOLDER
115*4882a593Smuzhiyun
116*4882a593Smuzhiyundefine ORACLE_MYSQL_INSTALL_INIT_SYSV
117*4882a593Smuzhiyun	$(INSTALL) -D -m 0755 $(ORACLE_MYSQL_PKGDIR)/S97mysqld \
118*4882a593Smuzhiyun		$(TARGET_DIR)/etc/init.d/S97mysqld
119*4882a593Smuzhiyunendef
120*4882a593Smuzhiyun
121*4882a593Smuzhiyundefine ORACLE_MYSQL_INSTALL_INIT_SYSTEMD
122*4882a593Smuzhiyun	$(INSTALL) -D -m 644 $(ORACLE_MYSQL_PKGDIR)/mysqld.service \
123*4882a593Smuzhiyun		$(TARGET_DIR)/usr/lib/systemd/system/mysqld.service
124*4882a593Smuzhiyunendef
125*4882a593Smuzhiyun
126*4882a593Smuzhiyunelse
127*4882a593SmuzhiyunORACLE_MYSQL_CONF_OPTS += \
128*4882a593Smuzhiyun	--without-server
129*4882a593Smuzhiyunendif
130*4882a593Smuzhiyun
131*4882a593Smuzhiyundefine ORACLE_MYSQL_REMOVE_TEST_PROGS
132*4882a593Smuzhiyun	rm -rf $(TARGET_DIR)/usr/mysql-test $(TARGET_DIR)/usr/sql-bench
133*4882a593Smuzhiyunendef
134*4882a593Smuzhiyun
135*4882a593SmuzhiyunORACLE_MYSQL_POST_INSTALL_TARGET_HOOKS += ORACLE_MYSQL_REMOVE_TEST_PROGS
136*4882a593Smuzhiyun
137*4882a593Smuzhiyun$(eval $(autotools-package))
138*4882a593Smuzhiyun$(eval $(host-autotools-package))
139