Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

New Variable to support wx-config in MSys2 MinGW

<< < (2/9) > >>

ollydbg:
There is a command named "cygpath", which can do such convert


--- Code: ---F:\code>cygpath -m F:\code\msys2-64\mingw64\
F:/code/msys2-64/mingw64/
--- End code ---

So, either we can define a new variable like "TARGET_COMPILER_DIR_UNIX_SEP" or we may use the cygpath command some where.

ollydbg:

--- Code: ---F:\code>sh.exe -c 'wx-config-3.1 --prefix=`cygpath -m F:\code\msys2-64\mingw64\ ` --libs all'
-LF:codemsys2-64mingw64/lib   -pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high -Wl,--subsystem,windows -mwindows -lwx_mswu_xrc-3.1 -lwx_mswu_webview-3.1 -lwx_mswu_stc-3.1
 -lwx_mswu_richtext-3.1 -lwx_mswu_ribbon-3.1 -lwx_mswu_propgrid-3.1 -lwx_mswu_aui-3.1 -lwx_mswu_gl-3.1 -lwx_mswu_html-3.1 -lwx_mswu_qa-3.1 -lwx_mswu_core-3.1 -lwx_baseu_xml-3.1 -lwx_baseu_net-3.1 -lwx
_baseu-3.1


--- End code ---

This works, but please note that there is a space after the string "F:\code\msys2-64\mingw64\". Also, I don't know how to do this inside the C::B build option.

stahta01:
Could not find what I thought I did.
But, I found a more complex solution.

Your stuff will likely fail to work; but, try doing it. Maybe you have better luck; I really do not know CB scripting and I think it might be simple using CB scripting.

If you want a better fix than fix the below so it works in setting a custom variable.

--- Code: ---$TO_UNIX_PATH{$(TARGET_COMPILER_DIR)}

--- End code ---

Everything I try failed to work in setting a custom variable; the two lines work patch I posted yesterday.
I just recalled the changing of TARGET_COMPILER_DIR patch was posted by someone else.
I cannot remember who did it; but, it just changed the "\"  to "/" and I think it removed the trailing slash.

Tim S.

stahta01:

--- Code: ---Index: src/sdk/macrosmanager.cpp
===================================================================
--- src/sdk/macrosmanager.cpp (revision 12814)
+++ src/sdk/macrosmanager.cpp (working copy)
@@ -394,6 +394,8 @@
             wxFileName MasterPath;
             MasterPath.SetPath(c->GetMasterPath(), wxPATH_NATIVE);
             m_Macros[_T("TARGET_COMPILER_DIR")] = MasterPath.GetPathWithSep(wxPATH_NATIVE);
+            m_Macros[_T("TARGET_COMPILER_UNIX_PATH")] = MasterPath.GetVolume() +
+                     MasterPath.GetVolumeSeparator() + MasterPath.GetPath(wxPATH_GET_VOLUME, wxPATH_UNIX);
         }
         m_Macros[_T("TARGET_OBJECT_DIR")] = target->GetObjectOutput();
     }

--- End code ---

I am building CB with the above patch; no idea if it will work; but, the wxWidgets directions implies it might.

Edit: It worked in the wx 3.1 minimal test project. No idea what it will do under wxWidgets 3.0 or under Linux.
Edit2: WX_CONFIG=wx-config-3.1 --prefix=$(TARGET_COMPILER_UNIX_PATH)

Tim S.

ollydbg:
Hi, Tim, you method works under C::B.

I just add the below line to the linker option:


--- Code: ---`sh.exe -c 'wx-config-3.1 --prefix=$TO_UNIX_PATH{$(TARGET_COMPILER_DIR)} --libs all'`

--- End code ---

and the linker works correctly(it link to the wx library supplied by msys2).

So, is the patch below still needed?


--- Quote from: stahta01 on May 19, 2022, 09:36:32 am ---
--- Code: ---Index: src/sdk/macrosmanager.cpp
===================================================================
--- src/sdk/macrosmanager.cpp (revision 12814)
+++ src/sdk/macrosmanager.cpp (working copy)
@@ -394,6 +394,8 @@
             wxFileName MasterPath;
             MasterPath.SetPath(c->GetMasterPath(), wxPATH_NATIVE);
             m_Macros[_T("TARGET_COMPILER_DIR")] = MasterPath.GetPathWithSep(wxPATH_NATIVE);
+            m_Macros[_T("TARGET_COMPILER_UNIX_PATH")] = MasterPath.GetVolume() +
+                     MasterPath.GetVolumeSeparator() + MasterPath.GetPath(wxPATH_GET_VOLUME, wxPATH_UNIX);
         }
         m_Macros[_T("TARGET_OBJECT_DIR")] = target->GetObjectOutput();
     }

--- End code ---

I am building CB with the above patch; no idea if it will work; but, the wxWidgets directions implies it might.

Edit: It worked in the wx 3.1 minimal test project. No idea what it will do under wxWidgets 3.0 or under Linux.
Edit2: WX_CONFIG=wx-config-3.1 --prefix=$(TARGET_COMPILER_UNIX_PATH)

Tim S.

--- End quote ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version