-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: include manifests in .rc files #3173
base: master
Are you sure you want to change the base?
Conversation
I'm not familiar with the detailed process of how these pieces fit together on Windows. Do you have some internet ressource with background information on this? In particular, I wonder what the digit in front of |
Background information is here, but I am also don't clearly understand how it works. Particularly, I tried to generate manifests automatically with
Explanation is here. |
This changeset looks reasonable then, thank you. Is there anything missing to complete this draft? |
Oh, I see. There is a build failure using the nmake files: lib /nologo /machine:x86 /out:pkcs15init.lib pkcs15-lib.obj profile.obj pkcs15-cflex.obj pkcs15-cardos.obj pkcs15-starcos.obj pkcs15-oberthur.obj pkcs15-oberthur-awp.obj pkcs15-setcos.obj pkcs15-muscle.obj pkcs15-asepcos.obj pkcs15-rutoken.obj pkcs15-entersafe.obj pkcs15-rtecp.obj pkcs15-myeid.obj pkcs15-authentic.obj pkcs15-iasecc.obj pkcs15-epass2003.obj pkcs15-openpgp.obj pkcs15-sc-hsm.obj pkcs15-isoApplet.obj pkcs15-gids.obj
NMAKE : fatal error U1073: don't know how to make '..\..\win32\versioninfo.res'
Stop.
NMAKE : fatal error U1073: don't know how to make '..\..\src\libopensc\opensc_a.lib'
Stop.
NMAKE : fatal error U1073: don't know how to make '..\..\src\libopensc\opensc.lib'
Stop.
NMAKE : fatal error U1073: don't know how to make '..\..\src\libopensc\opensc_a.lib'
Stop.
NMAKE : fatal error U1073: don't know how to make '..\..\src\libopensc\opensc_a.lib'
Stop.
NMAKE : fatal error U1077: 'for' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'for' : return code '0x2'
Stop.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also it would be nice to rename files accordingly.
versioninfo-pkcs11.rc.in -> opensc-pkcs11.rc.in
exe.manifest -> opensc-tools.manifest
src/pkcs11/versioninfo-pkcs11.rc.in
Outdated
@@ -37,7 +37,7 @@ BEGIN | |||
END | |||
|
|||
#ifndef __MINGW32__ | |||
2 RT_MANIFEST "@abs_top_srcdir@\\src\\pkcs11\\opensc-pkcs11.dll.manifest" | |||
2 RT_MANIFEST "..\\..\\src\\pkcs11\\opensc-pkcs11.dll.manifest" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to @abs_top_srcdir@ intentionally to support out-of-source builds (Meson does not support in-source builds by design). Why have you changed it back?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to hint this in the commit message. All previous CI runs failed, for example this one, because when we use nmake, we run ./configure
in a cygwin environment, which replaces abs_top_srcdir
with the cygpath. However, when we build the files with nmake, only actual windows paths must be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I see. We have three options here:
- Use native Cygwin's
windres
to compile resources; - Introduce a new substitution variable with a correct path (is it possible to do in
configure.ac
?). On Cygwin we should callcygpath
to get the correct path; - Close this PR and create separate .rc files with manifests for Meson only.
I personally vote for the third point, because it is relatively simple to implement (for me). What do you think?
Could you try the following? diff --git a/configure.ac b/configure.ac
index b8224b5de..1bdbc9a01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -980,6 +980,15 @@ if test "${enable_sm}" = "yes"; then
esac
fi
+case "${host}" in
+ *-winnt*|*-cygwin*)
+ win_abs_top_srcdir="$(cygpath --windows $(realpath ${srcdir}))"
+ ;;
+ *)
+ win_abs_top_srcdir="$(realpath ${srcdir})"
+ ;;
+esac
+
if test "${with_pkcs11_provider}" = "detect"; then
if test "${WIN32}" != "yes"; then
DEFAULT_PKCS11_PROVIDER="${libdir}/opensc-pkcs11${DYN_LIB_EXT}"
@@ -1126,6 +1135,7 @@ AC_SUBST([PROFILE_DIR_DEFAULT])
AC_SUBST([OPTIONAL_NOTIFY_CFLAGS])
AC_SUBST([OPTIONAL_NOTIFY_LIBS])
AC_SUBST([TIDY_CHECKS])
+AC_SUBST([win_abs_top_srcdir])
AM_CONDITIONAL([ENABLE_MAN], [test "${enable_man}" = "yes"])
AM_CONDITIONAL([ENABLE_THREAD_LOCKING], [test "${enable_thread_locking}" = "yes"])
diff --git a/src/minidriver/versioninfo-minidriver.rc.in b/src/minidriver/versioninfo-minidriver.rc.in
index 4844a14b0..fede775a8 100644
--- a/src/minidriver/versioninfo-minidriver.rc.in
+++ b/src/minidriver/versioninfo-minidriver.rc.in
@@ -5,9 +5,9 @@
#define IDI_SMARTCARD 102
#ifndef __MINGW32__
-IDI_SMARTCARD ICON "..\\..\\win32\\DDORes.dll_14_2302.ico"
+IDI_SMARTCARD ICON "@win_abs_top_srcdir@\\win32\\DDORes.dll_14_2302.ico"
#else
-IDI_SMARTCARD ICON "../../win32/DDORes.dll_14_2302.ico"
+IDI_SMARTCARD ICON "@win_abs_top_srcdir@/win32/DDORes.dll_14_2302.ico"
#endif
VS_VERSION_INFO VERSIONINFO
diff --git a/src/tools/versioninfo-opensc-notify.rc.in b/src/tools/versioninfo-opensc-notify.rc.in
index 3b01d660b..7a895ec5e 100644
--- a/src/tools/versioninfo-opensc-notify.rc.in
+++ b/src/tools/versioninfo-opensc-notify.rc.in
@@ -5,9 +5,9 @@
#define IDI_SMARTCARD 102
#ifndef __MINGW32__
-IDI_SMARTCARD ICON "..\\..\\win32\\DDORes.dll_14_2302.ico"
+IDI_SMARTCARD ICON "@win_abs_top_srcdir@\\win32\\DDORes.dll_14_2302.ico"
#else
-IDI_SMARTCARD ICON "../../win32/DDORes.dll_14_2302.ico"
+IDI_SMARTCARD ICON "@win_abs_top_srcdir@/win32/DDORes.dll_14_2302.ico"
#endif
VS_VERSION_INFO VERSIONINFO |
a1a7a48
to
a69ab9e
Compare
Could you explain the failure in MinGW? |
It's definitely some conflict in rules. Autotools needs to generate I renamed the file to |
If that helps, OK, but then I think you can equally stick to the |
The prefix |
This avoids using MSVC-specific
mt.exe
orlink.exe
and simplify building for MinGW and Cygwin.