2
1

mysql.mk 3.5 KB

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