diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4 index 4eb93d755b..35344d78ad 100644 --- a/config/lyxinclude.m4 +++ b/config/lyxinclude.m4 @@ -714,3 +714,20 @@ do break], [AC_MSG_RESULT(no)]) 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) +]) diff --git a/configure.ac b/configure.ac index decd65edd0..2be419db4e 100644 --- a/configure.ac +++ b/configure.ac @@ -282,6 +282,13 @@ LIBS="$save_LIBS" AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir) 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 ### 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([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. AC_CONFIG_FILES([Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 23f41e3158..c275a12eb9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -40,6 +40,12 @@ lyx$(EXEEXT): $(FRONTENDS_PROGS) rm -f $@ $(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 BUILT_SOURCES = $(PCH_FILE) @@ -70,6 +76,10 @@ lyx_qt4_SOURCES = \ Thesaurus.cpp \ Thesaurus.h +if LYX_WIN_RESOURCE +lyx_qt4_SOURCES += lyxwinres.rc +endif + liblyxcore_la_SOURCES = \ Author.cpp \ Author.h \ diff --git a/src/lyxwinres.rc b/src/lyxwinres.rc new file mode 100644 index 0000000000..8a093a5ed4 --- /dev/null +++ b/src/lyxwinres.rc @@ -0,0 +1,52 @@ +/* Icons */ +IDI_ICON1 ICON DISCARDABLE "lyx_32x32.ico" +IDI_ICON2 ICON DISCARDABLE "lyx_doc_32x32.ico" + +#include "config.h" +#include + +#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 + } +} +