summaryrefslogtreecommitdiff
path: root/package/mysql
diff options
context:
space:
mode:
Diffstat (limited to 'package/mysql')
-rw-r--r--package/mysql/Makefile26
-rw-r--r--package/mysql/patches/patch-include_config_h_in4
-rw-r--r--package/mysql/patches/patch-scripts_mysql_config_sh11
3 files changed, 27 insertions, 14 deletions
diff --git a/package/mysql/Makefile b/package/mysql/Makefile
index fb3d1404c..09aa971b0 100644
--- a/package/mysql/Makefile
+++ b/package/mysql/Makefile
@@ -25,7 +25,7 @@ BUILD_STYLE:= manual
INSTALL_STYLE:= manual
CONFIGURE_ENV+= OPTIMIZE_CFLAGS="${TARGET_CFLAGS}" \
- OPTIMIZE_CXXFLAGS="${TARGET_CFLAGS}" \
+ OPTIMIZE_CXXFLAGS="${TARGET_CXXFLAGS}" \
ac_cv_lib_nsl_gethostbyname_r=no \
ac_cv_lib_nsl_yp_get_default_domain=no \
ac_cv_sys_restartable_syscalls=yes \
@@ -50,16 +50,16 @@ CONFIGURE_ARGS+= --disable-assembler \
--without-docs \
--without-readline \
--with-machine-type=${CPU_ARCH}
-HOSTTOOLFLAGS= CC="${HOSTCC}" \
- CXX='c++' \
- CFLAGS='${HOSTCFLAGS} -DHOSTCOMPILE=1' \
- CXXFLAGS='${HOSTCFLAGS}' \
- LDFLAGS='${HOSTLDFLAGS}' \
- CPPFLAGS='${HOSTCPPFLAGS}' \
- CXXLINK='c++ ${HOSTCFLAGS} ${HOSTLDFLAGS} -o $$@' \
- LINK='${HOSTCC} ${HOSTCFLAGS} ${HOSTLDFLAGS} -o $$@'
+BUILD_LFLAGS= CC="${CC_FOR_BUILD}" \
+ CXX='${CXX_FOR_BUILD}' \
+ CFLAGS='${CFLAGS_FOR_BUILD} -DHOSTCOMPILE=1' \
+ CXXFLAGS='${CXXFLAGS_FOR_BUILD}' \
+ LDFLAGS='${LDFLAGS_FOR_BUILD}' \
+ CPPFLAGS='${CPPFLAGS_FOR_BUILD}' \
+ CXXLINK='${CXX_FOR_BUILD} ${CFLAGS_FOR_BUILD} ${LDFLAGS_FOR_BUILD} -o $$@' \
+ LINK='${CC_FOR_BUILD} ${CFLAGS_FOR_BUILD} ${LDFLAGS_FOR_BUILD} -o $$@'
ifneq (${OStype},Linux)
-HOSTTOOLFLAGS+= LIBS='-lm -lz'
+BUILD_FLAGS+= LIBS='-lm -lz'
endif
do-build:
@@ -68,8 +68,8 @@ do-build:
DESTDIR="${WRKINST}" \
all install
${MAKE} -C "${WRKBUILD}/libmysql" \
- LINK="${HOSTCC} -o conf_to_src -lc" \
- ${HOSTTOOLFLAGS} \
+ LINK="${CC_FOR_BUILD} -o conf_to_src -lc" \
+ ${BUILD_FLAGS} \
conf_to_src
${MAKE} -C "${WRKBUILD}" \
CFLAGS="${TARGET_CFLAGS}" \
@@ -87,5 +87,7 @@ do-install:
${INSTALL_DIR} ${IDIR_LIBMYSQLCLIENT}/usr/lib
${CP} ${WRKINST}/usr/lib/mysql/libmysqlclient.so* \
${IDIR_LIBMYSQLCLIENT}/usr/lib
+ $(SED) "s,\(^pkgincludedir='\)\(.*\),\1${STAGING_TARGET_DIR}\2," \
+ ${WRKINST}/usr/bin/mysql_config
include ${TOPDIR}/mk/pkg-bottom.mk
diff --git a/package/mysql/patches/patch-include_config_h_in b/package/mysql/patches/patch-include_config_h_in
index 361a8b651..d9b28c419 100644
--- a/package/mysql/patches/patch-include_config_h_in
+++ b/package/mysql/patches/patch-include_config_h_in
@@ -1,11 +1,11 @@
--- mysql-5.1.48.orig/include/config.h.in 2010-06-03 17:54:04.000000000 +0200
-+++ mysql-5.1.48/include/config.h.in 2011-01-15 13:01:30.000000000 +0100
++++ mysql-5.1.48/include/config.h.in 2011-01-21 00:08:19.737408555 +0100
@@ -856,7 +856,7 @@
/* Define to 1 if you have the `strtoull' function. */
#undef HAVE_STRTOULL
-/* Define to 1 if `st_rdev' is member of `struct stat'. */
-+/* Define to 1 if `st_rdev' is a member of `struct stat'. */
++/* Define to 1 if `struct stat' is a member of `st_rdev'. */
#undef HAVE_STRUCT_STAT_ST_RDEV
/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use
diff --git a/package/mysql/patches/patch-scripts_mysql_config_sh b/package/mysql/patches/patch-scripts_mysql_config_sh
new file mode 100644
index 000000000..3e1833199
--- /dev/null
+++ b/package/mysql/patches/patch-scripts_mysql_config_sh
@@ -0,0 +1,11 @@
+--- mysql-5.1.48.orig/scripts/mysql_config.sh 2010-06-03 17:50:21.000000000 +0200
++++ mysql-5.1.48/scripts/mysql_config.sh 2011-01-21 00:32:53.596454498 +0100
+@@ -119,7 +119,7 @@ if [ -r "$pkglibdir/libmygcc.a" ]; then
+ embedded_libs="$embedded_libs -lmygcc "
+ fi
+
+-cflags="-I$pkgincludedir @CFLAGS@ " #note: end space!
++cflags="-I$pkgincludedir" #note: end space!
+ include="-I$pkgincludedir"
+
+ # Remove some options that a client doesn't have to care about