Skip to content

Commit

Permalink
Tweak configure
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Feb 25, 2018
1 parent f1de5c4 commit c658644
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
15 changes: 7 additions & 8 deletions configure
@@ -1,14 +1,13 @@
#!/bin/bash
# Anticonf script by Jeroen Ooms (2017)
#!/usr/bin/env bash
# Anticonf script by Jeroen Ooms (2018)
# The script will try 'mariadb_config' and 'mysql_config' to find required
# cflags and ldflags. Make sure this executable is in PATH when installing
# the package. Alternatively, you can set INCLUDE_DIR and LIB_DIR manually:
# R CMD INSTALL --configure-vars='INCLUDE_DIR=/.../include LIB_DIR=/.../lib'

# Library settings
PKG_CONFIG_NAME="libmysqlclient"
PKG_DEB_NAME="libmariadbclient-dev | libmariadb-client-lgpl-dev"
PKG_RPM_NAME="mariadb-devel | mysql-devel"
PKG_RPM_NAME="mariadb-connector-c-devel | mariadb-devel | mysql-devel"
PKG_CSW_NAME="mysql56_dev"
PKG_BREW_NAME="mariadb-connector-c"
PKG_TEST_HEADER="<mysql.h>"
Expand Down Expand Up @@ -63,14 +62,14 @@ echo "#include $PKG_TEST_HEADER" | ${CC} ${CPPFLAGS} ${PKG_CFLAGS} ${CFLAGS} -E
# Customize the error
if [ $R_CONFIG_ERROR ]; then
echo "------------------------- ANTICONF ERROR ---------------------------"
echo "Configuration failed because $PKG_CONFIG_NAME was not found. Try installing:"
echo "Configuration failed because no mysql client library was found. Try installing:"
echo " * deb: $PKG_DEB_NAME (Debian, Ubuntu)"
echo " * rpm: $PKG_RPM_NAME (Fedora, CentOS, RHEL)"
echo " * csw: $PKG_CSW_NAME (Solaris)"
echo " * brew: $PKG_BREW_NAME (OSX)"
echo "If $PKG_CONFIG_NAME is already installed, check that 'pkg-config' is in your"
echo "PATH and PKG_CONFIG_PATH contains a $PKG_CONFIG_NAME.pc file. If pkg-config"
echo "is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:"
echo "If you already have a mysql client library installed, verify that either"
echo "mariadb_config or mysql_config is on your PATH. If these are unavailable"
echo "you can also set INCLUDE_DIR and LIB_DIR manually via:"
echo "R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'"
echo "--------------------------------------------------------------------"
exit 1;
Expand Down
2 changes: 1 addition & 1 deletion tools/winlibs.R
Expand Up @@ -2,7 +2,7 @@
# Info and source code: https://downloads.mariadb.org/client-native/
if(!file.exists("../windows/libmariadbclient-2.3.4/include/mariadb/mysql.h")){
if(getRversion() < "3.3.0") setInternet2()
curl::curl_download("https://github.com/rwinlib/libmariadbclient/archive/v2.3.4.zip", "lib.zip")
download.file("https://github.com/rwinlib/libmariadbclient/archive/v2.3.4.zip", "lib.zip", quiet = TRUE)
dir.create("../windows", showWarnings = FALSE)
unzip("lib.zip", exdir = "../windows")
unlink("lib.zip")
Expand Down

0 comments on commit c658644

Please sign in to comment.