diff --git a/configure.ac b/configure.ac index b0156035f1..9860f11596 100644 --- a/configure.ac +++ b/configure.ac @@ -392,6 +392,9 @@ char * strerror(int n); #endif ]) +AC_DEFINE_UNQUOTED([LYX_DATE],"$LYX_DATE",[Date of release]) +AC_DEFINE_UNQUOTED([VERSION_INFO],"$VERSION_INFO",[Full version info]) + ### Finish the work. AC_CONFIG_FILES([Makefile boost/Makefile \ @@ -413,7 +416,6 @@ AC_CONFIG_FILES([Makefile sourcedoc/Makefile \ src/client/Makefile \ src/Makefile \ - src/version.cpp-tmp:src/version.cpp.in \ src/tex2lyx/Makefile \ src/support/Makefile \ src/frontends/Makefile \ diff --git a/development/cmake/src/CMakeLists.txt b/development/cmake/src/CMakeLists.txt index 18b1bee1fe..4a3c671c86 100644 --- a/development/cmake/src/CMakeLists.txt +++ b/development/cmake/src/CMakeLists.txt @@ -18,8 +18,6 @@ if(NOT MERGE_FILES) endif(NOT MERGE_FILES) -configure_file(${TOP_SRC_DIR}/src/version.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/version.cpp) - file(GLOB lyx_sources ${TOP_SRC_DIR}/src/${LYX_CPP_FILES}) file(GLOB lyx_headers ${TOP_SRC_DIR}/src/${LYX_HPP_FILES}) @@ -41,11 +39,10 @@ lyx_add_msvc_pch(lyx) if(NOT MERGE_FILES) - set(lyx_sources ${lyx_sources} ${CMAKE_CURRENT_BINARY_DIR}/version.cpp) + set(lyx_sources ${lyx_sources}) else(NOT MERGE_FILES) lyx_const_touched_files(_allinone lyx_sources) - set(lyx_sources ${_allinone_files} ${CMAKE_CURRENT_BINARY_DIR}/version.cpp - ) + set(lyx_sources ${_allinone_files}) endif(NOT MERGE_FILES) add_executable(lyx-${qt_postfix} diff --git a/development/qmake/src/src.pro b/development/qmake/src/src.pro index ed85a17d1a..d95b7aca4f 100644 --- a/development/qmake/src/src.pro +++ b/development/qmake/src/src.pro @@ -221,6 +221,7 @@ CPP += paragraph_funcs.cpp CPP += rowpainter.cpp CPP += sgml.cpp CPP += toc.cpp +CPP += version.cpp for(FILE,CPP) { SOURCES += $${BUILD_BASE_SOURCE_DIR}/src/$${FILE} } for(FILE,HPP) { HEADERS += $${BUILD_BASE_SOURCE_DIR}/src/$${FILE} } @@ -233,16 +234,6 @@ configtarget.target = $${BUILD_BASE_TARGET_DIR}/src/config.h configtarget.commands = \ cp $${BUILD_BASE_SOURCE_DIR}/development/qmake/config.h.template config.h -versiontarget.target = version.cpp -versiontarget.commands = \ - cp $${BUILD_BASE_SOURCE_DIR}/src/version.cpp.in version.cpp -versiontarget.depends = config.h - -versiontarget2.target = version.o -versiontarget2.commands = $${QMAKE_RUN_CXX1} -c version.cpp -o version.o -versiontarget2.depends = version.cpp config.h - - packagetarget.target = Package.cpp packagetarget.commands = \ cp $${BUILD_BASE_SOURCE_DIR}/src/support/Package.cpp.in Package.cpp @@ -254,14 +245,12 @@ packagetarget2.depends = Package.cpp config.h QMAKE_EXTRA_TARGETS += configtarget -QMAKE_EXTRA_TARGETS += versiontarget versiontarget2 QMAKE_EXTRA_TARGETS += packagetarget packagetarget2 -QMAKE_CLEAN += Package.o Package.cpp version.o version.cpp config.h +QMAKE_CLEAN += Package.o Package.cpp config.h PRE_TARGETDEPS += $${BUILD_BASE_TARGET_DIR}/src/config.h PRE_TARGETDEPS += Package.o -PRE_TARGETDEPS += version.o -LIBS += version.o Package.o +LIBS += Package.o diff --git a/development/scons/SConstruct b/development/scons/SConstruct index 568af6cc96..91bcac43cf 100644 --- a/development/scons/SConstruct +++ b/development/scons/SConstruct @@ -371,15 +371,10 @@ env.AppendUnique(LIBPATH = ['$LOCALLIBPATH']) # TOP_SRCDIR, LOCALEDIR, LYX_DIR, PROGRAM_SUFFIX # lib/lyx2lyx/lyx2lyx_version.py.in # PACKAGE_VERSION -# src/version.cpp.in -# PACKAGE_VERSION, LYX_DATE, VERSION_INFO # full path name is used to build msvs project files # and to replace TOP_SRCDIR in package.C env['TOP_SRCDIR'] = Dir(top_src_dir).abspath -# needed by src/version.cpp.in => src/version.cpp -env['PACKAGE_VERSION'] = package_version -env['LYX_DATE'] = time.asctime() # determine share_dir etc packaging_method = env.get('packaging') @@ -1824,9 +1819,6 @@ if build_lyxbase: # print "Processing files in src..." - env.Depends('$BUILDDIR/common/version.cpp', '$BUILDDIR/common/config.h') - version_cpp = env.substFile('$BUILDDIR/common/version.cpp', '$TOP_SRCDIR/src/version.cpp.in') - if env.has_key('USE_ASPELL') and env['USE_ASPELL']: src_post_files.append('ASpell.cpp') elif env.has_key('USE_PSPELL') and env['USE_PSPELL']: @@ -1838,7 +1830,7 @@ if build_lyxbase: # so I exclude main.cpp from lyxbase lyxbase_pre = env.StaticLibrary( target = '$LOCALLIBPATH/lyxbase_pre', - source = ['$BUILDDIR/common/%s' % x for x in src_pre_files] + version_cpp + source = ['$BUILDDIR/common/%s' % x for x in src_pre_files] ) lyxbase_post = env.StaticLibrary( target = '$LOCALLIBPATH/lyxbase_post', diff --git a/development/scons/scons_manifest.py b/development/scons/scons_manifest.py index 61ccfe3644..ebde867e50 100644 --- a/development/scons/scons_manifest.py +++ b/development/scons/scons_manifest.py @@ -234,6 +234,7 @@ src_pre_files = Split(''' rowpainter.cpp sgml.cpp toc.cpp + version.cpp ''') @@ -253,8 +254,6 @@ src_extra_src_files = Split(''' Section.cpp Variables.cpp main.cpp - stamp-h.in - version.cpp.in ''') diff --git a/src/Makefile.am b/src/Makefile.am index 320e9b939d..5d26a6369c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/config/common.am ############################### Core ############################## -DISTCLEANFILES += config.h libintl.h version.cpp stamp-version version.cpp-tmp +DISTCLEANFILES += config.h libintl.h MAINTAINERCLEANFILES += $(srcdir)/config.h.in @@ -10,7 +10,7 @@ AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) SUBDIRS = support frontends . -EXTRA_DIST = config.h.in stamp-h.in version.cpp.in \ +EXTRA_DIST = config.h.in \ Section.h \ Section.cpp \ Variables.cpp \ @@ -41,7 +41,7 @@ lyx$(EXEEXT): $(FRONTENDS_PROGS) #lyx_LDFLAGS=-Wl,-O1 -BUILT_SOURCES = $(PCH_FILE) version.cpp +BUILT_SOURCES = $(PCH_FILE) if USE_ASPELL ASPELL = ASpell.cpp ASpell_local.h @@ -259,19 +259,6 @@ liblyxcore_la_SOURCES = \ VSpace.cpp \ VSpace.h -version.cpp: stamp-version - @: - -stamp-version: version.cpp-tmp - if cmp -s $< version.cpp ; then \ - : ;\ - else \ - rm -f version.cpp ;\ - cp $< version.cpp ;\ - fi - echo timestamp > $@ - - ############################### Graphics ############################## pkglib_LTLIBRARIES += liblyxgraphics.la diff --git a/src/stamp-h.in b/src/stamp-h.in deleted file mode 100644 index 9788f70238..0000000000 --- a/src/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/src/version.cpp.in b/src/version.cpp similarity index 63% rename from src/version.cpp.in rename to src/version.cpp index c0777ffdd6..6027f9a06c 100644 --- a/src/version.cpp.in +++ b/src/version.cpp @@ -12,10 +12,12 @@ * All changes to this file will be lost. */ -/// -char const * lyx_version = "@PACKAGE_VERSION@"; -/// -char const * lyx_release_date = "@LYX_DATE@"; +#include -/// This is the version information shown by 'lyx -version' -char const * lyx_version_info = "@VERSION_INFO@"; +/// +char const * lyx_version = PACKAGE_VERSION; +/// +char const * lyx_release_date = LYX_DATE; + +/// This is the version information shown by 'lyx --version' +char const * lyx_version_info = VERSION_INFO;