Skip to content

Commit eaa5537

Browse files
author
Sebastiano Merlino
committed
Added option to enable same directory build
1 parent 71d3be3 commit eaa5537

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

‎configure.ac‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,18 @@ CXXFLAGS=$OLD_CXXFLAGS
3939
AC_LANG([C++])
4040
AC_SYS_LARGEFILE
4141

42-
if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
43-
AC_MSG_ERROR("you must configure in a separate build directory")
42+
AC_MSG_CHECKING([whether it is possible to compile in the same directory])
43+
AC_ARG_ENABLE([same-directory-build],
44+
[AS_HELP_STRING([--enable-same-directory-build],
45+
[enable to compile in the same directory. This is heavily discouraged. (def=no)])],
46+
[samedirectory="$enableval"],
47+
[samedirectory=no])
48+
AC_MSG_RESULT([$samedirectory])
49+
50+
if test x"$samedirectory" = x"no"; then
51+
if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
52+
AC_MSG_ERROR("you must configure in a separate build directory")
53+
fi
4454
fi
4555

4656
# Checks for header files.

0 commit comments

Comments
 (0)