diff --git a/gsmartcontrol/.svnignore.txt b/.svnignore.txt
similarity index 91%
rename from gsmartcontrol/.svnignore.txt
rename to .svnignore.txt
index 6b40be3..4d2c657 100644
--- a/gsmartcontrol/.svnignore.txt
+++ b/.svnignore.txt
@@ -8,8 +8,6 @@ config.guess
config.sub
aclocal.m4
config.h.in
-compile
-ar-lib
missing
install-sh
*.glade.cpp
diff --git a/gsmartcontrol/AUTHORS.txt b/AUTHORS.txt
similarity index 100%
rename from gsmartcontrol/AUTHORS.txt
rename to AUTHORS.txt
diff --git a/gsmartcontrol/COPYING b/COPYING
similarity index 100%
rename from gsmartcontrol/COPYING
rename to COPYING
diff --git a/gsmartcontrol/ChangeLog b/ChangeLog
similarity index 100%
rename from gsmartcontrol/ChangeLog
rename to ChangeLog
diff --git a/gsmartcontrol/Doxyfile b/Doxyfile
similarity index 100%
rename from gsmartcontrol/Doxyfile
rename to Doxyfile
diff --git a/gsmartcontrol/INSTALL b/INSTALL
similarity index 100%
rename from gsmartcontrol/INSTALL
rename to INSTALL
diff --git a/gsmartcontrol/LICENSE_boost_1_0.txt b/LICENSE_boost_1_0.txt
similarity index 100%
rename from gsmartcontrol/LICENSE_boost_1_0.txt
rename to LICENSE_boost_1_0.txt
diff --git a/gsmartcontrol/LICENSE_bsd-ac.txt b/LICENSE_bsd-ac.txt
similarity index 100%
rename from gsmartcontrol/LICENSE_bsd-ac.txt
rename to LICENSE_bsd-ac.txt
diff --git a/gsmartcontrol/LICENSE_bsd-ucb.txt b/LICENSE_bsd-ucb.txt
similarity index 100%
rename from gsmartcontrol/LICENSE_bsd-ucb.txt
rename to LICENSE_bsd-ucb.txt
diff --git a/gsmartcontrol/LICENSE_gpl2.txt b/LICENSE_gpl2.txt
similarity index 100%
rename from gsmartcontrol/LICENSE_gpl2.txt
rename to LICENSE_gpl2.txt
diff --git a/gsmartcontrol/LICENSE_gpl3.txt b/LICENSE_gpl3.txt
similarity index 100%
rename from gsmartcontrol/LICENSE_gpl3.txt
rename to LICENSE_gpl3.txt
diff --git a/gsmartcontrol/LICENSE_gsmartcontrol.txt b/LICENSE_gsmartcontrol.txt
similarity index 93%
rename from gsmartcontrol/LICENSE_gsmartcontrol.txt
rename to LICENSE_gsmartcontrol.txt
index 9ef6668..f2a2e5a 100644
--- a/gsmartcontrol/LICENSE_gsmartcontrol.txt
+++ b/LICENSE_gsmartcontrol.txt
@@ -23,6 +23,10 @@ examples are covered under the Unlicense. See LICENSE_unlicense.txt for
details.
+Portions of this software are copyright Google Inc. See LICENSE_pcrecpp.txt
+for details.
+
+
This product includes the HZ library (or portions of it). See LICENSE_hz.txt
for details.
diff --git a/gsmartcontrol/LICENSE_hz.txt b/LICENSE_hz.txt
similarity index 100%
rename from gsmartcontrol/LICENSE_hz.txt
rename to LICENSE_hz.txt
diff --git a/LICENSE_pcrecpp.txt b/LICENSE_pcrecpp.txt
new file mode 100644
index 0000000..d76a461
--- /dev/null
+++ b/LICENSE_pcrecpp.txt
@@ -0,0 +1,28 @@
+Copyright (c) 2005 - 2010, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/gsmartcontrol/LICENSE_unlicense.txt b/LICENSE_unlicense.txt
similarity index 100%
rename from gsmartcontrol/LICENSE_unlicense.txt
rename to LICENSE_unlicense.txt
diff --git a/gsmartcontrol/LICENSE_zlib.txt b/LICENSE_zlib.txt
similarity index 100%
rename from gsmartcontrol/LICENSE_zlib.txt
rename to LICENSE_zlib.txt
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..d437fab
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,154 @@
+
+# Add autoconf.m4 directory to local macro search path
+ACLOCAL_AMFLAGS = -I autoconf.m4
+
+SUBDIRS = data debian.dist src
+
+
+# These files are actually needed for compilation.
+noinst_DATA = AUTHORS.txt LICENSE_gsmartcontrol.txt README.txt
+
+
+# For the files to be bundled with the distribution, specify them in
+# one of the following.
+
+# These will be installed into docdir.
+# Some of these files are actually needed for compilation (see src/res/Makefile.am).
+dist_doc_DATA = AUTHORS.txt ChangeLog NEWS README.txt \
+ LICENSE_boost_1_0.txt \
+ LICENSE_bsd-ac.txt \
+ LICENSE_bsd-ucb.txt \
+ LICENSE_gpl2.txt \
+ LICENSE_gpl3.txt \
+ LICENSE_gsmartcontrol.txt \
+ LICENSE_hz.txt \
+ LICENSE_pcrecpp.txt \
+ LICENSE_unlicense.txt \
+ LICENSE_zlib.txt
+
+
+# nobase_ preserves their directory names.
+nobase_dist_doc_DATA = contrib/cron-based_noadmin/README \
+ contrib/cron-based_noadmin/cron_gather_smart.sh \
+ contrib/cron-based_noadmin/crontab.example \
+ contrib/cron-based_noadmin/smartctl_subst.sh
+
+
+# Extra files bundled with distribution.
+# file2csource.sh is needed for building but not installed.
+EXTRA_DIST = COPYING INSTALL configure autogen.sh \
+ gsmartcontrol.kdev4 \
+ file2csource.sh \
+ gsmartcontrol.spec
+
+
+
+# PCH support
+
+global_macros.h.gch: $(top_srcdir)/src/global_macros.h
+ $(CXX) $(CXXFLAGS) $(DEFS) -x "c++-header" $(top_srcdir)/src/global_macros.h -o global_macros.h.gch
+
+gch: global_macros.h.gch
+
+gch-clean:
+ rm -f global_macros.h.gch
+
+
+
+# rpm support
+
+src-rpm: dist
+ rpmbuild -ts $(distdir).tar.bz2
+
+
+# Don't use this - it does something weird, and gcc errors out with "long long long" errors, etc...
+#rpm: dist
+# rpmbuild -ta $(distdir).tar.bz2
+
+
+
+# NSIS installer support.
+# Requires wine, installed NSIS, smartctl-nc.exe, smartctl.exe, update-smart-drivedb.exe.
+# Gtkmm dlls and pcre dlls are required if linking against them.
+# dos2unix on build machine.
+# Execute only with win32 build present.
+
+WIN_ZIP_NAME = $(PACKAGE)-$(VERSION)-win32
+WIN_ZIP_NOGTK_NAME = $(PACKAGE)-$(VERSION)-win32-nogtk
+
+
+win-dist: win-dist-nocleanup win-dist-cleanup
+
+win-dist-nocleanup: win-dist-prepare nsis-dist-nocleanup win-zip-dist-nocleanup
+
+win-dist-cleanup: win-zip-dist-cleanup nsis-dist-cleanup
+ rm -rf win-dist
+
+win-dist-clean: win-dist-cleanup
+ rm -f gsmartcontrol-*.exe gsmartcontrol-*.zip
+
+
+win-dist-prepare-all: nsis-dist-prepare win-zip-dist-prepare
+
+
+# Don't strip smartctl (it will only change the header), and
+# don't strip update-smart-drivedb (it will break its CRC check).
+win-dist-prepare: all
+ $(MKDIR_P) win-dist
+ cp $(top_srcdir)/data/icon_*.png win-dist/
+
+ $(MKDIR_P) win-dist/doc
+ cp data/nsis/distribution*.txt win-dist/doc/
+ cp $(top_srcdir)/AUTHORS.txt $(top_srcdir)/LICENSE_* $(top_srcdir)/README.txt win-dist/doc/
+ cp $(top_srcdir)/NEWS win-dist/doc/NEWS.txt
+
+ cp src/gsmartcontrol.exe src/gsmartcontrol.exe.manifest win-dist/
+
+ unix2dos win-dist/doc/*.txt
+
+ cp -p "@WINDOWS_BINDIR@"/smartctl-nc.exe win-dist/
+ cp -p "@WINDOWS_BINDIR@"/smartctl.exe win-dist/
+ cp -p "@WINDOWS_BINDIR@"/update-smart-drivedb.exe win-dist/
+
+
+nsis-dist-prepare: win-dist-prepare
+ cp -a win-dist nsis-dist
+ cp $(top_srcdir)/data/gsmartcontrol.ico nsis-dist/
+ cp data/nsis/*.nsi $(top_srcdir)/data/nsis/nsi_* nsis-dist/
+ unix2dos nsis-dist/*.nsi
+ cp "@WINDOWS_BINDIR@"/"@GTK_INSTALLER_NAME@".exe nsis-dist/
+
+nsis-dist-nocleanup: nsis-dist-prepare
+ cd nsis-dist && @NSIS_EXEC@ gsmartcontrol.nsi
+ mv nsis-dist/$(PACKAGE)-$(VERSION).exe .
+ cd nsis-dist && @NSIS_EXEC@ /DNO_GTK gsmartcontrol.nsi
+ mv nsis-dist/$(PACKAGE)-$(VERSION)-nogtk.exe .
+
+nsis-dist-cleanup:
+ rm -rf nsis-dist
+
+nsis-dist: nsis-dist-nocleanup nsis-dist-cleanup
+
+
+win-zip-dist-prepare:
+ cp -a win-dist $(WIN_ZIP_NAME)
+ cp -a win-dist $(WIN_ZIP_NOGTK_NAME)
+ cp -a "@WINDOWS_BINDIR@"/"@GTK_INSTALLER_NAME@"/* $(WIN_ZIP_NAME)/
+
+win-zip-dist-nocleanup: win-zip-dist-prepare
+ zip -K -9r $(WIN_ZIP_NAME).zip $(WIN_ZIP_NAME) -x $(WIN_ZIP_NAME)/doc/distribution-nogtk.txt
+ zip -K -9r $(WIN_ZIP_NOGTK_NAME).zip $(WIN_ZIP_NOGTK_NAME) -x $(WIN_ZIP_NOGTK_NAME)/doc/distribution.txt
+
+win-zip-dist-cleanup:
+ rm -rf $(WIN_ZIP_NAME)
+ rm -rf $(WIN_ZIP_NOGTK_NAME)
+
+win-zip-dist: win-zip-dist-nocleanup win-zip-dist-cleanup
+
+
+
+
+distclean-local: gch-clean win-dist-clean
+
+
+
diff --git a/gsmartcontrol/NEWS b/NEWS
similarity index 79%
rename from gsmartcontrol/NEWS
rename to NEWS
index b255f8f..a2b1e0a 100644
--- a/gsmartcontrol/NEWS
+++ b/NEWS
@@ -1,56 +1,3 @@
-Version 1.1.3, released on 2017-11-12
- Fixed gsmartcontrol-root not launching if GDK_* variables are not set.
-
-Version 1.1.2, released on 2017-11-11
- Fixed gsmartcontrol-root not passing GDK_SCALE and GDK_DPI_SCALE variables
- to gsmartcontrol when using PolKit.
- Fixed blurriness of icons in the main window with GDK_SCALE=2.
- Tweaked the main window interface.
- Windows: Show volume labels beside drive letters in icon tooltips.
-
-Version 1.1.1, released on 2017-09-25
- Windows: Use Adwaita GTK+ theme for systems which support Classic Windows
- theme, since the default win32 GTK+ theme is broken in it; this
- includes Windows 7 and Windows Server.
- Statistics entry values are formatted with commas for readability.
- Moved help information to website.
-
-Version 1.1.0, released on 2017-09-07
- New Statistics, Temperature Log, Error Recovery, Physical and Directory
- tabs.
- General tab shows non-SMART device settings as well.
- Attributes tab shows entries in "brief" format.
- Error Log tab shows Extended error log by default (if supported).
- Self-Test Log tab now shows Extended self-test log by default (if
- supported).
- GSmartControl now uses "-x" equivalent for retrieving data (as upposed to
- "-a"); loading "-x" outputs as virtual drives is also supported.
- Implemented ability to copy rows in CSV format from Attribute, Statistics
- and Self-Test Log tables.
- Implemented "Update Drive Database" functionality.
- Windows: Drive letters are shown for each drive.
- Scan time is shown under virtual drive icons.
- Polkit is supported with gsmartcontrol-root script now.
- Pcrecpp is no longer bundled, use system-installed one instead.
- Smartmontools version 5.43 is required at runtime.
- Other minor improvements and fixes.
-
-Version 1.0.2, released on 2017-07-21
- Fixed incomplete capturing of smartctl output under Windows.
- Added missing icons under Windows.
- Fixed being able to turn on AODC even if unsupported.
-
-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.
- Tweaked the user interface a bit.
- Dropped support for Windows XP, 2000 and 2003 (they are no longer
- supported by GTK+).
- Fixed detection of newer system-installed smartmontools under Windows.
Version 0.9.0, released on 2017-05-11
Implemented (untested) support for Linux-based Areca controllers with
diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..900f6b5
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,422 @@
+
+About GSmartControl
+
+GSmartControl - Hard disk drive and SSD health inspection tool.
+
+GSmartControl is a graphical user interface for smartctl (from smartmontools
+package, see http://smartmontools.sourceforge.net), which is a tool for
+querying and controlling SMART (Self-Monitoring, Analysis, and Reporting
+Technology) data on modern hard disk and solid-state drives. It allows you to
+inspect the drive's SMART data to determine its health, as well as run various
+tests on it.
+
+Note: GSmartControl supports ATA drives (both PATA and SATA), various USB to
+ATA bridges and drives behind some RAID controllers (selected models of
+3ware, Areca, Adaptec, Intel RAID controllers).
+
+http://gsmartcontrol.sourceforge.net
+
+
+
+Features
+
+* automatically reports and highlights any anomalies;
+
+* allows enabling/disabling SMART;
+
+* allows enabling/disabling Automatic Offline Data Collection - a short
+self-check that the drive will perform automatically every four hours with no
+impact on performance;
+
+* supports configuration of global and per-drive options for smartctl;
+
+* performs SMART self-tests;
+
+* displays drive identity information, capabilities, attributes, and
+self-test/error logs;
+
+* can read in smartctl output from a saved file, interpreting it as a
+read-only virtual device;
+
+* works on most smartctl-supported operating systems;
+
+* has extensive help information.
+
+
+
+What Is SMART?
+
+Short answer: SMART is a technology which provides hard disk drives with
+methods to predict certain kinds of failures with certain chance of success.
+
+Long answer: read below.
+
+Self-Monitoring, Analysis, and Reporting Technology, or SMART, is a
+monitoring system for hard drives and SSDs to detect and report various
+indicators of reliability, in the hope of anticipating failures. SMART is
+implemented inside the drives, providing several ways of monitoring the drive
+health. It may present information about general health, various drive
+attributes (for example, number of unreadable sectors), error logs, and so on.
+It may also provide ways to instruct the drive to run various self-tests,
+which may report valuable information. It may even automatically scan the disk
+surface in when the drive is idle, repairing the defects while reallocating
+the data to more safe areas.
+
+While having SMART sounds really good, there are some nuances to consider. One
+of the common pitfalls is that it may create a false sense of security. That
+is, a perfectly good SMART data is NOT an indication that the drive won't fail
+the next minute. The reverse is also true - some drives may function perfectly
+even with not-so-good-looking SMART data. However, as studies indicate, given
+a large population of drives, some SMART attributes may reliably predict
+drive failures within up to two months.
+
+Another common mistake is to assume that the attribute values are the real
+physical values, as experienced by the drive. As manufacturers do not
+necessarily agree on precise attribute definitions and measurement units, the
+exact meaning of the attributes may vary greatly across different drive
+models.
+
+At present SMART is implemented individually by manufacturers. While some
+aspects are standardized for compatibility, others are not. In fact, most
+manufacturers refer the users to their own health monitoring utilities and
+advice against taking SMART data seriously. Nevertheless, SMART may prove an
+effective measure against data loss.
+
+Yet another issue is that quite often the drives have bugs which prevent
+correct SMART usage. This is usually due to buggy firmware, or the
+manufacturer ignoring the standards. Luckily, smartmontools usually detects
+these bugs and works around them.
+
+
+
+Software Requirements
+
+You need to have the following software installed:
+
+* pcre - http://www.pcre.org .
+
+* smartmontools - see http://smartmontools.sourceforge.net .
+
+* GTK+, version 2.6 or higher - see http://www.gtk.org .
+
+* Gtkmm, version 2.6 or higher - see http://www.gtkmm.org .
+
+* libglademm, version 2.4 or higher - see http://www.gtkmm.org .
+Note: libglademm is not needed when using GTK+ / Gtkmm 2.12 or newer.
+
+Note that having GTK+ 2.12 and Gtkmm 2.12 is HIGHLY recommended. While earlier
+versions may work, they may produce suboptimal results and buggy behavior.
+
+Most of these packages are probably already provided by your distribution.
+Here are the packages you need to have to build GSmartControl on some Linux
+distributions:
+
+openSUSE, SLES, SLED:
+gcc-c++, pcre-devel, gtkmm2-devel, (possibly) libglademm-devel.
+
+Fedora, CentOS, RHEL:
+gcc-c++, pcre-devel, gtkmm24-devel, (possibly) libglademm24-devel.
+
+Mandriva:
+gcc-c++, gcc-cpp, libpcre-devel, gtkmm2.4-devel, (possibly)
+libglademm2.4-devel.
+
+Ubuntu, Debian GNU/Linux:
+g++, libpcre3-dev, libgtkmm-2.4-dev, (possibly) libglademm-2.4-dev.
+
+Note that usually you need to specify only these packages - the rest is
+installed automatically by the package manager's dependency resolver. Keep in
+mind that you also need smartmontools to run the program.
+
+Note: If using the official Windows package, the requirements are listed on
+GSmartControl's website.
+
+
+The following operating systems are supported:
+
+* Linux - All the popular configurations should work.
+
+* FreeBSD - Tested with DesktopBSD 1.6 (FreeBSD 6.3) / x86.
+
+* NetBSD - Tested with NetBSD 4.0.1 / x86.
+
+* OpenBSD - Tested with OpenBSD 4.3 / x86-64 / gcc-3.3.5.
+
+* Windows (2000 SP4 or newer) - Tested with Windows 2000 SP4, Windows XP SP3,
+Windows Vista SP2 (32-bit and 64-bit), Windows 7 SP1 (32-bit and 64-bit). The
+Windows port uses pd0, pd1, etc... for physical drives 0, 1, etc... .
+
+* Solaris - Tested with Solaris 10 / x86 / gcc-3.4.3 / blastwave,
+Solaris 10 / x86 / sunstudio12 / sunfreeware. OpenSolaris should work but has
+not been tested yet.
+
+* Mac OS X - 3rd-party testing by the MacPorts and Fink projects.
+
+* DragonFlyBSD - Code written but no testing has been performed yet. Expected
+to work without any issues.
+
+* QNX - Code written but no testing has been performed yet.
+
+
+
+Installation
+
+Short answer: build and install via: ./configure; make; make install
+
+Run gsmartcontrol-root to invoke gsmartcontrol with your desktop's su
+mechanism, or use the desktop menu entry.
+
+
+Long answer: read below.
+
+First, check if you can find a pre-built package for your distribution or
+operating system - they usually provide the best integration and the easiest
+installation procedure. For Linux, one option is to try the openSUSE Build
+Service - it provides ready-to-install packages for various popular Linux
+distributions (openSUSE, Fedora, etc...). See
+http://download.opensuse.org/repositories/home:/alex_sh/ .
+
+If you want to compile from source, check that you have all the required
+dependencies (see Software Requirements section). Then the usual
+
+./configure; make; make install
+
+will build and install it. Installation usually requires administrative
+privileges, but you don't need to install the program in order to run it
+directly from the build directory.
+
+
+
+Smartctl Options
+
+GSmartControl tries its best to guard the user from having to specify smartctl
+options. However, this is not always possible due to drive firmware bugs,
+unimplemented features, and so on. The smartctl manual page contains all the
+information you may need when dealing with smartctl.
+See http://smartmontools.sourceforge.net/man/smartctl.8.html
+
+Additional information is available at http://smartmontools.sourceforge.net
+
+
+
+Command Line Options
+
+GSmartControl inherits options from GTK+ and other libraries, so be sure to
+run it with --help option to get a full list of accepted parameters.
+Note: The Windows version may not have a text output at all, so --help and
+similar arguments won't have any effect. However, --verbose will still
+increase the verbosity of a log saved via "Options -> View Execution Log ->
+Save All".
+
+The most important parameters are:
+
+-?, --help - Show help options.
+
+-l, --no-locale - Don't use system locale.
+
+-V, --version - Display version information.
+
+--no-scan - Don't scan devices on startup.
+
+--no-hide-tabs - Don't hide non-identity tabs when SMART is disabled. Useful
+for debugging.
+
+--add-virtual - Load smartctl data from file, creating a virtual drive. You
+can specify this option multiple times.
+
+--add-device - Add this device to device list. The format of the device is
+"::::", where type and extra_args are optional. This
+option is useful with --no-scan to list certain drives only. You can specify
+this option multiple times.
+Example: --add-device /dev/sda --add-device /dev/twa0::3ware,2 --add-device
+'/dev/sdb::::-T permissive'.
+
+-v, --verbose - Enable verbose logging; same as --verbosity-level 5.
+
+-q, --quiet - Disable logging; same as --verbosity-level 0.
+
+-b, --verbosity-level - Set verbosity level [0-5].
+
+
+
+Permission Problems
+
+Short answer: you need to be root (that's Administrator in Windows).
+In X11, use kdesu, gnomesu, sux, xdg-su or similar.
+
+Long answer: read below.
+
+Most operating systems prohibit direct access to hardware to users with
+non-administrative privileges. Unfortunately, to access SMART data, smartctl
+needs to directly access the hard drive.
+
+The provided X11 desktop and menu icons should show the "Please enter the root
+password" dialog boxes, and, after correct information is entered, should run
+this program with root privileges. The dialogs should be available in most
+commonly used X11 desktop environments.
+
+Another way is to use the included gsmartcontrol-root script, which finds the
+available su program and runs gsmartcontrol with it.
+
+Yet another way is to manually invoke the program with kdesu, gnomesu, sux or
+similar programs. For example,
+
+kdesu -u root -c gsmartcontrol
+
+will ask for root password and run gsmartcontrol with root privileges. Replace
+"kdesu" with "gnomesu" if using Gnome. The "sux" or "xdg-su" commands may also
+help, if neither KDE or GNOME are available.
+
+Please don't set the "setuid" flag on smartctl binary. It is considered a
+security risk.
+
+
+
+Enable SMART Permanently
+
+Specifications say that once you set a SMART-related property, it will be
+preserved across reboots. So, when you, say, enable SMART and Automatic
+Offline Data Collection, both will stay enabled until you disable them.
+
+However, BIOS, your operating system, your other operating systems (if
+present), and various startup programs may affect that. For example, BIOS may
+enable SMART each time you start your computer, so if you disabled SMART
+previously, it will be re-enabled on reboot.
+
+The easiest way to work around this is to set the desired settings on system
+startup. You may use smartctl or smartd to do that. For example, to enable
+both SMART and Automatic Offline Data Collection on /dev/sda, one would write
+the following to the system startup script (e.g. boot.local, rc.local or
+similar on Linux):
+
+smartctl -s on -o on /dev/sda
+
+For more information, see smartctl and smartd documentation.
+
+
+
+Known Issues
+
+Only ATA drives (both PATA and SATA), various USB to ATA bridges and drives
+behind some RAID controllers are supported for now. The main reasons are:
+
+* We can't support drives which don't work with smartmontools. This affects
+drives which don't support SMART or don't export SMART data correctly (e.g.
+some USB enclosures, RAIDs, etc...).
+
+* Smartctl's output for SCSI drives is completely different compared to ATA.
+Also, SCSI drives are rarely found in desktop systems and the servers rarely
+have X11 / Gtkmm running, so this is a low priority task.
+
+* I only have ATA drives, so testing anything else is very difficult.
+
+Immediate Offline Tests are not supported. I haven't found a way to reliably
+monitor them yet. Besides, they run automatically anyway if Automatic Offline
+Data Collection is enabled.
+
+Testing is only supported on drives which correctly report their progress
+information in capabilities.
+
+Not all drives support disabling Automatic Offline Data Collection, even if
+they report otherwise. Unfortunately, there's no way to detect such drives.
+
+Running on GTK+ / Gtkmm versions earlier than 2.12 may cause visual artifacts,
+usability issues (especially with tooltips and icons), instability, etc...
+
+The texts probably contain a lot of grammatical errors, English being my third
+language and all.
+
+
+
+Reporting Bugs
+
+If it is a SMART or drive-related problem, please try to test it with smartctl
+first. Chances are, the problem you're experiencing is not tied to
+GSmartControl, but is a drive firmware or smartctl problem. For example, to
+see a complete information about your /dev/sda drive, type the following in a
+terminal emulator (e.g., xterm, konsole or gnome-terminal):
+
+smartctl -a /dev/sda
+
+Note: If using Windows, the device name should be /dev/pd1 for the second
+physical drive, etc... .
+
+If you still think it's a GSmartControl issue, please collect the following
+information about your system. Without it, it may be very hard or impossible
+to fix the bug.
+
+* Which operating system you use (for example, openSUSE Linux 11.4).
+
+* Which version of GTK and Gtkmm you have installed. Finding this out is very
+distribution-specific. For example, on openSUSE it would be
+"rpm -q gtk2 gtkmm2". Some distributions have gtkmm24 instead. You may also
+search them in your distribution's graphical package manager, if there is one.
+
+* Execution log from the program, if possible. To obtain it, run the program
+with -v option, e.g. (type the following in a terminal emulator or Run
+dialog):
+
+gsmartcontrol-root auto -v
+
+Note: On Windows, run gsmartcontrol.exe with "-v" switch as Administrator.
+
+Perform the steps needed to reproduce the bug, then go to
+"Options -> View Execution Log", and click "Save All".
+
+* Detailed description of steps you performed when the bug occurred.
+
+Once you have this information, send an email to me, Alexander Shaduri
+. Note that I may refer you to smartmontools support
+if it's a bug in smartmontools and not GSmartControl. Normally, I won't
+redirect your support request to them myself, because they may ask questions
+which only you have the answers to.
+
+Please read the "License and Copyright" and "Patch Licensing" sections before
+sending any patches.
+
+
+
+License and Copyright
+
+For license information, see LICENSE_gsmartcontrol.txt file.
+
+You may notice that GSmartControl is not licensed under "GNU GPL version X or
+later", but under "GNU GPL version X and Y". I firmly believe that it's unwise
+to license a piece of code under non-existent licenses, whatever anyone else
+might say. The reason for this is that one simply CANNOT know that, say, in 20
+years FSF won't be bought by some corporation who will release GPL version Z
+which will completely reverse the reasons GPL was created for.
+
+The removal of "or later" clause somewhat imposes responsibility on the
+copyright holders to review every future version of the license once it's
+released, and, if deemed acceptable, re-license the code under the new license
+(possibly retaining the old licenses). Unfortunately, this is a necessary
+inconvenience we will have to deal with.
+
+
+
+Patch Licensing
+
+Due to reasons described in "License and Copyright" section, to make it
+possible to re-license the code without tracking down all the people who ever
+wrote a patch, the copyrights of all minor patches must be assigned to the
+central copyright holder of the project. If the patch is major enough (that
+is, it forms a significant part of the program source code), the author may
+retain the copyright, if he or she chooses to do so. However, unless the
+author plans to maintain his part of the source code, he / she is humbly asked
+to consider assigning away his / her copyright. A simple "I disclaim all
+copyright to this patch" by the author is sufficient. All credits will be
+mentioned in product documentation, whatever the size of the patch is.
+
+Please note that centralization of copyright is needed to maintain a
+reasonably healthy legal status of the project. Also note that this method is
+not unique - FSF and many other organizations require exactly the same thing.
+
+Some contributors may have reasonable doubts about the future status of this
+project. Let me assure you that this project will never have more restrictive
+license than GPLv2. If, some time in the future, the GPL is somehow
+invalidated in court, the project will be re-licensed under similar (in
+spirit) license, if possible, or a license less restrictive than GPL (for
+example, the three-clause BSD license).
+
+
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..ab4d8ba
--- /dev/null
+++ b/TODO
@@ -0,0 +1,250 @@
+
+
+GTKMM Notes:
+
+To transfer an ownership from your local code to a container, use
+Gtk::Button* pButton = Gtk::manage(new Gtk::Button("Test"));
+container->add(*pButton);
+(add() takes an object by reference).
+otherwise, you will need to delete() it.
+
+local scope destruction also works if using stack variables.
+{
+ Gtk::Button aButton;
+ // destroyed here
+}
+
+
+A treeview (also iconview, combobox) from glade comes
+with existing model, which should be unset.
+
+
+Bugs / patches:
+ Patch pangomm for Pango::strip_markup().
+
+
+
+--------------------------------------------------------
+
+TODO:
+
+Don't rely on smartctl return code (2), parse the output instead.
+ This will allow us to show the Info page.
+
+?Fix not being able to quit while executing commands.
+ Cannot reproduce.
+ https://www.google.com/search?client=opera&q=IA__gtk_main_quit:+assertion+%60main_loops+!=+NULL'+failed&sourceid=opera&ie=utf-8&oe=utf-8&channel=suggest
+ https://developer.gnome.org/gtk2/2.24/gtk2-General.html#gtk-main-quit
+ https://www.google.com/search?num=50&hl=en&safe=off&client=opera&hs=Dr5&channel=suggest&q=calling+gtk_main_quit+during+gtk_main_iteration+warning&oq=calling+gtk_main_quit+during+gtk_main_iteration+warning&gs_l=serp.12...7064.8155.0.12753.8.8.0.0.0.0.216.935.0j6j1.7.0.les%3B..0.0...1c.1.4.serp.GUiDL5IM2U8
+ https://developer.gnome.org/glib/2.34/glib-The-Main-Event-Loop.html#g-main-loop-quit
+
+Port to GTK2 with disable-deprecated flags, then GTK3.
+ Drop support for old distros.
+
+
+In main window add multi-selection support and right-click menu with various
+ tests, so that it's possible to run multiple tests in parallel from there.
+
+
+Areca detection
+ Linux:
+ Somehow differentiate between the cards with expanders (-d areca,N/E) and without (-d areca,N).
+ The expander ones seem to have "ix" (case-insensitive) as their name suffixes.
+ areca,N - N is [1,24].
+ areca,N/E - N is [1,128], E is [1,8].
+ We should limit these using some config key (36 for N and 4 for E seems ok).
+ N/E syntax is since smartmontools 5.43.
+ For older versions we get: /dev/: Option -d areca,N requires N to be a non-negative integer
+ Windows Detection:
+ Credit Richard Kagerer.
+
+
+Credit Fabrice Bacchella for Linux CCISS detection.
+
+
+
+
+Add ability (through ctrl-C?) to copy individual rows from attributes page,
+ in tab-separated format (for easy pasting into libreoffice).
+
+
+Investiage the new "-l ssd" and "-l devstat" options (since 5.42)
+
+Check also other options in 5.42 and 5.43.
+ "-g all" looks promising alongside -i (shows APM and other stuff as well).
+
+Add --identify option to context menu, for convenience.
+
+Add menu item - "update drive database" (not sure about linux, should
+ check if it's supported first; also need to run it in terminal).
+
+
+Testing:
+ If ETA time has elapsed, but it's still only at 10% completion,
+ ETA 0 is displayed. Fix.
+ If smartctl -t ... returns an error, testing=true should not be set.
+ Can't reproduce it?
+ Detect running tests on launch (maybe ask the user too? some tests
+ may be stuck due to bad firmware, e.g. 3ware/windows).
+
+
+
+48-bit ATA command support:
+ '-l xerror' -> Extended Comprehensive Error log: An multi-sector and
+ LBA48 capable version of '-l error'. Output is similar, except more
+ entries can exists and the high bytes of the registers are also printed.
+ Some newer drives (Samsung) only write to this log.
+
+ '-l xselftest' -> Extended Self Test Log: An multi-sector and LBA48
+ capable version of '-l selftest'. Output will be similar, except more
+ entries can exists and the LBA values can be somewhat longer.
+
+ "smartctl -l this_wont_exist" gives the list of supported logs - this
+ is needed to detect xerror / xselftest support in smartctl.
+
+
+Rework drive properties UI:
+ use 48-bit or not or auto.
+ Enable/disable/dont_touch SMART on startup for this drive.
+ Enable/disable/dont_touch AODC on startup for this drive.
+ Add --init-smart-only option to only apply the SMART/AODC enabling status
+ from the drive properties.
+ Add also --no-init-smart to avoid doing that on GUI startup.
+
+Notifications:
+ Tied to (drive::subdrive, notif_key, exact_value(optional)).
+ If exact_value isn't specified when ignoring, notify on every value change.
+ Ignore options:
+ Per-drive: Ignore all notifications for this key, ignore only this value.
+ Don't generate multiple notifications for the same drive/key combo.
+ Clearing in preferences: Clear all ignored, clear ignored for this drive, clear individual.
+ Soft-warnings require "-a" by default, tricky for scsi (maybe try -a, then -i?).
+
+Monitor:
+ Needs root access, so not gonna happen until the dbus/udisks stuff
+ is finalized.
+ Same program, add --tray option to start in tray only.
+ Option to enable the tray icon.
+ Option to continue running in the tray on window close.
+ Use freedesktop notifications when notifications are generated
+ and we're running in tray only.
+ Don't generate the same notification at a single run time if it was
+ ignored (untouched) by the user; Change the tray icon and
+ show them in the main window instead.
+ Periodically re-run smartctl to refresh the notifications.
+ Periodically see if drives were added / removed (possibly use OS callbacks
+ instead of polling?)
+
+Win7 widget:
+ Can be done in html/js.
+ Shows temperature
+ Detects drives
+ Opens GSmartControl
+
+If a drive is not recognized, suggest using -d (sat, sat,12, ...)
+ Refer the user to
+ http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_USB-Devices
+
+
+
+RAID:
+ http://sourceforge.net/apps/trac/smartmontools/wiki/Supported_RAID-Controllers
+
+ Areca Windows:
+ Detection not supported by smartctl --scan-open.
+
+ Areca FreeBSD: since 5.42.
+ Call as: smartctl -a -d areca,[1-24] /dev/arcmsr1
+
+ 3ware FreeBSD:
+ Call as: smartctl -i -d 3ware,[0-127] /dev/twa0 (or twe0)
+ Detection: unknown.
+
+ LSI MegaRAID (SCSI/SAS), Linux:
+ Call as: smartctl -i -d megaraid,[0-?] /dev/sda
+ We should differentiate between ordinary sda and RAID one (not sure if sda is detected).
+ Detection: unknown.
+
+ HighPoint RocketRAID ((S)ATA) Linux:
+ Call as: smartctl -i -d hpt,[1-8]/[1-8] /dev/sda
+ Call as: smartctl -i -d hpt,[1-8]/[1-8]/[1-15] /dev/sda
+ Note: /dev/sda should be derived from this controller.
+ We should differentiate between ordinary sda and RAID one (not sure if sda is detected).
+ Smartctl docs specify smaller limits, but the code says these are the ones.
+ Detection: unknown.
+
+ HighPoint RocketRAID ((S)ATA) FreeBSD:
+ Call as: smartctl -i -d hpt,[1-8]/[1-8] /dev/hptrr
+ Call as: smartctl -i -d hpt,[1-8]/[1-8]/[1-15] /dev/hptrr
+ Note: /dev/hptrr should be derived from this controller.
+ Smartctl docs specify smaller limits, but the code says these are the ones.
+ Detection: unknown.
+ TODO: Analyze sent info.
+
+ CCISS (HP (Compaq) Smart Array Controller) FreeBSD:
+ Seems to be the same as Linux (uses the same driver?).
+ Detection: unknown.
+
+
+
+
+libdebug:
+ per-channel disabling.
+ per-channel formatting.
+ all flags should be per-channel.
+ bug: if -q is passed, Execution log doesn't contain libdebug log. (requires per-channel status control).
+ use format_time() instead of ctime() and friends, with ISO formatting.
+
+
+
+'-l sataphy' -> SATA Phy event counters: Non-SMART feature, useful to detect SATA cabling problems.
+
+
+SCT Temperatures
+ -l scttemp prints temperature and history.
+ -t scttempint,N[,p] (N - count, p - preserve across reset or not).
+ This configures temperature logging interval (1 min by default) and clears the history.
+ -l scterc[,...] to get/set the SCT Error Recovery Control time limit (5.40 and newer).
+
+
+Add detection for Interix (i586-pc-interix3), maybe with debian?
+
+
+
+
+----------- SMART stuff ----------
+
+
+Run one-time Immediate Offline test (-t offline).
+ Offline tests only update Attributes, and if errors are found they will
+ appear in SMART error log. Self-test logs are unaffected.
+ Abort (-X). Abort works with Offline only if there's
+ "Abort Offline collection upon new command" capability.
+ If the drive has "Suspend Offline collection upon new command" capability,
+ immediate offline test may be tracked through --capabilities (not on mine!).
+ If it's "Abort Offline collection upon new command", then the test
+ will abort on --capabilities or --abort.
+
+
+Polling time
+The self-test routine recommended polling time shall be equal to the number of minutes that is the minimum
+recommended time before which the host should first poll for test completion status. Actual test time could
+be several times this value. Polling before this time could extend the self-test execution time or abort the test
+depending on the state of bit 2 of the off-line data capability bits.
+
+Autosave
+This command enables and disables the optional attribute autosave feature of the device. This command
+may either allow the device, after some vendor specified event, to save the device updated attribute values
+to non-volatile memory; or this command may cause the autosave feature to be disabled. The state of the
+attribute autosave feature (either enabled or disabled) shall be preserved by the device across power cycles.
+A value of zero written by the host into the device’s Sector Count register before issuing this command shall
+cause this feature to be disabled. Disabling this feature does not preclude the device from saving SMART
+data to non-volatile memory during some other normal operation such as during a power-on or power-off
+sequence or during an error recovery sequence.
+A value of F1h written by the host into the device’s Sector Count register before issuing this command shall
+cause this feature to be enabled. Any other meaning of this value or any other non-zero value written by the
+host into this register before issuing this command may differ from device to device. The meaning of any
+non-zero value written to this register at this time shall be preserved by the device across power cycles.
+
+
+
diff --git a/gsmartcontrol/autoconf.m4/ac_cxx_exceptions.m4 b/autoconf.m4/ac_cxx_exceptions.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/ac_cxx_exceptions.m4
rename to autoconf.m4/ac_cxx_exceptions.m4
diff --git a/gsmartcontrol/autoconf.m4/ac_cxx_namespaces.m4 b/autoconf.m4/ac_cxx_namespaces.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/ac_cxx_namespaces.m4
rename to autoconf.m4/ac_cxx_namespaces.m4
diff --git a/gsmartcontrol/autoconf.m4/ac_cxx_rtti.m4 b/autoconf.m4/ac_cxx_rtti.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/ac_cxx_rtti.m4
rename to autoconf.m4/ac_cxx_rtti.m4
diff --git a/gsmartcontrol/autoconf.m4/ac_cxx_verbose_terminate_handler.m4 b/autoconf.m4/ac_cxx_verbose_terminate_handler.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/ac_cxx_verbose_terminate_handler.m4
rename to autoconf.m4/ac_cxx_verbose_terminate_handler.m4
diff --git a/gsmartcontrol/autoconf.m4/app_auto_clear_flags.m4 b/autoconf.m4/app_auto_clear_flags.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/app_auto_clear_flags.m4
rename to autoconf.m4/app_auto_clear_flags.m4
diff --git a/autoconf.m4/app_choose_gld_reader.m4 b/autoconf.m4/app_choose_gld_reader.m4
new file mode 100644
index 0000000..1eddda6
--- /dev/null
+++ b/autoconf.m4/app_choose_gld_reader.m4
@@ -0,0 +1,157 @@
+
+############################################################################
+# Copyright:
+# (C) 2008 - 2009 Alexander Shaduri
+# License: See LICENSE_zlib.txt file
+############################################################################
+
+
+# APP_CHOOSE_GLD_READER([C|C++][, flags_prefix])
+# This macro detects whether GtkBuilder (from gtk >= 2.12) or libglade
+# are present. If the first parameter is C++, then gtkmm and libglademm
+# are searched for instead.
+# flags_prefixCFLAGS, flags_prefixCXXFLAGS and flags_prefixLIBS
+# will be initialized (or appended to) with the correct flags in case of libglade(mm).
+# app_cv_gld_reader will be set to none, libglade or gtkbuilder.
+
+# ENABLE_LIBGLADE or ENABLE_GTKBUILDER will be exported to config.h
+
+# You must call AX_COMPILER_VENDOR before using this macro.
+
+AC_DEFUN([APP_CHOOSE_GLD_READER], [
+ # These requirements check compile-time presence, not that they were called
+ AC_REQUIRE([AX_COMPILER_VENDOR])
+
+ AC_ARG_ENABLE(abort-if-no-glade-reader, AS_HELP_STRING([--disable-abort-if-no-glade-reader],
+ [disable abort if no glade file reader is found (default: configure aborts when glade file reader is not found)]),
+ [app_cv_abort_if_no_glade_reader=${enableval}], [app_cv_abort_if_no_glade_reader=yes])
+
+ AC_MSG_NOTICE([Abort if no glade file reader is found: $app_cv_abort_if_no_glade_reader])
+
+ # This is just in case
+ # PKG_PROG_PKG_CONFIG()
+
+ # this variable will have values "none", "libglade" or "gtkbuilder".
+ app_cv_gld_reader="none";
+
+ # in case libglade(mm) is found, these will contain the flags.
+ app_cv_gld_reader_CFLAGS="";
+ app_cv_gld_reader_CXXFLAGS="";
+ app_cv_gld_reader_LIBS="";
+
+ app_cv_gld_reader_libglade_name="libglade";
+ app_cv_gld_reader_libglade_pkg_name="libglade-2.0";
+ app_cv_gld_reader_gtk_name="gtk";
+ app_cv_gld_reader_gtk_pkg_name="gtk+-2.0";
+ if test "x$1" = "xC++"; then
+ app_cv_gld_reader_libglade_name="libglademm";
+ app_cv_gld_reader_libglade_pkg_name="libglademm-2.4";
+ app_cv_gld_reader_gtk_name="gtkmm";
+ app_cv_gld_reader_gtk_pkg_name="gtkmm-2.4";
+ fi
+
+
+ # Manual control. AC_ARG_ENABLE doesn't get bash variables, so we have
+ # to do it this way. If put inside a shell conditional, it still shows up in configure help.
+
+ AC_ARG_ENABLE(libglade, AS_HELP_STRING([--enable-libglade],
+ [use libglade(mm) instead of GtkBuilder (default: auto)]),
+ [with_libglade=${enableval}], [with_libglade=auto])
+
+
+ # Try gtkbuilder first
+ if test "x$with_libglade" = "xno" || test "x$with_libglade" = "xauto"; then
+ PKG_CHECK_EXISTS([$app_cv_gld_reader_gtk_pkg_name >= 2.12.0],
+ [app_cv_gld_reader="gtkbuilder"])
+ fi
+ if test "$with_libglade" = "no" && test "$app_cv_gld_reader" = "none"; then
+ AC_MSG_ERROR([GtkBuilder support not found (you need $app_cv_gld_reader_gtk_name version 2.12 or higher). Try using $app_cv_gld_reader_libglade_name instead.])
+ fi
+
+ # libglade specified, or auto and no gtkbuilder. gtkmm2.4-compatible libglademm is >= 2.4.0.
+ # (not sure about libglade version).
+ if test "x$app_cv_gld_reader" = "xnone"; then
+ if test "x$app_cv_gld_reader_libglade_name" = "xlibglade"; then
+ # libglade
+ PKG_CHECK_MODULES([LIBGLADE], [$app_cv_gld_reader_libglade_pkg_name >= 2.4.0],
+ [app_cv_gld_reader="libglade"], [AC_MSG_WARN([$LIBGLADE_PKG_ERRORS])])
+ app_cv_gld_reader_CFLAGS="$LIBGLADE_CFLAGS";
+ app_cv_gld_reader_CXXFLAGS="$LIBGLADE_CFLAGS";
+ app_cv_gld_reader_LIBS="$LIBGLADE_LIBS";
+ else
+ # libglademm
+ PKG_CHECK_MODULES([LIBGLADEMM], [$app_cv_gld_reader_libglade_pkg_name >= 2.4.0],
+ [app_cv_gld_reader="libglade"], [AC_MSG_WARN([$LIBGLADEMM_PKG_ERRORS])])
+ app_cv_gld_reader_CFLAGS=""
+ app_cv_gld_reader_CXXFLAGS="$LIBGLADEMM_CFLAGS";
+ app_cv_gld_reader_LIBS="$LIBGLADEMM_LIBS";
+ fi
+ # reset them so they don't interfere later
+ LIBGLADE_CFLAGS="";
+ LIBGLADE_LIBS="";
+ fi
+
+ if test "x$with_libglade" = "xyes" && test "x$app_cv_gld_reader" = "xnone"; then
+ AC_MSG_ERROR([$app_cv_gld_reader_libglade_name not found. Try building with GtkBuilder support (you need $app_cv_gld_reader_gtk_name version 2.12 or higher).])
+ fi
+
+ # still not found.
+ if test "$app_cv_gld_reader" = "none"; then
+ if test "x$app_cv_abort_if_no_glade_reader" = "xno"; then
+ AC_MSG_WARN([$LIBGLADE_PKG_ERRORS])
+ AC_MSG_WARN([Neither GtkBuilder nor $app_cv_gld_reader_libglade_name found. The program will be unable to compile fully.])
+ else
+ AC_MSG_WARN([Neither GtkBuilder nor $app_cv_gld_reader_libglade_name found.])
+ AC_MSG_ERROR([$LIBGLADE_PKG_ERRORS])
+ fi
+ fi
+
+
+ # export the flags
+ if test "x$2" != "x"; then
+ if test "x$$2[]CFLAGS" = "x"; then
+ $2[]CFLAGS="$app_cv_gld_reader_CFLAGS";
+ else
+ $2[]CFLAGS="$$2[]CFLAGS $app_cv_gld_reader_CFLAGS";
+ fi
+ if test "x$$2[]CXXFLAGS" = "x"; then
+ $2[]CXXFLAGS="$app_cv_gld_reader_CXXFLAGS";
+ else
+ $2[]CXXFLAGS="$$2[]CXXFLAGS $app_cv_gld_reader_CXXFLAGS";
+ fi
+ if test "x$$2[]LIBS" = "x"; then
+ $2[]LIBS="$app_cv_gld_reader_LIBS";
+ else
+ $2[]LIBS="$$2[]LIBS $app_cv_gld_reader_LIBS";
+ fi
+ fi
+
+
+ # export to automake.am-s
+ AM_CONDITIONAL([ENABLE_LIBGLADE], [test "$app_cv_gld_reader" = "libglade"])
+ AM_CONDITIONAL([ENABLE_GTKBUILDER], [test "$app_cv_gld_reader" = "gtkbuilder"])
+
+
+ # export to config.h
+ if test "$app_cv_gld_reader" = "libglade"; then
+ AC_DEFINE(ENABLE_LIBGLADE, 1, [Use libglade(mm) instead of GtkBuilder])
+ else
+ AC_DEFINE(ENABLE_LIBGLADE, 0, [Use libglade(mm) instead of GtkBuilder])
+ fi
+ if test "$app_cv_gld_reader" = "gtkbuilder"; then
+ AC_DEFINE(ENABLE_GTKBUILDER, 1, [Use GtkBuilder instead of libglademm])
+ else
+ AC_DEFINE(ENABLE_GTKBUILDER, 1, [Use GtkBuilder instead of libglademm])
+ fi
+
+ # If we move this to the start, some messages get in between, so we have to have it here.
+ AC_MSG_CHECKING([for glade file support])
+
+ AC_MSG_RESULT([$app_cv_gld_reader])
+
+])
+
+
+
+
+
diff --git a/gsmartcontrol/autoconf.m4/app_compiler_options.m4 b/autoconf.m4/app_compiler_options.m4
similarity index 93%
rename from gsmartcontrol/autoconf.m4/app_compiler_options.m4
rename to autoconf.m4/app_compiler_options.m4
index 2337ab8..8ad0a00 100644
--- a/gsmartcontrol/autoconf.m4/app_compiler_options.m4
+++ b/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=none])
+ [app_cv_compiler_common_options=${enableval}], [app_cv_compiler_common_options=auto])
# 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,14 +54,14 @@ 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. Default for mingw.
+ # -mms-bitfields - make structures compatible with msvc. recommended default for non-cygwin.
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"
fi
app_cv_compiler_tmp_var="-Wall -Wcast-align -Wcast-qual -Wconversion \
--Wfloat-equal -Wnon-virtual-dtor -Woverloaded-virtual \
+-Wctor-dtor-privacy -Wfloat-equal -Wnon-virtual-dtor -Woverloaded-virtual \
-Wpointer-arith -Wshadow -Wsign-compare -Wsign-promo -Wundef -Wwrite-strings";
if test "x$app_cv_compiler_common_options" = "xclang"; then
# these are really annoying
@@ -183,23 +183,10 @@ 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";
- 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";
+ 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";
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/autoconf.m4/app_cxx_extern_c_overload.m4 b/autoconf.m4/app_cxx_extern_c_overload.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/app_cxx_extern_c_overload.m4
rename to autoconf.m4/app_cxx_extern_c_overload.m4
diff --git a/gsmartcontrol/autoconf.m4/app_cxx_func.m4 b/autoconf.m4/app_cxx_func.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/app_cxx_func.m4
rename to autoconf.m4/app_cxx_func.m4
diff --git a/gsmartcontrol/autoconf.m4/app_detect_os.m4 b/autoconf.m4/app_detect_os.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/app_detect_os.m4
rename to autoconf.m4/app_detect_os.m4
diff --git a/gsmartcontrol/autoconf.m4/app_get_mt_flags.m4 b/autoconf.m4/app_get_mt_flags.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/app_get_mt_flags.m4
rename to autoconf.m4/app_get_mt_flags.m4
diff --git a/gsmartcontrol/autoconf.m4/app_use_system_extensions.m4 b/autoconf.m4/app_use_system_extensions.m4
similarity index 94%
rename from gsmartcontrol/autoconf.m4/app_use_system_extensions.m4
rename to autoconf.m4/app_use_system_extensions.m4
index 06c6747..2ce353f 100644
--- a/gsmartcontrol/autoconf.m4/app_use_system_extensions.m4
+++ b/autoconf.m4/app_use_system_extensions.m4
@@ -89,7 +89,7 @@ AC_DEFUN([APP_USE_SYSTEM_EXTENSIONS], [
# See sys/featuretest.h
;;
- mingw*)
+ mingw32)
# This enables standards-compliant stdio behaviour (regarding printf and
# friends), as opposed to msvc-compatible one. This is usually enabled
# by default if one of the usual macros are encountered (_XOPEN_SOURCE,
@@ -98,8 +98,14 @@ AC_DEFUN([APP_USE_SYSTEM_EXTENSIONS], [
# Other things to consider: _NO_OLDNAMES (disable "deprecated"
# non-underscored names like chdir (use _chdir), etc...).
# See _mingw.h for details.
- app_cv_target_extension_cflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0600" # Since Vista
- app_cv_target_extension_cxxflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0600"
+ app_cv_target_extension_cflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0500"
+ app_cv_target_extension_cxxflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0500"
+ ;;
+
+ mingw64)
+ # Same as ming32, but enable "from xp" mode, since there's no x86_64 2k.
+ app_cv_target_extension_cflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0501"
+ app_cv_target_extension_cxxflags="-D__USE_MINGW_ANSI_STDIO=1 -DWINVER=0x0501"
;;
interix)
diff --git a/gsmartcontrol/autoconf.m4/ax_compiler_vendor.m4 b/autoconf.m4/ax_compiler_vendor.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/ax_compiler_vendor.m4
rename to autoconf.m4/ax_compiler_vendor.m4
diff --git a/gsmartcontrol/autoconf.m4/ax_cxx_gcc_abi_demangle.m4 b/autoconf.m4/ax_cxx_gcc_abi_demangle.m4
similarity index 100%
rename from gsmartcontrol/autoconf.m4/ax_cxx_gcc_abi_demangle.m4
rename to autoconf.m4/ax_cxx_gcc_abi_demangle.m4
diff --git a/gsmartcontrol/autogen.sh b/autogen.sh
similarity index 89%
rename from gsmartcontrol/autogen.sh
rename to autogen.sh
index eb630b4..eabc95f 100755
--- a/gsmartcontrol/autogen.sh
+++ b/autogen.sh
@@ -16,7 +16,7 @@
# autoconf
-autoreconf --verbose --install -W all --force
+autoreconf --verbose --install -W all
rm -f config.cache
diff --git a/baqup b/baqup
new file mode 100755
index 0000000..5863207
--- /dev/null
+++ b/baqup
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+stamp="../gsmartcontrol-`date +%F`"
+echo $stamp
+
+mkdir $stamp
+cp -dp * $stamp/
+
+rm -f $stamp/*pcs # kdevelop persistent store files
+
+cp -a autoconf.m4/ $stamp/
+cp -a data/ $stamp/
+cp -a src/ $stamp/
+cp -a templates/ $stamp/
+# cp -a test-data/ $stamp/
+
+tar cvf $stamp.tar $stamp
+bzip2 -9 $stamp.tar
+
diff --git a/gsmartcontrol/compilation_flags.in b/compilation_flags.in
similarity index 100%
rename from gsmartcontrol/compilation_flags.in
rename to compilation_flags.in
diff --git a/configure-dev b/configure-dev
new file mode 100755
index 0000000..795da55
--- /dev/null
+++ b/configure-dev
@@ -0,0 +1,73 @@
+#!/bin/bash
+
+# Configure a build directory according to developer flags
+
+type="$1";
+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 " is ../configure by default"
+ exit 1;
+fi
+
+if [ "$configure_script" == "" ]; then
+ configure_script="../configure";
+fi
+
+
+flags="";
+
+case $type in
+ optimized)
+ flags="--disable-user-flags --enable-optimize-options --enable-tests" ;;
+ debug)
+ flags="--enable-debug-options --enable-tests" ;;
+ clang)
+ flags="CC=clang CXX=clang++ --enable-debug-options --enable-tests" ;;
+ icc)
+ flags="CC=icc64 CXX=icpc64 --disable-user-flags --enable-tests" ;;
+ win32)
+ flags="CC=i386-pc-mingw32-gcc CXX=i386-pc-mingw32-g++ \
+ PKG_CONFIG_PATH=/cross/w32/target/lib/pkgconfig PKG_CONFIG_LIBDIR=\"\" \
+ PATH=\"/cross/w32/gcc-bin:/cross/w32/target/bin:$PATH\" \
+ --with-windows-gtk-name=gtk2-runtime-2.24.10-2012-10-10-ash --disable-user-flags \
+ --with-nsis=/root/.wine/drive_c/Programs_x86/NSIS/makensis.exe \
+ --enable-optimize-options --enable-tests --build=i686-linux --host=i386-pc-mingw32" ;;
+ win32-debug)
+ flags="CC=i386-pc-mingw32-gcc CXX=i386-pc-mingw32-g++ \
+ PKG_CONFIG_PATH=/cross/w32/target/lib/pkgconfig PKG_CONFIG_LIBDIR=\"\" \
+ PATH=\"/cross/w32/gcc-bin:/cross/w32/target/bin:$PATH\" \
+ --disable-user-flags --enable-debug-options --enable-tests --build=i686-linux --host=i386-pc-mingw32" ;;
+ win64-debug)
+ flags="CC=x86_64-pc-mingw32-gcc CXX=x86_64-pc-mingw32-g++
+ PKG_CONFIG_PATH=/cross/w64/target/lib/pkgconfig \
+ PKG_CONFIG_LIBDIR=\"\" PATH=\"/cross/w64/gcc-bin:/cross/w64/target/bin:$PATH\" \
+ --disable-user-flags --enable-optimize-options --enable-tests --build=i686-linux \
+ --host=x86_64-pc-mingw32" ;;
+ sun)
+ flags="CC=suncc CXX=sunCC 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\" \
+ PKG_CONFIG_LIBDIR=\"\" --enable-tests" ;;
+ portland)
+ flags="CC=pgcc CXX=pgCC LDFLAGS=\"-s\" CFLAGS=\"-Minform=warn -Bstatic_pgi\" \
+ CXXFLAGS=\"-Minform=warn -Bstatic_pgi -noswitcherror -define_macro=HZ_NO_COMPILER_AUTOINCLUDE\" \
+ --enable-tests" ;;
+
+ open64)
+ flags="CC=/opt/open64/bin/opencc CXX=/opt/open64/bin/openCC CXXFLAGS=\"-Wall\" \
+ --enable-tests" ;;
+esac
+
+
+echo "Running:"
+echo $configure_script $flags;
+
+$configure_script $flags
+
+
+exit $?
diff --git a/gsmartcontrol/configure.ac b/configure.ac
similarity index 73%
rename from gsmartcontrol/configure.ac
rename to configure.ac
index 5a10f97..e152afe 100644
--- a/gsmartcontrol/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
-AC_INIT([GSmartControl],[1.1.3],[],[gsmartcontrol])
+AC_INIT([GSmartControl],[0.9.0],[],[gsmartcontrol])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_HEADERS([config.h])
@@ -22,7 +22,6 @@ AC_PROG_CXX
#AC_PROG_CXXCPP
#AM_PROG_LIBTOOL
-AM_PROG_AR
# C++ support in checks
#AC_LANG([C])
@@ -64,10 +63,6 @@ APP_DETECT_OS_KERNEL([build], [CONFIG_HOST_KERNEL_])
# which is important for some compatibility flags (e.g. __func__ visibility, etc...).
APP_COMPILER_OPTIONS([])
-# Enable C++11 support. This is implied by gtkmm3, but CentOS7 fails to add it
-# to gtkmm flags, so we have to enable it manually. Make it optional for Debian 7 (gcc 4.7).
-AX_CXX_COMPILE_STDCXX([11], [], [optional])
-
# Thread support for known configurations.
# Sun compiler (at least on linux) has some runtime issues with stringstream
# unless we use the thread flags. Also, Linux-based gdb fails to debug
@@ -132,6 +127,9 @@ APP_CXX_EXTERN_C_OVERLOAD
# This may be needed for pch support
AC_CHECK_HEADERS([stdc++.h])
+# pcrecpp needs this (break on first function found)
+AC_CHECK_FUNCS([strtoll _strtoi64], [break])
+
# Non-C99 systems don't have strtof and strtold. some have strtodf for strtof,
# but let's ignore it. Note: They may be supported by system libc,
# but not enabled by default (e.g. by glibc feature macros). In that case,
@@ -177,7 +175,8 @@ AC_ARG_ENABLE(abort-if-no-gtkmm, AS_HELP_STRING([--disable-abort-if-no-gtkmm],
AC_MSG_NOTICE([Abort if no gtkmm is found: $app_cv_abort_if_no_gtkmm])
-pkg_modules="gtkmm-3.0 >= 3.4.0"
+# iconview is available since 2.6.0. gthread is not enabled by default.
+pkg_modules="gtkmm-2.4 >= 2.6.0" # gthread-2.0 >= 2.0
# define ENABLE_GLIB and friends if it's found.
gtkmm_found="no"
@@ -202,38 +201,67 @@ if test "x$gtkmm_found" = "xno"; then
fi
fi
+# GTK flags must be prepended, or glib_config.h conflict between
+# gtk 2.x and 1.2 may occur.
+
#CFLAGS="$GTKMM_CFLAGS $CFLAGS"
CXXFLAGS="$GTKMM_CFLAGS $CXXFLAGS"
LIBS="$GTKMM_LIBS $LIBS"
+# Detect libglade / gtkbuilder support
+
+APP_CHOOSE_GLD_READER([C++], [LIBGLADE_])
+
+if test "$app_cv_gld_reader" = "libglade"; then
+ CFLAGS="$CFLAGS $LIBGLADE_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $LIBGLADE_CXXFLAGS"
+ LIBS="$LIBS $LIBGLADE_LIBS"
+fi
+
# -------------------------------------------------------------------------------------
# -------------------------------------------------------------------------------------
-PCRECPP_CFLAGS="";
-PCRECPP_LIBS="";
+PCRE_CFLAGS="";
+PCRE_LIBS="";
# try pkg-config first
-PKG_CHECK_MODULES(PCRECPP, [libpcrecpp], [pcrecpp_found=yes], [pcrecpp_found=no])
+PKG_CHECK_MODULES(PCRE, [libpcre], [pcre_found=yes], [pcre_found=no])
# if not found, try pcre-config (solaris had it but not pkg-config).
-if test "x$pcrecpp_found" = "xno"; then
+if test "x$pcre_found" = "xno"; then
AC_PATH_PROG(pcre_config_binary, [pcre-config])
if test "x$pcre_config_binary" != "x"; then
PCRE_CFLAGS="`pcre-config --cflags`"
- PCRE_LIBS="`pcre-config --libs-cpp`"
+ PCRE_LIBS="`pcre-config --libs`"
else
- # AC_MSG_ERROR([Could not find pcrecpp through pkg-config and pcre-config. Make sure the pcre and pcrecpp libraries are installed])
- AC_MSG_ERROR([$PCRECPP_PKG_ERRORS])
+ # AC_MSG_ERROR([Could not find pcre through pkg-config and pcre-config. Make sure the pcre libraries are installed])
+ AC_MSG_ERROR([$PCRE_PKG_ERRORS])
fi
fi
-CFLAGS="$CFLAGS $PCRECPP_CFLAGS"
-CXXFLAGS="$CXXFLAGS $PCRECPP_CFLAGS"
-LIBS="$LIBS $PCRECPP_LIBS"
+CFLAGS="$CFLAGS $PCRE_CFLAGS"
+CXXFLAGS="$CXXFLAGS $PCRE_CFLAGS"
+LIBS="$LIBS $PCRE_LIBS"
+
+
+# -------------------------------------------------------------------------------------
+
+# -------------------------------------------------------------------------------------
+
+
+# Test stuff here...
+#
+
+#SDL_VERSION=1.2.0
+#AM_PATH_SDL($SDL_VERSION, :,
+# AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) )
+#CFLAGS="$CFLAGS $SDL_CFLAGS"
+#CXXFLAGS="$CXXFLAGS $SDL_CFLAGS "
+#LIBS="$LIBS $SDL_LIBS"
# -------------------------------------------------------------------------------------
@@ -249,13 +277,17 @@ AC_ARG_WITH([nsis], [AS_HELP_STRING([--with-nsis=|auto],
["~/.wine/drive_c/Program Files/NSIS/Unicode/makensis.exe" for others)])],
[with_nsis=${withval}], [with_nsis=auto])
-AC_ARG_ENABLE([nsis-wine], [AS_HELP_STRING([--enable-nsis-wine=yes|no],
- [use wine to run makensis.exe when making NSIS packages (default: no)])],
- [with_nsis_wine=${enableval}], [with_nsis_wine=no])
+AC_ARG_ENABLE([nsis-wine], [AS_HELP_STRING([--enable-nsis-wine=yes|no|auto],
+ [use wine to run makensis.exe when making NSIS packages (default: auto, which is no for windows, yes for others)])],
+ [with_nsis_wine=${enableval}], [with_nsis_wine=yes])
-AC_ARG_WITH([windows-sysroot], [AS_HELP_STRING([--with-windows-sysroot],
- [specify location of Windows system root directory when making Windows packages (default: /mingw32)])],
- [with_windows_sysroot=${withval}], [with_windows_sysroot=auto])
+AC_ARG_WITH([windows-bindir], [AS_HELP_STRING([--with-windows-bindir],
+ [specify location of Windows dlls and executables when making Windows packages (default: /cross/w32/target/bin)])],
+ [with_windows_bindir=${withval}], [with_windows_bindir=auto])
+
+AC_ARG_WITH([windows-gtk-name], [AS_HELP_STRING([--with-windows-gtk-name],
+ [specify name of Windows GTK+ runtime (installer and unpacked directory) when making Windows packages. It will be looked in windows-bindir.])],
+ [with_windows_gtk_name=${withval}], [with_windows_gtk_name=])
if test "x$with_nsis" = "xauto" || test "x$with_nsis" = "x"; then
# if building on windows, use native paths
@@ -266,26 +298,30 @@ if test "x$with_nsis" = "xauto" || test "x$with_nsis" = "x"; then
fi
fi
+if test "x$with_nsis_wine" = "xauto"; then
+ # if not building on windows, use wine
+ if test "x$app_cv_build_os_kernel" = "xwindows32" || test "x$app_cv_build_os_kernel" = "xwindows64"; then
+ with_nsis_wine="no";
+ else
+ with_nsis_wine="yes";
+ fi
+fi
+
NSIS_EXEC="$with_nsis";
-if test "x$with_nsis_wine" = "xyes"; then
+if test "x$with_nsis_wine" != "xno"; then
NSIS_EXEC="wine $with_nsis";
fi
-if test "x$with_windows_sysroot" = "xauto" || test "x$with_windows_sysroot" = "x"; then
- with_windows_sysroot="/mingw32"
+if test "x$with_windows_bindir" = "xauto" || test "x$with_windows_bindir" = "x"; then
+ with_windows_bindir="/cross/w32/target/bin"
fi
-WINDOWS_SYSROOT="$with_windows_sysroot";
+WINDOWS_BINDIR="$with_windows_bindir";
-WINDOWS_SUFFIX="";
-if test "x$app_cv_target_os_kernel" = "xwindows32"; then
- WINDOWS_SUFFIX="win32"
-elif test "x$app_cv_target_os_kernel" = "xwindows64"; then
- WINDOWS_SUFFIX="win64"
-fi
+GTK_INSTALLER_NAME="$with_windows_gtk_name";
AC_SUBST(NSIS_EXEC)
-AC_SUBST(WINDOWS_SYSROOT)
-AC_SUBST(WINDOWS_SUFFIX)
+AC_SUBST(WINDOWS_BINDIR)
+AC_SUBST(GTK_INSTALLER_NAME)
# -------------------------------------------------------------------------------------
@@ -310,20 +346,26 @@ AC_SUBST(WINDOWS_ARCH)
# -------------------------------------------------------------------------------------
-RES_FILES="src/res/gsc_about_dialog.ui \
- src/res/gsc_add_device_window.ui \
- src/res/gsc_executor_log_window.ui \
- src/res/gsc_info_window.ui \
- src/res/gsc_main_window.ui \
- src/res/gsc_preferences_window.ui \
- src/res/gsc_text_window.ui \
- AUTHORS.txt LICENSE_gsmartcontrol.txt"
+RES_FILES="src/res/gsc_about_dialog.glade \
+ src/res/gsc_add_device_window.glade \
+ src/res/gsc_executor_log_window.glade \
+ src/res/gsc_help_window.glade \
+ src/res/gsc_info_window.glade \
+ src/res/gsc_main_window.glade \
+ src/res/gsc_preferences_window.glade \
+ src/res/gsc_text_window.glade \
+ AUTHORS.txt LICENSE_gsmartcontrol.txt README.txt"
# Unfortunately, _SOURCES can't contain substitutions, so we use LIBADD.
RES_LIBADD="" # .o file to put into .a, libres_a_LIBADD, libres_a_DEPENDENCIES.
RES_DIST="" # only files in "res" directory, EXTRA_DIST
RES_TARGETS="" # entry for each file in makefile
+RES_GLD_EXT="glade"
+if test "$app_cv_gld_reader" = "gtkbuilder"; then
+ RES_GLD_EXT="ui"
+fi
+
for RES_FILE in $RES_FILES;
do # on separate line for portability
RES_BASE=`echo "$RES_FILE" | sed 's/.*\///'` # "a/b/c" -> "c", "c" -> "c"
@@ -339,14 +381,28 @@ do # on separate line for portability
RES_FILE_CANON="\$(srcdir)/$RES_BASE" # shorter path, better make behaviour
fi
- if test "$RES_BASE_EXT" = "ui"; then
- RES_LIBADD="$RES_LIBADD $RES_BASE_NOEXT.ui.$ac_objext" # file.ui.o
+ # We use separate source files for gtkbuilder and libglademm, because
+ # make dist should be able to bundle both of them separately.
+
+ if test "$RES_BASE_EXT" = "glade"; then
+
+ RES_LIBADD="$RES_LIBADD $RES_BASE_NOEXT.$RES_GLD_EXT.$ac_objext" # file.ui.o or file.glade.o
+
+ # Output both glade and ui rules. This way make dist will be able
+ # to build cpp files of both of them.
+
RES_TARGETS="$RES_TARGETS
$RES_BASE_NOEXT.ui.cpp: $RES_FILE_CANON
- \"\$(top_srcdir)/file2csource.sh\" \"$RES_FILE_CANON\" \"$RES_BASE_NOEXT.ui.cpp\" \"$RES_BASE_NOEXT\"_ui
+ gtk-builder-convert \"$RES_FILE_CANON\" \"$RES_BASE_NOEXT\".tmp_ui
+ \"\$(top_srcdir)/file2csource.sh\" \"$RES_BASE_NOEXT\".tmp_ui \"$RES_BASE_NOEXT.ui.cpp\" \"$RES_BASE_NOEXT\"_ui
+"
+ RES_TARGETS="$RES_TARGETS
+$RES_BASE_NOEXT.glade.cpp: $RES_FILE_CANON
+ \"\$(top_srcdir)/file2csource.sh\" \"$RES_FILE_CANON\" \"$RES_BASE_NOEXT.glade.cpp\" \"$RES_BASE_NOEXT\"_ui
"
else # txt, etc...
+
SRC_FILE="$RES_BASE.cpp"
RES_LIBADD="$RES_LIBADD $RES_BASE.$ac_objext" # file.txt.o
@@ -389,20 +445,21 @@ CXXFLAGS="$CXXFLAGS $ADDITIONAL_FLAGS"
# Add global configuration file. Note: It must be searched in top_builddir
# first (that's why -I is the first flag), for precompiled headers to work.
-ADDITIONAL_INCLUDES="-I\$(top_builddir) -I\$(top_srcdir)/src"
+# Add pcrecpp too, because its files use # on each other.
+ADDITIONAL_INCLUDES="-I\$(top_builddir) -I\$(top_srcdir)/src -I\$(top_srcdir)/src/pcrecpp"
# -include works with gcc, intel, pathscale and sunstudio since 12u1, but doesn't work
# with pgi and older sunstudio (the one in solaris10, for example).
# Note: some gcc-frontend-based compilers may have to be added here
# (e.g. gccfss (gcc frontend / sun backend), etc...).
# We use -include only when using pch.
-# if test "x$app_cv_compiler_gcc_pch" = "xyes"; then
-# if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang" \
-# || test "$ax_cv_cxx_compiler_vendor" = "intel" || test "$ax_cv_cxx_compiler_vendor" = "pathscale"; then
-# # This auto-includes this file when compiling any file. Benefits include pch support.
-# ADDITIONAL_INCLUDES="$ADDITIONAL_INCLUDES -include global_macros.h"
-# fi
-# fi
+if test "x$app_cv_compiler_gcc_pch" = "xyes"; then
+ if test "$ax_cv_cxx_compiler_vendor" = "gnu" || test "$ax_cv_cxx_compiler_vendor" = "clang" \
+ || test "$ax_cv_cxx_compiler_vendor" = "intel" || test "$ax_cv_cxx_compiler_vendor" = "pathscale"; then
+ # This auto-includes this file when compiling any file. Benefits include pch support.
+ ADDITIONAL_INCLUDES="$ADDITIONAL_INCLUDES -include global_macros.h"
+ fi
+fi
# our flags must be before all the others
#CFLAGS="$ADDITIONAL_INCLUDES $CFLAGS"
@@ -453,8 +510,6 @@ AC_SUBST(LDFLAGS)
# print them out for debug purposes
AC_MSG_NOTICE([
-CXX:
-$CXX
CXXFLAGS:
$CXXFLAGS
LDFLAGS:
@@ -475,7 +530,7 @@ AC_SUBST(AUTODIRS)
AC_CONFIG_FILES([ data/gsmartcontrol.desktop data/gsmartcontrol.appdata.xml \
- data/nsis/distribution.txt data/nsis/gsmartcontrol.nsi \
+ data/nsis/distribution.txt data/nsis/distribution-nogtk.txt data/nsis/gsmartcontrol.nsi \
debian.dist/changelog \
src/gsc_winres.rc src/gsmartcontrol.exe.manifest \
gsmartcontrol.spec version compilation_flags ])
@@ -487,7 +542,7 @@ AC_CONFIG_FILES([data/gsmartcontrol-root], [chmod +x data/gsmartcontrol-root])
# these are all the makefiles to generate
AC_CONFIG_FILES([Makefile src/Makefile src/applib/Makefile src/res/Makefile src/hz/Makefile \
- src/libdebug/Makefile src/rconfig/Makefile src/rmn/Makefile \
+ src/libdebug/Makefile src/pcrecpp/Makefile src/rconfig/Makefile src/rmn/Makefile \
data/Makefile data/16/Makefile data/22/Makefile data/24/Makefile data/32/Makefile \
data/48/Makefile data/64/Makefile data/128/Makefile data/256/Makefile data/nsis/Makefile \
debian.dist/Makefile])
diff --git a/gsmartcontrol/contrib/cron-based_noadmin/README b/contrib/cron-based_noadmin/README
similarity index 100%
rename from gsmartcontrol/contrib/cron-based_noadmin/README
rename to contrib/cron-based_noadmin/README
diff --git a/gsmartcontrol/contrib/cron-based_noadmin/cron_gather_smart.sh b/contrib/cron-based_noadmin/cron_gather_smart.sh
similarity index 100%
rename from gsmartcontrol/contrib/cron-based_noadmin/cron_gather_smart.sh
rename to contrib/cron-based_noadmin/cron_gather_smart.sh
diff --git a/gsmartcontrol/contrib/cron-based_noadmin/crontab.example b/contrib/cron-based_noadmin/crontab.example
similarity index 100%
rename from gsmartcontrol/contrib/cron-based_noadmin/crontab.example
rename to contrib/cron-based_noadmin/crontab.example
diff --git a/gsmartcontrol/contrib/cron-based_noadmin/smartctl_subst.sh b/contrib/cron-based_noadmin/smartctl_subst.sh
similarity index 100%
rename from gsmartcontrol/contrib/cron-based_noadmin/smartctl_subst.sh
rename to contrib/cron-based_noadmin/smartctl_subst.sh
diff --git a/gsmartcontrol/data/128/Makefile.am b/data/128/Makefile.am
similarity index 100%
rename from gsmartcontrol/data/128/Makefile.am
rename to data/128/Makefile.am
diff --git a/gsmartcontrol/data/128/gsmartcontrol.png b/data/128/gsmartcontrol.png
similarity index 100%
rename from gsmartcontrol/data/128/gsmartcontrol.png
rename to data/128/gsmartcontrol.png
diff --git a/gsmartcontrol/data/16/Makefile.am b/data/16/Makefile.am
similarity index 100%
rename from gsmartcontrol/data/16/Makefile.am
rename to data/16/Makefile.am
diff --git a/gsmartcontrol/data/16/gsmartcontrol.png b/data/16/gsmartcontrol.png
similarity index 100%
rename from gsmartcontrol/data/16/gsmartcontrol.png
rename to data/16/gsmartcontrol.png
diff --git a/gsmartcontrol/data/22/Makefile.am b/data/22/Makefile.am
similarity index 100%
rename from gsmartcontrol/data/22/Makefile.am
rename to data/22/Makefile.am
diff --git a/gsmartcontrol/data/22/gsmartcontrol.png b/data/22/gsmartcontrol.png
similarity index 100%
rename from gsmartcontrol/data/22/gsmartcontrol.png
rename to data/22/gsmartcontrol.png
diff --git a/gsmartcontrol/data/24/Makefile.am b/data/24/Makefile.am
similarity index 100%
rename from gsmartcontrol/data/24/Makefile.am
rename to data/24/Makefile.am
diff --git a/gsmartcontrol/data/24/gsmartcontrol.png b/data/24/gsmartcontrol.png
similarity index 100%
rename from gsmartcontrol/data/24/gsmartcontrol.png
rename to data/24/gsmartcontrol.png
diff --git a/gsmartcontrol/data/256/Makefile.am b/data/256/Makefile.am
similarity index 100%
rename from gsmartcontrol/data/256/Makefile.am
rename to data/256/Makefile.am
diff --git a/gsmartcontrol/data/256/gsmartcontrol.png b/data/256/gsmartcontrol.png
similarity index 100%
rename from gsmartcontrol/data/256/gsmartcontrol.png
rename to data/256/gsmartcontrol.png
diff --git a/gsmartcontrol/data/32/Makefile.am b/data/32/Makefile.am
similarity index 100%
rename from gsmartcontrol/data/32/Makefile.am
rename to data/32/Makefile.am
diff --git a/gsmartcontrol/data/32/gsmartcontrol.png b/data/32/gsmartcontrol.png
similarity index 100%
rename from gsmartcontrol/data/32/gsmartcontrol.png
rename to data/32/gsmartcontrol.png
diff --git a/gsmartcontrol/data/48/Makefile.am b/data/48/Makefile.am
similarity index 100%
rename from gsmartcontrol/data/48/Makefile.am
rename to data/48/Makefile.am
diff --git a/gsmartcontrol/data/48/gsmartcontrol.png b/data/48/gsmartcontrol.png
similarity index 100%
rename from gsmartcontrol/data/48/gsmartcontrol.png
rename to data/48/gsmartcontrol.png
diff --git a/gsmartcontrol/data/64/Makefile.am b/data/64/Makefile.am
similarity index 100%
rename from gsmartcontrol/data/64/Makefile.am
rename to data/64/Makefile.am
diff --git a/gsmartcontrol/data/64/gsmartcontrol.png b/data/64/gsmartcontrol.png
similarity index 100%
rename from gsmartcontrol/data/64/gsmartcontrol.png
rename to data/64/gsmartcontrol.png
diff --git a/gsmartcontrol/data/Makefile.am b/data/Makefile.am
similarity index 84%
rename from gsmartcontrol/data/Makefile.am
rename to data/Makefile.am
index 7495112..5fa727f 100644
--- a/gsmartcontrol/data/Makefile.am
+++ b/data/Makefile.am
@@ -13,7 +13,7 @@ uninstall-extra-mans:
# This command is needed if installing with make install (the cache
# file is ignored for rpms).
-gtk_update_icon_cache = gtk-update-icon-cache-3.0 -f -t $(datadir)/icons/hicolor
+gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
install-data-hook: install-extra-mans update-icon-cache
uninstall-hook: uninstall-extra-mans update-icon-cache
@@ -44,10 +44,6 @@ desktop_DATA = gsmartcontrol.desktop
metainfodir = $(datadir)/metainfo
metainfo_DATA = gsmartcontrol.appdata.xml
-# PolKit files
-polkitdir = $(datadir)/polkit-1/actions
-polkit_DATA = org.gsmartcontrol.policy
-
# Application pixmap (fallback icon for desktop files).
# Same as 48/gsmartcontrol.png.
@@ -57,7 +53,7 @@ pixmaps_DATA = 48/gsmartcontrol.png gsmartcontrol.xpm
# Put everything inside the distribution
-EXTRA_DIST = $(appdata_DATA) $(polkit_DATA) gsmartcontrol.ico gsmartcontrol.xpm
+EXTRA_DIST = $(appdata_DATA) gsmartcontrol.ico gsmartcontrol.xpm
bin_SCRIPTS = gsmartcontrol-root
diff --git a/gsmartcontrol/data/gsmartcontrol-root.in b/data/gsmartcontrol-root.in
similarity index 87%
rename from gsmartcontrol/data/gsmartcontrol-root.in
rename to data/gsmartcontrol-root.in
index 50fd643..969bcd2 100644
--- a/gsmartcontrol/data/gsmartcontrol-root.in
+++ b/data/gsmartcontrol-root.in
@@ -8,7 +8,7 @@
# Run gsmartcontrol with root, asking for root password first.
# export GSMARTCONTROL_SU to override a su command (e.g. "kdesu -c").
-EXEC_BIN="@prefix@/sbin/gsmartcontrol";
+EXEC_BIN="@prefix@/bin/gsmartcontrol";
prog_name="gsmartcontrol"
@@ -71,12 +71,11 @@ fi
# They're basically the same, only the order is different.
-# pkexec is for PolKit.
# sux requires xterm to ask for the password.
# xdg-su is basically like this script, except worse :)
# su-to-root is a debian/ubuntu official method (although gksu is available).
-gnome_sus="pkexec su-to-root gnomesu gksu kdesu beesu xdg-su sux";
-kde_sus="pkexec su-to-root kdesu gnomesu gksu beesu xdg-su sux";
+gnome_sus="su-to-root gnomesu gksu kdesu beesu xdg-su sux";
+kde_sus="su-to-root kdesu gnomesu gksu beesu xdg-su sux";
other_sus="$gnome_sus";
@@ -102,7 +101,7 @@ if [ "$GSMARTCONTROL_SU" = "" ]; then
if [ "$found_su" = "" ]; then
xmessage "Error launching ${prog_name}: No suitable su mechanism found.
-Try installing PolKit, kdesu, gnomesu, gksu, beesu or sux first.";
+Try installing kdesu, gnomesu, gksu, beesu or sux first.";
exit 1;
fi
fi
@@ -137,15 +136,6 @@ full_cmd="";
if [ "$GSMARTCONTROL_SU" != "" ]; then
full_cmd="$GSMARTCONTROL_SU '$EXEC_BIN $final_args_quoted'";
-elif [ "$found_su" = "pkexec" ]; then
- if [ "$GDK_SCALE" != "" ]; then
- final_args_quoted="$final_args_quoted --gdk-scale='$GDK_SCALE'"
- fi
- if [ "$GDK_DPI_SCALE" != "" ]; then
- final_args_quoted="$final_args_quoted --gdk-dpi-scale='$GDK_DPI_SCALE'"
- fi
- full_cmd="pkexec --disable-internal-agent $EXEC_BIN $final_args_quoted";
-
elif [ "$found_su" = "sux" ]; then
full_cmd="xterm -e sux -c '$EXEC_BIN $final_args_quoted'";
diff --git a/gsmartcontrol/data/gsmartcontrol.1 b/data/gsmartcontrol.1
similarity index 100%
rename from gsmartcontrol/data/gsmartcontrol.1
rename to data/gsmartcontrol.1
diff --git a/gsmartcontrol/data/gsmartcontrol.appdata.xml.in b/data/gsmartcontrol.appdata.xml.in
similarity index 85%
rename from gsmartcontrol/data/gsmartcontrol.appdata.xml.in
rename to data/gsmartcontrol.appdata.xml.in
index ec09b03..b0e8b88 100644
--- a/gsmartcontrol/data/gsmartcontrol.appdata.xml.in
+++ b/data/gsmartcontrol.appdata.xml.in
@@ -16,19 +16,19 @@