]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add check for -rpath, but do not use the result
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 27 Mar 2006 20:46:04 +0000 (20:46 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Mon, 27 Mar 2006 20:46:04 +0000 (20:46 +0000)
git-svn-id: https://svn.dealii.org/trunk@12683 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/aclocal.m4
deal.II/configure
deal.II/configure.in

index 0d75f14d6a38b0956ddb7d2c5da306f0de9d4416..b88edc88a343a94a5f117c7a50bc824c0f5f7d28 100644 (file)
@@ -1426,6 +1426,26 @@ AC_DEFUN(DEAL_II_SET_F77_FLAGS, dnl
 ])
 
 
+dnl -------------------------------------------------------------
+dnl
+dnl Check whether we can use -rpath for linking. If so, we can use
+dnl -rpath instead of -L in LDFLAGS below, so the dynamic linker
+dnl finds all libraries.
+dnl
+dnl -------------------------------------------------------------
+AC_DEFUN(DEAL_II_CHECK_RPATH,
+[ OLD_LDFLAGS=$LDFLAGS
+  LDFLAGS="-Wl,-rpath $DEAL_II_PATH $LDFLAGS"
+  AC_MSG_CHECKING([whether compiler understands option -Wl,-rpath])
+  AC_LINK_IFELSE(
+   [ AC_LANG_PROGRAM([[]],[[]])],
+     dnl Note the 'space' at the end of the string!
+   [ AC_MSG_RESULT(yes)
+     LD_PATH_OPTION="-Wl,-rpath "],
+   [ AC_MSG_RESULT(no)
+     LDFLAGS=$OLD_LDFLAGS
+     LD_PATH_OPTION="-L"])
+])
 
 
 dnl -------------------------------------------------------------
index 3ba49335f71a3563f543c54c8841cd5b0a1a8ba0..157b6a4fb90e44495eae8315adcf9a8e8780e1f5 100755 (executable)
@@ -313,7 +313,7 @@ ac_includes_default="\
 #endif"
 
 ac_subdirs_all="$ac_subdirs_all contrib tests"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DEAL_II_MAJOR DEAL_II_MINOR DEAL_II_PATH DEAL2_DIR build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GXX_VERSION GXX_VERSION_DETAILED CXXFLAGSG CXXFLAGSO CXXFLAGSPIC SHLIBLD SHLIBFLAGS CC_VERSION CFLAGSPIC enablemultithreading withmultithreading CXXCPP EGREP BOOST_INCLUDE_DIR F77 F77_VERSION F77FLAGSO F77FLAGSG F77FLAGSPIC F77LIBS enableshared static_lib_suffix shared_lib_suffix AR RANLIB ac_ct_RANLIB enableparser DEAL_II_DISABLE_PARSER USE_CONTRIB_PETSC DEAL_II_PETSC_DIR DEAL_II_PETSC_ARCH DEAL_II_PETSC_VERSION_MAJOR DEAL_II_PETSC_VERSION_MINOR DEAL_II_PETSC_VERSION_SUBMINOR DEAL_II_PETSC_MPIUNI_LIB DEAL_II_DEFINE_DEAL_II_USE_PETSC NEEDS_F77LIBS HSL_INCLUDE_DIR USE_CONTRIB_HSL TECPLOT_INCLUDE_DIR NETCDF_INCLUDE_DIR USE_CONTRIB_METIS DEAL_II_METIS_DIR UMFPACK_LIB UMFPACK_INCLUDE_DIR USE_CONTRIB_UMFPACK DOXYGEN DOT DEAL_II_HAVE_DOT PERL subdirs LDFLAGSPIC LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DEAL_II_MAJOR DEAL_II_MINOR DEAL_II_PATH DEAL2_DIR build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX GXX_VERSION GXX_VERSION_DETAILED CXXFLAGSG CXXFLAGSO CXXFLAGSPIC SHLIBLD SHLIBFLAGS CC_VERSION CFLAGSPIC enablemultithreading withmultithreading CXXCPP EGREP BOOST_INCLUDE_DIR F77 F77_VERSION F77FLAGSO F77FLAGSG F77FLAGSPIC F77LIBS enableshared static_lib_suffix shared_lib_suffix AR RANLIB ac_ct_RANLIB enableparser DEAL_II_DISABLE_PARSER USE_CONTRIB_PETSC DEAL_II_PETSC_DIR DEAL_II_PETSC_ARCH DEAL_II_PETSC_VERSION_MAJOR DEAL_II_PETSC_VERSION_MINOR DEAL_II_PETSC_VERSION_SUBMINOR DEAL_II_PETSC_MPIUNI_LIB DEAL_II_DEFINE_DEAL_II_USE_PETSC NEEDS_F77LIBS HSL_INCLUDE_DIR USE_CONTRIB_HSL TECPLOT_INCLUDE_DIR USE_CONTRIB_METIS DEAL_II_METIS_DIR UMFPACK_LIB UMFPACK_INCLUDE_DIR USE_CONTRIB_UMFPACK DOXYGEN DOT DEAL_II_HAVE_DOT PERL subdirs LDFLAGSPIC LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -4153,7 +4153,61 @@ echo "${ECHO_T}Unknown C compiler - using generic options" >&6
 
 
 
