From c97a1c7a22e79891e2b74ec1036d3459f4b3ba5b Mon Sep 17 00:00:00 2001
From: "Stephen A. Wood" <saw@jlab.org>
Date: Wed, 23 Mar 2016 17:10:23 -0400
Subject: [PATCH] Fix library order so that linking works on Ubuntu   Fixed for
 make and scons   Put libHallC before libHallA before root libs

---
 Makefile   | 4 ++--
 SConstruct | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 2a2623d..e622ba3 100644
--- a/Makefile
+++ b/Makefile
@@ -192,8 +192,8 @@ endif
 
 src/THcInterface.d:  $(HDR_COMPILEDATA)
 
-hcana:		src/main.o $(LIBDC) $(LIBHALLA) $(USERLIB)
-		$(LD) $(LDFLAGS) $< $(HALLALIBS) $(EVIOLIB) -L. -lHallC $(CCDBLIBS) \
+hcana:		src/main.o $(LIBDC) $(LIBHALLA) $(USERLIB) 
+		$(LD) $(LDFLAGS) $< -lHallC $(HALLALIBS) $(EVIOLIB) -L. $(CCDBLIBS) \
 		$(GLIBS) -o $@
 
 $(USERLIB):	$(HDR) $(OBJS)
diff --git a/SConstruct b/SConstruct
index 8b13dff..b5a7758 100644
--- a/SConstruct
+++ b/SConstruct
@@ -195,8 +195,8 @@ directorylist = ['./','src','podd','podd/src','podd/hana_decode']
 
 baseenv.Append(SHLIBSUFFIX ='.'+baseenv.subst('$VERSION'))
 pbaseenv=baseenv.Clone()
-pbaseenv.Append(LIBS=[eviolib,hallclib,hallalib,dclib])
-baseenv.Append(LIBS=[eviolib,hallalib,dclib])
+pbaseenv.Prepend(LIBS=[hallclib,hallalib,dclib,eviolib])
+baseenv.Prepend(LIBS=[hallalib,dclib,eviolib])
 Export('pbaseenv')
 
 SConscript(dirs = directorylist,name='SConscript.py',exports='baseenv')
-- 
GitLab