[hackers] [scc] [driver] Use internal library path || Quentin Rameau

From: <git_AT_suckless.org>
Date: Fri, 24 Mar 2017 10:34:25 +0100 (CET)

commit 9f3f093fde9fb05a0763d886623c03137b6833dd
Author: Quentin Rameau <quinq_AT_fifth.space>
AuthorDate: Wed Mar 22 13:13:48 2017 +0100
Commit: Quentin Rameau <quinq_AT_fifth.space>
CommitDate: Fri Mar 24 10:11:59 2017 +0100

    [driver] Use internal library path
    
    And provide a way to configure them via inc/syslibs.h

diff --git a/Makefile b/Makefile
index dcf409f..203dd0c 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -76,4 +76,4 @@ clean:
         rm -f bin/cc* bin/scc
 
 distclean: clean
- rm -f inc/sysincludes.h
+ rm -f inc/sysincludes.h inc/syslibs.h
diff --git a/driver/posix/Makefile b/driver/posix/Makefile
index 72f3620..6124293 100644
--- a/driver/posix/Makefile
+++ b/driver/posix/Makefile
_AT_@ -7,14 +7,17 @@ OBJS = scc.o
 
 all: scc
 
-$(OBJS): ../../inc/cc.h ../../inc/arg.h
-
-../../lib/libcc.a:
- cd ../../lib && $(MAKE) -e
+$(OBJS): ../../inc/cc.h ../../inc/arg.h ../../inc/syslibs.h
 
 scc: $(OBJS) ../../lib/libcc.a
         $(CC) $(SCC_LDFLAGS) $(OBJS) ../../lib/libcc.a -o $_AT_
 
+../../inc/syslibs.h: ../../inc/syslibs.def.h
+ cp -f ../../inc/syslibs.def.h ../../inc/syslibs.h
+
+../../lib/libcc.a:
+ cd ../../lib && $(MAKE) -e
+
 clean:
         rm -f $(OBJS)
         rm -f scc
diff --git a/driver/posix/scc.c b/driver/posix/scc.c
index 038bdcd..a5d89d5 100644
--- a/driver/posix/scc.c
+++ b/driver/posix/scc.c
_AT_@ -16,6 +16,7 @@ static char sccsid[] = "@(#) ./driver/posix/scc.c";
 
 #include "../../inc/arg.h"
 #include "../../inc/cc.h"
+#include "../../inc/syslibs.h"
 
 enum {
         CC1,
_AT_@ -118,6 +119,10 @@ inittool(int tool)
                 addarg(tool, "-o");
                 t->outfile = outfile ? outfile : xstrdup("a.out");
                 addarg(tool, t->outfile);
+ for (n = 0; syslibs[n]; ++n) {
+ addarg(tool, "-L");
+ addarg(tool, syslibs[n]);
+ }
                 break;
         case AS:
                 addarg(tool, "-o");
diff --git a/inc/syslibs.def.h b/inc/syslibs.def.h
new file mode 100644
index 0000000..3c407fa
--- /dev/null
+++ b/inc/syslibs.def.h
_AT_@ -0,0 +1,7 @@
+char *syslibs[] = {
+ PREFIX "/lib/scc/" ,
+ /* configure below your standard sys include paths */
+ PREFIX "/lib/",
+ PREFIX "/local/lib/",
+ NULL
+};
Received on Fri Mar 24 2017 - 10:34:25 CET

This archive was generated by hypermail 2.3.0 : Fri Mar 24 2017 - 10:36:30 CET