11dnl Process this file with autoconf to produce a configure script.
22
3- AC_INIT ( mstflint ,
4.7 .0 ,
[email protected] ) 3+ AC_INIT ( mstflint ,
4.8 .0 ,
[email protected] ) 44
55AC_DEFINE_UNQUOTED ( [ PROJECT] , [ "mstflint"] , [ Define the project name.] )
66AC_SUBST ( [ PROJECT] )
77
8- AC_DEFINE_UNQUOTED ( [ VERSION] , [ "4.7 .0"] , [ Define the project version.] )
8+ AC_DEFINE_UNQUOTED ( [ VERSION] , [ "4.8 .0"] , [ Define the project version.] )
99AC_SUBST ( [ VERSION] )
1010
1111AC_CONFIG_AUX_DIR ( config )
@@ -23,6 +23,7 @@ dnl Checks for headers
2323AC_CHECK_HEADER ( termios.h ,[ CXXFLAGS="${CXXFLAGS} -DHAVE_TERMIOS_H"] )
2424TOOLS_CRYPTO=""
2525MAD_IFC=""
26+ MLXFWUPDATE=""
2627
2728COMPILER_FPIC="-fPIC"
2829AC_SUBST ( COMPILER_FPIC )
@@ -38,14 +39,35 @@ if test "$enable_dc" = "yes"; then
3839 AC_CHECK_LIB ( z , uncompress ,, AC_MSG_ERROR ( [ cannot find zlib uncompress() function. Use --disable-dc to remove this dependaency] ) )
3940fi
4041
42+ # FWMANAGER
43+ AC_MSG_CHECKING ( -- enable-fw-mgr argument )
44+ AC_ARG_ENABLE ( fw-mgr ,
45+ [ --enable-fw-mgr Enable compiling mstfwmanager tool and features] ,
46+ [ enable_fw_mgr="yes"] ,
47+ [ enable_fw_mgr="no"] )
48+ AC_MSG_RESULT ( $enable_fw_mgr )
49+ if test "x$enable_fw_mgr" = "xyes"; then
50+ AC_CHECK_HEADER ( zlib.h ,,AC_MSG_ERROR ( [ cannot find zlib.h . this header is needed for compiling fw manager tool] ) )
51+ AC_CHECK_HEADER ( curl/curl.h ,,AC_MSG_ERROR ( [ cannot find curl/curl.h . this header is needed for compiling fw manager tool] ) )
52+ AC_CHECK_LIB ( z , uncompress ,, AC_MSG_ERROR ( [ cannot find zlib uncompress() function.] ) )
53+ AC_CHECK_LIB ( boost_regex , regcompA ,, AC_MSG_ERROR ( [ cannot find boost_regex regcompA() function. Try re-installing the library...] ) )
54+ CURL_INC_DIR=/usr/include/curl/
55+ fi
56+
57+ AC_SUBST ( CURL_INC_DIR )
58+
59+ AM_CONDITIONAL(ENABLE_FWMGR, [ test "x$enable_fw_mgr" = "xyes" ] )
60+ AC_SUBST ( ENABLE_FWMGR )
61+
62+ AC_SUBST ( ENABLE_FWMGR )
4163# XML2
4264AC_MSG_CHECKING ( -- enable-xml2 argument )
4365AC_ARG_ENABLE ( xml2 ,
4466 [ --enable-xml2 Enable mstflint libxml2 dependant features] ,
4567 [ enable_xml2="yes"] ,
4668 [ enable_xml2="no"] )
4769AC_MSG_RESULT ( $enable_xml2 )
48- if test "x$enable_xml2" = "xyes"; then
70+ if test [ "x$enable_xml2" = "xyes" ] || [ test "x$enable_fw_mgr" = "xyes" ] ; then
4971 # XML2 checks
5072 if test ! -f /usr/include/libxml2/libxml/xpath.h; then
5173 AC_MSG_NOTICE ( [ checking for libxml2... no] )
@@ -57,6 +79,7 @@ if test "x$enable_xml2" = "xyes"; then
5779 AC_CHECK_LIB ( xml2 , xmlDocDumpFormatMemoryEnc ,, AC_MSG_ERROR ( [ cannot find xml2 xmlDocDumpFormatMemoryEnc() function. Try re-installing the library...] ) )
5880 AC_SUBST ( XML2_INC_DIR )
5981fi
82+
6083AM_CONDITIONAL(DISABLE_XML2, [ test "x$enable_xml2" = "xno"] )
6184AC_SUBST ( DISABLE_XML2 )
6285
@@ -126,13 +149,12 @@ CXXFLAGS="$CXXFLAGS -Werror -DMST_UL"
126149
127150AC_CONFIG_FILES ( mstflint.spec )
128151
129- AS_IF ( [ test "x$enable_cs" = "xyes" || test "x$enable_openssl" = "xyes"] , [
130- AC_CONFIG_FILES ( tools_crypto/Makefile )
131- ] )
132-
133- AS_IF ( [ test "x$enable_openssl" = "xyes"] , [
134- AC_CONFIG_FILES ( mlxsign_lib/Makefile )
135- ] )
152+ # Check for new ignore flags needed for GCC >= 7
153+ AX_CHECK_COMPILE_FLAG ( [ -Wno-implicit-fallthrough] , [ CXXFLAGS="$CXXFLAGS -Wno-implicit-fallthrough"] , [ ] , [ ] )
154+ AX_CHECK_COMPILE_FLAG ( [ -Wno-format-overflow] , [ CFLAGS="$CFLAGS -Wno-format-overflow"] , [ ] , [ ] )
155+ AX_CHECK_COMPILE_FLAG ( [ -Wno-implicit-fallthrough] , [ CFLAGS="$CFLAGS -Wno-implicit-fallthrough"] , [ ] , [ ] )
156+ AX_CHECK_COMPILE_FLAG ( [ -Wno-format-overflow] , [ CXXFLAGS="$CXXFLAGS -Wno-format-overflow"] , [ ] , [ ] )
157+
136158
137159TOOLS_BUILD_TIME=`date +"%b %d %Y\, %H:%M:%S"`
138160AC_SUBST ( TOOLS_BUILD_TIME )
@@ -149,8 +171,28 @@ if test x"$TOOLS_GIT_SHA" == x; then
149171fi
150172AC_SUBST ( TOOLS_GIT_SHA )
151173
174+ AS_IF ( [ test "x$enable_cs" = "xyes" || test "x$enable_openssl" = "xyes"] , [
175+ AC_CONFIG_FILES ( tools_crypto/Makefile )
176+ ] )
177+
178+ AS_IF ( [ test "x$enable_openssl" = "xyes"] , [
179+ AC_CONFIG_FILES ( mlxsign_lib/Makefile )
180+ ] )
181+
182+ AS_IF ( [ test "x$enable_fw_mgr" = "xyes"] , [
183+ AC_CONFIG_FILES ( mlxfwupdate/Makefile )
184+ AC_CONFIG_FILES ( libmfa/Makefile )
185+ AC_CONFIG_FILES ( xz_utils/Makefile )
186+ AC_CONFIG_FILES ( ext_libs/iniParser/Makefile )
187+ AC_CONFIG_FILES ( ext_libs/json/Makefile )
188+ AC_CONFIG_FILES ( ext_libs/minixz/Makefile )
189+ MLXFWUPDATE="libmfa xz_utils mlxfwupdate"
190+ ] )
191+
192+ AC_SUBST ( MLXFWUPDATE )
193+
152194AC_OUTPUT ( Makefile common/Makefile mft_utils/Makefile mtcr_ul/Makefile mtcr_py/Makefile ext_libs/Makefile ext_libs/sqlite/Makefile ext_libs/muparser/Makefile dev_mgt/Makefile tools_layouts/Makefile reg_access/Makefile \
153195 cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mlxconfig/mlxconfig_dbs/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile \
154- small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile \
196+ small_utils/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile mvpd/Makefile \
155197 fw_comps_mgr/Makefile mad_ifc/Makefile )
156198
0 commit comments