Ticket #1957 (closed defect: fixed)
MC 4.7.0.1 on AIX - several build problem
Reported by: | tammer | Owned by: | slavazanko |
---|---|---|---|
Priority: | major | Milestone: | 4.7.1 |
Component: | mc-core | Version: | 4.7.0.1 |
Keywords: | AIX build | Cc: | |
Blocked By: | Blocking: | ||
Branch state: | Votes for changeset: | committed-master committed-stable |
Description
Hello,
I just tried to upgrade mc (from 4.6.2 to 4.7.0.1) on AIX. There are several build problem (with IBM XL C) on AIX.
- src/tty/tty-ncurses.c
- cur_term->Nttyb.c_cc[VINTR] = CTRL ('g'); /* g */
+ cur_term->Nttyb.c_cc[VINTR] = unctrl ('g'); /* g */
CTRL() is not there, I have used unctrl() instead.
- src/unixcompat.h
#if defined(_AIX) && defined(HAVE_SYS_SYSMACROS_H)
# include <sys/sysmacros.h> /* AIX */
+# include <time.h> /* AIX tm */
#endif
I had to add <time.h> because tm as undefined
- vfs/direntry.c
-#include <sys/fcntl.h>
+#if defined(_AIX)
+# include <fcntl.h>
+#else
+# include <sys/fcntl.h>
+#endif
The directory for fcntl.h was not correct. This should be changed in the configure system.
- vfs/vfs.c
+#if defined(_AIX) && !defined(NAME_MAX)
+#define NAME_MAX FILENAME_MAX
+#endif
This is a bit fuzzy but it should work
- Makefile
CFLAGS = -fdiagnostics-show-option ...
The -fdiagnostics-show-option does not work with cc_r (IBM XL C). Unfortunately the configure test is not catching this.
- Screen library
The flag --with-screen=mcslang is no longer working because the slang library is no longer bundled. The bundled version was very good on AIX...
- opendir()
In mc opendir() is used even if large file support is on. This leads to problems as the opendir() can not handle large inodes (> 32 bit). It would be a good idea to use the XXX64() versions if large file support is enabled.
Bye
Rainer
Attachments
Change History
comment:2 Changed 15 years ago by tammer
Hello,
this is a proposal for an patch for 5.:
m4.include/mc-cflags.m4
dnl Sorted -f options:
AC_MSG_CHECKING([CC is $CC])
case "$CC" in
gcc)
MC_CHECK_ONE_CFLAG([-fdiagnostics-show-option])
dnl MC_CHECK_ONE_CFLAG([-fno-stack-protector])
;;
*)
;;
esac
As this is a gcc option we only need to check if gcc is used.
Bye
Rainer
comment:3 in reply to: ↑ description ; follow-up: ↓ 5 Changed 15 years ago by andrew_b
Replying to tammer:
- Screen library
The flag --with-screen=mcslang is no longer working because the slang library is no longer bundled. The bundled version was very good on AIX...
bundled version of S-Lang was version 1.x. Now MC uses S-Lang of 2.x version.
Would you provide a patch in unified format (diff -rup) for this ticket?
comment:5 in reply to: ↑ 3 Changed 15 years ago by andrew_b
Replying to andrew_b:
bundled version of S-Lang was version 1.x. Now MC uses S-Lang of 2.x version.
Oh, sorry. It's my mistake. Bundled version was 2.0.6.
comment:6 follow-up: ↓ 7 Changed 15 years ago by tammer
Hello,
so the bundled version should still work. Any change to bundle it again ??
Yes,
I can provide a patch. I first wanted to discuss if my solutions for the problems are acceptable to you.
Bye
Rainer
comment:7 in reply to: ↑ 6 Changed 15 years ago by andrew_b
Replying to tammer:
Hello,
so the bundled version should still work. Any change to bundle it again ??
No. MC will use upstream (and installed in system) libraries.
Yes,
I can provide a patch. I first wanted to discuss if my solutions for the problems are acceptable to you.
None of MC developers does not use AIX. We just can trust you.
comment:8 Changed 15 years ago by tammer
Hello,
good. Should I open a new ticket for every fix or should I provide a combined fix for the AIX build problems ?
As a base for the fix I will use HEAD from git.
The CTRL() thing was not quite right, ... the CTRL() is only:
#define CTRL(x) ((x) & 0x1f)
So I will go with that version.
Bye
Rainer
comment:9 Changed 15 years ago by tammer
Hello,
one addition to ncurses. If slang is installed there is no big problem, but if ncurses is installed the the configure tools will pick up the system curses and kinda ignore the ncurses library. I had to manually tweak two Makefiles to pick up ncurses. To use ncurses on AIX we would need --with-ncurses-includes / --with-ncurses-libs. I think I will go with the slang version in the first round. If I can find some additional spare time I try to add the --withXXX parameters.
Bye
Rainer
comment:10 Changed 15 years ago by slavazanko
- Owner set to slavazanko
- Status changed from new to accepted
good. Should I open a new ticket for every fix?
No need. Just attach one-fix patch-files into this ticket, please.
comment:11 Changed 15 years ago by tammer
Hello,
I have prepared a first fix for current HEAD.
With this patch you can compile MC 4.7 with the IBM XL C/C++ compiler. It is required that slang is installed.
This is my configure call:
#!/usr/bin/bash
export CC=cc_r
export CXX=xlC_r
export CFLAGS="-I/opt/freeware/include"
export LDFLAGS="-Wl,-brtl"
export CONFIG_SHELL=/usr/bin/bash
export SHELL=/usr/bin/bash
./configure --prefix=/usr/local/mc \
--with-libiconv-prefix=/opt/freeware \
--sysconfdir=/etc \
--with-screen=slang \
--with-slang-includes=/usr/local/slang/include \
--with-slang-libs=/usr/local/slang/lib \
--without-x
Bye
Rainer
Changed 15 years ago by tammer
- Attachment 0001-MC-4.7-patches-for-AIX.patch added
0001-MC-4.7-patches-for-AIX.patch
comment:12 Changed 15 years ago by tammer
Hello,
as soon as I find some time I will have a look at the ncurses stuff.
Am I right that slang is the preferred screen library ?
Bye
Rainer
comment:13 Changed 15 years ago by slavazanko
- severity changed from no branch to on review
- Milestone changed from 4.7 to 4.7.1
Am I right that slang is the preferred screen library ?
Yes, S-Lang preferred. But ncurses important too, if in some reason target system totally don't have S-Lang :)
Created branch 1957_build_AIX
Changesets:
- 444ea4dd1bc9bcaeb729b54be7f3f30cfdc1f4e8: MC 4.7.0.1 on AIX - fixed several build problems
comment:14 Changed 15 years ago by slavazanko
- Votes for changeset set to slavazanko
As andrew_b saw, we can just trust to you...
And thanks for your help.
comment:15 Changed 15 years ago by angel_il
- Votes for changeset changed from slavazanko to slavazanko angel_il
test build under tcc passed
comment:16 follow-up: ↓ 17 Changed 15 years ago by tammer
Hello,
good to hear :-).
I will try to get a look at the ncurses stuff on the weekend. This is probably a bit more work.
Bye
Rainer
comment:17 in reply to: ↑ 16 Changed 15 years ago by andrew_b
- severity changed from on review to on hold
Replying to tammer:
I will try to get a look at the ncurses stuff on the weekend. This is probably a bit more work.
OK. Branch is frozen until your result.
comment:18 Changed 15 years ago by tammer
Hello,
My ncurses version is 5.2, with TERM=dtterm color support is working. Other TERM settings do not work properly (xterm, vt220, vt420). This would be something for the INSTALL file... The slang library is working better in this regard.
I have prepared a first version which accepts the new two configure parameters --with-ncurses-includes/--with-ncurses-lib.
If you specify these two parameters then configure looks for ncurses/ncurses.h and ncurses/term.h or ncurses.h and term.h in the specified directory.
The problem on AIX is that the system supplies a term.h which is not compatible with the ncurses version of term.h. So you have to be very careful not to pick up the wrong version... :-((
Bye
Rainer
comment:19 Changed 15 years ago by metux
Some things (eg. including <time.h> and <fcntl.h>) are
IMHO a generic - not AIX specific - thing, so why the
#ifdef's ?
comment:20 Changed 15 years ago by tammer
Hello,
I have already changed this in the first part of the patch.
vfs/direntry.c:
... snip ...
#include <fcntl.h> /* include fcntl.h -> sys/fcntl.h only */
/* includes fcntl.h see IEEE Std 1003.1-2008 */
... snip ...
The second part (--with-ncurses-XX) of the patch is almost ready. I have implemented it in the following way:
- If the parms are not given then the old logic is used
- If the parms are given then configure looks in the specified location for the ncurses headers/lib.
It works on AIX but I need someone testing it on Linux. I will post the patch later this day. On AIX slang is the better solution for the screen library. I could get the ncurses build only working with TERM=dtterm.
Bye
Rainer
Changed 15 years ago by tammer
- Attachment 0001-patches-for-AIX-with-ncurses-support.patch added
second patch version
comment:21 Changed 15 years ago by tammer
Hello,
this is a combined patch against HEAD (2010-01-17).
With this patch you can:
Compile on AIX with S-Lang 2.0.7 or ncurses 5.2.
Please could someone test this on Linux.
Bye
Rainer
comment:22 Changed 15 years ago by slavazanko
- Votes for changeset changed from slavazanko angel_il to slavazanko
- severity changed from on hold to on review
Branch rebased. New initial changeset:e8c574f4bd20602c6b80f06936a55195fba947dd
Review, please.
comment:23 Changed 15 years ago by tammer
Hello,
if there are any questions about this patch please feel free to ask.
Bye
Rainer
comment:24 Changed 15 years ago by andrew_b
- Votes for changeset changed from slavazanko to slavazanko andrew_b
- severity changed from on review to approved
comment:25 Changed 15 years ago by angel_il
- Votes for changeset changed from slavazanko andrew_b to slavazanko andrew_b angel_il
i have no problem with TCC.
comment:26 Changed 15 years ago by slavazanko
- Status changed from accepted to testing
- Votes for changeset changed from slavazanko andrew_b angel_il to commited-master commited-stable
- Resolution set to fixed
- severity changed from approved to merged
merge master: bf951d52edd2fcc35fe4476e4678c4058a43873b
stable: b8ff2cfc1a15b054e56621efaec7471d79a1c497
Hello,
one small addition to 5.:
This is not caught by configure as -fXXX is a valid option for XL C during compile time. But the meaning is completely different:
Bye