changeset 594:e096a1502428

Fix #88 : pragma(lib, "str") is now converted to -lstr in the linker command line.
author Christian Kamm <kamm incasoftware de>
date Sun, 14 Sep 2008 14:36:11 +0200
parents 7042d912767e
children bbfb66c623e7
files gen/toir.cpp
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gen/toir.cpp	Sun Sep 14 13:47:38 2008 +0200
+++ b/gen/toir.cpp	Sun Sep 14 14:36:11 2008 +0200
@@ -21,6 +21,7 @@
 #include "template.h"
 #include "hdrgen.h"
 #include "port.h"
+#include "mem.h"
 
 #include "gen/irstate.h"
 #include "gen/logger.h"
@@ -2551,9 +2552,12 @@
     return 0;
 }
 
-void obj_includelib(char*)
+void obj_includelib(char* lib)
 {
-// FIXME: we want to support pragma(lib)
+    char *arg = (char *)mem.malloc(64);
+    strcpy(arg, "-l");
+    strncat(arg, lib, 64);
+    global.params.linkswitches->push(arg);
 }
 
 void backend_init()