11dnl Process this file with autoconf to produce a configure script.
22
3- AC_INIT ( mstflint ,
4.10 .0 ,
[email protected] ) 3+ AC_INIT ( mstflint ,
4.11 .0 ,
[email protected] ) 44
55AC_DEFINE_UNQUOTED ( [ PROJECT] , [ "mstflint"] , [ Define the project name.] )
66AC_SUBST ( [ PROJECT] )
77
8- AC_DEFINE_UNQUOTED ( [ VERSION] , [ "4.10 .0"] , [ Define the project version.] )
8+ AC_DEFINE_UNQUOTED ( [ VERSION] , [ "4.11 .0"] , [ Define the project version.] )
99AC_SUBST ( [ VERSION] )
1010
1111AC_CONFIG_AUX_DIR ( config )
@@ -28,6 +28,8 @@ if test "x$OS" = "xFreeBSD"; then
2828 AC_MSG_NOTICE ( FreeBSD Build )
2929 MTCR_CONF_DIR="mtcr_freebsd"
3030 default_en_inband="no"
31+ CXXFLAGS="${CXXFLAGS} -isystem /usr/local/include"
32+ LDFLAGS="${LDFLAGS} -L/usr/local/lib"
3133else
3234 MTCR_CONF_DIR="mtcr_ul"
3335 LDL="-ldl"
@@ -41,7 +43,7 @@ dnl Checks for headers
4143AC_CHECK_HEADER ( termios.h ,[ CXXFLAGS="${CXXFLAGS} -DHAVE_TERMIOS_H"] )
4244TOOLS_CRYPTO=""
4345MAD_IFC=""
44- MLXFWUPDATE =""
46+ FW_MGR_TOOLS =""
4547
4648COMPILER_FPIC="-fPIC"
4749AC_SUBST ( COMPILER_FPIC )
@@ -67,8 +69,8 @@ AC_MSG_RESULT($enable_fw_mgr)
6769if test "x$enable_fw_mgr" = "xyes"; then
6870 AC_CHECK_HEADER ( curl/curl.h ,,AC_MSG_ERROR ( [ cannot find curl/curl.h . this header is needed for compiling fw manager tool] ) )
6971 AC_CHECK_HEADER ( zlib.h ,,AC_MSG_ERROR ( [ cannot find zlib.h . this header is needed for compiling fw manager tool] ) )
70- AC_CHECK_HEADER ( lzma.h ,,AC_MSG_ERROR ( [ cannot find lzma.h . this header is needed for compiling fw manager tool] ) )
7172 AC_CHECK_LIB ( z , uncompress ,, AC_MSG_ERROR ( [ cannot find zlib uncompress() function.] ) )
73+ AC_CHECK_HEADER ( lzma.h ,,AC_MSG_ERROR ( [ Cannot find lzma.h.] ) )
7274 AC_CHECK_LIB ( boost_regex , regcompA ,, AC_MSG_ERROR ( [ cannot find boost_regex regcompA() function. Try re-installing the library...] ) )
7375 CURL_INC_DIR=/usr/include/curl/
7476fi
@@ -130,11 +132,11 @@ if test "x$enable_cs" = "xyes"; then
130132 TOOLS_CRYPTO="tools_crypto"
131133fi
132134
133- AC_MSG_CHECKING ( -- enable -openssl argument )
135+ AC_MSG_CHECKING ( -- disable -openssl argument )
134136AC_ARG_ENABLE ( openssl ,
135- [ --enable -openssl Enable all openssl features, dependant of openssl library] ,
136- [ enable_openssl="yes" ] ,
137- [ enable_openssl="no "] )
137+ [ --disable -openssl Disable all openssl features, dependant of openssl library] ,
138+ [ enable_openssl=$enableval ] ,
139+ [ enable_openssl="yes "] )
138140AC_MSG_RESULT ( $enable_openssl )
139141if test "x$enable_openssl" = "xyes"; then
140142 AC_CHECK_HEADER ( openssl/sha.h ,,AC_MSG_ERROR ( [ cannot find openssl/sha.h . remove --enable-openssl to remove this dependaency or install openssl] ) )
@@ -163,38 +165,56 @@ AS_IF([test "x$enable_dynamic_ld" = "xyes"], [
163165 LDFLAGS="$LDFLAGS -Wl,--dynamic-linker=/lib64/ld64.so.2"
164166] )
165167
166- CFLAGS="$CFLAGS -Werror -DMST_UL"
167- CXXFLAGS="$CXXFLAGS -Werror -DMST_UL"
168+ CFLAGS="$CFLAGS -DMST_UL"
169+ CXXFLAGS="$CXXFLAGS -DMST_UL"
170+
171+ AM_CFLAGS="-Wall -Werror"
172+ AM_CXXFLAGS="-Wall -Werror"
168173
169174AC_CONFIG_FILES ( mstflint.spec )
170175
176+ # We save and restore CFLAGS, after adding Wall and Werror
177+ # because AX_CHECK_COMPILE_FLAG doesn't work properly without it
178+
171179# C related ignores
180+ OLD_CFLAGS="$CFLAGS"
181+ CFLAGS="$CFLAGS -Wall -Werror"
172182AX_CHECK_COMPILE_FLAG ( [ -Wno-format-overflow] , [ CFLAGS="$CFLAGS -Wno-format-overflow"] , [ ] , [ ] )
173183AX_CHECK_COMPILE_FLAG ( [ -Wno-implicit-fallthrough] , [ CFLAGS="$CFLAGS -Wno-implicit-fallthrough"] , [ ] , [ ] )
174184AX_CHECK_COMPILE_FLAG ( [ -Wno-cast-function-type] , [ CFLAGS="$CFLAGS -Wno-cast-function-type"] , [ ] , [ ] )
185+ CFLAGS="$OLD_CFLAGS"
175186
176187# C++ related ignores
188+ OLD_CXXFLAGS="$CXXFLAGS"
189+ CXXFLAGS="$CXXFLAGS -Wall -Werror"
177190AC_LANG_PUSH ( [ C++] )
178191AX_CHECK_COMPILE_FLAG ( [ -Wno-implicit-fallthrough] , [ CXXFLAGS="$CXXFLAGS -Wno-implicit-fallthrough"] , [ ] , [ ] )
179192AX_CHECK_COMPILE_FLAG ( [ -Wno-format-overflow] , [ CXXFLAGS="$CXXFLAGS -Wno-format-overflow"] , [ ] , [ ] )
180193AX_CHECK_COMPILE_FLAG ( [ -Wno-cast-function-type] , [ CXXFLAGS="$CXXFLAGS -Wno-cast-function-type"] , [ ] , [ ] )
181194AX_CHECK_COMPILE_FLAG ( [ -Wno-class-memaccess] , [ CXXFLAGS="$CXXFLAGS -Wno-class-memaccess"] , [ ] , [ ] )
182195AC_LANG_POP ( [ C++] )
196+ CXXFLAGS="$OLD_CXXFLAGS"
183197
184198TOOLS_BUILD_TIME=`date +"%b %d %Y\, %H:%M:%S"`
185199AC_SUBST ( TOOLS_BUILD_TIME )
186200
187- AC_ARG_VAR ( MFT_VERSION_STR , The MSTFLINT version )
188- if test x"$MFT_VERSION_STR " == x; then
189- MFT_VERSION_STR ="$PACKAGE_STRING"
201+ AC_ARG_VAR ( MSTFLINT_VERSION_STR , The MSTFLINT version )
202+ if test x"$MSTFLINT_VERSION_STR " == x; then
203+ MSTFLINT_VERSION_STR ="$PACKAGE_STRING"
190204fi
191- AC_SUBST ( MFT_VERSION_STR )
205+
206+ AC_SUBST ( MSTFLINT_VERSION_STR )
207+ AC_DEFINE ( [ MSTFLINT_VERSION_STR] , [ ] , [ The MSTFLINT version] )
208+ AC_DEFINE_UNQUOTED ( MSTFLINT_VERSION_STR , "$MSTFLINT_VERSION_STR" )
209+
192210
193211AC_ARG_VAR ( TOOLS_GIT_SHA , The MSTFLINT tree git sha hash version )
194212if test x"$TOOLS_GIT_SHA" == x; then
195213 TOOLS_GIT_SHA="N/A"
196214fi
197215AC_SUBST ( TOOLS_GIT_SHA )
216+ AC_DEFINE ( [ TOOLS_GIT_SHA] , [ ] , [ The MSTFLINT tree git sha hash version] )
217+ AC_DEFINE_UNQUOTED ( TOOLS_GIT_SHA , "$TOOLS_GIT_SHA" )
198218
199219AS_IF ( [ test "x$enable_cs" = "xyes" || test "x$enable_openssl" = "xyes"] , [
200220 AC_CONFIG_FILES ( tools_crypto/Makefile )
@@ -205,18 +225,14 @@ AS_IF([test "x$enable_openssl" = "xyes"], [
205225 ] )
206226
207227AS_IF ( [ test "x$enable_fw_mgr" = "xyes"] , [
208- AC_CONFIG_FILES ( mlxfwupdate/Makefile )
209- AC_CONFIG_FILES ( libmfa/Makefile )
210228 AC_CONFIG_FILES ( xz_utils/Makefile )
229+ AC_CONFIG_FILES ( mlxfwupdate/Makefile )
211230 AC_CONFIG_FILES ( ext_libs/iniParser/Makefile )
212- AC_CONFIG_FILES ( ext_libs/json/Makefile )
213- AC_CONFIG_FILES ( ext_libs/minixz/Makefile )
214- MLXFWUPDATE="libmfa xz_utils mlxfwupdate"
231+ AC_CONFIG_FILES ( mlxarchive/Makefile )
232+ FW_MGR_TOOLS="xz_utils mlxfwupdate mlxarchive"
215233 ] )
216234
217- AC_SUBST ( MLXFWUPDATE )
218-
219-
235+ AC_SUBST ( FW_MGR_TOOLS )
220236
221237if test "x$OS" = "xFreeBSD"; then
222238 AC_MSG_NOTICE ( FreeBSD MTCR )
226242 AC_CONFIG_FILES ( mtcr_ul/Makefile )
227243fi
228244
229- AC_OUTPUT ( Makefile common/Makefile mft_utils/Makefile mtcr_py/Makefile ext_libs/Makefile ext_libs/sqlite/Makefile ext_libs/muparser/Makefile dev_mgt/ Makefile tools_layouts/ Makefile reg_access /Makefile \
230- cmdif/Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mlxconfig/mlxconfig_dbs/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile \
231- small_utils/Makefile small_utils/mlxfwresetlib/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile mvpd/Makefile \
232- fw_comps_mgr/Makefile mad_ifc/Makefile )
245+ AC_OUTPUT ( Makefile common/Makefile mft_utils/Makefile mtcr_py/Makefile ext_libs/Makefile ext_libs/sqlite/Makefile ext_libs/muparser/Makefile ext_libs/json/ Makefile ext_libs/minixz/ Makefile dev_mgt /Makefile \
246+ tools_layouts/Makefile reg_access/Makefile cmdif/Makefile libmfa /Makefile tools_res_mgmt/Makefile mlxconfig/Makefile mlxconfig/mlxconfig_dbs/Makefile mflash/Makefile mlxfwops/Makefile mlxfwops/lib/Makefile cmdparser/Makefile flint/Makefile \
247+ small_utils/Makefile small_utils/mlxfwresetlib/Makefile mstdump/Makefile mstdump/crd_lib/Makefile mstdump/crd_main/Makefile mstdump/mstdump_dbs/Makefile mvpd/Makefile \
248+ fw_comps_mgr/Makefile mad_ifc/Makefile )
233249
0 commit comments