diff options
| author | 2014-10-22 02:14:52 +0200 | |
|---|---|---|
| committer | 2014-10-22 02:14:52 +0200 | |
| commit | cc907c0f162ee84e5698b9c27ac6fb0be8bb9bc0 (patch) | |
| tree | ee6873a5fda80158afdbb2c9706ace0d771e4cec /configure.ac | |
| parent | a2c5ec6350597ad6a84341579c9d1d1780e97a98 (diff) | |
| download | libplist-cc907c0f162ee84e5698b9c27ac6fb0be8bb9bc0.tar.gz libplist-cc907c0f162ee84e5698b9c27ac6fb0be8bb9bc0.tar.bz2 | |
Workaround autoconf bug and ensure a C++ compiler is mandatory
If AC_PROG_CXX is used after AC_PROG_CC, it will return "g++" even if no
C++ compiler is installed. However, as we need one, testing compiling a
program will make configure fail if indeed no C++ compiler is installed.
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index fb6b196..b9185a6 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -27,6 +27,16 @@ AC_SUBST(LIBXML2_VERSION) | |||
| 27 | # Checks for programs. | 27 | # Checks for programs. |
| 28 | AC_PROG_CC | 28 | AC_PROG_CC |
| 29 | AC_PROG_CXX | 29 | AC_PROG_CXX |
| 30 | |||
| 31 | # AC_PROG_CXX will return "g++" even if no c++ compiler is installed | ||
| 32 | AC_LANG_PUSH([C++]) | ||
| 33 | AC_MSG_CHECKING([whether $CXX is available and compiles a program]) | ||
| 34 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])], | ||
| 35 | [AC_MSG_RESULT([yes])], | ||
| 36 | [AC_MSG_RESULT([no]) | ||
| 37 | AC_MSG_ERROR([C++ compiler not available or unable to compile])]) | ||
| 38 | AC_LANG_POP | ||
| 39 | |||
| 30 | AM_PROG_CC_C_O | 40 | AM_PROG_CC_C_O |
| 31 | AC_PROG_LIBTOOL | 41 | AC_PROG_LIBTOOL |
| 32 | 42 | ||
