diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,7 @@
+## 0.1.7.3
+
+* Fix error on certain systems introduced by the change in (#40): some implementations of `mysql_config` do not recognise `--libs-sys`, yet return a zero status for attempts to use it.
+
 ## 0.1.7.2
 
 * Update .cabal file
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -10,7 +10,7 @@
 
 import Control.Exception (IOException, catch)
 import Control.Monad (liftM, msum, sequence)
-import Data.List (isPrefixOf, nub)
+import Data.List (isPrefixOf, isInfixOf, nub)
 import Distribution.PackageDescription
 import Distribution.Simple
 import Distribution.Simple.LocalBuildInfo
@@ -69,7 +69,14 @@
   include <- mysqlConfig ["--include"]
   libs <- mysqlConfig ["--libs"]
   libsR <- mysqlConfig ["--libs_r"]
-  libsSys <- mysqlConfig ["--libs_sys"] `catch` libsFromError
+  libsSys' <- mysqlConfig ["--libs_sys"] `catch` libsFromError
+
+  -- On some systems, `mysql_config` fails to give an error status even though
+  -- it cannot handle `--libs_sys`.  The "Usage:" message lists libraries we do
+  -- do not want to include, so recognise it for what it is!
+  --
+  let libsSys = if null $ filter ("Usage:" `isInfixOf`) libsSys' then libsSys'
+                else []
 
   return emptyBuildInfo {
     extraLibDirs = map (drop 2) . filter ("-L" `isPrefixOf`) $
diff --git a/mysql.cabal b/mysql.cabal
--- a/mysql.cabal
+++ b/mysql.cabal
@@ -1,5 +1,5 @@
 name:           mysql
-version:        0.1.7.2
+version:        0.1.7.3
 homepage:       https://github.com/paul-rouse/mysql
 bug-reports:    https://github.com/paul-rouse/mysql/issues
 synopsis:       A low-level MySQL client library.