+ OLD_LDFLAGS=$LDFLAGS
+  LDFLAGS="-Wl,-rpath $DEAL_II_PATH $LDFLAGS"
+  echo "$as_me:$LINENO: checking whether compiler understands option -Wl,-rpath" >&5
+echo $ECHO_N "checking whether compiler understands option -Wl,-rpath... $ECHO_C" >&6
+  cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+      echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+     LD_PATH_OPTION="-Wl,-rpath "
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+     LDFLAGS=$OLD_LDFLAGS
+     LD_PATH_OPTION="-L"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
 
 
 
@@ -11078,7 +11132,6 @@ _ACEOF
 
 
 
-
     echo "$as_me:$LINENO: checking for Metis library directory" >&5
 echo $ECHO_N "checking for Metis library directory... $ECHO_C" >&6
 
@@ -12676,7 +12729,6 @@ s,@NEEDS_F77LIBS@,$NEEDS_F77LIBS,;t t
 s,@HSL_INCLUDE_DIR@,$HSL_INCLUDE_DIR,;t t
 s,@USE_CONTRIB_HSL@,$USE_CONTRIB_HSL,;t t
 s,@TECPLOT_INCLUDE_DIR@,$TECPLOT_INCLUDE_DIR,;t t
-s,@NETCDF_INCLUDE_DIR@,$NETCDF_INCLUDE_DIR,;t t
 s,@USE_CONTRIB_METIS@,$USE_CONTRIB_METIS,;t t
 s,@DEAL_II_METIS_DIR@,$DEAL_II_METIS_DIR,;t t
 s,@UMFPACK_LIB@,$UMFPACK_LIB,;t t
index b854e45d5e967b20e7c9cff6b1b3631ac931952e..d591110fb4f37edb5cffec699f246e3b8e17546f 100644 (file)
@@ -131,8 +131,8 @@ AC_SUBST(CC_VERSION)
 AC_SUBST(CFLAGS)
 AC_SUBST(CFLAGSPIC)
 
-
-
+dnl Check if the linker supports -rpath
+DEAL_II_CHECK_RPATH
 
 dnl -------------------------------------------------------------
 dnl                          Multithreading
@@ -469,7 +469,7 @@ DEAL_II_CONFIGURE_TECPLOT
 AC_SUBST(TECPLOT_INCLUDE_DIR)
 
 DEAL_II_CONFIGURE_NETCDF
-AC_SUBST(NETCDF_INCLUDE_DIR)
+dnl AC_SUBST(NETCDF_INCLUDE_DIR)
 
 DEAL_II_CONFIGURE_METIS
 AC_SUBST(USE_CONTRIB_METIS)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.