poniedziałek, 8 marca 2010

Postfix w OpenSolaris, a NIS+

Jeśli ktoś będzie kompilować Postfixa na OpenSolarisie nowszym niż b130, otrzyma następujący błąd:

"dict_nisplus.c", line 123: undefined symbol: nis_result
"dict_nisplus.c", line 123: undefined symbol: reply
"dict_nisplus.c", line 182: warning: implicit function declaration: nis_list
"dict_nisplus.c", line 182: undefined symbol: FOLLOW_LINKS
"dict_nisplus.c", line 182: undefined symbol: FOLLOW_PATH
"dict_nisplus.c", line 188: left operand of "->" must be pointer to struct/union
"dict_nisplus.c", line 188: undefined symbol: NIS_SUCCESS
"dict_nisplus.c", line 189: undefined struct/union member: objects
"dict_nisplus.c", line 189: left operand of "->" must be pointer to struct/union
"dict_nisplus.c", line 189: undefined struct/union member: objects_len
"dict_nisplus.c", line 189: warning: left operand of "." must be struct/union object
"dict_nisplus.c", line 193: warning: implicit function declaration: nis_freeresult
"dict_nisplus.c", line 196: left operand of "->" must be pointer to struct/union
"dict_nisplus.c", line 196: undefined struct/union member: objects_val
"dict_nisplus.c", line 196: warning: left operand of "." must be struct/union object
"dict_nisplus.c", line 196: left operand of "->" must be pointer to struct/union
"dict_nisplus.c", line 203: left operand of "->" must be pointer to struct/union
"dict_nisplus.c", line 203: warning: left operand of "." must be struct/union object
"dict_nisplus.c", line 203: left operand of "->" must be pointer to struct/union
"dict_nisplus.c", line 220: left operand of "->" must be pointer to struct/union
"dict_nisplus.c", line 220: undefined symbol: NIS_NOTFOUND
"dict_nisplus.c", line 221: left operand of "->" must be pointer to struct/union
"dict_nisplus.c", line 221: undefined symbol: NIS_PARTIAL
"dict_nisplus.c", line 224: warning: implicit function declaration: nis_sperrno
"dict_nisplus.c", line 224: left operand of "->" must be pointer to struct/union
cc: acomp failed for dict_nisplus.c
make: *** [dict_nisplus.o] Error 1
make: *** [update] Error 1


Dzieje się tak dlatego, iż Postfix zakłada, że mamy biblioteki podsystemu NIS+, jednak ten system nazewniczy został usunięty w b131: Heads-Up: Removed NIS+ as Naming Service from Solaris Installer

Najlepszym rozwiązaniem problemu jest zdefiniowanie system OpenSolaris w src/util/sys_defs.h jako osobna platforma systemowa.
Prostszą i szybszą metodą jest usunięcie wpisu dotyczącą NIS+ ("#define HAS_NISPLUS") z pliku "src/util/sys_defs.h" w źródłach Postfixa.

Różnice w plikach wersji 2.7.0:

$ diff -u src/util/sys_defs.h_orig src/util/sys_defs.h
--- src/util/sys_defs.h_orig 2010-03-07 21:09:19.889612089 +0100
+++ src/util/sys_defs.h 2010-03-07 21:39:07.102353914 +0100
@@ -401,7 +401,6 @@
#define DEF_DB_TYPE "dbm"
#define ALIAS_DB_MAP "dbm:/etc/mail/aliases"
#define HAS_NIS
-#define HAS_NISPLUS
#define USE_SYS_SOCKIO_H /* Solaris 2.5, changed sys/ioctl.h */
#define GETTIMEOFDAY(t) gettimeofday(t)
#define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"


Następnie kompilujemy Postfixa. W najprostszej postaci:

$ make makefiles
$ make

Jeśli potrzebujemy kompilator GCC lub Sun Studio, można je zainstalować z repozytorium:
# pkg install -v gcc-dev

lub dla Sun Studio:
# pkg install -v sunstudio12u1
# ln -s /opt/sunstudio12.1 /opt/SUNWspro



Jeśli chcemy skompilować Postfixa za pomocą Sun Studio:
$ make makefiles CC=/opt/SUNWspro/bin/cc
$ make

Brak komentarzy: