AIX 安装GCC
1. Installing the RedHat Package Manager (RPM)
在安装GCC软件之前,必须安装RPM - the RedHat Package Manager。
你需要用installp安装RPM包, 下载此包的地址为:
安装rpm 包,必须以root 用户操作,命令如下:
# installp -qacXgd rpm.rte rpm.rte
2.Using the RedHat Package Manager (RPM)
使用RPM的完整信息详见. 基本的安装操作参数:
-i: install
-e: erase
-q: query
--help: help
rpm程序在/opt/freeware/bin/中
#cd /opt/freeware/bin/
# ./rpm
RPM version 3.0.5
Copyright & 1998 - Red Hat Software
This may be freely redistributed under the terms of the GNU GPL
3.下载GCC软件包
到上下载gcc
2.9.aix51.020209 (5.1)
注意:installing package gcc-2.9.aix51.020209-4 needs 27Mb on the /opt filesystem
以root用户执行如下步骤:
# /opt/freeware/bin/rpm -i gcc-2.9.aix51.020209-4.aix5.1.ppc.rpm
#
# find / -name "gcc" -print
/opt/freeware/GNUPro/bin/gcc
/usr/bin/gcc
/usr/local/bin/gcc
你可以在shell的提示符号下键入gcc -v,萤幕上就会显示出你目前正在使用的GCC的版本.在我的系统上,执行
gcc -v的结果是:
# gcc -v
Reading specs from /usr/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0/2.9-aix51-020209/specs
gcc version 2.9-aix51-020209
4.测试方法
只要执行gcc时,附加 -v这个参数(switch),就能找出你所用的这版gcc,自动帮你定义了什麽符号(symbols).例
如,我的机器看起来会像这样:
# echo 'main(){printf("hello world\n");}' | gcc -E -v -
Reading specs from /usr/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0/2.9-aix51-0202
09/specs
gcc version 2.9-aix51-020209
/usr/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0/2.9-aix51-020209/cpp -lang-c -v
-iprefix /usr/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0/2.9-aix51-020209/ -D__GN
UC__=2 -D__GNUC_MINOR__=9 -D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D
_AIX51 -D_LONG_LONG -D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51
-D_LONG_LONG -Asystem(unix) -Asystem(aix) -D__CHAR_UNSIGNED__ -D_ARCH_COM -
GNU CPP version 2.9-aix51-020209
#i nclude "..." search starts here:
#i nclude <...> search starts here:
/usr/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0/2.9-aix51-020209/../../../../pow
erpc-ibm-aix5.1.0.0/include
/usr/bin/../lib/gcc-lib/powerpc-ibm-aix5.1.0.0/2.9-aix51-020209/include
/opt/freeware/GNUPro/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/2.9-aix51-020209/../../
../../powerpc-ibm-aix5.1.0.0/include
/opt/freeware/GNUPro/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/2.9-aix51-020209/includ
e
/usr/include
End of search list.
The following default directories have been omitted from the search path:
/opt/freeware/GNUPro/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/2.9-aix51-020209/../../
../../include/g++-3
/opt/freeware/GNUPro/include
End of omitted list.
# 1 ""
main(){printf("hello world
");}
#
通过编译程序文件的方式来测试编译器是否正常工作。
C编译器的测试
执行如下命令:
#cd /tmp
#vi testc.c
testc.c内容如下:
#i nclude
main()
{
printf("\nGCC is OK!\n\n");
}
编译test.c
# gcc -O test.c -o test
生成可执行文件test(通过ls命令可以看到)
运行 test
#./test
屏幕输出
GCC is OK!
说明GCC程序编译正确。
AIX 安装Samba
Download source code:
STEP 1. Building the binaries
in the source directory:
#./configure
#make
#make install
troubleshooting:
Error:
Linking bin/nmbd
Compiling web/cgi.c
web/cgi.c:35: error: redefinition of `struct var'
web/cgi.c: In function `cgi_load_variables':
web/cgi.c:170: error: structure has no member named `name'
web/cgi.c:171: error: structure has no member named `value'
web/cgi.c:175: error: structure has no member named `name'
web/cgi.c:176: error: structure has no member named `value'
web/cgi.c:179: error: structure has no member named `value'
web/cgi.c:180: error: structure has no member named `name'
web/cgi.c:209: error: structure has no member named `name'
web/cgi.c:210: error: structure has no member named `value'
web/cgi.c:212: error: structure has no member named `name'
web/cgi.c:213: error: structure has no member named `value'
web/cgi.c:216: error: structure has no member named `value'
web/cgi.c:217: error: structure has no member named `name'
web/cgi.c: In function `cgi_variable':
web/cgi.c:247: error: structure has no member named `name'
web/cgi.c:248: error: structure has no member named `value'
make: 1254-004 The error code from the last command is 1.
Fix:
Renames the "struct var" to "struct cgi_var" in web/cgi.c then re-execute #make:
-struct var {
+struct cgi_var {
char *name;
char *value;
};
-static struct var variables[MAX_VARIABLES];
+static struct cgi_var variables[MAX_VARIABLES];
static int num_variables;
static int content_length;
static int request_post;
STEP 2. Create the smb configuration file.
#vi /usr/local/samba/lib/smb.conf
The simplest useful configuration file would be something like this:
[global]
wins support = Yes
workgroup = MYGROUP
encrypt passwords = Yes
[homes]
guest ok = no
read only = no
[tmp]
comment = temporary files
path = /tmp
read only = yes
[ibm]
comment = opt ibm
path = /opt/ibm
guest ok = no
read only = no
STEP 3. Test your config file with testparm
#/usr/local/samba/bin/testparm /usr/local/samba/lib/smb.conf
STEP 4. 建立用户的存取密码
#/usr/local/samba/bin/smbpasswd -a xxx,密码与该用户操作系统密码相同,建立xxx用户的存取密码;
STEP 5. Starting the smbd and nmbd.
#/usr/local/samba/bin/smbd -D
#/usr/local/samba/bin/nmbd -D
STEP 6. Try listing the shares available on your server
#/usr/local/samba/bin/smbclient -L yourhostname
Added interface ip=9.181.65.28 bcast=9.181.67.255 nmask=255.255.252.0
Password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.0.0]
Sharename Type Comment
--------- ---- -------
homes Disk
tmp Disk temporary files
ibm Disk opt ibm
IPC$ IPC IPC Service (Samba 2.0.0)
Server Comment
--------- -------
NOTESXRH Samba Server
QPAIX01 Samba 2.0.0
Workgroup Master
--------- -------
MYGROUP NOTESXRH
STEP 7. Accessing from Windows Client
Click Start => Run...
阅读(2044) | 评论(0) | 转发(0) |