diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,11 @@
+## 0.1.7.2
+
+* Update .cabal file
+
+## 0.1.7.1
+
+* Use `mysql_config --libs-sys` in Setup.hs if available (#40)
+
 ## 0.1.7
 
 * Add support for JSON type
diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -8,6 +8,7 @@
 #define MIN_VERSION_Cabal(x,y,z) 0 
 #endif
 
+import Control.Exception (IOException, catch)
 import Control.Monad (liftM, msum, sequence)
 import Data.List (isPrefixOf, nub)
 import Distribution.PackageDescription
@@ -68,12 +69,18 @@
   include <- mysqlConfig ["--include"]
   libs <- mysqlConfig ["--libs"]
   libsR <- mysqlConfig ["--libs_r"]
+  libsSys <- mysqlConfig ["--libs_sys"] `catch` libsFromError
 
   return emptyBuildInfo {
-    extraLibDirs = map (drop 2) . filter ("-L" `isPrefixOf`) $ libs
+    extraLibDirs = map (drop 2) . filter ("-L" `isPrefixOf`) $
+                   nub (libsSys ++ libs)
   , extraLibs = map (drop 2) . filter ("-l" `isPrefixOf`) .
                 filter (/= "-lmygcc") $
                 filter (/= "-lmysqlclient_r") $
-                nub (libs ++ libsR)
+                nub (libsSys ++ libs ++ libsR)
   , includeDirs = map (drop 2) include
   }
+  where
+    -- Recover from an error by returning an empty list.
+    libsFromError :: IOException -> IO [String]
+    libsFromError _ = return []
diff --git a/mysql.cabal b/mysql.cabal
--- a/mysql.cabal
+++ b/mysql.cabal
@@ -1,5 +1,5 @@
 name:           mysql
-version:        0.1.7
+version:        0.1.7.2
 homepage:       https://github.com/paul-rouse/mysql
 bug-reports:    https://github.com/paul-rouse/mysql/issues
 synopsis:       A low-level MySQL client library.
@@ -22,7 +22,7 @@
                 Copyright 2013 Bryan O'Sullivan <bos@serpentine.com>
 category:       Database
 build-type:     Custom
-cabal-version:  >= 1.8
+cabal-version:  >= 1.10
 extra-source-files:
     include/mysql_signals.h
     ChangeLog.md
@@ -62,12 +62,14 @@
     ghc-prof-options: -auto-all
     ghc-options: -Werror
     cpp-options: -DASSERTS
+  default-language:  Haskell2010
 
 test-suite test
     type:            exitcode-stdio-1.0
     main-is:         main.hs
     hs-source-dirs:  test
     ghc-options:     -Wall
+    default-language: Haskell2010
     build-depends:   base                    >= 4 && < 5
                    , bytestring
                    , hspec
