Chinaunix首页 | 论坛 | 博客
  • 博客访问: 10705556
  • 博文数量: 2905
  • 博客积分: 20098
  • 博客等级: 上将
  • 技术积分: 36298
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-23 05:00
文章存档

2012年(1)

2011年(3)

2009年(2901)

分类: LINUX

2009-03-23 11:15:59

#!/bin/sh
####################################################################################################
#作者:胡昌文
#时间:2008-09-28
#MSN:
###################################################################################################
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Please Input the options in the following!"
echo "   Modified By GTSC Hu Changwen"
echo "   Any problem,Please Connact me:wtcmaster@126.com"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo ""
for data in ldap mysql sasl ssl
do
echo "======================================="
echo "Start to define $data options:"
#define the function named ldap()
fun ()
{
    echo "Please input the include directory of $data:[/usr/local/include]"
    read data_include
    if [ "$data_include" = "" ];then
       data_include="/usr/local/include"
    fi
    echo "Please input the lib directory of ${data}:[/usr/local/lib]"
    read data_lib
    if [ "$data_lib" = "" ];then
       data_lib="/usr/local/lib"
    fi
}
#define makefile options
makefile ()
{
    if [ "$data" = ldap ]; then
    option="${option} -I${data_include} -DHAS_LDAP"
    options="${options} -L${data_lib} -lldap -llber"
    elif [ "$data" = mysql ]; then
    option="${option} -I${data_include} -DHAS_MYSQL"
    options="${options} -L${data_lib} -lmysqlclient -lz -lm"
    elif [ "$data" = sasl ]; then
    option="${option} -I${data_include} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL"
    options="${options} -L${data_lib} -lsasl2"
    elif [ "$data" = ssl ]; then
    option="${option} -I${data_include} -DHAS_SSL"
    options="${options} -L${data_lib} -lcrypto -lssl"
    fi
}
#define whether support mysql
echo "Do you want to have your postmail system support ${data}? [Yes,No]"
while read data_res;do
    if [ "$data_res" = yes ]; then
       fun
       makefile
       break 1
    else if [ "$data_res" = no ]; then
       echo "Don't Support mysql!"
       break 1
         fi
    fi
  echo "Do you want to have your postmail system support ${data}? [Yes,No]"
  done
done
echo "-------------------------------------------------------------------------------------------"
echo ""
make -f Makefile.init makefiles CCARGS="$option" AUXLIBS="$options"
阅读(1151) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~