Index: ThirdParty/mpqc_open/src/lib/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/Makefile.am	(revision 0035ea419537dcdf74ab59b934d0227f1cca43dc)
+++ ThirdParty/mpqc_open/src/lib/Makefile.am	(revision bbc9821982d085faaabde9fa52f49343777c131a)
@@ -1,3 +1,3 @@
-AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib $(MPI_CXXFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib $(EXTRADEFINES) $(MPI_CXXFLAGS)
 AM_LDFLAGS = $(MPI_LDFLAGS)
 
@@ -16,5 +16,5 @@
 MKF77SYM= $(PERL) $(top_builddir)/bin/mkf77sym.pl
 
-if CONDCCA
+if COND_CCA
 include chemistry/cca/Makefile.am
 endif
@@ -22,11 +22,19 @@
 include chemistry/molecule/Makefile.am
 include chemistry/qc/basis/Makefile.am
-#include chemistry/qc/cints/Makefile.am
+
+if COND_LIBINT
+include chemistry/qc/cints/Makefile.am
+endif
+
 include chemistry/qc/dft/Makefile.am
-#include chemistry/qc/intcca/Makefile.am
+
+if COND_CCA
+include chemistry/qc/intcca/Makefile.am
+endif
+
 include chemistry/qc/intv3/Makefile.am
 include chemistry/qc/mbpt/Makefile.am
 
-if CONDLIBINT
+if COND_LIBINT
 include chemistry/qc/mbptr12/Makefile.am
 endif
Index: ThirdParty/mpqc_open/src/lib/chemistry/cca/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/cca/Makefile.am	(revision 0035ea419537dcdf74ab59b934d0227f1cca43dc)
+++ ThirdParty/mpqc_open/src/lib/chemistry/cca/Makefile.am	(revision bbc9821982d085faaabde9fa52f49343777c131a)
@@ -48,4 +48,7 @@
 libSCcca_la_includedir = $(includedir)/chemistry/cca
 libSCcca_la_CPPFLAGS = $(AM_CPPFLAGS)
+if COND_LIBINT
+libSCcca_la_CPPFLAGS += -DHAVE_CINTS
+endif
 libSCcca_la_LDFLAGS = $(AM_LDFLAGS)
 libSCcca_la_LIBADD =
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/cints/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/cints/Makefile.am	(revision 0035ea419537dcdf74ab59b934d0227f1cca43dc)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/cints/Makefile.am	(revision bbc9821982d085faaabde9fa52f49343777c131a)
@@ -100,4 +100,13 @@
         $(CINTSLIBS)
 
+if COND_LIBINT
+cintstest_LDADD += -lint
+endif
+if COND_LIBR12
+cintstest_LDADD += -lr12
+endif
+if COND_LIBDERIV
+cintstest_LDADD += -lderiv
+endif
 
 EXTRA_DIST += ./chemistry/qc/cints/cintstest.in
Index: ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/Makefile.am	(revision 0035ea419537dcdf74ab59b934d0227f1cca43dc)
+++ ThirdParty/mpqc_open/src/lib/chemistry/qc/intcca/Makefile.am	(revision bbc9821982d085faaabde9fa52f49343777c131a)
@@ -23,7 +23,15 @@
 noinst_LTLIBRARIES += libSCintcca.la
 libSCintcca_la_includedir = $(includedir)/chemistry/qc/intcca
-libSCintcca_la_CPPFLAGS = $(AM_CPPFLAGS)
-libSCintcca_la_LDFLAGS = $(AM_LDFLAGS)
-libSCintcca_la_LIBADD =
+libSCintcca_la_CPPFLAGS = $(AM_CPPFLAGS) 
+if COND_LIBINT
+libSCintcca_la_CPPFLAGS += -DHAVE_CINTS
+endif
+libSCintcca_la_CPPFLAGS += -DDMALLOC -I../../cca
+libSCintcca_la_LDFLAGS = \
+	$(AM_LDFLAGS) \
+	-L$(CCAFE_LIB) -R$(CCAFE_LIB) \
+	-L$(BABEL_LIB) -R$(BABEL_LIB) \
+	-L$(CCA_CHEM_LIB) -R$(CCA_CHEM_LIB)
+libSCintcca_la_LIBADD = -lccafeCore -lsidl -lccachem_cxx_client -lccachem_cxx_server
 
 nobase_libSCintcca_la_include_HEADERS = ${LIBSCINTCCAHEADERS}
Index: ThirdParty/mpqc_open/src/lib/util/group/Makefile.am
===================================================================
--- ThirdParty/mpqc_open/src/lib/util/group/Makefile.am	(revision 0035ea419537dcdf74ab59b934d0227f1cca43dc)
+++ ThirdParty/mpqc_open/src/lib/util/group/Makefile.am	(revision bbc9821982d085faaabde9fa52f49343777c131a)
@@ -1,19 +1,14 @@
 LIBSCGROUPSOURCES = \
-	util/group/globcnt.cc \
 	util/group/hcube.cc \
 	util/group/memamsg.cc \
 	util/group/memiter.cc \
 	util/group/memmsg.cc \
-	util/group/memmtmpi.cc \
 	util/group/memory.cc \
 	util/group/memproc.cc \
 	util/group/memrdma.cc \
-	util/group/memshm.cc \
 	util/group/message.cc \
 	util/group/messimpl.cc \
 	util/group/messint.cc \
-	util/group/messmpi.cc \
 	util/group/messproc.cc \
-	util/group/messshm.cc \
 	util/group/mstate.cc \
 	util/group/pool.cc \
@@ -21,14 +16,13 @@
 	util/group/reduce.cc \
 	util/group/rnglock.cc \
-	util/group/thpthd.cc \
 	util/group/thread.cc \
 	util/group/topology.cc
-
+	
 #	util/group/file.cc \
 #	util/group/fileproc.cc \
-#	util/group/memarmci.cc \
 #	util/group/thpuma.cc \
 #
 TESTSOURCES = \
+	util/group/mstate.cc \
 	util/group/message.cc \
 	util/group/messimpl.cc \
@@ -50,25 +44,18 @@
 
 LIBSCGROUPHEADERS = \
-	util/group/globcnt.h \
 	util/group/hcube.h \
-	util/group/LIBS.h \
 	util/group/linkage.h \
 	util/group/memamsg.h \
 	util/group/memiter.h \
 	util/group/memmsg.h \
-	util/group/memmtmpi.h \
 	util/group/memory.h \
 	util/group/memproc.h \
 	util/group/memrdma.h \
-	util/group/memshm.h \
 	util/group/message.h \
 	util/group/messaget.h \
-	util/group/messmpi.h \
-	util/group/messshm.h \
 	util/group/mstate.h \
 	util/group/pool.h \
 	util/group/pregtime.h \
 	util/group/rnglock.h \
-	util/group/thpthd.h \
 	util/group/thread.h \
 	util/group/topology.h
@@ -76,8 +63,8 @@
 #	util/group/file.h \
 #	util/group/fileproc.h \
-#	util/group/memarmci.h \
 #	util/group/thpuma.h \
 #
 TESTHEADERS = \
+	util/group/mstate.h \
 	util/group/message.h \
 	util/group/topology.h \
@@ -94,4 +81,38 @@
 	util/group/memrdma.h
 
+if COND_SYSV_IPC
+LIBSCGROUPSOURCES += \
+	util/group/globcnt.cc \
+	util/group/memshm.cc \
+	util/group/messshm.cc
+LIBSCGROUPHEADERS += \
+	util/group/globcnt.h \
+	util/group/memshm.h \
+	util/group/messshm.h
+endif
+
+if COND_MPI
+LIBSCGROUPSOURCES += \
+	util/group/memmtmpi.cc \
+	util/group/messmpi.cc
+LIBSCGROUPHEADERS += \
+	util/group/memmtmpi.h \
+	util/group/messmpi.h
+endif
+
+if COND_ARMCI
+LIBSCGROUPSOURCES += \
+	util/group/memarmci.cc
+LIBSCGROUPHEADERS += \
+	util/group/memarmci.h
+endif
+
+if COND_PTHREAD
+LIBSCGROUPSOURCES += \
+	util/group/thpthd.cc
+LIBSCGROUPHEADERS += \
+	util/group/thpthd.h
+endif
+
 lib_LTLIBRARIES +=
 noinst_LTLIBRARIES += libSCgroup.la
