From 767a2fad9120f0cbbaa0cffae4ade1a9c46125ec Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 6 Apr 2023 22:25:20 +0200 Subject: [PATCH] Don't generate the Windows version resource The Windows version resource is compiled and can include the (generated) version.h header file for the definition of the version macros. There is no need to have it generated by autotools. Less generated files makes it easier to use other build systems, like Visual Studio. --- configure.ac | 1 - contrib/msvc/libdivecomputer.vcxproj | 12 +++++ src/Makefile.am | 2 +- src/libdivecomputer.rc | 68 ++++++++++++++++++++++++++++ src/libdivecomputer.rc.in | 45 ------------------ 5 files changed, 81 insertions(+), 47 deletions(-) create mode 100644 src/libdivecomputer.rc delete mode 100644 src/libdivecomputer.rc.in diff --git a/configure.ac b/configure.ac index 32496f6..e46f8f1 100644 --- a/configure.ac +++ b/configure.ac @@ -238,7 +238,6 @@ AC_CONFIG_FILES([ include/libdivecomputer/Makefile include/libdivecomputer/version.h src/Makefile - src/libdivecomputer.rc doc/Makefile doc/doxygen.cfg doc/man/Makefile diff --git a/contrib/msvc/libdivecomputer.vcxproj b/contrib/msvc/libdivecomputer.vcxproj index dbdb1e1..10dba0f 100644 --- a/contrib/msvc/libdivecomputer.vcxproj +++ b/contrib/msvc/libdivecomputer.vcxproj @@ -101,6 +101,9 @@ true Windows + + ..\..\include;%(AdditionalIncludeDirectories) + @@ -118,6 +121,9 @@ true Windows + + ..\..\include;%(AdditionalIncludeDirectories) + @@ -138,6 +144,9 @@ true true + + ..\..\include;%(AdditionalIncludeDirectories) + @@ -159,6 +168,9 @@ true true + + ..\..\include;%(AdditionalIncludeDirectories) + diff --git a/src/Makefile.am b/src/Makefile.am index 72961b8..9234ba7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,7 +103,7 @@ libdivecomputer.exp: libdivecomputer.symbols $(AM_V_GEN) sed -e '/^$$/d' $< > $@ .rc.lo: - $(AM_V_GEN) $(LIBTOOL) --silent --tag=CC --mode=compile $(RC) $(DEFS) $(DEFAULT_INCLUDES) $< -o $@ + $(AM_V_GEN) $(LIBTOOL) --silent --tag=CC --mode=compile $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS) $< -o $@ libdivecomputer.lo: revision.h diff --git a/src/libdivecomputer.rc b/src/libdivecomputer.rc new file mode 100644 index 0000000..1441085 --- /dev/null +++ b/src/libdivecomputer.rc @@ -0,0 +1,68 @@ +/* + * libdivecomputer + * + * Copyright (C) 2010 Jef Driesen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include + +#ifdef HAVE_VERSION_SUFFIX +#include "revision.h" +#endif + +VS_VERSION_INFO VERSIONINFO +FILEVERSION DC_VERSION_MAJOR,DC_VERSION_MINOR,DC_VERSION_MICRO,0 +PRODUCTVERSION DC_VERSION_MAJOR,DC_VERSION_MINOR,DC_VERSION_MICRO,0 +FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef HAVE_VERSION_SUFFIX +FILEFLAGS VS_FF_PRERELEASE +#else +FILEFLAGS 0 +#endif +FILEOS VOS__WINDOWS32 +FILETYPE VFT_DLL +FILESUBTYPE 0 +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "The libdivecomputer developers" + VALUE "FileDescription", "A library for communication with various dive computers." + VALUE "FileVersion", DC_VERSION + VALUE "InternalName", "libdivecomputer" + VALUE "LegalCopyright", "Copyright © 2010 Jef Driesen" + VALUE "OriginalFilename", "libdivecomputer.dll" + VALUE "ProductName", "libdivecomputer" + VALUE "ProductVersion", DC_VERSION +#ifdef HAVE_VERSION_SUFFIX + VALUE "Comments", DC_VERSION_REVISION +#endif + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 1033, 1200 + END +END diff --git a/src/libdivecomputer.rc.in b/src/libdivecomputer.rc.in deleted file mode 100644 index f98d2ed..0000000 --- a/src/libdivecomputer.rc.in +++ /dev/null @@ -1,45 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include - -#ifdef HAVE_VERSION_SUFFIX -#include "revision.h" -#endif - -VS_VERSION_INFO VERSIONINFO -FILEVERSION @DC_VERSION_MAJOR@,@DC_VERSION_MINOR@,@DC_VERSION_MICRO@,0 -PRODUCTVERSION @DC_VERSION_MAJOR@,@DC_VERSION_MINOR@,@DC_VERSION_MICRO@,0 -FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef HAVE_VERSION_SUFFIX -FILEFLAGS VS_FF_PRERELEASE -#else -FILEFLAGS 0 -#endif -FILEOS VOS__WINDOWS32 -FILETYPE VFT_DLL -FILESUBTYPE 0 -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "The libdivecomputer developers" - VALUE "FileDescription", "A library for communication with various dive computers." - VALUE "FileVersion", "@VERSION@" - VALUE "InternalName", "libdivecomputer" - VALUE "LegalCopyright", "Copyright © 2010 Jef Driesen" - VALUE "OriginalFilename", "libdivecomputer.dll" - VALUE "ProductName", "libdivecomputer" - VALUE "ProductVersion", "@VERSION@" -#ifdef HAVE_VERSION_SUFFIX - VALUE "Comments", DC_VERSION_REVISION -#endif - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 1033, 1200 - END -END