summaryrefslogtreecommitdiff
path: root/parse.c
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2005-07-14 13:04:41 +0000
committerArch Librarian <arch@canonical.com>2005-07-14 13:04:41 +0000
commitb890f705eb5fc0691faa87672aa28a86daf75680 (patch)
treed8afc858dad771c7ccf5084f659773000834375f /parse.c
parentd86ec30f0aef0139309a48555054cb5cb69be477 (diff)
downloadpkg-config-b890f705eb5fc0691faa87672aa28a86daf75680.tar.gz
2001-10-27 Tor Lillqvist <tml@iki.fi>
Author: tml Date: 2001-10-27 17:55:11 GMT 2001-10-27 Tor Lillqvist <tml@iki.fi> New Win32 feature to make pkg-config useful for users of MSVC: with the flag --msvc-syntax, munge -L and -l flags appropriately for the MSVC command-line compiler. (-I flags are the same.) * README.win32: Update. * main.c (main): Add --msvc-syntax flag. * pkg-config.1: Document it. * pkg.h: Declare msvc_syntax. * parse.c (parse_libs): Obey msvc_syntax.
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 370043f..5fcf609 100644
--- a/parse.c
+++ b/parse.c
@@ -17,8 +17,10 @@
#ifdef G_OS_WIN32
int dont_define_prefix = FALSE;
char *prefix_variable = "prefix";
+int msvc_syntax = FALSE;
#endif
+
/**
* Read an entire line from a file into a buffer. Lines may
* be delimited with '\n', '\r', '\n\r', or '\r\n'. The delimiter
@@ -571,6 +573,15 @@ parse_libs (Package *pkg, const char *str, const char *path)
int argc;
int result;
int i;
+#ifdef G_OS_WIN32
+ char *L_flag = (msvc_syntax ? "/libpath:" : "-L");
+ char *l_flag = (msvc_syntax ? "" : "-l");
+ char *lib_suffix = (msvc_syntax ? ".lib" : "");
+#else
+ char *L_flag = "-L";
+ char *l_flag = "-l";
+ char *lib_suffix = "";
+#endif
if (pkg->l_libs || pkg->L_libs || pkg->other_libs)
{
@@ -619,7 +630,7 @@ parse_libs (Package *pkg, const char *str, const char *path)
libname = g_strndup (start, p - start);
pkg->l_libs = g_slist_prepend (pkg->l_libs,
- g_strconcat ("-l", libname, NULL));
+ g_strconcat (l_flag, libname, lib_suffix, NULL));
g_free (libname);
}
@@ -639,7 +650,7 @@ parse_libs (Package *pkg, const char *str, const char *path)
libname = g_strndup (start, p - start);
pkg->L_libs = g_slist_prepend (pkg->L_libs,
- g_strconcat ("-L", libname, NULL));
+ g_strconcat (L_flag, libname, NULL));
g_free (libname);
}