-
Notifications
You must be signed in to change notification settings - Fork 103
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
Minimum required patches for building ncurses libraries on Visual Studio #1
Conversation
1670ae4
to
431b524
Compare
The |
@ThomasDickey |
I haven't tested with msvc yet, but current code seems to work with mingw. Compiler warning made me notice an error in one |
3e86274
to
af356da
Compare
af356da
to
98edd28
Compare
I've updated the patches. The The same goes for the other error: |
98edd28
to
f8fc473
Compare
yes, I'm aware of this, but the lib_gen.c change will not produce a working library (just something that compiles). I've been setting up a development environment to work on this, but am not done. |
f8fc473
to
a92f020
Compare
Defining |
Things these patches fix:
appveyor ci: https://ci.appveyor.com/project/madebr/ncurses/builds/33060824 TODO (What is not fixed/untouched)
The output is: /bin/sh ./run_tic.sh
** Building terminfo database, please wait...
Running tic to install C:/Users/maarten/.conan/data/ncurses/6.2-20200516/_/_/package/911e47335817cd75de61d9b47c4d68a137801d08/share/terminfo ...
You may see messages regarding extended capabilities, e.g., AX.
These are extended terminal capabilities which are compiled
using
tic -x
If you have ncurses 4.2 applications, you should read the INSTALL
document, and install the terminfo without the -x option.
ncurses 6.2.20200516
"terminfo.tmp", line 1115, col 36, terminal 'fbterm': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 4839, col 36, terminal 'xterm+256color': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 4858, col 36, terminal 'xterm+256setaf': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 4902, col 25, terminal 'xterm+direct2': limiting value of `colors' from 0x1000000 to 0x7fff
"terminfo.tmp", line 4902, col 40, terminal 'xterm+direct2': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 4917, col 25, terminal 'xterm+direct': limiting value of `colors' from 0x1000000 to 0x7fff
"terminfo.tmp", line 4917, col 40, terminal 'xterm+direct': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 4939, col 25, terminal 'xterm+indirect': limiting value of `colors' from 0x1000000 to 0x7fff
"terminfo.tmp", line 4939, col 40, terminal 'xterm+indirect': limiting value of `pairs' from 0x10000 to 0x7fff
"terminfo.tmp", line 7710, col 36, terminal 'dvtm-256color': limiting value of `pairs' from 0x10000 to 0x7fff
? tic could not build C:/Users/maarten/.conan/data/ncurses/6.2-20200516/_/_/package/911e47335817cd75de61d9b47c4d68a137801d08/share/terminfo |
92f42b3
to
cf9de8b
Compare
Referring to the packaging_patches branch, some of those have been addressed:
These are the ones that I'm considering:
The problem that I see in these is that they change longstanding public-use header files, making them dependent upon a different build configuration. I'm considering how to solve the problem without breaking compatibility. This patch is solving a problem which probably should be done outside ncurses: These don't look suitable for inclusion in ncurses: |
See c976a90#diff-f425a63d0f18f4bbd666c1086bac3b6d for the other change.
Using MSVC, these changes can be avoided by using module-definition (.def) files. See https://www.gnu.org/software/gnulib/manual/html_node/Exported-Symbols-of-Shared-Libraries.html#Exported-Symbols-of-Shared-Libraries,
Yes, because this patch creates a script that will link object files to an executable.
I totally agree. |
hmm - at the moment I'm test-building the mingw stuff, to review, etc. (I didn't find time to test with msvc, too many distractions recently). |
Today I tried the full set of changes, noticed redefinition warnings (in the import/export stuff), backed out those changes for now, but added the |
Cool! While you're looking at exporting symbols on mingw, |
I was using gcc-10 on Debian/testing. Regarding libtool, I have a different to-do (fixing build problems with the gnat/Ada95), but I mostly build without libtool. However I have a scripted build for that configuration which I work on. The |
Please don't feel obligated to work under a deadline to fix this problem.. Through debugging, I found out what caused the The msdn documentation for access only describes R_OK and W_OK. Looking at the definition of access, it looks like its usage is discouraged. So perhaps its use should be reduced (or even removed). Patching out the use of |
For |
I changed In #1 (comment), you were talking about errors. |
In today's patch (20200704), I'm adding most of this, except:
So you might want to merge and see what remaining changes (such as "access") should be proposed. |
In today's patch, I (think I) addressed these issues (except, reviewing now -- user32). However, I see that my native-MinGW builds fail in linking the test-programs (from last week's update), so I'll be making some fixes in that area. |
ad94c7c
to
f235aed
Compare
Indeed, a lot of problems are fixed in this last patch release.
Results on CI: https://ci.appveyor.com/project/madebr/ncurses/builds/34055899 |
I see (am reviewing the changes now). Adding I found that not adding NCURSES_STATIC to the test-makefile in my native MinGW build was the problem I had from last week, so I filled out If conan doesn't have |
f235aed
to
c014f3f
Compare
I understand. Sorry for that. It would be nice if libtool had some way to divert options to shared/static builds.
You probably saw a lot of
Indeed, I did not pass Anyway, only a small change to Apart from the test fix, I don't have any further problems with building ncurses on MSVC. Do you know of any configuration options that I may not have tested and could cause problems on MSVC? |
I don't see anything obvious overlooked. In yesterday's update, I only saw one place (removing CFLAGS from the linker in the test-directory) which I didn't see as necessary. |
I think the Ideally, it should be added to BUILD_LDFLAGS when built as a shared library, and added to But adding it only to |
I'm puzzled regarding the |
I made that comment because, when creating shared libraries, only I'm not really home in your usage of |
I'm adding a special case for user32.lib (pre-setting it before CF_BUILD_CC), and improving the |
The conanfile contains the complete build script. if self.settings.os == "Windows":
self._autotools.defines.append("_WIN32")
if self.settings.arch == "x86_64":
self._autotools.defines.append("_WIN64") I'm not sure whether these are really needed. |
7c8e194
to
b084be6
Compare
appveyor ci of this pr should become available at https://ci.appveyor.com/project/madebr/ncurses/builds/34668185
|
d636745
to
58db8da
Compare
I just wanted to point out that all jobs on appveyor are now succeeding as Conan now has a tsearch implementation available. |
sounds good. The case statement would be simpler as I did that before digging into Juergen's changes. Those will take a few days of development before they're ready (perhaps by next weekend). |
Thanks for helping me upstream these patches. |
sounds good - you can make a new pull request to handle regressions or new features |
+ add test/back_ground.c, to exercise the wide-character background functions. + add a check in _nc_build_wch() in case the background character is a wide-character, rather than a new part of a multibyte character. + improve tracemunch's coverage of form/menu/panel libraries. + improve tracemunch's checking/reporting the type for the first parameter, e.g., "WINDOW*" rather than "#1".
These patches are the minimum required patches to let me build the ncurses libraries on Windows using Visual Studio.
I created these while trying to package ncurses 6.2 for conan.
My WIP scripts can be found at https://github.com/madebr/conan-center-index/tree/ncurses/recipes/ncurses/all
Building for Visual Studio was causing some problems because it is missing some features.
This patchset adds workarounds for building the ncurses libraries.
What these patches do not fix is biuilding shared ncurses shared libraries (dlls) on Windows.
NCURSES_IMPEXP
is defined globally and is the same for every ncurses sublibrary.Whereas each sublibrary must have its own definition.
What I mean is that when building libmenu, a preprocessor variable
LIBMENU_IMPEXP
must be__declspec(dllexport)
butNCURSES_IMPEXP
must be__declspec(dllimport)
.