交叉编译jpeg库的问题
Posted on 03月 11, 2008 - Filed Under bash | Leave a Comment
./configure --enable-shared --enable-static
加了 --enable-shared 或者 --enable-statics 就会报
ltconfig: cannot guess host type; you must specify one
方法是安装最新版的 libtool 然后
cp /usr/share/libtool/config.sub .
cp /usr/share/libtool/config.guess .
./configure --enable-shared --enable-static
make; make install
Leopard 编译 universal php5
Posted on 12月 11, 2007 - Filed Under Bsd, MacosX, Unix, bash, php | 1 Comment
因为自带的php没有gd所以要重编
因为服务器用的是x86_64 httpd+php5所以要编 x86_64
因为自带的httpd+php是 universal ,所以要这样做
自带的httpd很好,所以不搞它了
参考:
ppc就不要了
export MACOSX_DEPLOYMENT_TARGET=10.5
export ARCHFLAGS='-arch i386 -arch x86_64'
export CFLAGS='-arch i386 -arch x86_64 -O3 -pipe'
export CXXFLAGS='-arch i386 -arch x86_64 -O3 -pipe'
export LDFLAGS='-arch i386 -arch x86_64 -bind_at_load'
make时候可能出现这样的提示:
gcc-4.0: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
在 configure 的时候加上 --disable-dependency-tracking
'./configure' \
'--prefix=/usr' \
'--with-config-file-path=/private/etc' \
'--sysconfdir=/private/etc' \
'--with-apxs2=/usr/sbin/apxs' \
'--with-iconv=/usr/local' \
'--with-mhash=/usr/local' \
'--with-gettext=/usr/local' \
'--with-mysql=/usr/local' \
'--with-mysqli=/usr/local/bin/mysql_config' \
'--with-pdo-mysql=/usr/local' \
'--with-openssl=/usr' \
'--with-zlib=/usr' [...]
都是dash惹的祸
Posted on 03月 6, 2007 - Filed Under Bsd, Linux, MacosX, Unix, bash, dash, shell | 6 Comments
困扰我一个春天的问题!
Ubuntu
某天下了一个nerolinux,然后安装
安装失败,提示某脚本出错,看上去是语法错误
出错嘛就删除了哦
结果删除失败,提示同样的错误
导致使用apt-get任何时候都提示这个错误
几经搞整以后造成“新立得”无法正常运行
准备好光盘准备重装了
同时继续寻找希望,搜编google没有正解
其中错误包括:
dpkg (子进程):无法执行新的 post-removal script: No such file or directory
dpkg: 作下列清理工作时发生错误:
子进程·post-removal script·返回了错误号·2
在处理时有错误发生:
-------------------------------------
软件包nerolinux 需要重新安装,但是我无法找到相应的安装文件。
仔细看了一下错误文件
/var/lib/dpkg/info/nerolinux.xxx
打开一看,语法好像不太寻常,我看到了 function 字样
再看头部 #!/bin/sh
改为 #!/bin/bash 后解决问题
ls -l /bin/sh 这个东西是链接到 dash 而不是 bash的
自从ubuntu 6.10 开始就是这样,很让人头痛,很多脚本运行有问题
见过有人为了装一个软件先把 bash->sh 装完了再 dash->sh 回去
妈B的,不改回去了,也没见哪个脚本运行不正常的!
最后,不知道这个dash是啥东东,本来想大骂一顿的,不过…… 还是算了……
ssh SendEnv 问题
Posted on 03月 5, 2007 - Filed Under Linux, MacosX, Unix, bash, shell | Leave a Comment
远程主机不支持 zh_CN.UTF-8 我机器确是
ssh时:
debug1: Sending environment.
debug1: Sending env LANG = zh_CN.UTF-8
debug1: Sending env LC_CTYPE = zh_CN.UTF-8
造成远程很多程序不能运行
我认为既是远程,就不管那么多了,语言环境随它去比较好
修改
/etc/ssh/ssh_config
注销掉 SendEnv LANG LC_*
即可
再谈 jre / ZendStudio 中文字体问题
Posted on 01月 23, 2007 - Filed Under Linux, Zend, bash, java, php, shell | Leave a Comment
找了若干资料,终于有了结果
原来如此简单:
把 Courier New 的几个字体文件 copy 到 jre/lib/fonts/
cd xxx/jre/lib/fonts
mkfontscale
cp fonts.scale fonts.dir
cd ../
cp fontconfig.properties.src fontconfig.properties
vi fontconfig.properties
修改相关位置:
monospaced.plain.latin-1=-monotype-courier new-medium-r-normal--0-0-0-0-m-0-iso8859-1
monospaced.bold.latin-1=-monotype-courier new-bold-r-normal--0-0-0-0-m-0-iso8859-1
monospaced.italic.latin-1=-monotype-courier new-medium-i-normal--0-0-0-0-m-0-iso8859-1
monospaced.bolditalic.latin-1=-monotype-courier new-bold-i-normal--0-0-0-0-m-0-iso8859-1
最后再 cp 一个你喜欢的中文字体到 xxx/jre/fonts/fallback/
打开 ZDE,设置字体为 monospaced
这下爽了,我顶你个肺!
注意:此方法只在 Ubuntu 下测试通过,另外 Windows 是不适用的,如果是suse或者redhat之类的系统,主意看 xxx/jre/lib 下面的fontconfig.xxxx 文件,与当前系统相关做相应的修改就可以(没试过)
相关网址:http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html
bash 中的正则表达式
Posted on 09月 13, 2006 - Filed Under Linux, bash, shell | Leave a Comment
类似
$ps ax | grep -v grep | grep httpd | tr -s ' ' | cut -d ' ' -f1
的方法来取得pid确实还挺好用的,不过今天要取得这个程序执行了多长时间,这个就麻烦了,因为时间中间有空格
翻了半天的man还是没好的解决方案,换了台机器,ubuntu 的,发现 ps 有不小的区别,可以这样:
$ps -eo pid,lstart,args | grep httpd | grep -v grep
2374 Wed Sep 13 00:41:59 2006 /usr/local/httpd/bin/httpd -k restart
2469 Wed Sep 13 00:42:03 2006 /usr/local/httpd/bin/httpd -k restart
22470 Wed Sep 13 00:42:03 2006 [...]