OldHawk

菜地一块,欢迎拍砖
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

为Unrealircd增加Mysql的数据库支持(三)

Posted on 2007-04-14 17:25  OldHawk  阅读(443)  评论(0编辑  收藏  举报
           上 接 为Unrealircd增加Mysql的数据库支持(二)

            四、为mysql准备编译环境
                 此处以linux下编译为例,你需要将mysql/include的所有头文件复制到unrealircd/include/mysql-inc下面来,否则编译时会出现大量的错误信息。
                 请编辑Makefile文件中的如下行, 加入mysql的连接类库
IRCDLIBS=-lcrypt -lnsl -lmysqlclient -ldl -L/home/ircd/Unreal3.2/extras/regexp/lib -ltre   -lcares
                  然后,请打开unrealircd/src/Makefile文件,修改如下行:
OBJS=timesynch.o res.o s_bsd.o auth.o aln.o channel.o cloak.o crule.o dbuf.o \
        events.o fdlist.o hash.o help.o ircd.o ircsprintf.o list.o lusers.o \
        match.o modules.o packet.o parse.o s_auth.o \
        s_conf.o s_debug.o s_err.o s_extra.o s_kline.o \
        s_misc.o s_numeric.o s_serv.o s_svs.o $(STRTOUL) socket.o \
        ssl.o s_user.o charsys.o scache.o send.o support.o umodes.o \
        version.o whowas.o zip.o cidr.o random.o extcmodes.o mysql.o \
        extbans.o md5.o api
-isupport.o api-command.o $(URL)

INCLUDES = ../include/auth.h ../include/badwords.h ../include/channel.h \
        ../include/class.h ../include/common.h ../include/config.h ../include/dbuf.h \
        ../include/dynconf.h ../include/events.h ../include/fdlist.h ../include/h.h \
        ../include/hash.h ../include/inet.h ../include/ircsprintf.h \
        ../include/license.h ../include/macros.h ../include/md5.h \
        ../include/modules.h ../include/modversion.h ../include/msg.h ../include/nameser.h \
        ../include/numeric.h ../include/proto.h \
        ../include/resource.h ../include/setup.h ../include/sjoin.h \
        ../include/sock.h ../include/ssl.h ../include/struct.h ../include/sys.h \
        ../include/threads.h ../include/types.h ../include/url.h \
        ../include/version.h ../include/whowas.h ../include/zip.h ../include/mysql-inc/mysql.h

url.o: url.c $(INCLUDES)
        $(CC) $(CFLAGS) -c url.c

mysql.o: mysql.c $(INCLUDES)
        $(CC) $(CFLAGS) -c mysql.c


# DO NOT DELETE THIS LINE -- make depend depends on it.

      注:上面红色文字为自已添加的部分。


      为Unrealircd增加Mysql的数据库支持(四)