Add version information to the lyx executable on Windows.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19537 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Enrico Forestieri 2007-08-14 01:34:26 +00:00
parent d74be992b3
commit 60c73c05a3
4 changed files with 90 additions and 0 deletions

View File

@ -714,3 +714,20 @@ do
break], break],
[AC_MSG_RESULT(no)]) [AC_MSG_RESULT(no)])
done]) done])
dnl Extract the single digits from PACKAGE_VERSION and make them available.
dnl Defines LYX_MAJOR_VERSION, LYX_MINOR_VERSION, LYX_RELEASE_LEVEL, and
dnl LYX_RELEASE_PATCH, the latter being possibly equal to 0.
AC_DEFUN([LYX_SET_VERSION_INFO],
[lyx_major=`echo $PACKAGE_VERSION | sed -e 's/[[.]].*//'`
lyx_patch=`echo $PACKAGE_VERSION | sed -e "s/^$lyx_major//" -e 's/^.//'`
lyx_minor=`echo $lyx_patch | sed -e 's/[[.]].*//'`
lyx_patch=`echo $lyx_patch | sed -e "s/^$lyx_minor//" -e 's/^.//'`
lyx_release=`echo $lyx_patch | sed -e 's/[[^0-9]].*//'`
lyx_patch=`echo $lyx_patch | sed -e "s/^$lyx_release//" -e 's/^[[.]]//' -e 's/[[^0-9]].*//'`
test "x$lyx_patch" = "x" && lyx_patch=0
AC_SUBST(LYX_MAJOR_VERSION,$lyx_major)
AC_SUBST(LYX_MINOR_VERSION,$lyx_minor)
AC_SUBST(LYX_RELEASE_LEVEL,$lyx_release)
AC_SUBST(LYX_RELEASE_PATCH,$lyx_patch)
])

View File

@ -282,6 +282,13 @@ LIBS="$save_LIBS"
AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir) AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir)
AC_LANG_POP(C) AC_LANG_POP(C)
lyx_win_res=false;
case ${host} in
*mingw*|*cygwin*) lyx_win_res=true;;
esac
AM_CONDITIONAL(LYX_WIN_RESOURCE, $lyx_win_res)
LYX_SET_VERSION_INFO
AC_FUNC_SELECT_ARGTYPES AC_FUNC_SELECT_ARGTYPES
### Some information on what just happened ### Some information on what just happened
@ -402,6 +409,10 @@ AM_CONDITIONAL(MONOLITHIC_BOOST, test $enable_monolithic_boost = yes)
AC_DEFINE_UNQUOTED([LYX_DATE],"$LYX_DATE",[Date of release]) AC_DEFINE_UNQUOTED([LYX_DATE],"$LYX_DATE",[Date of release])
AC_DEFINE_UNQUOTED([VERSION_INFO],"$VERSION_INFO",[Full version info]) AC_DEFINE_UNQUOTED([VERSION_INFO],"$VERSION_INFO",[Full version info])
AC_DEFINE_UNQUOTED([LYX_MAJOR_VERSION],$lyx_major,[Major version number])
AC_DEFINE_UNQUOTED([LYX_MINOR_VERSION],$lyx_minor,[Minor version number])
AC_DEFINE_UNQUOTED([LYX_RELEASE_LEVEL],$lyx_release,[Release version number])
AC_DEFINE_UNQUOTED([LYX_RELEASE_PATCH],$lyx_patch,[Patch version number])
### Finish the work. ### Finish the work.
AC_CONFIG_FILES([Makefile AC_CONFIG_FILES([Makefile

View File

@ -40,6 +40,12 @@ lyx$(EXEEXT): $(FRONTENDS_PROGS)
rm -f $@ rm -f $@
$(LN_S) $< $@ $(LN_S) $< $@
if LYX_WIN_RESOURCE
.rc.o:
cp $(top_srcdir)/development/Win32/packaging/icons/lyx_*32x32.ico .
windres -I. --preprocessor "$(CPP) -xc-header -DRC_INVOKED" $< -o $@
endif
#lyx_LDFLAGS=-Wl,-O1 #lyx_LDFLAGS=-Wl,-O1
BUILT_SOURCES = $(PCH_FILE) BUILT_SOURCES = $(PCH_FILE)
@ -70,6 +76,10 @@ lyx_qt4_SOURCES = \
Thesaurus.cpp \ Thesaurus.cpp \
Thesaurus.h Thesaurus.h
if LYX_WIN_RESOURCE
lyx_qt4_SOURCES += lyxwinres.rc
endif
liblyxcore_la_SOURCES = \ liblyxcore_la_SOURCES = \
Author.cpp \ Author.cpp \
Author.h \ Author.h \

52
src/lyxwinres.rc Normal file
View File

@ -0,0 +1,52 @@
/* Icons */
IDI_ICON1 ICON DISCARDABLE "lyx_32x32.ico"
IDI_ICON2 ICON DISCARDABLE "lyx_doc_32x32.ico"
#include "config.h"
#include <winver.h>
#ifdef _WIN32
#define PLATFORM "Windows"
#define PRODNAME "LyX/Win"
#else
#define PLATFORM "Cygwin"
#define PRODNAME "LyX/Cygwin"
#endif
#if LYX_RELEASE_PATCH > 0
#define PATCH_TAG ".LYX_RELEASE_PATCH"
#else
#define PATCH_TAG ""
#endif
LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */
VS_VERSION_INFO VERSIONINFO
FILEVERSION LYX_MAJOR_VERSION,LYX_MINOR_VERSION,LYX_RELEASE_LEVEL,LYX_RELEASE_PATCH
PRODUCTVERSION LYX_MAJOR_VERSION,LYX_MINOR_VERSION,LYX_RELEASE_LEVEL,LYX_RELEASE_PATCH
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS 0x0L
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE 0x0L
{
BLOCK "StringFileInfo"
{
BLOCK "040904b0"
{
VALUE "FileDescription", "LyX for " PLATFORM "\0"
VALUE "OriginalFilename", "lyx.exe\0"
VALUE "CompanyName", "LyX Team\0"
VALUE "FileVersion", "LYX_MAJOR_VERSION.LYX_MINOR_VERSION.LYX_RELEASE_LEVEL" PATCH_TAG "\0"
VALUE "InternalName", "LyX\0"
VALUE "LegalCopyright", "Copyright \251 1995 by Matthias Ettrich, 1995-2006 LyX Team\0"
VALUE "ProductName", PRODNAME "\0"
VALUE "ProductVersion", PACKAGE_VERSION "\0"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x409, 1200
}
}