Ticket #885: myth-version.2.diff

File myth-version.2.diff, 4.7 KB (added by willu.mailingLists@…, 20 years ago)

patch that has the version detected at make time rather than configure time

  • libs/libmyth/libmyth.pro

     
    99
    1010QMAKE_CLEAN += $(TARGET) $(TARGETA) $(TARGETD) $(TARGET0) $(TARGET1) $(TARGET2)
    1111
     12system(touch vers.cpp)
     13
     14vers.target = vers.cpp
     15vers.commands = echo "const char *myth_source_version = \"`( svnversion ../.. 2>/dev/null ) || echo "Release $${LIBVERSION}"`\";" > vers.cpp
     16vers.depends = FORCE
     17
     18QMAKE_EXTRA_UNIX_TARGETS += vers
     19
    1220# Input
    1321HEADERS += dialogbox.h lcddevice.h mythcontext.h mythwidgets.h oldsettings.h 
    1422HEADERS += remotefile.h settings.h themedmenu.h util.h mythwizard.h
     
    1725HEADERS += uilistbtntype.h generictree.h screensaver.h
    1826HEADERS += managedlist.h DisplayRes.h volumebase.h audiooutputbase.h
    1927HEADERS += dbsettings.h screensaver-null.h output.h visual.h
    20 HEADERS += langsettings.h audiooutputnull.h
     28HEADERS += langsettings.h audiooutputnull.h vers.h
    2129HEADERS += DisplayResScreen.h util-x11.h mythdeque.h qmdcodec.h
    2230HEADERS += exitcodes.h virtualkeyboard.h mythobservable.h mythevent.h
    2331
     
    3139SOURCES += dbsettings.cpp screensaver.cpp screensaver-null.cpp output.cpp
    3240SOURCES += langsettings.cpp mythdbcon.cpp audiooutputnull.cpp
    3341SOURCES += DisplayResScreen.cpp util-x11.cpp qmdcodec.cpp
    34 SOURCES += virtualkeyboard.cpp mythobservable.cpp
     42SOURCES += virtualkeyboard.cpp mythobservable.cpp vers.cpp
    3543
    3644INCLUDEPATH += ../libmythsamplerate ../libmythsoundtouch ../..
    3745DEPENDPATH += ../libmythsamplerate ../libmythsoundtouch
     
    5866inc.files += uilistbtntype.h generictree.h managedlist.h
    5967inc.files += visual.h volumebase.h output.h langsettings.h qmdcodec.h
    6068inc.files += exitcodes.h mythconfig.h mythconfig.mak virtualkeyboard.h
    61 inc.files += mythevent.h mythobservable.h
     69inc.files += mythevent.h mythobservable.h vers.h
    6270
    6371using_oss {
    6472    DEFINES += USING_OSS
  • libs/libmyth/vers.h

     
     1#ifndef VERS_H_
     2#define VERS_H_
     3
     4extern const char *myth_source_version;
     5
     6#endif
     7
  • programs/mythfrontend/main.cpp

     
    4747#include "langsettings.h"
    4848#include "livetvchain.h"
    4949
     50#include "vers.h"
     51
    5052#define NO_EXIT  0
    5153#define QUIT     1
    5254#define HALT     2
     
    840842        }
    841843        else if (!strcmp(a.argv()[argpos],"--version"))
    842844        {
    843             cout << MYTH_BINARY_VERSION << endl;
     845            cout << "Source version: " << myth_source_version << endl;
     846            cout << "API version: " << MYTH_BINARY_VERSION << endl;
    844847#ifdef MYTH_BUILD_CONFIG
    845848            cout << "Options compiled in:" <<endl;
    846849            cout << MYTH_BUILD_CONFIG << endl;
     
    987990        return FRONTEND_EXIT_DB_OUTOFDATE;
    988991    }
    989992
    990     VERBOSE(VB_ALL, QString("%1 version: %2 www.mythtv.org")
    991                             .arg(binname).arg(MYTH_BINARY_VERSION));
     993    VERBOSE(VB_ALL, QString("%1 version: %2, %3 www.mythtv.org")
     994                            .arg(binname).arg(myth_source_version)
     995                            .arg(MYTH_BINARY_VERSION));
    992996
    993997    VERBOSE(VB_ALL, QString("Enabled verbose msgs: %1").arg(verboseString));
    994998
  • programs/mythbackend/main.cpp

     
    3030#include "libmyth/mythcontext.h"
    3131#include "libmyth/mythdbcon.h"
    3232#include "libmyth/exitcodes.h"
     33#include "libmyth/vers.h"
    3334#include "libmythtv/programinfo.h"
    3435#include "libmythtv/dbcheck.h"
    3536#include "libmythtv/jobqueue.h"
     
    323324        }
    324325        else if (!strcmp(a.argv()[argpos],"--version"))
    325326        {
    326             cout << MYTH_BINARY_VERSION << endl;
     327            cout << "Source version: " << myth_source_version << endl;
     328            cout << "API version: " << MYTH_BINARY_VERSION << endl;
    327329#ifdef MYTH_BUILD_CONFIG
    328330            cout << "Options compiled in:" <<endl;
    329331            cout << MYTH_BUILD_CONFIG << endl;
     
    517519    else
    518520        jobqueue = new JobQueue(ismaster);
    519521
    520     VERBOSE(VB_ALL, QString("%1 version: %2 www.mythtv.org")
    521                             .arg(binname).arg(MYTH_BINARY_VERSION));
     522    VERBOSE(VB_ALL, QString("%1 version: %2, %3 www.mythtv.org")
     523                            .arg(binname).arg(myth_source_version)
     524                            .arg(MYTH_BINARY_VERSION));
    522525
    523526    VERBOSE(VB_ALL, QString("Enabled verbose msgs: %1").arg(verboseString));
    524527