Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <3A0A3AF6.5B0DF5F4@ece.gatech.edu> Date: Thu, 09 Nov 2000 00:49:42 -0500 From: "Charles S. Wilson" X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: cygwin AT sources DOT redhat DOT com Subject: [avail for test] ncurses-5.2-1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I've just uploaded ncurses-5.2-1 to sourceware. USE A MIRROR -- the ones listed in the INSTALLATION section have been verified up-to-date with ncurses. ncurses is marked as a 'test' release, so you may have to specifically select it in setup to install (see INSTALLATION below). I need some help debugging C++/dll issues; but the C/dll's work fine as do the C and C++ static libraries. Search for "HELP HELP HELP" below. The ncurses pacakge provides several libraries of routines for handling consoles and text-based displays. o CONFLICTS!!! known conflicts: termcap package /usr/include/termcap.h clear package /usr/bin/clear.exe Backup these files BEFORE installing the ncurses package; ncurses will overwrite them. You have been warned. o After installing, please read /usr/doc/Cygwin/ncurses-5.2.README o (Full build instructions included in source distro; overview only here) The build procedure for static libs is very straightforward. However, building the dlls requires an odd "./configure" THEN patch, then build sequence. This is my typical way of dll-izing a new package, at first -- get it working, then clean it up. Normally I don't release until it's clean, but I'm stuck and need some help (more below). If you look at my other packages (zlib, libpng, etc) the procedure is "./configure; make" and poof! Both static libs and dlls are built, plus two versions of each utility/test program -- one statically linked and one dynamically. We're at the 'get it working' stage right now, so the build process isn't quite as streamlined. o There are two patches: one that is already applied in the source archive ncurses-5.2-1-src.tar.gz. It munges all the headers and C files so that functions and variables are declared using , __declspec(dllexport), or __declspec(dllimport), as appropriate, depending on -DNCURSES_STATIC / -DNCURSES_DLL / . That patch is over 400k. The second, much smaller patch, are the Makefile-specific changes necessary ONLY when building the dll's and dll-dependent executable (this one must be applied only AFTER doing a ./configure). Anyway, I've put in quite a bit of work on this package, but I can't go any further without outside help (see HELP HELP HELP below). o The binary package DOES contain static libs, import libs, and dlls for all of the libraries in the ncurses package, plus statically and dynamically linked versions of all test and utility programs. Some variants are in subdirectories of /usr/bin: /usr/bin/* dynamically linked version of the utility programs also, the dll's /usr/bin/ncurses-stat/* statically linked versions of the utility programs /usr/bin/ncurses-test-dll/* dynamically linked versions of the test programs /usr/bin/ncurses-test-stat/* statically linked versions of the test programs o Nothing is stripped, so that debugging is easier -- but it means the download is huge. ------------------------------------------------------ o My tests show: - the statically linked programs which depend on the C libraries all seem to work just as well as the ncurses-5.0 distribution at cygutils. There are a *few* imperfections (like testscanw.exe doesn't work) -- but these failures are not new. So, I conclude that the static versions of the C libraries (libncurses.a, libpanel.a, libform.a, libmenu.a) are all A-OK. - the one program which links to the C++ library, (demo.exe links to libncurses++), works fine when statically linked. I conclude that libncurses++.a is A-OK. - the dynamically linked programs which depend on the C libraries all work identically to their statically linked counterparts. So, I conclude that the dll versions of the C libraries (cygncurses5.dll, cygpanel5.dll, cygform5.dll, and cygmenu5.dll, with their respective import libraries) are all A-OK. HELP HELP HELP HELP HELP HELP - Big problems when dynamically linking the one program that exercises the C++ library. demo.cc does NOT have a main() function -- it relies on global static initializers to bootstrap itself. This works okay when linking statically, but ld fails to link when trying to link demo.exe dynamically. To get around this, I added a kludged main() function to demo.cc (which is ONLY #defined when (a) __CYGWIN__ and (b) linking dynamically). After doing that, I could link demo.exe dynamically. However, it coredumps when I run it. I do not know if the problem is: o my stupid main() is wrong o the C++ dll, cygncurses++5.dll, is somehow messed up o cygwin binutils can't handle static initializes + dlls o some other explanation. o some or all of the above This is the problem I need help fixing or understanding -- I don't know C++ well enough to figure this out. Some valuable tests: o somebody please write your own program which requires libncurses++ but does NOT use global static initializers. Link it statically and verify operation. Link it dynamically and verify (?) operation. This will prove (?) that the problem is demo.cc, not cygncurses++5.dll. o fix my kludgy main() in demo.cc -- I may have done something stupid; I really don't know what I'm doing here. Get it to 'work' with the existing cygncurses++5.dll if possible. This will prove (?) that the problem is my stupid main(), and not cygncurses++5.dll. o Explain why global static initializers + dlls + cygwin-binutils doesn't work, when global static initializes + cygwin-binutils with NO dlls does work. FWIW, the 'kludge' main() in demo.cc is this: #if !defined(__CYGWIN__) static TestApplication Demo; #else # if defined(NCURSES_STATIC) static TestApplication Demo; # else int main() { TestApplication * Demo = new TestApplication(); Demo->run(); return 0; } # endif #endif The original was just: static TestApplication Demo; ------------------------------------------------------ o follows new naming scheme for dlls /usr/lib/libncurses.dll.a (import lib) /usr/lib/libcurses.dll.a --> libncurses.dll.a /usr/lib/libpanel.dll.a (import lib) /usr/lib/libmenu.dll.a (import lib) /usr/lib/libform.dll.a (import lib) /usr/lib/libncurses++.dll.a (import lib) /usr/lib/libncurses.a (static lib) /usr/lib/libcurses.a --> libncurses.a /usr/lib/libpanel.a (static lib) /usr/lib/libmenu.a (static lib) /usr/lib/libform.a (static lib) /usr/lib/libncurses++.a (static lib) /usr/bin/cygncurses5.dll (dll) /usr/bin/cygpanel5.dll (dll) /usr/bin/cygmenu5.dll (dll) /usr/bin/cygform5.dll (dll) /usr/bin/cygncurses++5.dll (dll) INSTALLATION: To update your installation, click on the "Install Cygwin now" link on the http://sources.redhat.com/cygwin web page. This downloads setup.exe to your system. FIRST BACK UP /usr/bin/clear.exe and /usr/include/termcap.h ! Run setup and answer all of the questions. PLEASE, PLEASE, PLEASE choose a mirror site for your download. The 'sources.redhat.com' site is badly overloaded. The mirrors below have the latest version of this package: ftp://ftp.freesoftware.com/pub/sourceware/cygwin/ (US) ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin/mirrors/cygnus/ (Germany) ftp://ftp.ntua.gr/pub/pc/cygwin/ (Greece) The setup.exe program will figure out what needs to be updated on your system and should install the less package automatically. To install this Test version of ncurses you'll have to tell setup.exe to specifically install it by clicking on the arrows to the left of the ncurses package line until "Test" shows up. You may need to click on the "Full/Part" button in the upper right corner of the the setup screen to get ncurses to show up in the list. --Chuck Wilson -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com