Merge from vendor branch TNF:
[pkgsrcv2.git] / chat / inspircd12 / options.mk
1 # $NetBSD: options.mk,v 1.1.1.1 2009/01/04 00:52:27 adrianp Exp $
2
3 PKG_OPTIONS_VAR=        PKG_OPTIONS.inspircd
4
5 PKG_SUPPORTED_OPTIONS=  inet6 ssl gnutls kqueue epoll inspircd-remoteinet6
6 PKG_SUPPORTED_OPTIONS+= pcre inspircd-ziplinks inspircd-sqlauth
7 PKG_SUPPORTED_OPTIONS+= inspircd-sqllog inspircd-sqloper
8 PKG_SUGGESTED_OPTIONS=  inet6
9
10 .include "../../mk/bsd.options.mk"
11
12 ###
13 ### Dependency notes:
14 ###
15 ### sql         = mysql, pgsql, sqlite3
16 ### sqlutils    = m_sqlutils.cpp m_sqlutils.h
17 ###
18 ### sqloper     needs sql sqlutils
19 ### sqllog      needs sql
20 ### sqlauth     needs sql sqlutils
21 ###
22
23 ###
24 ### Enable kqueue support
25 ###
26 .if !empty(PKG_OPTIONS:Mkqueue)
27 CONFIGURE_ARGS+=        --enable-kqueue
28 .else
29 CONFIGURE_ARGS+=        --disable-kqueue
30 .endif
31
32 ###
33 ### Enable epoll support
34 ###
35 .if !empty(PKG_OPTIONS:Mepoll)
36 CONFIGURE_ARGS+=        --enable-epoll
37 .else
38 CONFIGURE_ARGS+=        --disable-epoll
39 .endif
40
41 ###
42 ### Enable IPv6 support
43 ###
44 .if !empty(PKG_OPTIONS:Minet6)
45 CONFIGURE_ARGS+=        --enable-ipv6
46 .endif
47
48 ###
49 ### Enable remote IPv6 support
50 ###
51 .if !empty(PKG_OPTIONS:Mremoteinet6)
52 PKG_SUGGESTED_OPTIONS+= inet6
53 CONFIGURE_ARGS+=        --enable-remote-ipv6
54 .else
55 CONFIGURE_ARGS+=        --disable-remote-ipv6
56 .endif
57
58 ###
59 ### Enable OpenSSL support
60 ###
61 .if !empty(PKG_OPTIONS:Mssl)
62 .       include "../../security/openssl/buildlink3.mk"
63 BUILDLINK_API_DEPENDS.openssl+= openssl>=0.9.7
64 CONFIGURE_ARGS+=        --enable-openssl
65 MODULES+=               m_ssl_openssl.cpp
66 .endif
67
68 ###
69 ### Enable GNU TLS support
70 ### Apparently this gives better performance when compared to OpenSSL
71 ###
72 .if !empty(PKG_OPTIONS:Mgnutls)
73 .       include "../../security/gnutls/buildlink3.mk"
74 .       include "../../security/gnutls/libgnutls-config.mk"
75 CONFIGURE_ARGS+=        --enable-gnutls
76 MODULES+=               m_ssl_gnutls.cpp
77 .endif
78
79 ###
80 ### Compile in support for ziplinks.  This compresses data sent from
81 ### server <-> server with zlib.
82 ###
83 .if !empty(PKG_OPTIONS:Minspircd-ziplinks)
84 .       include "../../devel/zlib/buildlink3.mk"
85 MODULES+=               m_ziplink.cpp
86 .endif
87
88 ###
89 ### Perl regex support
90 ###
91 .if !empty(PKG_OPTIONS:Mpcre)
92 .       include "../../devel/pcre/buildlink3.mk"
93 MODULES+=               m_filter_pcre.cpp
94 .endif
95
96 ###
97 ### Use SQL for storing user details
98 ###
99 .if !empty(PKG_OPTIONS:Minspircd-sqlauth)
100 INSPIRCD_STORAGE_DRIVER?=       mysql
101 MODULES+=               m_sqlauth.cpp m_sqlutils.cpp
102 HEADERS+=               m_sqlutils.h
103 .endif
104
105 ###
106 ### Use SQL for logging
107 ###
108 .if !empty(PKG_OPTIONS:Minspircd-sqllog)
109 INSPIRCD_STORAGE_DRIVER?=       mysql
110 MODULES+=               m_sqllog.cpp
111 .endif
112
113 ###
114 ### Use SQL for storing oper details
115 ###
116 .if !empty(PKG_OPTIONS:Minspircd-sqloper)
117 INSPIRCD_STORAGE_DRIVER?=       mysql
118 MODULES+=               m_sqloper.cpp m_sqlutils.cpp
119 HEADERS+=               m_sqlutils.h
120 .endif
121
122 ###
123 ### Strorage driver magic
124 ###
125 ### This will only be activated if INSPIRCD_STORAGE_DRIVER is set either
126 ### explictly by the user or by selecting one of the options that are
127 ### dependent on an SQL storage driver.
128 ###
129 .if defined(INSPIRCD_STORAGE_DRIVER)
130 BUILD_DEFS+=            INSPIRCD_STORAGE_DRIVER
131 .  if !empty(INSPIRCD_STORAGE_DRIVER:Mmysql)
132 .       include "../../mk/mysql.buildlink3.mk"
133 MODULES+=               m_mysql.cpp
134 HEADERS+=               m_sqlv2.h
135 .  elif !empty(INSPIRCD_STORAGE_DRIVER:Mpgsql)
136 .       include "../../mk/pgsql.buildlink3.mk"
137 MODULES+=               m_pgsql.cpp
138 HEADERS+=               m_sqlv2.h
139 .  elif !empty(INSPIRCD_STORAGE_DRIVER:Msqlite3)
140 .       include "../../databases/sqlite3/buildlink3.mk"
141 MODULES+=               m_sqlite3.cpp
142 HEADERS+=               m_sqlv2.h
143 .  else
144 PKG_FAIL_REASON+=       "${PKGBASE}: unknown storage driver \\'${INSPIRCD_STORAGE_DRIVER}\\'"
145 .  endif
146 .endif