AIX port



Hi ,

A was able to build mc on AIX 4.3.3 using VisualAge C v5.0 compiler (xlc_r).
The  cc compiler didn't work so I had to specify explicitly CC=xlc_r.
I used code drop 2002-03-20.
I had to fix few build problems using type casts (this compiler is a little
bit picky with types) and some other trivial problems.

Another problem was with mountlist.c : somehow  MOUNTED_GETMNTENT1 got
defined instead of MOUNTED_VMOUNT, so the mountlist.c was not compiling.
Fixed using preprocessor.

The biggest problem was with subshell support ( I reported this problem some
time back) . This problem is also present in IBM's linux toolbox binaries.
It turned out that a wrong version of pty_open_master was used. Fixed using
preprocessor.

I beleive both of these problems come from configure script, but I have no
idea how to fix it, so I fixed them just using preprocessor.

Now, since the subsehell is working, I can start testing mc in real work.

Below is a diff file.

Alex


diff -rcbt mc-4.5.99a/edit/edit.h mc-4.5.99a_aix/edit/edit.h
*** mc-4.5.99a/edit/edit.h Mon Mar 18 15:20:59 2002
--- mc-4.5.99a_aix/edit/edit.h Thu Mar 21 15:47:56 2002
***************
*** 344,349 ****
--- 344,350 ----
  #define FONT_MEAN_WIDTH 1

  #define get_sys_error(s) (s)
+ #undef open
  #define open mc_open
  #define close(f) mc_close(f)
  #define read(f,b,c) mc_read(f,b,c)
