How to use pkgsrc on AIX
From NetBSD Wiki
Contents |
Introduction
After struggling to keep my aging AIX machines up to date by compiling from source manually, I decided to try and migrate to using pkgsrc instead. I have set up this page to document my progress.
For business reasons I am running a very old version of AIX - Version 4.1.4 - so this page may have a limited audience. However, it will at least provide a place holder for any other information relating to using pkgsrc on AIX.
pkgsrc bootstrapping problems
Conflicting type declarations
Following the instructions to bootstrap pkgsrc-2006Q3 did not work on my system. After several minutes the bootstrap process aborted with the following error:
sh makelist -bc ./vi.c ./emacs.c ./common.c > help.c
sh makelist -bh ./vi.c ./emacs.c ./common.c > help.h
gcc -g -O2 -I. -I./.. -I. -I.. -I./../libedit -I./../libnetbsd -c chared.c
In file included from sys.h:142,
from chared.c:37:
/usr/include/regex.h:172: conflicting types for `regex'
/usr/include/libgen.h:31: previous declaration of `regex'
/usr/include/regex.h:173: conflicting types for `regcmp'
/usr/include/libgen.h:30: previous declaration of `regcmp'
*** Error code 1
Stop.
bmake: stopped in /usr/pkgsrc/bootstrap/work/tnftp/libedit
*** Error code 1
Stop.
bmake: stopped in /usr/pkgsrc/bootstrap/work/tnftp
===> exited with status 1
aborted.
I found an explanation of this error with help from Google:
- Old Unix versions define these functions in libgen.h, newer in regex.h. It seems that AIX define in two places but with different prototypes.
Not having any skills in C programming, I was unable to resolve the issue by correcting the conflicting definitions and had to resort to sledgehammer tactics; I removed libgen.h but the bootstrap process then failed as it was not able to locate the file. I then overwrote the libgen.h file with a copy of regex.h. This sorted out the conflicting type declaration problem, but I am not sure if this will have any adverse effect on my system! The plan was just to get the bootstrap process to complete then re-instate the original libgen.h file.
- You should never change your operating system's files just to make any third-party software run. The proper solution is to tell the author of tnftp (see pkgsrc/net/tnftp/Makefile.common) to have a look at it. --Rillig 13:11, 17 December 2006 (CET)
- A workaround -- remove check for libgen.h from tnftp/configure. (Verified on AIX 4.3.2.0, pkgsrc-2007Q1.) Shattered 21:10, 9 July 2007 (CEST)
Undeclared variable
After restarting the bootstrap process, it failed again with the following error:
gcc -g -O2 -I. -I./.. -I. -I.. -I./../libedit -I./../libnetbsd -c inet_ntop.c gcc -g -O2 -I. -I./.. -I. -I.. -I./../libedit -I./../libnetbsd -c inet_pton.c inet_pton.c: In function `inet_pton4': inet_pton.c:92: `uint32_t' undeclared (first use in this function) inet_pton.c:92: (Each undeclared identifier is reported only once inet_pton.c:92: for each function it appears in.) inet_pton.c:92: parse error before `val' inet_pton.c:108: `val' undeclared (first use in this function) *** Error code 1 Stop. bmake: stopped in /usr/pkgsrc/bootstrap/work/tnftp/libnetbsd *** Error code 1 Stop. bmake: stopped in /usr/pkgsrc/bootstrap/work/tnftp ===> exited with status 1 aborted.
This is as far as I have managed to get at the moment. I will update this page as and when I have a solution to this problem.
- I think adding #include <inttypes.h> at line 25 of pkgsrc/net/tnftp/files/tnftp.h helps. --Rillig 14:03, 17 December 2006 (CET)
