9db0ec
diff --git a/cmdif/Makefile.am b/cmdif/Makefile.am
3592e8
index 0d8f53b..d800302 100644
9db0ec
--- a/cmdif/Makefile.am
9db0ec
+++ b/cmdif/Makefile.am
3592e8
@@ -50,7 +50,7 @@ libcmdif_a_SOURCES = tools_cif.c tools_cif.h icmd_cif_common.c icmd_cif_common.h
9db0ec
 cmdif_pylibdir = $(libdir)/mstflint/python_tools/
9db0ec
 cmdif_pylib_DATA = ${CCMDIF_SO} cmdif.py
9db0ec
 ${CCMDIF_SO}: libcmdif.a
9db0ec
-	$(CC) -g -Wall -pthread -shared ${CFLAGS} *.o -o ${CCMDIF_SO} \
9db0ec
+	$(CC) -g -Wall -pthread -shared ${CFLAGS} ${LDFLAGS} *.o -o ${CCMDIF_SO} \
9db0ec
 	-L$(USER_DIR)/tools_layouts -ltools_layouts -L$(USER_DIR)/${MTCR_CONF_DIR} -lmtcr_ul
9db0ec
 
9db0ec
 CLEANFILES = ${CCMDIF_SO}
9db0ec
diff --git a/dev_mgt/Makefile.am b/dev_mgt/Makefile.am
3592e8
index 3118b85..e708ad8 100644
9db0ec
--- a/dev_mgt/Makefile.am
9db0ec
+++ b/dev_mgt/Makefile.am
9db0ec
@@ -50,7 +50,7 @@ dev_mgt_pylib_DATA = c_dev_mgt.so dev_mgt.py
9db0ec
 dist_dev_mgt_pylib_DATA = dev_mgt.py
9db0ec
 
9db0ec
 c_dev_mgt.so: libdev_mgt.a
9db0ec
-	$(CC) -g -Wall -pthread -shared ${CFLAGS} tools_dev_types.o -o c_dev_mgt.so \
9db0ec
+	$(CC) -g -Wall -pthread -shared ${CFLAGS} ${LDFLAGS} tools_dev_types.o -o c_dev_mgt.so \
9db0ec
 	-L$(USER_DIR)/reg_access -lreg_access \
9db0ec
 	-L$(USER_DIR)/tools_layouts -ltools_layouts \
9db0ec
 	-L$(USER_DIR)/${MTCR_CONF_DIR} -lmtcr_ul
9db0ec
diff --git a/mtcr_py/Makefile.am b/mtcr_py/Makefile.am
9db0ec
index 5f5677d..566a870 100644
9db0ec
--- a/mtcr_py/Makefile.am
9db0ec
+++ b/mtcr_py/Makefile.am
9db0ec
@@ -39,7 +39,7 @@ MTCR_DIR = $(USER_DIR)/${MTCR_CONF_DIR}
9db0ec
 mtcr_pylib_DATA = cmtcr.so mtcr.py
9db0ec
 dist_mtcr_pylib_DATA = mtcr.py
9db0ec
 cmtcr.so:
9db0ec
-	$(CC) -g -Wall -pthread -shared ${CFLAGS} $(MTCR_DIR)/*.o -o cmtcr.so
9db0ec
+	$(CC) -g -Wall -pthread -shared ${CFLAGS} ${LDFLAGS} $(MTCR_DIR)/*.o -o cmtcr.so
9db0ec
 
9db0ec
 CLEANFILES = cmtcr.so
9db0ec
 
3592e8
diff --git a/mvpd/Makefile.am b/mvpd/Makefile.am
3592e8
index e9fa5c6..fab1599 100755
3592e8
--- a/mvpd/Makefile.am
3592e8
+++ b/mvpd/Makefile.am
3592e8
@@ -1,61 +1,61 @@
3592e8
-#--
3592e8
-# Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
3592e8
-#
3592e8
-# This software is available to you under a choice of one of two
3592e8
-# licenses.  You may choose to be licensed under the terms of the GNU
3592e8
-# General Public License (GPL) Version 2, available from the file
3592e8
-# COPYING in the main directory of this source tree, or the
3592e8
-# OpenIB.org BSD license below:
3592e8
-#
3592e8
-#     Redistribution and use in source and binary forms, with or
3592e8
-#     without modification, are permitted provided that the following
3592e8
-#     conditions are met:
3592e8
-#
3592e8
-#      - Redistributions of source code must retain the above
3592e8
-#        copyright notice, this list of conditions and the following
3592e8
-#        disclaimer.
3592e8
-#
3592e8
-#      - Redistributions in binary form must reproduce the above
3592e8
-#        copyright notice, this list of conditions and the following
3592e8
-#        disclaimer in the documentation and/or other materials
3592e8
-#        provided with the distribution.
3592e8
-#
3592e8
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3592e8
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3592e8
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3592e8
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
3592e8
-# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3592e8
-# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3592e8
-# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3592e8
-# SOFTWARE.
3592e8
-#--
3592e8
-
3592e8
-# Makefile.am -- Process this file with automake to produce Makefile.in
3592e8
-MTCR_DIR = $(top_srcdir)/${MTCR_CONF_DIR}
3592e8
-COMMON_DIR = $(top_srcdir)/common
3592e8
-LAYOUTS_DIR = $(top_srcdir)/tools_layouts
3592e8
-USER_DIR = $(top_srcdir)
3592e8
-
3592e8
-AM_CPPFLAGS = -I. -I$(USER_DIR) -I$(srcdir) -I$(LAYOUTS_DIR) -I$(USER_DIR)/include/mtcr_ul
3592e8
-AM_CFLAGS = -W -Wall -g -MP -MD $(COMPILER_FPIC)
3592e8
-
3592e8
-noinst_LTLIBRARIES = libmvpd.a
3592e8
-
3592e8
-libmvpd_a_SOURCES =  mvpd.c mvpd.h
3592e8
-
3592e8
-libmvpd_a_DEPENDENCIES = $(MTCR_DIR)/libmtcr_ul.a
3592e8
-libmvpd_a_LIBADD = $(libmvpd_a_DEPENDENCIES)
3592e8
-
3592e8
-RMVPD_SO = rmvpd.so
3592e8
-
3592e8
-		  
3592e8
-LDADD= ../${MTCR_CONF_DIR}/libmtcr_ul.a ${LDL}
3592e8
-
3592e8
-
3592e8
-noinst_HEADERS = mvpd.h
3592e8
-
3592e8
-${RMVPD_SO}: libmvpd.a
3592e8
-	$(CC) -g -Wall -pthread -shared ${CFLAGS} *.o -o ${RMVPD_SO} \
3592e8
-	 -L$(MTCR_DIR) -lmtcr_ul
3592e8
-	
3592e8
-CLEANFILES = ${RMVPD_SO}
3592e8
+#--
3592e8
+# Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
3592e8
+#
3592e8
+# This software is available to you under a choice of one of two
3592e8
+# licenses.  You may choose to be licensed under the terms of the GNU
3592e8
+# General Public License (GPL) Version 2, available from the file
3592e8
+# COPYING in the main directory of this source tree, or the
3592e8
+# OpenIB.org BSD license below:
3592e8
+#
3592e8
+#     Redistribution and use in source and binary forms, with or
3592e8
+#     without modification, are permitted provided that the following
3592e8
+#     conditions are met:
3592e8
+#
3592e8
+#      - Redistributions of source code must retain the above
3592e8
+#        copyright notice, this list of conditions and the following
3592e8
+#        disclaimer.
3592e8
+#
3592e8
+#      - Redistributions in binary form must reproduce the above
3592e8
+#        copyright notice, this list of conditions and the following
3592e8
+#        disclaimer in the documentation and/or other materials
3592e8
+#        provided with the distribution.
3592e8
+#
3592e8
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3592e8
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
3592e8
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3592e8
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
3592e8
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
3592e8
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
3592e8
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3592e8
+# SOFTWARE.
3592e8
+#--
3592e8
+
3592e8
+# Makefile.am -- Process this file with automake to produce Makefile.in
3592e8
+MTCR_DIR = $(top_srcdir)/${MTCR_CONF_DIR}
3592e8
+COMMON_DIR = $(top_srcdir)/common
3592e8
+LAYOUTS_DIR = $(top_srcdir)/tools_layouts
3592e8
+USER_DIR = $(top_srcdir)
3592e8
+
3592e8
+AM_CPPFLAGS = -I. -I$(USER_DIR) -I$(srcdir) -I$(LAYOUTS_DIR) -I$(USER_DIR)/include/mtcr_ul
3592e8
+AM_CFLAGS = -W -Wall -g -MP -MD $(COMPILER_FPIC)
3592e8
+
3592e8
+noinst_LTLIBRARIES = libmvpd.a
3592e8
+
3592e8
+libmvpd_a_SOURCES =  mvpd.c mvpd.h
3592e8
+
3592e8
+libmvpd_a_DEPENDENCIES = $(MTCR_DIR)/libmtcr_ul.a
3592e8
+libmvpd_a_LIBADD = $(libmvpd_a_DEPENDENCIES)
3592e8
+
3592e8
+RMVPD_SO = rmvpd.so
3592e8
+
3592e8
+		  
3592e8
+LDADD= ../${MTCR_CONF_DIR}/libmtcr_ul.a ${LDL}
3592e8
+
3592e8
+
3592e8
+noinst_HEADERS = mvpd.h
3592e8
+
3592e8
+${RMVPD_SO}: libmvpd.a
3592e8
+	$(CC) -g -Wall -pthread -shared ${CFLAGS} ${LDFLAGS} *.o -o ${RMVPD_SO} \
3592e8
+	 -L$(MTCR_DIR) -lmtcr_ul
3592e8
+	
3592e8
+CLEANFILES = ${RMVPD_SO}
9db0ec
diff --git a/reg_access/Makefile.am b/reg_access/Makefile.am
3592e8
index f28290e..a141704 100644
9db0ec
--- a/reg_access/Makefile.am
9db0ec
+++ b/reg_access/Makefile.am
9db0ec
@@ -53,7 +53,7 @@ reg_access_pylib_DATA = ${RREG_ACCESS_SO} regaccess.py
9db0ec
 dist_reg_access_pylib_DATA = regaccess.py
9db0ec
 
9db0ec
 ${RREG_ACCESS_SO}: libreg_access.a
9db0ec
-	$(CC) -g -Wall -pthread -shared ${CFLAGS} *.o -o ${RREG_ACCESS_SO} \
9db0ec
+	$(CC) -g -Wall -pthread -shared ${CFLAGS} ${LDFLAGS} *.o -o ${RREG_ACCESS_SO} \
9db0ec
 	-L$(USER_DIR)/tools_layouts -ltools_layouts -L$(MTCR_DIR) -lmtcr_ul
9db0ec
 
9db0ec
 CLEANFILES = ${RREG_ACCESS_SO}