diff -rcbt mc-4.5.99a/edit/editcmd.c mc-4.5.99a_aix/edit/editcmd.c
*** mc-4.5.99a/edit/editcmd.c Wed Feb 27 09:41:29 2002
--- mc-4.5.99a_aix/edit/editcmd.c Sun Apr  7 21:14:20 2002
***************
*** 1433,1440 ****
      while ((p = edit_find_string (p, exp, len, last_byte, get_byte, data,
once_only, d)) >= 0) {
          if (replace_whole) {
  /*If the bordering chars are not in option_whole_chars_search then word is
whole */
!             if (!strcasechr (option_whole_chars_search, (*get_byte) (data,
p - 1))
!                 && !strcasechr (option_whole_chars_search, (*get_byte)
(data, p + *len)))
                  return p;
              if (once_only)
                  return -2;
--- 1433,1440 ----
      while ((p = edit_find_string (p, exp, len, last_byte, get_byte, data,
once_only, d)) >= 0) {
          if (replace_whole) {
  /*If the bordering chars are not in option_whole_chars_search then word is
whole */
!             if (!strcasechr ((const unsigned
char*)option_whole_chars_search, (*get_byte) (data, p - 1))
!                 && !strcasechr ((const unsigned
char*)option_whole_chars_search, (*get_byte) (data, p + *len)))
                  return p;
              if (once_only)
                  return -2;
***************
*** 1985,1991 ****
          int r;
          p = block = edit_get_block (edit, start, finish, &len);
          while (len) {
!             r = write (file, p, len);
              if (r < 0)
                  break;
              p += r;
--- 1985,1991 ----
          int r;
          p = block = edit_get_block (edit, start, finish, &len);
          while (len) {
!             r = write (file, (char*)p, len);
              if (r < 0)
                  break;
              p += r;
***************
*** 2433,2440 ****
      replace_case = rc;
  }

!
! unsigned int MAX_WORD_COMPLETIONS = 100; /* in listbox */
  unsigned int compl_dlg_h; /* completion dialog height */
  unsigned int compl_dlg_w; /* completion dialog width */

--- 2433,2439 ----
      replace_case = rc;
  }

! #define MAX_WORD_COMPLETIONS 100  /* in listbox */
  unsigned int compl_dlg_h; /* completion dialog height */
  unsigned int compl_dlg_w; /* completion dialog width */

***************
*** 2458,2467 ****
              break;

  /* add matched completion if not yet added */
!         bufpos = &edit->buffers1[start >> S_EDIT_BUF_SIZE][start &
M_EDIT_BUF_SIZE];
          skip = 0;
          for (i = 0; i < *num; i++) {
!             if (strncmp (&compl[i].text[word_len], &bufpos[word_len],
                  max (len, compl[i].len) - word_len) == 0) {
                  skip = 1;
                  break; /* skip it, already added */
--- 2457,2466 ----
              break;

  /* add matched completion if not yet added */
!         bufpos = (char*) &edit->buffers1[start >> S_EDIT_BUF_SIZE][start &
M_EDIT_BUF_SIZE];
          skip = 0;
          for (i = 0; i < *num; i++) {
!             if (strncmp ((const char*)&compl[i].text[word_len],
&bufpos[word_len],
                  max (len, compl[i].len) - word_len) == 0) {
                  skip = 1;
                  break; /* skip it, already added */
***************
*** 2548,2554 ****

  /* fill the listbox with the completions */
      for (i = 0; i < num_compl; i++)
!         listbox_add_item (compl_list, 0, 0, compl[i].text, NULL);

  /* pop up the dialog */
      run_dlg (compl_dlg);
--- 2547,2553 ----

  /* fill the listbox with the completions */
      for (i = 0; i < num_compl; i++)
!         listbox_add_item (compl_list, 0, 0, (char*)compl[i].text, NULL);

  /* pop up the dialog */
      run_dlg (compl_dlg);
***************
*** 2588,2594 ****
          return;

  /* prepare match expression */
!     bufpos = &edit->buffers1[word_start >> S_EDIT_BUF_SIZE]
                              [word_start & M_EDIT_BUF_SIZE];
      strncpy (match_expr, bufpos, word_len);
      match_expr[word_len] = '\0';
--- 2587,2593 ----
          return;

  /* prepare match expression */
!     bufpos = (char *) &edit->buffers1[word_start >> S_EDIT_BUF_SIZE]
                              [word_start & M_EDIT_BUF_SIZE];
      strncpy (match_expr, bufpos, word_len);
      match_expr[word_len] = '\0';
diff -rcbt mc-4.5.99a/src/mountlist.c mc-4.5.99a_aix/src/mountlist.c
*** mc-4.5.99a/src/mountlist.c Thu Sep  6 21:40:45 2001
--- mc-4.5.99a_aix/src/mountlist.c Sun Apr  7 21:06:11 2002
***************
*** 19,24 ****
--- 19,29 ----
  #include <config.h>
  #endif

+ #ifdef IS_AIX
+ #undef MOUNTED_GETMNTENT1
+ #define MOUNTED_VMOUNT
+ #endif
+
  #include <sys/types.h>
  #include <stdio.h>
  #include <fcntl.h>
diff -rcbt mc-4.5.99a/src/regex.c mc-4.5.99a_aix/src/regex.c
*** mc-4.5.99a/src/regex.c Mon Mar 18 15:22:03 2002
--- mc-4.5.99a_aix/src/regex.c Thu Mar 21 15:56:38 2002
***************
*** 297,303 ****
  # endif /* emacs */
  
  /* Integer type for pointers.  */
! # if !defined _LIBC && !defined HAVE_UINTPTR_T
  typedef unsigned long int uintptr_t;
  # endif

--- 297,303 ----
  # endif /* emacs */
  
  /* Integer type for pointers.  */
! # if !defined _LIBC && !defined HAVE_UINTPTR_T && !defined _H_INTTYPES
  typedef unsigned long int uintptr_t;
  # endif

Only in mc-4.5.99a_aix/src: regex.c~
diff -rcbt mc-4.5.99a/src/subshell.c mc-4.5.99a_aix/src/subshell.c
*** mc-4.5.99a/src/subshell.c Mon Feb 18 16:48:26 2002
--- mc-4.5.99a_aix/src/subshell.c Sat Apr  6 23:00:09 2002
***************
*** 1159,1165 ****

  /* }}} */

! #elif HAVE_GRANTPT /* !HAVE_SCO */

  /* {{{ System V version of pty_open_master */

--- 1159,1165 ----

  /* }}} */

! #elif defined(HAVE_GRANTPT) && !defined(IS_AIX)  /* !HAVE_SCO */

  /* {{{ System V version of pty_open_master */





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]