mysql.mk 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. ################################################################################
  2. #
  3. # mysql
  4. #
  5. ################################################################################
  6. MYSQL_VERSION_MAJOR = 5.1
  7. MYSQL_VERSION = $(MYSQL_VERSION_MAJOR).73
  8. MYSQL_SOURCE = mysql-$(MYSQL_VERSION).tar.gz
  9. MYSQL_SITE = http://downloads.skysql.com/archives/mysql-$(MYSQL_VERSION_MAJOR)
  10. MYSQL_INSTALL_STAGING = YES
  11. MYSQL_DEPENDENCIES = readline ncurses
  12. MYSQL_AUTORECONF = YES
  13. MYSQL_LICENSE = GPLv2
  14. MYSQL_LICENSE_FILES = README COPYING
  15. # Unix socket. This variable can also be consulted by other buildroot packages
  16. MYSQL_SOCKET = /run/mysql/mysql.sock
  17. MYSQL_CONF_ENV = \
  18. ac_cv_sys_restartable_syscalls=yes \
  19. ac_cv_path_PS=/bin/ps \
  20. ac_cv_FIND_PROC="/bin/ps p \$\$PID | grep -v grep | grep mysqld > /dev/null" \
  21. ac_cv_have_decl_HAVE_IB_ATOMIC_PTHREAD_T_GCC=yes \
  22. ac_cv_have_decl_HAVE_IB_ATOMIC_PTHREAD_T_SOLARIS=no \
  23. ac_cv_have_decl_HAVE_IB_GCC_ATOMIC_BUILTINS=yes \
  24. mysql_cv_new_rl_interface=yes
  25. MYSQL_CONF_OPTS = \
  26. --without-ndb-binlog \
  27. --without-docs \
  28. --without-man \
  29. --without-libedit \
  30. --without-readline \
  31. --with-low-memory \
  32. --enable-thread-safe-client \
  33. --with-unix-socket-path=$(MYSQL_SOCKET) \
  34. --disable-mysql-maintainer-mode
  35. # host-mysql only installs what is needed to build mysql, i.e. the
  36. # gen_lex_hash tool, and it only builds the parts that are needed to
  37. # create this tool
  38. HOST_MYSQL_DEPENDENCIES = host-zlib host-ncurses
  39. HOST_MYSQL_CONF_OPTS = \
  40. --with-embedded-server \
  41. --disable-mysql-maintainer-mode
  42. define HOST_MYSQL_BUILD_CMDS
  43. $(MAKE) -C $(@D)/include my_config.h
  44. $(MAKE) -C $(@D)/mysys libmysys.a
  45. $(MAKE) -C $(@D)/strings libmystrings.a
  46. $(MAKE) -C $(@D)/vio libvio.a
  47. $(MAKE) -C $(@D)/dbug libdbug.a
  48. $(MAKE) -C $(@D)/regex libregex.a
  49. $(MAKE) -C $(@D)/sql gen_lex_hash
  50. endef
  51. define HOST_MYSQL_INSTALL_CMDS
  52. $(INSTALL) -m 0755 $(@D)/sql/gen_lex_hash $(HOST_DIR)/usr/bin/
  53. endef
  54. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  55. MYSQL_DEPENDENCIES += openssl
  56. endif
  57. ifeq ($(BR2_PACKAGE_ZLIB),y)
  58. MYSQL_DEPENDENCIES += zlib
  59. endif
  60. ifeq ($(BR2_PACKAGE_MYSQL_SERVER),y)
  61. MYSQL_DEPENDENCIES += host-mysql host-bison
  62. MYSQL_CONF_OPTS += \
  63. --localstatedir=/var/mysql \
  64. --with-atomic-ops=up \
  65. --with-embedded-server \
  66. --without-query-cache \
  67. --without-plugin-partition \
  68. --without-plugin-daemon_example \
  69. --without-plugin-ftexample \
  70. --without-plugin-archive \
  71. --without-plugin-blackhole \
  72. --without-plugin-example \
  73. --without-plugin-federated \
  74. --without-plugin-ibmdb2i \
  75. --without-plugin-innobase \
  76. --without-plugin-innodb_plugin \
  77. --without-plugin-ndbcluster
  78. # Debugging is only available for the server, so no need for
  79. # this if-block outside of the server if-block
  80. ifeq ($(BR2_ENABLE_DEBUG),y)
  81. MYSQL_CONF_OPTS += --with-debug=full
  82. else
  83. MYSQL_CONF_OPTS += --without-debug
  84. endif
  85. define MYSQL_USERS
  86. mysql -1 nogroup -1 * /var/mysql - - MySQL daemon
  87. endef
  88. define MYSQL_ADD_FOLDER
  89. $(INSTALL) -d $(TARGET_DIR)/var/mysql
  90. endef
  91. MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_ADD_FOLDER
  92. define MYSQL_INSTALL_INIT_SYSV
  93. $(INSTALL) -D -m 0755 package/mysql/S97mysqld \
  94. $(TARGET_DIR)/etc/init.d/S97mysqld
  95. endef
  96. define MYSQL_INSTALL_INIT_SYSTEMD
  97. $(INSTALL) -D -m 644 package/mysql/mysqld.service \
  98. $(TARGET_DIR)/usr/lib/systemd/system/mysqld.service
  99. mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
  100. ln -sf ../../../../usr/lib/systemd/system/mysqld.service \
  101. $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mysqld.service
  102. endef
  103. else
  104. MYSQL_CONF_OPTS += \
  105. --without-server
  106. endif
  107. define MYSQL_REMOVE_TEST_PROGS
  108. rm -rf $(TARGET_DIR)/usr/mysql-test $(TARGET_DIR)/usr/sql-bench
  109. endef
  110. MYSQL_POST_INSTALL_TARGET_HOOKS += MYSQL_REMOVE_TEST_PROGS
  111. $(eval $(autotools-package))
  112. $(eval $(host-autotools-package))