configure: put buildinfo stuff in own config header

...so there's no need to rebuild everything all the time
This commit is contained in:
Stefan Seyfried
2013-11-13 14:34:18 +01:00
parent 548448456a
commit 06f233b288
2 changed files with 22 additions and 12 deletions

View File

@@ -12,19 +12,27 @@ AC_PROG_CXX
AC_DISABLE_STATIC AC_DISABLE_STATIC
AM_PROG_LIBTOOL AM_PROG_LIBTOOL
# Add build information to config.h # Add build information to local_build_config.h.tmp
# --------------------------------- # -------------------------------------------------
rm -f local_build_config.h.tmp
# Add host to config.h cat > local_build_config.h.tmp << EOF
AC_DEFINE_UNQUOTED(USED_BUILD, ["$build"], [Build system under which the program was compiled on.]) /* Build system under which the program was compiled on. */
#define USED_BUILD "$build"
# Add used CXXFLAGS to config.h /* Define to the used CXXFLAGS to compile this package. */
AC_DEFINE_UNQUOTED(USED_CXXFLAGS, ["$CXXFLAGS"], [Define to the used CXXFLAGS to compile this package.]) #define USED_CXXFLAGS "$CXXFLAGS"
EOF
# Get compiler (version)
AH_TEMPLATE(USED_COMPILER, [Define to name and version of used compiler])
if COMPILER=`$CC --version | head -n 1`; then if COMPILER=`$CC --version | head -n 1`; then
AC_DEFINE_UNQUOTED(USED_COMPILER, ["$COMPILER"]) cat >> local_build_config.h.tmp <<-EOF
/* Define to name and version of used compiler */
#define USED_COMPILER "$COMPILER"
EOF
fi
# only update header if it differs to avoid unnecessary rebuilds
if ! diff local_build_config.h.tmp local_build_config.h >/dev/null 2>&1; then
rm -f local_build_config.h
mv local_build_config.h.tmp local_build_config.h
else
rm -f local_build_config.h.tmp
fi fi
AC_ARG_WITH([tremor], [AS_HELP_STRING([--with-tremor], AC_ARG_WITH([tremor], [AS_HELP_STRING([--with-tremor],

View File

@@ -33,6 +33,8 @@
#include <gui/widget/messagebox.h> #include <gui/widget/messagebox.h>
#include <system/helpers.h> #include <system/helpers.h>
#include <local_build_config.h>
using namespace std; using namespace std;
CBuildInfo::CBuildInfo() : CComponentsWindow(1, 1, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) CBuildInfo::CBuildInfo() : CComponentsWindow(1, 1, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO)