# Copyright (C) 2020 Nathan Sidwell, nathan@acm.org
# License: Apache v2.0
+# Note: VAR+=... is not dashing, despite its looks
+
AC_DEFUN([NMS_NOT_IN_SOURCE],
[if test -e configure ; then
AC_MSG_ERROR([Do not build in the source tree. Reasons])
AC_DEFUN([NMS_TOOL_DIRS],
[if test "$tools" && test -d "$tools/include" ; then
- CXX+=" -I$tools/include"
+ CXX="$CXX -I$tools/include"
fi
if test "$tools" && test -d "$tools/lib" ; then
toollib="$tools/lib"
if os=$(CXX -print-multi-os-directory 2>/dev/null) ; then
- toollib+="/${os}"
+ toollib="$toollib/${os}"
fi
- ## VAR+=... is not dashing
LDFLAGS="$LDFLAGS -L $toollib"
unset toollib
fi])
]])],
[AC_MSG_RESULT([yes])],
[CXX_ORIG="$CXX"
-CXX+=" -std=c++11"
+CXX="$CXX -std=c++11"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#if __cplusplus != 201103
#error "C++11 is required"
#endif
]])],
[AC_MSG_RESULT([yes])],
-[CXX+=" -std=c++20"
+[CXX="$CXX -std=c++20"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
[#if __cplusplus <= 201703
#error "C++20 is required"
AC_CHECK_HEADERS([demangle.h libiberty/demangle.h],[break])
# libbfd prevents distribution because of licensing
AC_CHECK_HEADERS([bfd.h])
- AC_SEARCH_LIBS([bfd_openr],[bfd],[LIBS+="-lz -liberty -ldl"],,[-lz -liberty -ldl])
+ AC_SEARCH_LIBS([bfd_openr],[bfd],[LIBS="$LIBS -lz -liberty -ldl"],,[-lz -liberty -ldl])
fi
if test "$ac_cv_func_backtrace" = yes ; then
nms_backtrace=yes
done
for dir in . $SUBDIRS
do
- CONFIG_FILES+=" $dir/Makesub"
- test -f ${srcdir}/$dir/tests/Makesub.in && CONFIG_FILES+=" $dir/tests/Makesub"
+ CONFIG_FILES="$CONFIG_FILES $dir/Makesub"
+ test -f ${srcdir}/$dir/tests/Makesub.in && CONFIG_FILES="$CONFIG_FILES $dir/tests/Makesub"
done
AC_CONFIG_FILES([$CONFIG_FILES])
AC_SUBST(configure_args,[$ac_configure_args])
# Copyright (C) 2020 Nathan Sidwell, nathan@acm.org
# License: Apache v2.0
+# Note: VAR+=... is not dashing, despite its looks
+
# thanks to Zack Weinberg for fixing this!
$as_echo "yes" >&6; }
else
CXX_ORIG="$CXX"
-CXX+=" -std=c++11"
+CXX="$CXX -std=c++11"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$tools" && test -d "$tools/include" ; then
- CXX+=" -I$tools/include"
+ CXX="$CXX -I$tools/include"
fi
if test "$tools" && test -d "$tools/lib" ; then
toollib="$tools/lib"
if os=$(CXX -print-multi-os-directory 2>/dev/null) ; then
- toollib+="/${os}"
+ toollib="$toollib/${os}"
fi
- ## VAR+=... is not dashing
LDFLAGS="$LDFLAGS -L $toollib"
unset toollib
fi
done
for dir in . $SUBDIRS
do
- CONFIG_FILES+=" $dir/Makesub"
- test -f ${srcdir}/$dir/tests/Makesub.in && CONFIG_FILES+=" $dir/tests/Makesub"
+ CONFIG_FILES="$CONFIG_FILES $dir/Makesub"
+ test -f ${srcdir}/$dir/tests/Makesub.in && CONFIG_FILES="$CONFIG_FILES $dir/tests/Makesub"
done
ac_config_files="$ac_config_files $CONFIG_FILES"