[build] add --enable-dev-tools configure flag

This builds tools that I want to keep in the same code base, but not
intended for general release.
This commit is contained in:
Joe Thornber 2016-02-24 13:41:43 +00:00
parent f193a70a31
commit 5f879237f5
5 changed files with 58 additions and 1 deletions

View File

@ -95,7 +95,14 @@ SOURCE=\
thin-provisioning/thin_restore.cc \ thin-provisioning/thin_restore.cc \
thin-provisioning/thin_rmap.cc \ thin-provisioning/thin_rmap.cc \
thin-provisioning/thin_trim.cc \ thin-provisioning/thin_trim.cc \
thin-provisioning/xml_format.cc thin-provisioning/xml_format.cc \
DEVTOOLS_SOURCE=\
thin-provisioning/thin_generate_metadata.cc
ifeq ("@DEVTOOLS@", "yes")
SOURCE+=$(DEVTOOLS_SOURCE)
endif
CC:=@CC@ CC:=@CC@
CXX:=@CXX@ CXX:=@CXX@
@ -106,6 +113,11 @@ TOP_BUILDDIR:=@top_builddir@
CFLAGS+=-g -Wall -O3 CFLAGS+=-g -Wall -O3
CFLAGS+=@LFS_FLAGS@ CFLAGS+=@LFS_FLAGS@
CXXFLAGS+=-g -Wall -fno-strict-aliasing -std=c++11 CXXFLAGS+=-g -Wall -fno-strict-aliasing -std=c++11
ifeq ("@DEVTOOLS@", "yes")
CXXFLAGS+=-DDEV_TOOLS
endif
CXXFLAGS+=@CXXOPTIMISE_FLAG@ CXXFLAGS+=@CXXOPTIMISE_FLAG@
CXXFLAGS+=@CXXDEBUG_FLAG@ CXXFLAGS+=@CXXDEBUG_FLAG@
CXXFLAGS+=@CXX_STRERROR_FLAG@ CXXFLAGS+=@CXX_STRERROR_FLAG@

View File

@ -137,6 +137,14 @@ AC_ARG_ENABLE(testing,
TESTING=$enableval, TESTING=no) TESTING=$enableval, TESTING=no)
AC_MSG_RESULT($TESTING) AC_MSG_RESULT($TESTING)
################################################################################
dnl -- Enable development tools
AC_MSG_CHECKING(whenter to enable development tools)
AC_ARG_ENABLE(dev-tools,
AC_HELP_STRING(--enable-dev-tools, [enable development tools in the makefile]),
DEVTOOLS=$enableval, DEVTOOLS=no)
AC_MSG_RESULT($DEVTOOLS)
################################################################################ ################################################################################
dnl -- Enable static libstdc++ dnl -- Enable static libstdc++
AC_MSG_CHECKING(whether to statically link libstdc++) AC_MSG_CHECKING(whether to statically link libstdc++)
@ -173,6 +181,7 @@ AC_SUBST(RELEASE_DATE)
AC_SUBST(TESTING) AC_SUBST(TESTING)
AC_SUBST(THIN_PROVISIONING_TOOLS_VERSION) AC_SUBST(THIN_PROVISIONING_TOOLS_VERSION)
AC_SUBST(STATIC_CXX) AC_SUBST(STATIC_CXX)
AC_SUBST(DEVTOOLS)
################################################################################ ################################################################################
dnl -- First and last lines should not contain files to generate in order to dnl -- First and last lines should not contain files to generate in order to

View File

@ -17,6 +17,10 @@ thin_provisioning::register_thin_commands(base::application &app)
app.add_cmd(command::ptr(new thin_repair_cmd())); app.add_cmd(command::ptr(new thin_repair_cmd()));
app.add_cmd(command::ptr(new thin_rmap_cmd())); app.add_cmd(command::ptr(new thin_rmap_cmd()));
app.add_cmd(command::ptr(new thin_trim_cmd())); app.add_cmd(command::ptr(new thin_trim_cmd()));
#if DEV_COMMANDS
app.add_cmd(command::ptr(new thin_generate_metadata_cmd()));
#endif
} }
//---------------------------------------------------------------- //----------------------------------------------------------------

View File

@ -70,6 +70,13 @@ namespace thin_provisioning {
virtual int run(int argc, char **argv); virtual int run(int argc, char **argv);
}; };
class thin_generate_metadata_cmd : public base::command {
public:
thin_generate_metadata_cmd();
virtual void usage(std::ostream &out) const;
virtual int run(int argc, char **argv);
};
void register_thin_commands(base::application &app); void register_thin_commands(base::application &app);
} }

View File

@ -0,0 +1,25 @@
#include "thin-provisioning/commands.h"
using namespace thin_provisioning;
//----------------------------------------------------------------
thin_generate_metadata_cmd::thin_generate_metadata_cmd()
: command("thin_generate_metadata")
{
}
void
thin_generate_metadata_cmd::usage(std::ostream &out) const
{
}
int
thin_generate_metadata_cmd::run(int argc, char **argv)
{
return 1;
}
//----------------------------------------------------------------