Commits

carl douglas committed 00d5871

Fix mysql_config flags - now works on a
Linux machine that returns additional flags
such as -rdynamic.

  • Participants
  • Parent commits 422194e

Comments (0)

Files changed (1)

File mysql-client.setup

 (use posix)
 
-(define iflags '())
-(define lflags '())
+(define (mysql-flags opts)
+  (with-input-from-pipe
+    (string-append "mysql_config " (string-join opts " "))
+    (lambda() 
+      (string-split (read-line) " \t"))))
 
-(with-input-from-pipe 
-  "mysql_config --include" 
-  (lambda() 
-    (set! iflags (read-line))))
-
-(with-input-from-pipe 
-  "mysql_config --libs" 
-  (lambda() 
-    (set! lflags (read-line))))
-
-(compile -C ,iflags
-         -L ,lflags
+(compile ,@(map (lambda(f)(sprintf "-C ~A" f)) (mysql-flags '("--include")))
+         ,@(map (lambda(f)(sprintf "-L ~A" f)) (mysql-flags '("--libs")))
          -d0 -O3
          -s mysql-client.scm 
          -j mysql-client)