Bug 350511

Summary: emerge frameworks fails on build of win32libs/gpg-error
Product: kde-windows Reporter: Jeff <jeffjl.kde>
Component: buildsystemAssignee: KDE-Windows <kde-windows>
Status: RESOLVED UNMAINTAINED    
Severity: grave CC: zrax0111
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description Jeff 2015-07-22 17:47:53 UTC
There seems to be something wrong with the .awk files that construct the mkerrcodes.h file.  But whatever the cause, the mkerrcodes.h file ends up with invalid syntax and generates errors when included in the mkerrcodes.c file and compiled. (I'm using mingw.)  The mkerrcodes.h file contains structure initialization lines like:

{ , "GPG_ERR_E2BIG" },

where there is supposed to be a number before the first comma.

Reproducible: Always

Steps to Reproduce:
1. 'emerge qt' has already completed, and much of 'emerge frameworks' has completed
2. Use either 'emerge frameworks' or 'emerge --update gpg-error'
3.

Actual Results:  
About 110 occurrences of:

'R:/build/win32libs/gpg-error/work/mingw-w64-RelWithDebInfo-1.12/mkerrcodes.h:105:5: error: expected expression before ',' token

for all of the "{ , "GPG_ERR_*" }," lines.

Then emerge ends.

Expected Results:  
Completed build of gpg-error

I am running Window 8.1.  This system has never had any KDE installation on it before. I'm generally following the instructions from  https://techbase.kde.org/Getting_Started/Build/Windows
Comment 1 Michael 2015-07-23 07:21:12 UTC
GCC 5.x changes the preprocessor output, which breaks gpg-error's automatic header generation (there are other threads about this online -- it's not just MinGW that's broken).  What I did to get around it was to modify the cmake patch to add the -P option to GCC.

    diff --git a/portage/win32libs/gpg-error/libgpg-error-cmake-1.12.diff b/portage/win32libs/gpg-error/libgpg-error-cmake-1.12.diff
    index e2d6e9a..ab389a1 100644
    --- a/portage/win32libs/gpg-error/libgpg-error-cmake-1.12.diff
    +++ b/portage/win32libs/gpg-error/libgpg-error-cmake-1.12.diff
    @@ -52,10 +52,10 @@ diff -Nru -x '*~' libgpg-error-1.12.orig/CMakeLists.txt libgpg-error-1.12/CMakeLists.txt
     +
     +# if set, TARGET_CPP is the compiler of the target platform
     +if(TARGET_CPP)
    -+    set(ERR_COMPILER ${TARGET_CPP})
    ++    set(ERR_COMPILER ${TARGET_CPP} -P)
     +    set(INCLUDE_STRING "%TARGET_INCLUDE%")
     +else(TARGET_CPP)
    -+    set(ERR_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
    ++    set(ERR_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} -P)
     +      set(HOST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
     +    set(INCLUDE_STRING "%INCLUDE%")
     +endif(TARGET_CPP)

However, that is probably not portable to MSVC...
Comment 2 Jeff 2015-07-23 13:57:47 UTC
Thank you. The -P fix got me past that problem.
Comment 3 Justin Zobel 2021-03-09 23:01:49 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.