summaryrefslogtreecommitdiffstats
path: root/src/libmysqlclient.mk
diff options
context:
space:
mode:
authorTony Theodore <tonyt@logyst.com>2015-10-10 15:22:13 (GMT)
committerTony Theodore <tonyt@logyst.com>2015-10-10 15:22:26 (GMT)
commitc1cd55957116fa20209a872534bddc069fd6c13a (patch)
tree91f889b6d267cff9487d201651c11b0c1947a6ec /src/libmysqlclient.mk
parent6d5a460ee8961637c35258a69c69231f24d6e1a2 (diff)
downloadmxe-c1cd55957116fa20209a872534bddc069fd6c13a.zip
mxe-c1cd55957116fa20209a872534bddc069fd6c13a.tar.gz
mxe-c1cd55957116fa20209a872534bddc069fd6c13a.tar.bz2
libmysqlclient: fix x86_64 shared build and add test program
see #914, I'm not sure why the `def` file is needed on i686 shared.
Diffstat (limited to 'src/libmysqlclient.mk')
-rw-r--r--src/libmysqlclient.mk9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libmysqlclient.mk b/src/libmysqlclient.mk
index 104ef7f..ee22205 100644
--- a/src/libmysqlclient.mk
+++ b/src/libmysqlclient.mk
@@ -36,7 +36,8 @@ define $(PKG)_BUILD
'$(1)'
# def file created by cmake creates link errors
- cp '$(PWD)/src/$(PKG).def' '$(1).build/libmysql/libmysql_exports.def'
+ $(if $(findstring i686-w64-mingw32.shared,$(TARGET)),
+ cp '$(PWD)/src/$(PKG).def' '$(1).build/libmysql/libmysql_exports.def')
$(MAKE) -C '$(1).build' -j '$(JOBS)' VERBOSE=1
$(MAKE) -C '$(1).build/include' -j 1 install VERBOSE=1
@@ -48,4 +49,10 @@ define $(PKG)_BUILD
# missing headers
$(INSTALL) -m644 '$(1)/include/'thr_* '$(1)/include/'my_thr* '$(PREFIX)/$(TARGET)/include'
+
+ # build test with mysql_config
+ '$(TARGET)-g++' \
+ -W -Wall -Werror -ansi -pedantic \
+ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ `'$(PREFIX)/$(TARGET)/bin/mysql_config' --cflags --libs`
endef