diff --git a/gsmartcontrol/NEWS b/gsmartcontrol/NEWS index ac48093..faf73a2 100644 --- a/gsmartcontrol/NEWS +++ b/gsmartcontrol/NEWS @@ -1,3 +1,7 @@ +Version 1.0.1, released on 2017-06-19 + Fixed compilation under macOS. + Fixed compilation under Fedora Rawhide. + Don't use -mtune=generic for all targets. Version 1.0.0, released on 2017-06-16 Ported to GTK+ 3. diff --git a/gsmartcontrol/autoconf.m4/app_compiler_options.m4 b/gsmartcontrol/autoconf.m4/app_compiler_options.m4 index 0509e95..2337ab8 100644 --- a/gsmartcontrol/autoconf.m4/app_compiler_options.m4 +++ b/gsmartcontrol/autoconf.m4/app_compiler_options.m4 @@ -31,7 +31,7 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [ AC_ARG_ENABLE(common-options, AS_HELP_STRING([--enable-common-options=|auto|none], [enable useful compilation options (warnings, mostly). Accepted values are auto, none, gnu, clang, intel, sun. (Default: auto)]), - [app_cv_compiler_common_options=${enableval}], [app_cv_compiler_common_options=auto]) + [app_cv_compiler_common_options=${enableval}], [app_cv_compiler_common_options=none]) # the default value is "yes" (if no value given after =), treat it as auto. if test "x$app_cv_compiler_common_options" = "xyes" || test "x$app_cv_compiler_common_options" = "xauto"; then @@ -54,7 +54,7 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [ || test "x$app_cv_target_os_env" = "xcygwin"; then # mingw gcc options: # -mno-cygwin - generate non-cygwin executables in cygwin's mingw. - # -mms-bitfields - make structures compatible with msvc. recommended default for non-cygwin. + # -mms-bitfields - make structures compatible with msvc. recommended default for non-cygwin. Default for mingw. app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -mms-bitfields" app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -mms-bitfields" app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -mms-bitfields" @@ -183,10 +183,23 @@ AC_DEFUN([APP_COMPILER_OPTIONS], [ app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -g0 -O3 -s -march=i686"; app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -g0 -O3 -s -march=i686"; else # mingw64, cygwin (they have new gcc), others. - app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -g0 -O3 -s -mtune=generic"; - app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -g0 -O3 -s -mtune=generic"; - app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -g0 -O3 -s -mtune=generic"; + app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -g0 -O3 -s"; + app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -g0 -O3 -s"; + app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -g0 -O3 -s"; fi + # -mtune=generic is only for x86* + case "$target" in + i686-*) + app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -mtune=generic"; + app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -mtune=generic"; + app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -mtune=generic"; + ;; + x86_64-*) + app_cv_compiler_options_cflags="$app_cv_compiler_options_cflags -mtune=generic"; + app_cv_compiler_options_cxxflags="$app_cv_compiler_options_cxxflags -mtune=generic"; + app_cv_compiler_options_ldflags="$app_cv_compiler_options_ldflags -mtune=generic"; + ;; + esac # intel / gnu elif test "x$app_cv_compiler_optimize_options" = "xintel" && test "x$app_cv_target_os_env" = "xgnu"; then diff --git a/gsmartcontrol/configure-dev b/gsmartcontrol/configure-dev index 843f59b..9f98880 100755 --- a/gsmartcontrol/configure-dev +++ b/gsmartcontrol/configure-dev @@ -8,7 +8,8 @@ configure_script="$2"; if [ "$type" == "" ]; then echo "Usage: $0 []" echo "where is one of:" - echo "debug optimized icc clang win32 win32-debug win64-debug sun portland open64"; + echo "none debug optimized gcc-debug clang-debug icc-debug sun win32-cross win32-cross-debug \ + win64-cross win64-cross-debug win32-msys win32-msys-debug win64-msys win64-msys-debug"; echo " is ../configure by default" exit 1; fi @@ -21,16 +22,21 @@ fi flags=""; case $type in - gcc) - flags="--enable-optimize-options --enable-tests" ;; - gcc-debug) + none) + flags="--enable-tests" ;; + debug) flags="--enable-debug-options --enable-tests" ;; + optimized) + flags="--enable-optimize-options --enable-tests" ;; + + gcc-debug) + flags="CC=gcc CXX=g++ --enable-common-options=gnu --enable-debug-options --enable-tests" ;; clang-debug) - flags="CC=clang CXX=clang++ --enable-debug-options --enable-tests" ;; + flags="CC=clang CXX=clang++ --enable-common-options=clang --enable-debug-options --enable-tests" ;; icc-debug) - flags="CC=icc64 CXX=icpc64 --enable-debug-options --enable-tests" ;; + flags="CC=icc64 CXX=icpc64 --enable-common-options=intel --enable-debug-options --enable-tests" ;; sun) - flags="CC=suncc CXX=sunCC CFLAGS=\"-errwarn=%all -I/opt/sun/target64/include\" \ + flags="CC=suncc CXX=sunCC --enable-common-options=sun CFLAGS=\"-errwarn=%all -I/opt/sun/target64/include\" \ CXXFLAGS=\"-I/opt/sun/target64/include\" PATH=\"/opt/sun/sunstudio/bin:$PATH\" \ LDFLAGS=\"-R/opt/sun/target64/lib64 -L/opt/sun/target64/lib64\" \ PKG_CONFIG_PATH=\"/opt/sun/target64/lib64/pkgconfig:/usr/lib64/pkgconfig\" \ diff --git a/gsmartcontrol/configure.ac b/gsmartcontrol/configure.ac index dc43086..2da513b 100644 --- a/gsmartcontrol/configure.ac +++ b/gsmartcontrol/configure.ac @@ -1,5 +1,5 @@ -AC_INIT([GSmartControl],[1.0.0],[],[gsmartcontrol]) +AC_INIT([GSmartControl],[1.0.1],[],[gsmartcontrol]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_HEADERS([config.h]) diff --git a/gsmartcontrol/src/applib/storage_device.cpp b/gsmartcontrol/src/applib/storage_device.cpp index 88315f2..57cdb83 100644 --- a/gsmartcontrol/src/applib/storage_device.cpp +++ b/gsmartcontrol/src/applib/storage_device.cpp @@ -58,7 +58,7 @@ std::string StorageDevice::get_status_name(StorageDevice::status_t status, bool -StorageDevice::StorageDevice(const string& dev_or_vfile, bool is_virtual) +StorageDevice::StorageDevice(const std::string& dev_or_vfile, bool is_virtual) { detected_type_ = detected_type_unknown; // force_type_ = false; @@ -76,7 +76,7 @@ StorageDevice::StorageDevice(const string& dev_or_vfile, bool is_virtual) -StorageDevice::StorageDevice(const string& dev, const string& type_arg) +StorageDevice::StorageDevice(const std::string& dev, const std::string& type_arg) { detected_type_ = detected_type_unknown; // force_type_ = false; @@ -575,14 +575,14 @@ StorageProperty StorageDevice::get_health_property() const -string StorageDevice::get_device() const +std::string StorageDevice::get_device() const { return device_; } -string StorageDevice::get_device_base() const +std::string StorageDevice::get_device_base() const { if (is_virtual_) return ""; @@ -595,7 +595,7 @@ string StorageDevice::get_device_base() const -string StorageDevice::get_device_with_type() const +std::string StorageDevice::get_device_with_type() const { if (this->get_is_virtual()) { std::string ret = "Virtual"; @@ -626,7 +626,7 @@ StorageDevice::detected_type_t StorageDevice::get_detected_type() const -void StorageDevice::set_type_argument(const string& arg) +void StorageDevice::set_type_argument(const std::string& arg) { type_arg_ = arg; } @@ -640,7 +640,7 @@ std::string StorageDevice::get_type_argument() const -void StorageDevice::set_extra_arguments(const string& args) +void StorageDevice::set_extra_arguments(const std::string& args) { extra_args_ = args; } @@ -661,7 +661,7 @@ bool StorageDevice::get_is_virtual() const -string StorageDevice::get_virtual_file() const +std::string StorageDevice::get_virtual_file() const { return (is_virtual_ ? virtual_file_ : std::string()); } @@ -682,7 +682,7 @@ const SmartctlParser::prop_list_t& StorageDevice::get_properties() const -StorageProperty StorageDevice::lookup_property(const string& generic_name, StorageProperty::section_t section, StorageProperty::subsection_t subsection) const +StorageProperty StorageDevice::lookup_property(const std::string& generic_name, StorageProperty::section_t section, StorageProperty::subsection_t subsection) const { for (SmartctlParser::prop_list_t::const_iterator iter = properties_.begin(); iter != properties_.end(); ++iter) { if (section != StorageProperty::section_unknown && iter->section != section) @@ -698,21 +698,21 @@ StorageProperty StorageDevice::lookup_property(const string& generic_name, Stora -string StorageDevice::get_model_name() const +std::string StorageDevice::get_model_name() const { return (model_name_.defined() ? model_name_.value() : ""); } -string StorageDevice::get_family_name() const +std::string StorageDevice::get_family_name() const { return (family_name_.defined() ? family_name_.value() : ""); } -string StorageDevice::get_serial_number() const +std::string StorageDevice::get_serial_number() const { return (serial_number_.defined() ? serial_number_.value() : ""); } @@ -726,28 +726,28 @@ bool StorageDevice::get_is_hdd() const -void StorageDevice::set_info_output(const string& s) +void StorageDevice::set_info_output(const std::string& s) { info_output_ = s; } -string StorageDevice::get_info_output() const +std::string StorageDevice::get_info_output() const { return info_output_; } -void StorageDevice::set_full_output(const string& s) +void StorageDevice::set_full_output(const std::string& s) { full_output_ = s; } -string StorageDevice::get_full_output() const +std::string StorageDevice::get_full_output() const { return full_output_; } diff --git a/gsmartcontrol/src/hz/tls_policy_glib.h b/gsmartcontrol/src/hz/tls_policy_glib.h index ede9621..56cb94c 100644 --- a/gsmartcontrol/src/hz/tls_policy_glib.h +++ b/gsmartcontrol/src/hz/tls_policy_glib.h @@ -44,16 +44,14 @@ extern "C" { class TlsPolicyGlib { public: - TlsPolicyGlib(tls_policy_glib_cleanup_func_t native_cleanup) : native_cleanup_(native_cleanup) - { - key_ = G_PRIVATE_INIT(native_cleanup_); - } + TlsPolicyGlib(tls_policy_glib_cleanup_func_t native_cleanup) + : key_((GPrivate)G_PRIVATE_INIT(native_cleanup)) + { } #if defined HAVE_CXX_EXTERN_C_OVERLOAD && HAVE_CXX_EXTERN_C_OVERLOAD - TlsPolicyGlib(tls_policy_glib_cleanup_func_cpp_t native_cleanup) : native_cleanup_(native_cleanup) - { - key_ = G_PRIVATE_INIT(native_cleanup_); - } + TlsPolicyGlib(tls_policy_glib_cleanup_func_cpp_t native_cleanup) + : key_((GPrivate)G_PRIVATE_INIT(native_cleanup)) + { } #endif ~TlsPolicyGlib() @@ -78,7 +76,6 @@ class TlsPolicyGlib { private: mutable GPrivate key_; - tls_policy_glib_cleanup_func_t native_cleanup_; ///< may be NULL TlsPolicyGlib(const TlsPolicyGlib&); TlsPolicyGlib& operator= (const TlsPolicyGlib& from);