Skip to content
Snippets Groups Projects
Commit fc305278 authored by Christian Engwer's avatar Christian Engwer
Browse files

added new test to check whether linking of c++-objcets work

[[Imported from SVN: r3721]]
parent ee6cdebc
Branches
Tags
No related merge requests found
......@@ -13,15 +13,16 @@ AM_CONFIG_HEADER([config.h])
AC_PROG_CXX
AC_LANG_PUSH([C++])
# don't build shared libs per default, this is way better for debugging...
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
DUNE_CHECK_COMPILER
DUNE_LINKCXX
# how to create a deprecated warning
DUNE_CHECKDEPRECATED
# don't build shared libs per default, this is way better for debugging...
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
# check for auxiliary tools so that it's not fatal if they're missing
AC_CHECK_PROGS([DOXYGEN], [doxygen], [true])
AC_CHECK_PROGS([TEX], [latex], [true])
......
......@@ -13,6 +13,7 @@ dnl check for programs
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([AC_PROG_CPP])
AC_REQUIRE([DUNE_CHECK_COMPILER])
AC_REQUIRE([DUNE_LINKCXX])
AC_REQUIRE([DUNE_CHECKDEPRECATED])
AC_REQUIRE([AC_PROG_INSTALL])
AC_REQUIRE([AC_PROG_LN_S])
......
# $Id$
# tries to link c++ objects
AC_DEFUN([DUNE_LINKCXX],[
AC_MSG_CHECKING([whether compiling C++ code works])
AC_COMPILE_IFELSE(
AC_LANG_SOURCE(
[ #include <iostream>
int main (int argc, char** argv) {
std::cout << std::endl;
}]),
[ AC_MSG_RESULT([yes]);
AC_MSG_CHECKING([whether linking C++ objects works]);
# link from object file
ac_old_link=$ac_link
ac_link=`echo "$ac_old_link" | sed "s/conftest\.$ac_ext/conftest\.$ac_objext/"`
# disable deletion of object file
ac_old_objext=$ac_objext;
ac_objext="";
AC_LINK_IFELSE([],
[ AC_MSG_RESULT([yes])],
[ AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not link C++ code])])
ac_objext=$ac_old_objext;
ac_link=$ac_old_link;],
[ AC_MSG_RESULT([no])
AC_MSG_ERROR([Could not compile C++ code])]
)
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment