Kaydet (Commit) e0d94237 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use Executable_cpp instead of default gcc as preprocessor for windres

...to avoid having GCC as yet another prerequisite on Windows.

Cygwin 'man windres' states:  "The default preprocessor argument is 'gcc -E
-xc-header -DRC_INVOKED'."  Of those arguments, -E and -xc-header are not
relevant for Executable_cpp, so only -DRC_INVOKED is kept.

Additional arguments that turned out to be necessary are:

-I$(ATL_INCLUDE)
So that
  #include <afxres.h>
in workdir/UnpackedTarball/libgpg-error/src/versioninfo.rc is found.  (Not sure
how the original code using gcc found this.)

-+
So that using a C++ style comment in
  #include "winres.h"           // extract from windows header
in afxres.h does not cause a "Syntax error in #include" from Executable_cpp.

$(SOLARINC)
So that
   #include "winres.h"           // extract from windows header
in afxres.h is found.  (Not sure how the original code using gcc found this.)

-DWINAPI_FAMILY=0
Because dlgs.h (included indirectly from afxres.h) contains
  #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  [...]
  typedef struct tagCRGB
  {
      BYTE    bRed;
      BYTE    bGreen;
      BYTE    bBlue;
      BYTE    bExtra;
  } CRGB;           /* RGB Color */
and the WINAPI_FAMILY_PARTITION conditional (defined in winapifamily.h) would be
true, causing the output to contain those "typedef struct tagCRGB ..." tokens
that windres apparently doesn't expect (failing with "windres: can't open file
`tagCRGB': No such file or directory").  (Not sure how the original code using
gcc avoided this.)

Change-Id: Ic2d031c72025f2e9dbde26c774215d2d2d0a43a9
Reviewed-on: https://gerrit.libreoffice.org/45334Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst ecd683d3
......@@ -21,7 +21,7 @@ $(eval $(call gb_ExternalProject_use_externals,gpgmepp,\
))
ifeq ($(COM),MSC)
$(call gb_ExternalProject_get_state_target,gpgmepp,build):
$(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Executable_get_target,cpp)
$(call gb_ExternalProject_run,build,\
autoreconf \
&& ./configure \
......@@ -39,6 +39,7 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build):
$(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS))' \
--host=$(if $(filter INTEL,$(CPUNAME)),i686-mingw32,x86_64-w64-mingw32) \
MAKE=$(MAKE) \
RC='windres --preprocessor='\''$(call gb_Executable_get_target,cpp) -+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC) -I$(ATL_INCLUDE)'\' \
&& $(MAKE) \
)
else
......
......@@ -20,7 +20,7 @@ $(eval $(call gb_ExternalProject_use_externals,libassuan,\
))
ifeq ($(COM),MSC)
$(call gb_ExternalProject_get_state_target,libassuan,build):
$(call gb_ExternalProject_get_state_target,libassuan,build): $(call gb_Executable_get_target,cpp)
$(call gb_ExternalProject_run,build,\
autoreconf \
&& ./configure \
......@@ -32,6 +32,7 @@ $(call gb_ExternalProject_get_state_target,libassuan,build):
GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \
--host=$(if $(filter INTEL,$(CPUNAME)),i686-mingw32,x86_64-w64-mingw32) \
MAKE=$(MAKE) \
RC='windres --preprocessor='\''$(call gb_Executable_get_target,cpp) -+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC) -I$(ATL_INCLUDE)'\' \
&& $(MAKE) \
)
......
......@@ -16,7 +16,7 @@ $(eval $(call gb_ExternalProject_register_targets,libgpg-error,\
$(eval $(call gb_ExternalProject_use_autoconf,libgpg-error,build))
ifeq ($(COM),MSC)
$(call gb_ExternalProject_get_state_target,libgpg-error,build):
$(call gb_ExternalProject_get_state_target,libgpg-error,build): $(call gb_Executable_get_target,cpp)
$(call gb_ExternalProject_run,build,\
MAKE=$(MAKE) ./configure \
--enable-static \
......@@ -29,6 +29,7 @@ $(call gb_ExternalProject_get_state_target,libgpg-error,build):
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
--host=$(if $(filter INTEL,$(CPUNAME)),i686-mingw32,x86_64-w64-mingw32) \
RC='windres --preprocessor='\''$(call gb_Executable_get_target,cpp) -+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC) -I$(ATL_INCLUDE)'\' \
&& $(MAKE) \
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment