[mpich2-commits] r6623 - mpich2/trunk/confdb

balaji at mcs.anl.gov balaji at mcs.anl.gov
Fri May 7 02:13:15 CDT 2010


Author: balaji
Date: 2010-05-07 02:13:15 -0500 (Fri, 07 May 2010)
New Revision: 6623

Modified:
   mpich2/trunk/confdb/aclocal_shl.m4
Log:
Cleanup the C shared library support to be similar to the fortran
version.

Modified: mpich2/trunk/confdb/aclocal_shl.m4
===================================================================
--- mpich2/trunk/confdb/aclocal_shl.m4	2010-05-07 01:36:46 UTC (rev 6622)
+++ mpich2/trunk/confdb/aclocal_shl.m4	2010-05-07 07:13:15 UTC (rev 6623)
@@ -89,17 +89,13 @@
     # For example, include the libname as ${LIBNAME_SHL}
     #C_LINK_SHL='${CC} -shared -Wl,-h,<finallibname>'
     # May need -fPIC .  Test to see which one works.
-    PAC_C_CHECK_COMPILER_OPTION(-fPIC,fPIC_ok=yes,fPIC_ok=no)
-    if test "$fPIC_ok" != yes ; then
-        PAC_C_CHECK_COMPILER_OPTION(-fpic,fpic_ok=yes,fpic_ok=no)
-        if test "$fpic_ok" != yes ; then
-	     AC_MSG_ERROR([Neither -fpic nor -fPIC accepted by $CC])
-        else
-	     CC_SHL='${CC} -fpic'
-        fi
-    else
-        CC_SHL='${CC} -fPIC'
-    fi
+    for sh_arg in "-fPIC" "-fpic" "-KPIC" ; do
+        PAC_C_CHECK_COMPILER_OPTION($sh_arg,works=yes,works=no)
+        if test "$works" = "yes" ; then
+           CC_SHL="${CC} ${sh_arg}"
+	   break
+	fi
+    done
     # This used to have -Wl,-rpath earlier, but that causes problems
     # on many systems.
     C_LINKPATH_SHL=""



More information about the mpich2-commits mailing list