Honggang Li bbc279
diff --git a/cmdif/Makefile.am b/cmdif/Makefile.am
Honggang Li 26acdd
index 9807603..b23bcb9 100644
Honggang Li bbc279
--- a/cmdif/Makefile.am
Honggang Li bbc279
+++ b/cmdif/Makefile.am
Honggang Li 26acdd
@@ -51,7 +51,7 @@ libcmdif_a_SOURCES = tools_cif.c tools_cif.h icmd_cif_common.c icmd_cif_common.h
Honggang Li bbc279
 cmdif_pylibdir = $(libdir)/mstflint/python_tools/
Honggang Li bbc279
 cmdif_pylib_DATA = ${CCMDIF_SO} cmdif.py
Honggang Li bbc279
 ${CCMDIF_SO}: libcmdif.a
Honggang Li bbc279
-	$(CC) -g -Wall -pthread -shared ${CFLAGS} *.o -o ${CCMDIF_SO} \
Honggang Li bbc279
+	$(CC) -g -Wall -pthread -shared ${CFLAGS} ${LDFLAGS} *.o -o ${CCMDIF_SO} \
Honggang Li bbc279
 	-L$(USER_DIR)/tools_layouts -ltools_layouts -L$(USER_DIR)/${MTCR_CONF_DIR} -lmtcr_ul
Honggang Li bbc279
 
Honggang Li bbc279
 CLEANFILES = ${CCMDIF_SO}
Honggang Li bbc279
diff --git a/dev_mgt/Makefile.am b/dev_mgt/Makefile.am
Honggang Li 26acdd
index 1fbd142..df5b14a 100644
Honggang Li bbc279
--- a/dev_mgt/Makefile.am
Honggang Li bbc279
+++ b/dev_mgt/Makefile.am
Honggang Li bbc279
@@ -50,7 +50,7 @@ dev_mgt_pylib_DATA = c_dev_mgt.so dev_mgt.py
Honggang Li bbc279
 dist_dev_mgt_pylib_DATA = dev_mgt.py
Honggang Li bbc279
 
Honggang Li bbc279
 c_dev_mgt.so: libdev_mgt.a
Honggang Li bbc279
-	$(CC) -g -Wall -pthread -shared ${CFLAGS} tools_dev_types.o -o c_dev_mgt.so \
Honggang Li bbc279
+	$(CC) -g -Wall -pthread -shared ${CFLAGS} ${LDFLAGS} tools_dev_types.o -o c_dev_mgt.so \
Honggang Li bbc279
 	-L$(USER_DIR)/reg_access -lreg_access \
Honggang Li bbc279
 	-L$(USER_DIR)/tools_layouts -ltools_layouts \
Honggang Li bbc279
 	-L$(USER_DIR)/${MTCR_CONF_DIR} -lmtcr_ul
Honggang Li bbc279
diff --git a/mtcr_py/Makefile.am b/mtcr_py/Makefile.am
Honggang Li 26acdd
index 934b803..c8af0c2 100644
Honggang Li bbc279
--- a/mtcr_py/Makefile.am
Honggang Li bbc279
+++ b/mtcr_py/Makefile.am
Honggang Li 26acdd
@@ -40,7 +40,7 @@ MTCR_DIR = $(USER_DIR)/${MTCR_CONF_DIR}
Honggang Li bbc279
 mtcr_pylib_DATA = cmtcr.so mtcr.py
Honggang Li bbc279
 dist_mtcr_pylib_DATA = mtcr.py
Honggang Li bbc279
 cmtcr.so:
Honggang Li 23d029
-	$(CC) -g -Wall -pthread -shared ${CFLAGS} $(MTCR_DIR)/*.o -o cmtcr.so $(MFT_CORE_LIB_LINK)
Honggang Li 23d029
+	$(CC) -g -Wall -pthread -shared ${CFLAGS} ${LDFLAGS} $(MTCR_DIR)/*.o -o cmtcr.so $(MFT_CORE_LIB_LINK)
Honggang Li bbc279
 
Honggang Li bbc279
 CLEANFILES = cmtcr.so
Honggang Li bbc279
 
Honggang Li bbc279
diff --git a/reg_access/Makefile.am b/reg_access/Makefile.am
Honggang Li 26acdd
index 26f6a5a..9a42c37 100644
Honggang Li bbc279
--- a/reg_access/Makefile.am
Honggang Li bbc279
+++ b/reg_access/Makefile.am
Honggang Li bbc279
@@ -53,7 +53,7 @@ reg_access_pylib_DATA = ${RREG_ACCESS_SO} regaccess.py
Honggang Li bbc279
 dist_reg_access_pylib_DATA = regaccess.py
Honggang Li bbc279
 
Honggang Li bbc279
 ${RREG_ACCESS_SO}: libreg_access.a
Honggang Li bbc279
-	$(CC) -g -Wall -pthread -shared ${CFLAGS} *.o -o ${RREG_ACCESS_SO} \
Honggang Li bbc279
+	$(CC) -g -Wall -pthread -shared ${CFLAGS} ${LDFLAGS} *.o -o ${RREG_ACCESS_SO} \
Honggang Li bbc279
 	-L$(USER_DIR)/tools_layouts -ltools_layouts -L$(MTCR_DIR) -lmtcr_ul
Honggang Li bbc279
 
Honggang Li bbc279
 CLEANFILES = ${RREG_ACCESS_SO}