fc0ae336170a8ad4a6cfaf341783bee76b8dc4ac
[~tnikolova/compat/.git] / config / rdma.m4
1 dnl Checks for the in-box ib_core
2 AC_DEFUN([RDMA_CONFIG_COMPAT],
3 [
4         AC_MSG_CHECKING([if ib_verbs has ib_dma_map_single])
5         LB_LINUX_TRY_COMPILE([
6                 #include <linux/version.h>
7                 #include <linux/pci.h>
8                 #include <linux/gfp.h>
9                 #include <rdma/ib_verbs.h>
10         ],[
11                 ib_dma_map_single(NULL, NULL, 0, 0);
12                 return 0;
13         ],[
14                 AC_MSG_RESULT(yes)
15                 AC_DEFINE(HAVE_INBOX_IB_DMA_MAP, 1,
16                           [ib_dma_map_single defined])
17         ],[
18                 AC_MSG_RESULT(no)
19         ])
20
21         AC_MSG_CHECKING([if ib_create_cq wants comp_vector])
22         LB_LINUX_TRY_COMPILE([
23                 #include <linux/version.h>
24                 #include <linux/pci.h>
25                 #include <linux/gfp.h>
26                 #include <rdma/ib_verbs.h>
27         ],[
28                 ib_create_cq(NULL, NULL, NULL, NULL, 0, 0);
29                 return 0;
30         ],[
31                 AC_MSG_RESULT(yes)
32                 AC_DEFINE(HAVE_INBOX_IB_COMP_VECTOR, 1,
33                           [has completion vector])
34         ],[
35                 AC_MSG_RESULT(no)
36         ])
37
38         AC_MSG_CHECKING([if rdma_cm has RDMA_CM_EVENT_ADDR_CHANGE])
39         LB_LINUX_TRY_COMPILE([
40                 #include <linux/version.h>
41                 #include <linux/pci.h>
42                 #include <linux/gfp.h>
43                 #include <rdma/rdma_cm.h>
44         ],[
45                 return (RDMA_CM_EVENT_ADDR_CHANGE == 0);
46         ],[
47                 AC_MSG_RESULT(yes)
48                 AC_DEFINE(HAVE_INBOX_RDMA_CMEV_ADDRCHANGE, 1,
49                           [has completion vector])
50         ],[
51                 AC_MSG_RESULT(no)
52         ])
53
54         AC_MSG_CHECKING([if rdma_cm has RDMA_CM_EVENT_TIMEWAIT_EXIT])
55         LB_LINUX_TRY_COMPILE([
56                 #include <linux/version.h>
57                 #include <linux/pci.h>
58                 #include <linux/gfp.h>
59                 #include <rdma/rdma_cm.h>
60         ],[
61                 return (RDMA_CM_EVENT_TIMEWAIT_EXIT == 0);
62         ],[
63                 AC_MSG_RESULT(yes)
64                 AC_DEFINE(HAVE_INBOX_RDMA_CMEV_TIMEWAIT_EXIT, 1,
65                           [has completion vector])
66         ],[
67                 AC_MSG_RESULT(no)
68         ])
69
70         AC_MSG_CHECKING([if rdma_cm has rdma_set_reuseaddr])
71         LB_LINUX_TRY_COMPILE([
72                 #include <linux/version.h>
73                 #include <linux/pci.h>
74                 #include <linux/gfp.h>
75                 #include <rdma/rdma_cm.h>
76         ],[
77                 rdma_set_reuseaddr(NULL, 1);
78                 return 0;
79         ],[
80                 AC_MSG_RESULT(yes)
81                 AC_DEFINE(HAVE_INBOX_RDMA_SET_REUSEADDR, 1,
82                           [rdma_set_reuse defined])
83         ],[
84                 AC_MSG_RESULT(no)
85         ])
86
87         AC_MSG_CHECKING([if struct ib_wc has member named ts])
88         LB_LINUX_TRY_COMPILE([
89                 #include <linux/version.h>
90                 #include <rdma/ib_verbs.h>
91         ],[
92         struct ib_wc wc;
93         wc->ts.timestamp = 0;
94
95                 return 0;
96         ],[
97                 AC_MSG_RESULT(yes)
98                 AC_DEFINE(HAVE_INBOX_IB_WC_TS, 1,
99                           [ib_wc has member named ts])
100         ],[
101                 AC_MSG_RESULT(no)
102         ])
103
104         AC_MSG_CHECKING([if struct ib_ah_attr has member named dmac])
105         LB_LINUX_TRY_COMPILE([
106                 #include <linux/version.h>
107                 #include <rdma/ib_verbs.h>
108         ],[
109         struct ib_ah_attr *ah_attr;
110         memset(ah_attr->dmac, 0, 6);
111
112                 return 0;
113         ],[
114                 AC_MSG_RESULT(yes)
115                 AC_DEFINE(HAVE_INBOX_IB_AH_ATTR_DMAC, 1,
116                           [ah_attr has member named dmac])
117         ],[
118                 AC_MSG_RESULT(no)
119         ])
120
121         AC_MSG_CHECKING([if struct ib_ah_attr has member named vlan_id])
122         LB_LINUX_TRY_COMPILE([
123                 #include <linux/version.h>
124                 #include <rdma/ib_verbs.h>
125         ],[
126         struct ib_ah_attr *ah_attr;
127         ah_attr->vlan_id = 0;
128
129                 return 0;
130         ],[
131                 AC_MSG_RESULT(yes)
132                 AC_DEFINE(HAVE_INBOX_IB_AH_ATTR_VLAN_ID, 1,
133                           [ah_attr has member named vlan_id])
134         ],[
135                 AC_MSG_RESULT(no)
136         ])
137 ])
138
139 dnl Examine kernel functionality
140 AC_DEFUN([LINUX_CONFIG_COMPAT],
141 [
142         AC_MSG_CHECKING([if kernel has ktime_get_ns])
143         LB_LINUX_TRY_COMPILE([
144                 #include <linux/ktime.h>
145         ],[
146                 unsigned long long ns;
147
148                 ns = ktime_get_ns();
149                 return 0;
150         ],[
151                 AC_MSG_RESULT(yes)
152                 AC_DEFINE(HAVE_KTIME_GET_NS, 1,
153                           [ktime_get_ns defined])
154         ],[
155                 AC_MSG_RESULT(no)
156         ])
157
158         AC_MSG_CHECKING([if svc_xprt_class has xcl_ident])
159         LB_LINUX_TRY_COMPILE([
160                 #include <linux/sunrpc/xprt.h>
161                 #include <linux/sunrpc/svc_xprt.h>
162         ],[
163                 struct svc_xprt_class svc_rdma_class = {
164                         .xcl_ident = XPRT_TRANSPORT_RDMA,
165                 };
166                 return 0;
167         ],[
168                 AC_MSG_RESULT(yes)
169                 AC_DEFINE(HAVE_XCL_IDENT, 1,
170                           [xcl_ident defined])
171         ],[
172                 AC_MSG_RESULT(no)
173         ])
174
175         AC_MSG_CHECKING([if struct ifla_vf_info has max_tx_rate])
176         LB_LINUX_TRY_COMPILE([
177                 #include <linux/if_link.h>
178         ],[
179                 struct ifla_vf_info *ivf;
180
181                 ivf->max_tx_rate = 0;
182                 ivf->min_tx_rate = 0;
183
184                 return 0;
185         ],[
186                 AC_MSG_RESULT(yes)
187                 AC_DEFINE(HAVE_TX_RATE_LIMIT, 1,
188                           [max_tx_rate is defined])
189         ],[
190                 AC_MSG_RESULT(no)
191         ])
192
193         AC_MSG_CHECKING([if struct ethtool_ops has get/set_rxfh])
194         LB_LINUX_TRY_COMPILE([
195                 #include <linux/ethtool.h>
196         ],[
197                 const struct ethtool_ops en_ethtool_ops = {
198                         .get_rxfh_indir_size = NULL,
199                         .get_rxfh = NULL,
200                         .set_rxfh = NULL,
201                 };
202
203                 return 0;
204         ],[
205                 AC_MSG_RESULT(yes)
206                 AC_DEFINE(HAVE_GET_SET_RXFH, 1,
207                           [get/set_rxfh is defined])
208         ],[
209                 AC_MSG_RESULT(no)
210         ])
211
212
213         AC_MSG_CHECKING([if struct ethtool_ops has get/set_tunable])
214         LB_LINUX_TRY_COMPILE([
215                 #include <linux/ethtool.h>
216         ],[
217                 const struct ethtool_ops en_ethtool_ops = {
218                         .get_tunable = NULL,
219                         .set_tunable = NULL,
220                 };
221
222                 return 0;
223         ],[
224                 AC_MSG_RESULT(yes)
225                 AC_DEFINE(HAVE_GET_SET_TUNABLE, 1,
226                           [get/set_tunable is defined])
227         ],[
228                 AC_MSG_RESULT(no)
229         ])
230
231         AC_MSG_CHECKING([if exist struct ethtool_ops_ext])
232         LB_LINUX_TRY_COMPILE([
233                 #include <linux/ethtool.h>
234         ],[
235                 const struct ethtool_ops_ext en_ethtool_ops_ext = {
236                         .size = sizeof(struct ethtool_ops_ext),
237                 };
238
239                 return 0;
240         ],[
241                 AC_MSG_RESULT(yes)
242                 AC_DEFINE(HAVE_ETHTOOL_OPS_EXT, 1,
243                           [struct ethtool_ops_ext is defined])
244         ],[
245                 AC_MSG_RESULT(no)
246         ])
247
248         AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh])
249         LB_LINUX_TRY_COMPILE([
250                 #include <linux/ethtool.h>
251         ],[
252                 const struct ethtool_ops_ext en_ethtool_ops_ext = {
253                         .get_rxfh_indir_size = NULL,
254                         .get_rxfh = NULL,
255                         .set_rxfh = NULL,
256                 };
257
258                 return 0;
259         ],[
260                 AC_MSG_RESULT(yes)
261                 AC_DEFINE(HAVE_GET_SET_RXFH_OPS_EXT, 1,
262                           [get/set_rxfh is defined])
263         ],[
264                 AC_MSG_RESULT(no)
265         ])
266
267         AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_rxfh_indir])
268         LB_LINUX_TRY_COMPILE([
269                 #include <linux/ethtool.h>
270         ],[
271                 const struct ethtool_ops_ext en_ethtool_ops_ext = {
272                         .get_rxfh_indir_size = NULL,
273                         .get_rxfh_indir = NULL,
274                         .set_rxfh_indir = NULL,
275                 };
276
277                 return 0;
278         ],[
279                 AC_MSG_RESULT(yes)
280                 AC_DEFINE(HAVE_GET_SET_RXFH_INDIR, 1,
281                           [get/set_rxfh_indir is defined])
282         ],[
283                 AC_MSG_RESULT(no)
284         ])
285
286         AC_MSG_CHECKING([if struct net_device has dev_port])
287         LB_LINUX_TRY_COMPILE([
288                 #include <linux/netdevice.h>
289         ],[
290                 struct net_device *dev = NULL;
291
292                 dev->dev_port = 0;
293
294                 return 0;
295         ],[
296                 AC_MSG_RESULT(yes)
297                 AC_DEFINE(HAVE_NET_DEVICE_DEV_PORT, 1,
298                           [dev_port is defined])
299         ],[
300                 AC_MSG_RESULT(no)
301         ])
302
303         AC_MSG_CHECKING([if struct ptp_clock_info has n_pins])
304         LB_LINUX_TRY_COMPILE([
305                 #include <linux/ptp_clock_kernel.h>
306         ],[
307                 struct ptp_clock_info *info;
308                 info->n_pins = 0;
309
310                 return 0;
311         ],[
312                 AC_MSG_RESULT(yes)
313                 AC_DEFINE(HAVE_PTP_CLOCK_INFO_N_PINS, 1,
314                           [n_pins is defined])
315         ],[
316                 AC_MSG_RESULT(no)
317         ])
318
319         AC_MSG_CHECKING([if pci.h pci_enable_msi_exact])
320         LB_LINUX_TRY_COMPILE([
321                 #include <linux/pci.h>
322         ],[
323                 int x = pci_enable_msi_exact(NULL, 0);
324
325                 return 0;
326         ],[
327                 AC_MSG_RESULT(yes)
328                 AC_DEFINE(HAVE_PCI_ENABLE_MSI_EXACT, 1,
329                           [pci_enable_msi_exact is defined])
330         ],[
331                 AC_MSG_RESULT(no)
332         ])
333
334         AC_MSG_CHECKING([if pci.h pci_enable_msix_range])
335         LB_LINUX_TRY_COMPILE([
336                 #include <linux/pci.h>
337         ],[
338                 int x = pci_enable_msix_range(NULL, 0, 0, 0);
339
340                 return 0;
341         ],[
342                 AC_MSG_RESULT(yes)
343                 AC_DEFINE(HAVE_PCI_ENABLE_MSIX_RANGE, 1,
344                           [pci_enable_msix_range is defined])
345         ],[
346                 AC_MSG_RESULT(no)
347         ])
348
349         AC_MSG_CHECKING([if struct iscsi_transport has attr_is_visible])
350         LB_LINUX_TRY_COMPILE([
351                 #include <scsi/scsi_transport_iscsi.h>
352         ],[
353                 static struct iscsi_transport iscsi_iser_transport = {
354                         .attr_is_visible = NULL,
355                 };
356
357                 return 0;
358         ],[
359                 AC_MSG_RESULT(yes)
360                 AC_DEFINE(HAVE_ISCSI_ATTR_IS_VISIBLE, 1,
361                           [attr_is_visible is defined])
362         ],[
363                 AC_MSG_RESULT(no)
364         ])
365
366         AC_MSG_CHECKING([if struct iscsi_transport has get_ep_param])
367         LB_LINUX_TRY_COMPILE([
368                 #include <scsi/scsi_transport_iscsi.h>
369         ],[
370                 static struct iscsi_transport iscsi_iser_transport = {
371                         .get_ep_param = NULL,
372                 };
373
374                 return 0;
375         ],[
376                 AC_MSG_RESULT(yes)
377                 AC_DEFINE(HAVE_ISCSI_GET_EP_PARAM, 1,
378                           [get_ep_param is defined])
379         ],[
380                 AC_MSG_RESULT(no)
381         ])
382
383         AC_MSG_CHECKING([if struct iscsi_transport has check_protection])
384         LB_LINUX_TRY_COMPILE([
385                 #include <scsi/scsi_transport_iscsi.h>
386         ],[
387                 static struct iscsi_transport iscsi_iser_transport = {
388                         .check_protection = NULL,
389                 };
390
391                 return 0;
392         ],[
393                 AC_MSG_RESULT(yes)
394                 AC_DEFINE(HAVE_ISCSI_CHECK_PROTECTION, 1,
395                           [check_protection is defined])
396         ],[
397                 AC_MSG_RESULT(no)
398         ])
399
400         AC_MSG_CHECKING([if iscsi_proto.h has struct iscsi_scsi_req])
401         LB_LINUX_TRY_COMPILE([
402                 #include <scsi/iscsi_proto.h>
403         ],[
404                 struct iscsi_scsi_req req = {
405                         .opcode = 0,
406                 };
407
408                 return 0;
409         ],[
410                 AC_MSG_RESULT(yes)
411                 AC_DEFINE(HAVE_ISCSI_SCSI_REQ, 1,
412                           [struct iscsi_scsi_req is defined])
413         ],[
414                 AC_MSG_RESULT(no)
415         ])
416
417         AC_MSG_CHECKING([if struct request_queue has request_fn_active])
418         LB_LINUX_TRY_COMPILE([
419                 #include <linux/blkdev.h>
420         ],[
421                 struct request_queue rq = {
422                         .request_fn_active = 0,
423                 };
424
425                 return 0;
426         ],[
427                 AC_MSG_RESULT(yes)
428                 AC_DEFINE(HAVE_REQUEST_QUEUE_REQUEST_FN_ACTIVE, 1,
429                           [struct request_queue has request_fn_active])
430         ],[
431                 AC_MSG_RESULT(no)
432         ])
433
434         AC_MSG_CHECKING([if netdevice.h has select_queue_fallback_t])
435         LB_LINUX_TRY_COMPILE([
436                 #include <linux/netdevice.h>
437         ],[
438                 select_queue_fallback_t fallback;
439
440                 fallback = NULL;
441
442                 return 0;
443         ],[
444                 AC_MSG_RESULT(yes)
445                 AC_DEFINE(HAVE_SELECT_QUEUE_FALLBACK_T, 1,
446                           [select_queue_fallback_t is defined])
447         ],[
448                 AC_MSG_RESULT(no)
449         ])
450
451         AC_MSG_CHECKING([if skbuff.h has skb_set_hash])
452         LB_LINUX_TRY_COMPILE([
453                 #include <linux/netdevice.h>
454         ],[
455                 skb_set_hash(NULL, 0, PKT_HASH_TYPE_L3);
456
457                 return 0;
458         ],[
459                 AC_MSG_RESULT(yes)
460                 AC_DEFINE(HAVE_SKB_SET_HASH, 1,
461                           [skb_set_hash is defined])
462         ],[
463                 AC_MSG_RESULT(no)
464         ])
465
466         AC_MSG_CHECKING([if sockios.h has SIOCGHWTSTAMP])
467         LB_LINUX_TRY_COMPILE([
468                 #include <linux/sockios.h>
469         ],[
470                 int x = SIOCGHWTSTAMP;
471
472                 return 0;
473         ],[
474                 AC_MSG_RESULT(yes)
475                 AC_DEFINE(HAVE_SIOCGHWTSTAMP, 1,
476                           [SIOCGHWTSTAMP is defined])
477         ],[
478                 AC_MSG_RESULT(no)
479         ])
480
481         AC_MSG_CHECKING([if ip.h inet_get_local_port_range has 3 parameters])
482         LB_LINUX_TRY_COMPILE([
483                 #include <net/ip.h>
484         ],[
485                 inet_get_local_port_range(NULL, NULL, NULL);
486
487                 return 0;
488         ],[
489                 AC_MSG_RESULT(yes)
490                 AC_DEFINE(HAVE_INET_GET_LOCAL_PORT_RANGE_3_PARAMS, 1,
491                           [inet_get_local_port_range has 3 parameters])
492         ],[
493                 AC_MSG_RESULT(no)
494         ])
495
496         AC_MSG_CHECKING([if net.h has net_get_random_once])
497         LB_LINUX_TRY_COMPILE([
498                 #include <linux/net.h>
499         ],[
500                 net_get_random_once(NULL, 0);
501
502                 return 0;
503         ],[
504                 AC_MSG_RESULT(yes)
505                 AC_DEFINE(HAVE_NET_GET_RANDOM_ONCE, 1,
506                           [net_get_random_once is defined])
507         ],[
508                 AC_MSG_RESULT(no)
509         ])
510
511         AC_MSG_CHECKING([if inet_sock.h has __inet_ehashfn])
512         LB_LINUX_TRY_COMPILE([
513                 #include <net/inet_sock.h>
514         ],[
515                 __inet_ehashfn(0, 0, 0, 0, 0);
516
517                 return 0;
518         ],[
519                 AC_MSG_RESULT(yes)
520                 AC_DEFINE(HAVE_INET_EHASHFN, 1,
521                           [__inet_ehashfn is defined])
522         ],[
523                 AC_MSG_RESULT(no)
524         ])
525
526         AC_MSG_CHECKING([if err.h has PTR_ERR_OR_ZERO])
527         LB_LINUX_TRY_COMPILE([
528                 #include <linux/err.h>
529         ],[
530                 int x = PTR_ERR_OR_ZERO(NULL);
531
532                 return 0;
533         ],[
534                 AC_MSG_RESULT(yes)
535                 AC_DEFINE(HAVE_PTR_ERR_OR_ZERO, 1,
536                           [PTR_ERR_OR_ZERO is defined])
537         ],[
538                 AC_MSG_RESULT(no)
539         ])
540
541         AC_MSG_CHECKING([if struct iscsi_session has discovery_sess])
542         LB_LINUX_TRY_COMPILE([
543                 #include <scsi/libiscsi.h>
544         ],[
545                 struct iscsi_session session;
546                 session.discovery_sess = 0;
547
548                 return 0;
549         ],[
550                 AC_MSG_RESULT(yes)
551                 AC_DEFINE(HAVE_ISCSI_DISCOVERY_SESS, 1,
552                           [discovery_sess is defined])
553         ],[
554                 AC_MSG_RESULT(no)
555         ])
556
557         AC_MSG_CHECKING([if enum iscsi_param has ISCSI_PARAM_DISCOVERY_SESS])
558         LB_LINUX_TRY_COMPILE([
559                 #include <scsi/iscsi_if.h>
560         ],[
561                 int x = ISCSI_PARAM_DISCOVERY_SESS;
562
563                 return 0;
564         ],[
565                 AC_MSG_RESULT(yes)
566                 AC_DEFINE(HAVE_ISCSI_PARAM_DISCOVERY_SESS, 1,
567                           [ISCSI_PARAM_DISCOVERY_SESS is defined])
568         ],[
569                 AC_MSG_RESULT(no)
570         ])
571
572         AC_MSG_CHECKING([if pci.h has enum pcie_link_width])
573         LB_LINUX_TRY_COMPILE([
574                 #include <linux/pci.h>
575         ],[
576                 enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
577
578                 return 0;
579         ],[
580                 AC_MSG_RESULT(yes)
581                 AC_DEFINE(HAVE_PCIE_LINK_WIDTH, 1,
582                           [pcie_link_width is defined])
583         ],[
584                 AC_MSG_RESULT(no)
585         ])
586
587         AC_MSG_CHECKING([if pci.h has enum pci_bus_speed])
588         LB_LINUX_TRY_COMPILE([
589                 #include <linux/pci.h>
590         ],[
591                 enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
592
593                 return 0;
594         ],[
595                 AC_MSG_RESULT(yes)
596                 AC_DEFINE(HAVE_PCI_BUS_SPEED, 1,
597                           [pci_bus_speed is defined])
598         ],[
599                 AC_MSG_RESULT(no)
600         ])
601
602         AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_port_id])
603         LB_LINUX_TRY_COMPILE([
604                 #include <linux/netdevice.h>
605         ],[
606                 struct netdev_phys_port_id *x = NULL;
607
608                 return 0;
609         ],[
610                 AC_MSG_RESULT(yes)
611                 AC_DEFINE(HAVE_NETDEV_PHYS_PORT_ID, 1,
612                           [netdev_phys_port_id is defined])
613         ],[
614                 AC_MSG_RESULT(no)
615         ])
616
617         AC_MSG_CHECKING([if struct ifla_vf_info has linkstate])
618         LB_LINUX_TRY_COMPILE([
619                 #include <linux/if_link.h>
620         ],[
621                 struct ifla_vf_info x;
622                 x->linkstate = 0;
623
624                 return 0;
625         ],[
626                 AC_MSG_RESULT(yes)
627                 AC_DEFINE(HAVE_LINKSTATE, 1,
628                           [linkstate is defined])
629         ],[
630                 AC_MSG_RESULT(no)
631         ])
632
633         AC_MSG_CHECKING([if busy_poll.h has skb_mark_napi_id])
634         LB_LINUX_TRY_COMPILE([
635                 #include <net/busy_poll.h>
636         ],[
637                 skb_mark_napi_id(NULL, NULL);
638
639                 return 0;
640         ],[
641                 AC_MSG_RESULT(yes)
642                 AC_DEFINE(HAVE_SKB_MARK_NAPI_ID, 1,
643                           [skb_mark_napi_id is defined])
644         ],[
645                 AC_MSG_RESULT(no)
646         ])
647
648         AC_MSG_CHECKING([if netdevice.h has napi_hash_add])
649         LB_LINUX_TRY_COMPILE([
650                 #include <linux/netdevice.h>
651         ],[
652                 napi_hash_add(NULL);
653
654                 return 0;
655         ],[
656                 AC_MSG_RESULT(yes)
657                 AC_DEFINE(HAVE_NAPI_HASH_ADD, 1,
658                           [napi_hash_add is defined])
659         ],[
660                 AC_MSG_RESULT(no)
661         ])
662
663         AC_MSG_CHECKING([if netdevice.h has netif_keep_dst])
664         LB_LINUX_TRY_COMPILE([
665                 #include <linux/netdevice.h>
666         ],[
667                 netif_keep_dst(NULL);
668
669                 return 0;
670         ],[
671                 AC_MSG_RESULT(yes)
672                 AC_DEFINE(HAVE_NETIF_KEEP_DST, 1,
673                           [netif_keep_dst is defined])
674         ],[
675                 AC_MSG_RESULT(no)
676         ])
677
678         AC_MSG_CHECKING([if netdevice.h has dev_consume_skb_any])
679         LB_LINUX_TRY_COMPILE([
680                 #include <linux/netdevice.h>
681         ],[
682                 dev_consume_skb_any(NULL);
683
684                 return 0;
685         ],[
686                 AC_MSG_RESULT(yes)
687                 AC_DEFINE(HAVE_DEV_CONSUME_SKB_ANY, 1,
688                           [dev_consume_skb_any is defined])
689         ],[
690                 AC_MSG_RESULT(no)
691         ])
692
693         AC_MSG_CHECKING([if netdevice.h has netdev_txq_bql_complete_prefetchw])
694         LB_LINUX_TRY_COMPILE([
695                 #include <linux/netdevice.h>
696         ],[
697                 netdev_txq_bql_complete_prefetchw(NULL);
698                 netdev_txq_bql_enqueue_prefetchw(NULL);
699
700                 return 0;
701         ],[
702                 AC_MSG_RESULT(yes)
703                 AC_DEFINE(HAVE_NETDEV_TXQ_BQL_PREFETCHW, 1,
704                           [netdev_txq_bql_complete_prefetchw is defined])
705         ],[
706                 AC_MSG_RESULT(no)
707         ])
708
709         AC_MSG_CHECKING([if struct sk_buff has xmit_more])
710         LB_LINUX_TRY_COMPILE([
711                 #include <linux/skbuff.h>
712         ],[
713                 struct sk_buff *skb;
714                 skb->xmit_more = 0;
715
716                 return 0;
717         ],[
718                 AC_MSG_RESULT(yes)
719                 AC_DEFINE(HAVE_SK_BUFF_XMIT_MORE, 1,
720                           [xmit_more is defined])
721         ],[
722                 AC_MSG_RESULT(no)
723         ])
724
725         AC_MSG_CHECKING([if struct sk_buff has encapsulation])
726         LB_LINUX_TRY_COMPILE([
727                 #include <linux/skbuff.h>
728         ],[
729                 struct sk_buff *skb;
730                 skb->encapsulation = 0;
731
732                 return 0;
733         ],[
734                 AC_MSG_RESULT(yes)
735                 AC_DEFINE(HAVE_SK_BUFF_ENCAPSULATION, 1,
736                           [encapsulation is defined])
737         ],[
738                 AC_MSG_RESULT(no)
739         ])
740
741         AC_MSG_CHECKING([if etherdevice.h has eth_get_headlen])
742         LB_LINUX_TRY_COMPILE([
743                 #include <linux/etherdevice.h>
744         ],[
745                 eth_get_headlen(NULL, 0);
746
747                 return 0;
748         ],[
749                 AC_MSG_RESULT(yes)
750                 AC_DEFINE(HAVE_ETH_GET_HEADLEN, 1,
751                           [eth_get_headlen is defined])
752         ],[
753                 AC_MSG_RESULT(no)
754         ])
755
756         AC_MSG_CHECKING([if struct sk_buff has csum_level])
757         LB_LINUX_TRY_COMPILE([
758                 #include <linux/skbuff.h>
759         ],[
760                 struct sk_buff *skb;
761                 skb->csum_level = 0;
762
763                 return 0;
764         ],[
765                 AC_MSG_RESULT(yes)
766                 AC_DEFINE(HAVE_SK_BUFF_CSUM_LEVEL, 1,
767                           [csum_level is defined])
768         ],[
769                 AC_MSG_RESULT(no)
770         ])
771
772         AC_MSG_CHECKING([if struct skbuff.h has skb_inner_transport_header])
773         LB_LINUX_TRY_COMPILE([
774                 #include <linux/skbuff.h>
775         ],[
776                 skb_inner_transport_header(NULL);
777
778                 return 0;
779         ],[
780                 AC_MSG_RESULT(yes)
781                 AC_DEFINE(HAVE_SKB_INNER_TRANSPORT_HEADER, 1,
782                           [skb_inner_transport_header is defined])
783         ],[
784                 AC_MSG_RESULT(no)
785         ])
786
787         AC_MSG_CHECKING([if struct skbuff.h has skb_inner_network_header])
788         LB_LINUX_TRY_COMPILE([
789                 #include <linux/skbuff.h>
790         ],[
791                 skb_inner_network_header(NULL);
792
793                 return 0;
794         ],[
795                 AC_MSG_RESULT(yes)
796                 AC_DEFINE(HAVE_SKB_INNER_NETWORK_HEADER, 1,
797                           [skb_inner_network_header is defined])
798         ],[
799                 AC_MSG_RESULT(no)
800         ])
801
802         AC_MSG_CHECKING([if if_vlan.h has vlan_dev_get_egress_qos_mask])
803         LB_LINUX_TRY_COMPILE([
804                 #include <linux/if_vlan.h>
805         ],[
806                 vlan_dev_get_egress_qos_mask(NULL, 0);
807
808                 return 0;
809         ],[
810                 AC_MSG_RESULT(yes)
811                 AC_DEFINE(HAVE_VLAN_DEV_GET_EGRESS_QOS_MASK, 1,
812                           [vlan_dev_get_egress_qos_mask is defined])
813         ],[
814                 AC_MSG_RESULT(no)
815         ])
816
817         AC_MSG_CHECKING([if netdevice.h has netdev_get_prio_tc_map])
818         LB_LINUX_TRY_COMPILE([
819                 #include <linux/netdevice.h>
820         ],[
821                 netdev_get_prio_tc_map(NULL, 0);
822
823                 return 0;
824         ],[
825                 AC_MSG_RESULT(yes)
826                 AC_DEFINE(HAVE_NETDEV_GET_PRIO_TC_MAP, 1,
827                           [netdev_get_prio_tc_map is defined])
828         ],[
829                 AC_MSG_RESULT(no)
830         ])
831
832         AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep_rcu])
833         LB_LINUX_TRY_COMPILE([
834                 #include <linux/if_vlan.h>
835         ],[
836                 __vlan_find_dev_deep_rcu(NULL, 0, 0);
837
838                 return 0;
839         ],[
840                 AC_MSG_RESULT(yes)
841                 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP_RCU, 1,
842                           [__vlan_find_dev_deep_rcu is defined])
843         ],[
844                 AC_MSG_RESULT(no)
845         ])
846
847         AC_MSG_CHECKING([if ndo_select_queue has accel_priv])
848         LB_LINUX_TRY_COMPILE([
849                 #include <linux/netdevice.h>
850
851                 static u16 select_queue(struct net_device *dev, struct sk_buff *skb,
852                                         void *accel_priv)
853                 {
854                         return 0;
855                 }
856         ],[
857                 struct net_device_opts ndops;
858
859                 ndops.ndo_select_queue = select_queue;
860
861                 return 0;
862         ],[
863                 AC_MSG_RESULT(yes)
864                 AC_DEFINE(NDO_SELECT_QUEUE_HAS_ACCEL_PRIV, 1,
865                           [ndo_select_queue has accel_priv])
866         ],[
867                 AC_MSG_RESULT(no)
868         ])
869
870         AC_MSG_CHECKING([if drivers/net/bonding/bonding.h exists])
871         LB_LINUX_TRY_COMPILE([
872                 #include "../drivers/net/bonding/bonding.h"
873         ],[
874                 return 0;
875         ],[
876                 AC_MSG_RESULT(yes)
877                 AC_DEFINE(HAVE_BONDING_H, 1,
878                           [drivers/net/bonding/bonding.h exists])
879         ],[
880                 AC_MSG_RESULT(no)
881         ])
882
883         AC_MSG_CHECKING([if bonding.h bond_for_each_slave has 3 parameters])
884         LB_LINUX_TRY_COMPILE([
885                 #include "../drivers/net/bonding/bonding.h"
886         ],[
887                 struct bonding *bond = NULL;
888                 struct list_head *iter = NULL;
889                 struct slave *slave = NULL;
890
891                 bond_for_each_slave(bond, slave, iter) ;
892
893                 return 0;
894         ],[
895                 AC_MSG_RESULT(yes)
896                 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3_PARAMS, 1,
897                           [bond_for_each_slave has 3 parameters])
898         ],[
899                 AC_MSG_RESULT(no)
900         ])
901
902
903         AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_init])
904         LB_LINUX_TRY_COMPILE([
905                 #include <linux/u64_stats_sync.h>
906         ],[
907                 struct u64_stats_sync sync;
908                 u64_stats_init(&sync);
909
910                 return 0;
911         ],[
912                 AC_MSG_RESULT(yes)
913                 AC_DEFINE(HAVE_U64_STATS_SYNC, 1,
914                           [u64_stats_sync is defined])
915         ],[
916                 AC_MSG_RESULT(no)
917         ])
918
919         AC_MSG_CHECKING([if u64_stats_sync.h has u64_stats_fetch_begin_irq])
920         LB_LINUX_TRY_COMPILE([
921                 #include <linux/u64_stats_sync.h>
922         ],[
923                 struct u64_stats_sync sync;
924                 u64_stats_fetch_begin_irq(&sync);
925
926                 return 0;
927         ],[
928                 AC_MSG_RESULT(yes)
929                 AC_DEFINE(HAVE_U64_STATS_FETCH_BEGIN_IRQ, 1,
930                           [u64_stats_fetch_begin_irq is defined])
931         ],[
932                 AC_MSG_RESULT(no)
933         ])
934         AC_MSG_CHECKING([if etherdevice.h has ether_addr_copy])
935         LB_LINUX_TRY_COMPILE([
936                 #include <linux/etherdevice.h>
937         ],[
938                 char dest[6], src[6];
939                 ether_addr_copy(&dest, &src);
940
941                 return 0;
942         ],[
943                 AC_MSG_RESULT(yes)
944                 AC_DEFINE(HAVE_ETHER_ADDR_COPY, 1,
945                           [ether_addr_copy is defined])
946         ],[
947                 AC_MSG_RESULT(no)
948         ])
949
950         AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_vf_rate])
951         LB_LINUX_TRY_COMPILE([
952                 #include <linux/netdevice.h>
953
954                 int set_vf_rate(struct net_device *dev, int vf, int min_tx_rate,
955                                                    int max_tx_rate)
956                 {
957                         return 0;
958                 }
959         ],[
960                 struct net_device_ops netdev_ops;
961
962                 netdev_ops.ndo_set_vf_rate = set_vf_rate;
963                 return 0;
964         ],[
965                 AC_MSG_RESULT(yes)
966                 AC_DEFINE(HAVE_SET_VF_RATE, 1,
967                           [ndo_set_vf_rate is defined])
968         ],[
969                 AC_MSG_RESULT(no)
970         ])
971
972         AC_MSG_CHECKING([if netdev_extended has hw_features])
973         LB_LINUX_TRY_COMPILE([
974                 #include <linux/netdevice.h>
975         ],[
976                 struct net_device *dev = NULL;
977
978                 netdev_extended(dev)->hw_features = 0;
979
980                 return 0;
981         ],[
982                 AC_MSG_RESULT(yes)
983                 AC_DEFINE(HAVE_NETDEV_EXTENDED_HW_FEATURES, 1,
984                           [ is defined])
985         ],[
986                 AC_MSG_RESULT(no)
987         ])
988
989         AC_MSG_CHECKING([if net_device_extended has _tx_ext])
990         LB_LINUX_TRY_COMPILE([
991                 #include <linux/netdevice.h>
992         ],[
993                 struct net_device *dev = NULL;
994
995                 netdev_extended(dev)->_tx_ext = NULL;
996
997                 return 0;
998         ],[
999                 AC_MSG_RESULT(yes)
1000                 AC_DEFINE(HAVE_NET_DEVICE_EXTENDED_TX_EXT, 1,
1001                           [ is defined])
1002         ],[
1003                 AC_MSG_RESULT(no)
1004         ])
1005
1006         AC_MSG_CHECKING([if net_device_extended has ndo_busy_poll])
1007         LB_LINUX_TRY_COMPILE([
1008                 #include <linux/netdevice.h>
1009
1010                 int busy_poll(struct napi_struct *napi)
1011                 {
1012                         return 0;
1013                 }
1014         ],[
1015                 struct net_device *dev = NULL;
1016
1017                 netdev_extended(dev)->ndo_busy_poll = busy_poll;
1018
1019                 return 0;
1020         ],[
1021                 AC_MSG_RESULT(yes)
1022                 AC_DEFINE(HAVE_NETDEV_EXTENDED_NDO_BUSY_POLL, 1,
1023                           [ is defined])
1024         ],[
1025                 AC_MSG_RESULT(no)
1026         ])
1027
1028         AC_MSG_CHECKING([if netdevice.h has set_netdev_hw_features])
1029         LB_LINUX_TRY_COMPILE([
1030                 #include <linux/netdevice.h>
1031         ],[
1032                 struct net_device *dev = NULL;
1033
1034                 set_netdev_hw_features(dev, 0);
1035
1036                 return 0;
1037         ],[
1038                 AC_MSG_RESULT(yes)
1039                 AC_DEFINE(HAVE_SET_NETDEV_HW_FEATURES, 1,
1040                           [ is defined])
1041         ],[
1042                 AC_MSG_RESULT(no)
1043         ])
1044
1045         AC_MSG_CHECKING([if netdevice.h has netif_set_xps_queue])
1046         LB_LINUX_TRY_COMPILE([
1047                 #include <linux/netdevice.h>
1048         ],[
1049                 struct net_device *dev = NULL;
1050
1051                 netif_set_xps_queue(dev, NULL, 0);
1052
1053                 return 0;
1054         ],[
1055                 AC_MSG_RESULT(yes)
1056                 AC_DEFINE(HAVE_NETIF_SET_XPS_QUEUE, 1,
1057                           [ is defined])
1058         ],[
1059                 AC_MSG_RESULT(no)
1060         ])
1061
1062
1063         AC_MSG_CHECKING([if struct net_device_ops has *ndo_set_features])
1064         LB_LINUX_TRY_COMPILE([
1065                 #include <linux/netdevice.h>
1066
1067                 int set_features(struct net_device *dev, netdev_features_t features)
1068                 {
1069                         return 0;
1070                 }
1071         ],[
1072                 struct net_device_ops netdev_ops;
1073
1074                 netdev_ops.ndo_set_features = set_features;
1075                 return 0;
1076         ],[
1077                 AC_MSG_RESULT(yes)
1078                 AC_DEFINE(HAVE_NDO_SET_FEATURES, 1,
1079                           [ndo_set_features is defined])
1080         ],[
1081                 AC_MSG_RESULT(no)
1082         ])
1083
1084         AC_MSG_CHECKING([if struct net_device_ops has *ndo_setup_tc])
1085         LB_LINUX_TRY_COMPILE([
1086                 #include <linux/netdevice.h>
1087
1088                 int setup_tc(struct net_device *dev, , u8 tc)
1089                 {
1090                         return 0;
1091                 }
1092         ],[
1093                 struct net_device_ops netdev_ops;
1094
1095                 netdev_ops.ndo_setup_tc = setup_tc;
1096                 return 0;
1097         ],[
1098                 AC_MSG_RESULT(yes)
1099                 AC_DEFINE(HAVE_NDO_SETUP_TC, 1,
1100                           [ndo_setup_tc is defined])
1101         ],[
1102                 AC_MSG_RESULT(no)
1103         ])
1104
1105         AC_MSG_CHECKING([if struct net_device_ops has *ndo_rx_flow_steer])
1106         LB_LINUX_TRY_COMPILE([
1107                 #include <linux/netdevice.h>
1108
1109                 int rx_flow_steer(struct net_device *dev,
1110                                                      const struct sk_buff *skb,
1111                                                      u16 rxq_index,
1112                                                      u32 flow_id)
1113                 {
1114                         return 0;
1115                 }
1116         ],[
1117                 struct net_device_ops netdev_ops;
1118
1119                 netdev_ops.ndo_rx_flow_steer = rx_flow_steer;
1120                 return 0;
1121         ],[
1122                 AC_MSG_RESULT(yes)
1123                 AC_DEFINE(HAVE_NDO_RX_FLOW_STEER, 1,
1124                           [ndo_rx_flow_steer is defined])
1125         ],[
1126                 AC_MSG_RESULT(no)
1127         ])
1128
1129         AC_MSG_CHECKING([if struct net_device has priv_flags])
1130         LB_LINUX_TRY_COMPILE([
1131                 #include <linux/netdevice.h>
1132         ],[
1133                 struct net_device *netdev;
1134                 netdev->priv_flags = 0;
1135
1136                 return 0;
1137         ],[
1138                 AC_MSG_RESULT(yes)
1139                 AC_DEFINE(HAVE_NET_DEVICE_PRIV_FLAGS, 1,
1140                           [priv_flags is defined])
1141         ],[
1142                 AC_MSG_RESULT(no)
1143         ])
1144
1145         AC_MSG_CHECKING([if struct net_device_ops has *ndo_get_stats64])
1146         LB_LINUX_TRY_COMPILE([
1147                 #include <linux/netdevice.h>
1148
1149                 struct rtnl_link_stats64* get_stats_64(struct net_device *dev,
1150                                                      struct rtnl_link_stats64 *storage)
1151                 {
1152                         struct rtnl_link_stats64 stats_64;
1153                         return &stats_64;
1154                 }
1155         ],[
1156                 struct net_device_ops netdev_ops;
1157
1158                 netdev_ops.ndo_get_stats64 = get_stats_64;
1159
1160                 return 0;
1161         ],[
1162                 AC_MSG_RESULT(yes)
1163                 AC_DEFINE(HAVE_NDO_GET_STATS64, 1,
1164                           [ndo_get_stats64 is defined])
1165         ],[
1166                 AC_MSG_RESULT(no)
1167         ])
1168         AC_MSG_CHECKING([if struct net_device_ops has ndo_bridge_set/getlink])
1169         LB_LINUX_TRY_COMPILE([
1170                 #include <linux/netdevice.h>
1171         ],[
1172                 struct net_device_ops netdev_ops =  {
1173                         .ndo_bridge_setlink = NULL,
1174                         .ndo_bridge_getlink = NULL,
1175                 };
1176
1177                 return 0;
1178         ],[
1179                 AC_MSG_RESULT(yes)
1180                 AC_DEFINE(HAVE_NDO_BRIDGE_SET_GET_LINK, 1,
1181                           [ndo_bridge_set/getlink is defined])
1182         ],[
1183                 AC_MSG_RESULT(no)
1184         ])
1185
1186         AC_MSG_CHECKING([if struct net_device_ops ndo_vlan_rx_add_vid has 3 parameters ])
1187         LB_LINUX_TRY_COMPILE([
1188                 #include <linux/netdevice.h>
1189
1190                 int vlan_rx_add_vid(struct net_device *dev,__be16 proto, u16 vid)
1191                 {
1192                         return 0;
1193                 }
1194         ],[
1195                 struct net_device_ops netdev_ops;
1196                 struct net_device *dev;
1197
1198                 netdev_ops.ndo_vlan_rx_add_vid = vlan_rx_add_vid;
1199                 netdev_ops.ndo_vlan_rx_add_vid(dev, 0, 0);
1200
1201                 return 0;
1202         ],[
1203                 AC_MSG_RESULT(yes)
1204                 AC_DEFINE(HAVE_NDO_RX_ADD_VID_HAS_3_PARAMS, 1,
1205                           [ndo_vlan_rx_add_vid has 3 parameters])
1206         ],[
1207                 AC_MSG_RESULT(no)
1208         ])
1209
1210         AC_MSG_CHECKING([if net_device_ops has ndo_get_phys_port_id])
1211         LB_LINUX_TRY_COMPILE([
1212                 #include <linux/netdevice.h>
1213
1214                 int get_phys_port_id(struct net_device *dev,
1215                                      struct netdev_phys_port_id *ppid)
1216                 {
1217                         return 0;
1218                 }
1219         ],[
1220                 struct net_device_ops netdev_ops;
1221
1222                 netdev_ops.ndo_get_phys_port_id = get_phys_port_id;
1223
1224                 return 0;
1225         ],[
1226                 AC_MSG_RESULT(yes)
1227                 AC_DEFINE(HAVE_NETDEV_NDO_GET_PHYS_PORT_ID, 1,
1228                           [ is defined])
1229         ],[
1230                 AC_MSG_RESULT(no)
1231         ])
1232
1233         AC_MSG_CHECKING([if struct net_device_ops_ext exist])
1234         LB_LINUX_TRY_COMPILE([
1235                 #include <linux/netdevice.h>
1236         ],[
1237                 struct net_device_ops_ext netdev_ops_ext = {
1238                         .size = sizeof(struct net_device_ops_ext),
1239                 };
1240
1241                 return 0;
1242         ],[
1243                 AC_MSG_RESULT(yes)
1244                 AC_DEFINE(HAVE_NET_DEVICE_OPS_EXT, 1,
1245                           [struct net_device_ops_ext is defined])
1246         ],[
1247                 AC_MSG_RESULT(no)
1248         ])
1249
1250         AC_MSG_CHECKING([if net_device_ops_ext has ndo_get_phys_port_id])
1251         LB_LINUX_TRY_COMPILE([
1252                 #include <linux/netdevice.h>
1253
1254                 int get_phys_port_id(struct net_device *dev,
1255                                      struct netdev_phys_port_id *ppid)
1256                 {
1257                         return 0;
1258                 }
1259         ],[
1260                 struct net_device_ops_ext netdev_ops_ext;
1261
1262                 netdev_ops_ext.ndo_get_phys_port_id = get_phys_port_id;
1263
1264                 return 0;
1265         ],[
1266                 AC_MSG_RESULT(yes)
1267                 AC_DEFINE(HAVE_NETDEV_EXT_NDO_GET_PHYS_PORT_ID, 1,
1268                           [ndo_get_phys_port_id is defined])
1269         ],[
1270                 AC_MSG_RESULT(no)
1271         ])
1272
1273         AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_spoofchk])
1274         LB_LINUX_TRY_COMPILE([
1275                 #include <linux/netdevice.h>
1276
1277                 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1278                 {
1279                         return 0;
1280                 }
1281         ],[
1282                 struct net_device_ops netdev_ops;
1283
1284                 netdev_ops.ndo_set_vf_spoofchk = set_vf_spoofchk;
1285
1286                 return 0;
1287         ],[
1288                 AC_MSG_RESULT(yes)
1289                 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_SPOOFCHK, 1,
1290                           [ndo_set_vf_spoofchk is defined in net_device_ops])
1291         ],[
1292                 AC_MSG_RESULT(no)
1293         ])
1294
1295         AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_spoofchk])
1296         LB_LINUX_TRY_COMPILE([
1297                 #include <linux/netdevice.h>
1298
1299                 int set_vf_spoofchk(struct net_device *dev, int vf, bool setting)
1300                 {
1301                         return 0;
1302                 }
1303         ],[
1304                 struct net_device_ops_ext netdev_ops_ext;
1305
1306                 netdev_ops_ext.ndo_set_vf_spoofchk = set_vf_spoofchk;
1307
1308                 return 0;
1309         ],[
1310                 AC_MSG_RESULT(yes)
1311                 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_SPOOFCHK, 1,
1312                           [ndo_set_vf_spoofchk is defined in net_device_ops_ext])
1313         ],[
1314                 AC_MSG_RESULT(no)
1315         ])
1316
1317         AC_MSG_CHECKING([if net_device_ops has ndo_set_vf_link_state])
1318         LB_LINUX_TRY_COMPILE([
1319                 #include <linux/netdevice.h>
1320
1321                 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1322                 {
1323                         return 0;
1324                 }
1325         ],[
1326                 struct net_device_ops netdev_ops;
1327
1328                 netdev_ops.ndo_set_vf_link_state = set_vf_link_state;
1329
1330                 return 0;
1331         ],[
1332                 AC_MSG_RESULT(yes)
1333                 AC_DEFINE(HAVE_NETDEV_OPS_NDO_SET_VF_LINK_STATE, 1,
1334                           [ndo_set_vf_link_state is defined in net_device_ops])
1335         ],[
1336                 AC_MSG_RESULT(no)
1337         ])
1338
1339         AC_MSG_CHECKING([if net_device_ops_ext has ndo_set_vf_link_state])
1340         LB_LINUX_TRY_COMPILE([
1341                 #include <linux/netdevice.h>
1342
1343                 int set_vf_link_state(struct net_device *dev, int vf, int link_state)
1344                 {
1345                         return 0;
1346                 }
1347         ],[
1348                 struct net_device_ops_ext netdev_ops_ext;
1349
1350                 netdev_ops_ext.ndo_set_vf_link_state = set_vf_link_state;
1351
1352                 return 0;
1353         ],[
1354                 AC_MSG_RESULT(yes)
1355                 AC_DEFINE(HAVE_NETDEV_OPS_EXT_NDO_SET_VF_LINK_STATE, 1,
1356                           [ndo_set_vf_link_state is defined])
1357         ],[
1358                 AC_MSG_RESULT(no)
1359         ])
1360
1361
1362         AC_MSG_CHECKING([if netdevice.h netif_set_real_num_tx_queues returns int])
1363         LB_LINUX_TRY_COMPILE([
1364                 #include <linux/netdevice.h>
1365         ],[
1366                 struct net_device dev;
1367                 int ret;
1368                 ret = netif_set_real_num_tx_queues(&dev, 2);
1369                 return 0;
1370         ],[
1371                 AC_MSG_RESULT(yes)
1372                 AC_DEFINE(HAVE_RETURN_INT_FOR_SET_NUM_TX_QUEUES, 1,
1373                           [netif_set_real_num_tx_queues returns int])
1374         ],[
1375                 AC_MSG_RESULT(no)
1376         ])
1377
1378         AC_MSG_CHECKING([if struct netdevice.h has struct xps_map])
1379         LB_LINUX_TRY_COMPILE([
1380                 #include <linux/netdevice.h>
1381         ],[
1382                 struct xps_map map;
1383                 map.len = 0;
1384
1385                 return 0;
1386         ],[
1387                 AC_MSG_RESULT(yes)
1388                 AC_DEFINE(HAVE_XPS_MAP, 1,
1389                           [struct xps_map is defined])
1390         ],[
1391                 AC_MSG_RESULT(no)
1392         ])
1393
1394         AC_MSG_CHECKING([if struct ethtool_ops has set_phys_id])
1395         LB_LINUX_TRY_COMPILE([
1396                 #include <linux/ethtool.h>
1397         ],[
1398                 const struct ethtool_ops en_ethtool_ops = {
1399                         .set_phys_id= NULL,
1400                 };
1401
1402                 return 0;
1403         ],[
1404                 AC_MSG_RESULT(yes)
1405                 AC_DEFINE(HAVE_SET_PHYS_ID, 1,
1406                           [set_phys_id is defined])
1407         ],[
1408                 AC_MSG_RESULT(no)
1409         ])
1410
1411         AC_MSG_CHECKING([if struct ethtool_ops has get/set_channels])
1412         LB_LINUX_TRY_COMPILE([
1413                 #include <linux/ethtool.h>
1414         ],[
1415                 const struct ethtool_ops en_ethtool_ops = {
1416                         .get_channels = NULL,
1417                         .set_channels = NULL,
1418                 };
1419
1420                 return 0;
1421         ],[
1422                 AC_MSG_RESULT(yes)
1423                 AC_DEFINE(HAVE_GET_SET_CHANNELS, 1,
1424                           [get/set_channels is defined])
1425         ],[
1426                 AC_MSG_RESULT(no)
1427         ])
1428
1429         AC_MSG_CHECKING([if struct ethtool_ops_ext has get/set_channels])
1430         LB_LINUX_TRY_COMPILE([
1431                 #include <linux/ethtool.h>
1432         ],[
1433                 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1434                         .get_channels = NULL,
1435                         .set_channels = NULL,
1436                 };
1437
1438                 return 0;
1439         ],[
1440                 AC_MSG_RESULT(yes)
1441                 AC_DEFINE(HAVE_GET_SET_CHANNELS_EXT, 1,
1442                           [get/set_channels is defined in ethtool_ops_ext])
1443         ],[
1444                 AC_MSG_RESULT(no)
1445         ])
1446
1447         AC_MSG_CHECKING([if struct ethtool_ops has get_ts_info])
1448         LB_LINUX_TRY_COMPILE([
1449                 #include <linux/ethtool.h>
1450         ],[
1451                 const struct ethtool_ops en_ethtool_ops = {
1452                         .get_ts_info = NULL,
1453                 };
1454
1455                 return 0;
1456         ],[
1457                 AC_MSG_RESULT(yes)
1458                 AC_DEFINE(HAVE_GET_TS_INFO, 1,
1459                           [get_ts_info is defined])
1460         ],[
1461                 AC_MSG_RESULT(no)
1462         ])
1463
1464         AC_MSG_CHECKING([if struct ethtool_ops has set_dump])
1465         LB_LINUX_TRY_COMPILE([
1466                 #include <linux/ethtool.h>
1467         ],[
1468                 const struct ethtool_ops en_ethtool_ops = {
1469                         .set_dump = NULL,
1470                 };
1471
1472                 return 0;
1473         ],[
1474                 AC_MSG_RESULT(yes)
1475                 AC_DEFINE(HAVE_ETHTOOL_OPS_SET_DUMP, 1,
1476                           [set_dump is defined])
1477         ],[
1478                 AC_MSG_RESULT(no)
1479         ])
1480
1481         AC_MSG_CHECKING([if struct ethtool_ops has get_module_info])
1482         LB_LINUX_TRY_COMPILE([
1483                 #include <linux/ethtool.h>
1484         ],[
1485                 const struct ethtool_ops en_ethtool_ops = {
1486                         .get_module_info = NULL,
1487                 };
1488
1489                 return 0;
1490         ],[
1491                 AC_MSG_RESULT(yes)
1492                 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_INFO, 1,
1493                           [get_module_info is defined])
1494         ],[
1495                 AC_MSG_RESULT(no)
1496         ])
1497
1498         AC_MSG_CHECKING([if struct ethtool_ops has get_module_eeprom])
1499         LB_LINUX_TRY_COMPILE([
1500                 #include <linux/ethtool.h>
1501         ],[
1502                 const struct ethtool_ops en_ethtool_ops = {
1503                         .get_module_eeprom = NULL,
1504                 };
1505
1506                 return 0;
1507         ],[
1508                 AC_MSG_RESULT(yes)
1509                 AC_DEFINE(HAVE_ETHTOOL_OPS_GET_MODULE_EEPROM, 1,
1510                           [get_module_eeprom is defined])
1511         ],[
1512                 AC_MSG_RESULT(no)
1513         ])
1514
1515         AC_MSG_CHECKING([if struct ethtool_ops_ext has get_ts_info])
1516         LB_LINUX_TRY_COMPILE([
1517                 #include <linux/ethtool.h>
1518         ],[
1519                 const struct ethtool_ops_ext en_ethtool_ops_ext = {
1520                         .get_ts_info = NULL,
1521                 };
1522
1523                 return 0;
1524         ],[
1525                 AC_MSG_RESULT(yes)
1526                 AC_DEFINE(HAVE_GET_TS_INFO_EXT, 1,
1527                           [get_ts_info is defined in ethtool_ops_ext])
1528         ],[
1529                 AC_MSG_RESULT(no)
1530         ])
1531
1532         AC_MSG_CHECKING([if struct ethtool_flow_ext has h_dest])
1533         LB_LINUX_TRY_COMPILE([
1534                 #include <linux/ethtool.h>
1535         ],[
1536                 unsigned char mac[ETH_ALEN];
1537                 struct ethtool_flow_ext h_ext;
1538
1539                 memcpy(&mac, h_ext.h_dest, ETH_ALEN);
1540
1541                 return 0;
1542         ],[
1543                 AC_MSG_RESULT(yes)
1544                 AC_DEFINE(HAVE_ETHTOOL_FLOW_EXT_H_DEST, 1,
1545                           [ethtool_flow_ext has h_dest])
1546         ],[
1547                 AC_MSG_RESULT(no)
1548         ])
1549
1550         AC_MSG_CHECKING([if netdevice.h has struct dev_addr_list])
1551         LB_LINUX_TRY_COMPILE([
1552                 #include <linux/netdevice.h>
1553         ],[
1554                 struct dev_addr_list addr;
1555                 return 0;
1556         ],[
1557                 AC_MSG_RESULT(yes)
1558                 AC_DEFINE(HAVE_NETDEV_DEV_ADDR, 1,
1559                           [dev_addr_list is defined])
1560         ],[
1561                 AC_MSG_RESULT(no)
1562         ])
1563
1564         AC_MSG_CHECKING([if pci.h has pci_vfs_assigned])
1565         LB_LINUX_TRY_COMPILE([
1566                 #include <linux/pci.h>
1567         ],[
1568                 struct pci_dev pdev;
1569                 pci_vfs_assigned(&pdev);
1570                 return 0;
1571         ],[
1572                 AC_MSG_RESULT(yes)
1573                 AC_DEFINE(HAVE_PCI_VF_ASSIGNED, 1,
1574                           [pci_vfs_assigned is defined])
1575         ],[
1576                 AC_MSG_RESULT(no)
1577         ])
1578         AC_MSG_CHECKING([if __vlan_put_tag has 3 parameters])
1579         LB_LINUX_TRY_COMPILE([
1580                 #include <linux/if_vlan.h>
1581         ],[
1582                 struct sk_buff *skb;
1583                 __vlan_put_tag(skb, 0, 0);
1584
1585                 return 0;
1586         ],[
1587                 AC_MSG_RESULT(yes)
1588                 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_PUT_TAG, 1,
1589                           [__vlan_put_tag has 3 parameters])
1590         ],[
1591                 AC_MSG_RESULT(no)
1592         ])
1593
1594         AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1595         LB_LINUX_TRY_COMPILE([
1596                 #include <linux/if_vlan.h>
1597         ],[
1598                 struct sk_buff *skb;
1599                 __vlan_hwaccel_put_tag(skb, 0, 0);
1600
1601                 return 0;
1602         ],[
1603                 AC_MSG_RESULT(yes)
1604                 AC_DEFINE(HAVE_3_PARAMS_FOR_VLAN_HWACCEL_PUT_TAG, 1,
1605                           [__vlan_hwaccel_put_tag has 3 parameters])
1606         ],[
1607                 AC_MSG_RESULT(no)
1608         ])
1609
1610         AC_MSG_CHECKING([if struct inet6_ifaddr has if_next])
1611         LB_LINUX_TRY_COMPILE([
1612                 #include <net/if_inet6.h>
1613         ],[
1614                 struct inet6_ifaddr ifp ;
1615                 ifp.if_next = 0;
1616
1617                 return 0;
1618         ],[
1619                 AC_MSG_RESULT(yes)
1620                 AC_DEFINE(HAVE_INETADDR_IF_NEXT, 1,
1621                           [if_next is defined])
1622         ],[
1623                 AC_MSG_RESULT(no)
1624         ])
1625
1626         AC_MSG_CHECKING([if struct net_device has hw_features])
1627         LB_LINUX_TRY_COMPILE([
1628                 #include <linux/netdevice.h>
1629         ],[
1630                 struct net_device dev;
1631                 dev.hw_features = 0;
1632
1633                 return 0;
1634         ],[
1635                 AC_MSG_RESULT(yes)
1636                 AC_DEFINE(HAVE_NETDEV_HW_FEATURES, 1,
1637                           [hw_features is defined])
1638         ],[
1639                 AC_MSG_RESULT(no)
1640         ])
1641
1642         AC_MSG_CHECKING([if struct net_device has hw_enc_features])
1643         LB_LINUX_TRY_COMPILE([
1644                 #include <linux/netdevice.h>
1645         ],[
1646                 struct net_device dev;
1647                 dev.hw_enc_features = 0;
1648
1649                 return 0;
1650         ],[
1651                 AC_MSG_RESULT(yes)
1652                 AC_DEFINE(HAVE_NETDEV_HW_ENC_FEATURES, 1,
1653                           [hw_enc_features is defined])
1654         ],[
1655                 AC_MSG_RESULT(no)
1656         ])
1657
1658         AC_MSG_CHECKING([if struct net_device has rx_cpu_rmap])
1659         LB_LINUX_TRY_COMPILE([
1660                 #include <linux/netdevice.h>
1661         ],[
1662                 struct net_device dev;
1663                 dev.rx_cpu_rmap = NULL;
1664
1665                 return 0;
1666         ],[
1667                 AC_MSG_RESULT(yes)
1668                 AC_DEFINE(HAVE_NETDEV_RX_CPU_RMAP, 1,
1669                           [rx_cpu_rmap is defined])
1670         ],[
1671                 AC_MSG_RESULT(no)
1672         ])
1673
1674         AC_MSG_CHECKING([if if_vlan.h has vlan_hwaccel_receive_skb])
1675         LB_LINUX_TRY_COMPILE([
1676                 #include <linux/if_vlan.h>
1677         ],[
1678                 struct sk_buff *skb;
1679                 vlan_hwaccel_receive_skb(skb,0,0);
1680                 return 0;
1681         ],[
1682                 AC_MSG_RESULT(yes)
1683                 AC_DEFINE(HAVE_VLAN_HWACCEL_RECEIVE_SKB, 1,
1684                           [vlan_hwaccel_receive_skb is defined])
1685         ],[
1686                 AC_MSG_RESULT(no)
1687         ])
1688
1689         AC_MSG_CHECKING([if irqdesc.h has irq_desc_get_irq_data])
1690         LB_LINUX_TRY_COMPILE([
1691                 #include <linux/irqdesc.h>
1692         ],[
1693                 struct irq_data *data = irq_desc_get_irq_data(NULL);
1694                 return 0;
1695         ],[
1696                 AC_MSG_RESULT(yes)
1697                 AC_DEFINE(HAVE_IRQ_DESC_GET_IRQ_DATA, 1,
1698                           [irq_desc_get_irq_data is defined])
1699         ],[
1700                 AC_MSG_RESULT(no)
1701         ])
1702
1703
1704         AC_MSG_CHECKING([if pci_dev has pcie_mpss])
1705         LB_LINUX_TRY_COMPILE([
1706                 #include <linux/pci.h>
1707         ],[
1708                 struct pci_dev pdev;
1709
1710                 pdev.pcie_mpss = 0;
1711                 return 0;
1712         ],[
1713                 AC_MSG_RESULT(yes)
1714                 AC_DEFINE(HAVE_PCI_DEV_PCIE_MPSS, 1,
1715                           [pcie_mpss is defined])
1716         ],[
1717                 AC_MSG_RESULT(no)
1718         ])
1719
1720         AC_MSG_CHECKING([if uapi/linux/if_ether.h exist])
1721         LB_LINUX_TRY_COMPILE([
1722                 #include <uapi/linux/if_ether.h>
1723         ],[
1724                 return 0;
1725         ],[
1726                 AC_MSG_RESULT(yes)
1727                 AC_DEFINE(HAVE_UAPI_LINUX_IF_ETHER_H, 1,
1728                           [uapi/linux/if_ether.h exist])
1729         ],[
1730                 AC_MSG_RESULT(no)
1731         ])
1732
1733         AC_MSG_CHECKING([if ifla_vf_info has spoofchk])
1734         LB_LINUX_TRY_COMPILE([
1735                 #include <linux/if_link.h>
1736         ],[
1737                 struct ifla_vf_info *ivf;
1738
1739                 ivf->spoofchk = 0;
1740                 return 0;
1741         ],[
1742                 AC_MSG_RESULT(yes)
1743                 AC_DEFINE(HAVE_VF_INFO_SPOOFCHK, 1,
1744                           [spoofchk is defined])
1745         ],[
1746                 AC_MSG_RESULT(no)
1747         ])
1748
1749         AC_MSG_CHECKING([if dst.h has dst_get_neighbour])
1750         LB_LINUX_TRY_COMPILE([
1751                 #include <net/dst.h>
1752         ],[
1753                 struct neighbour *neigh = dst_get_neighbour(NULL);
1754
1755                 return 0;
1756         ],[
1757                 AC_MSG_RESULT(yes)
1758                 AC_DEFINE(HAVE_DST_GET_NEIGHBOUR, 1,
1759                           [ is defined])
1760         ],[
1761                 AC_MSG_RESULT(no)
1762         ])
1763
1764         AC_MSG_CHECKING([if netlink_dump_start has 6 parameters])
1765         LB_LINUX_TRY_COMPILE([
1766                 #include <linux/netlink.h>
1767         ],[
1768                 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL, 0);
1769
1770                 return 0;
1771         ],[
1772                 AC_MSG_RESULT(yes)
1773                 AC_DEFINE(HAVE_NETLINK_DUMP_START_6P, 1,
1774                           [ is defined])
1775         ],[
1776                 AC_MSG_RESULT(no)
1777         ])
1778
1779         AC_MSG_CHECKING([if netlink_dump_start has 5 parameters])
1780         LB_LINUX_TRY_COMPILE([
1781                 #include <linux/netlink.h>
1782         ],[
1783                 int ret = netlink_dump_start(NULL, NULL, NULL, NULL, NULL);
1784
1785                 return 0;
1786         ],[
1787                 AC_MSG_RESULT(yes)
1788                 AC_DEFINE(HAVE_NETLINK_DUMP_START_5P, 1,
1789                           [ is defined])
1790         ],[
1791                 AC_MSG_RESULT(no)
1792         ])
1793
1794         AC_MSG_CHECKING([if struct dcbnl_rtnl_ops has ieee_getmaxrate/ieee_setmaxrate])
1795         LB_LINUX_TRY_COMPILE([
1796                 #include <net/dcbnl.h>
1797         ],[
1798                 const struct dcbnl_rtnl_ops en_dcbnl_ops = {
1799                         .ieee_getmaxrate = NULL,
1800                         .ieee_setmaxrate = NULL,
1801                 };
1802
1803                 return 0;
1804         ],[
1805                 AC_MSG_RESULT(yes)
1806                 AC_DEFINE(HAVE_IEEE_GET_SET_MAXRATE, 1,
1807                           [ieee_getmaxrate/ieee_setmaxrate is defined])
1808         ],[
1809                 AC_MSG_RESULT(no)
1810         ])
1811
1812         AC_LANG_PUSH(C)
1813         ac_c_werror_flag=yes
1814         save_EXTRA_KCFLAGS=$EXTRA_KCFLAGS
1815         EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror"
1816
1817         AC_MSG_CHECKING([if bonding.h bond_for_each_slave has int for 3rd parameter])
1818         LB_LINUX_TRY_COMPILE([
1819                 #include "../drivers/net/bonding/bonding.h"
1820         ],[
1821                 struct bonding *bond = NULL;
1822                 struct slave *slave = NULL;
1823                 int iter;
1824
1825                 bond_for_each_slave(bond, slave, iter) ;
1826
1827                 return 0;
1828         ],[
1829                 AC_MSG_RESULT(yes)
1830                 AC_DEFINE(HAVE_BOND_FOR_EACH_SLAVE_3RD_PARAM_IS_INT, 1,
1831                           [bond_for_each_slave has int for 3rd parameter])
1832         ],[
1833                 AC_MSG_RESULT(no)
1834         ])
1835         EXTRA_KCFLAGS="$save_EXTRA_KCFLAGS"
1836         ac_c_werror_flag=
1837         AC_LANG_POP
1838
1839         AC_MSG_CHECKING([if netdevice.h has netdev_master_upper_dev_get_rcu])
1840         LB_LINUX_TRY_COMPILE([
1841                 #include <linux/netdevice.h>
1842         ],[
1843                 netdev_master_upper_dev_get_rcu(NULL);
1844
1845                 return 0;
1846         ],[
1847                 AC_MSG_RESULT(yes)
1848                 AC_DEFINE(HAVE_NETDEV_MASTER_UPPER_DEV_GET_RCU, 1,
1849                           [netdevice.h has netdev_master_upper_dev_get_rcu])
1850         ],[
1851                 AC_MSG_RESULT(no)
1852         ])
1853
1854         AC_MSG_CHECKING([if __vlan_find_dev_deep has 3 parameters])
1855         LB_LINUX_TRY_COMPILE([
1856                 #include <linux/if_vlan.h>
1857         ],[
1858                 __vlan_find_dev_deep(NULL, 0, 0);
1859
1860                 return 0;
1861         ],[
1862                 AC_MSG_RESULT(yes)
1863                 AC_DEFINE(HAVE__VLAN_FIND_DEV_DEEP_3P, 1,
1864                           [__vlan_find_dev_deep has 3 paramters])
1865         ],[
1866                 AC_MSG_RESULT(no)
1867         ])
1868
1869         AC_MSG_CHECKING([if sk_buff.h has __skb_alloc_page])
1870         LB_LINUX_TRY_COMPILE([
1871                 #include <linux/skbuff.h>
1872         ],[
1873                 __skb_alloc_page(0, NULL);
1874
1875                 return 0;
1876         ],[
1877                 AC_MSG_RESULT(yes)
1878                 AC_DEFINE(HAVE__SKB_ALLOC_PAGE, 1,
1879                           [sk_buff has __skb_alloc_page])
1880         ],[
1881                 AC_MSG_RESULT(no)
1882         ])
1883
1884         AC_MSG_CHECKING([if __vlan_hwaccel_put_tag has 3 parameters])
1885         LB_LINUX_TRY_COMPILE([
1886                 #include <linux/if_vlan.h>
1887         ],[
1888                 __vlan_hwaccel_put_tag(NULL, 0, 0);
1889
1890                 return 0;
1891         ],[
1892                 AC_MSG_RESULT(yes)
1893                 AC_DEFINE(HAVE__VLAN_HWACCEL_PUT_TAG_3P, 1,
1894                           [__vlan_hwaccel_put_tag has 3 paramters])
1895         ],[
1896                 AC_MSG_RESULT(no)
1897         ])
1898
1899         AC_MSG_CHECKING([if linux/mm_types.h has struct page_frag])
1900         LB_LINUX_TRY_COMPILE([
1901                 #include <linux/mm_types.h>
1902         ],[
1903                 struct page_frag frag = {0};
1904
1905                 return 0;
1906         ],[
1907                 AC_MSG_RESULT(yes)
1908                 AC_DEFINE(HAVE_MM_TYPES_PAGE_FRAG, 1,
1909                           [linux/mm_types.h has struct page_frag])
1910         ],[
1911                 AC_MSG_RESULT(no)
1912         ])
1913
1914         AC_MSG_CHECKING([if if_vlan.h has __vlan_find_dev_deep])
1915         LB_LINUX_TRY_COMPILE([
1916                 #include <linux/if_vlan.h>
1917         ],[
1918                 __vlan_find_dev_deep(NULL, 0);
1919
1920                 return 0;
1921         ],[
1922                 AC_MSG_RESULT(yes)
1923                 AC_DEFINE(HAVE___VLAN_FIND_DEV_DEEP, 1,
1924                           [__vlan_find_dev_deep is defined])
1925         ],[
1926                 AC_MSG_RESULT(no)
1927         ])
1928
1929         AC_MSG_CHECKING([if idr .h has idr_Alloc])
1930         LB_LINUX_TRY_COMPILE([
1931                 #include <linux/idr.h>
1932         ],[
1933                 idr_alloc(NULL, NULL, 0, 0, 0);
1934                 return 0;
1935         ],[
1936                 AC_MSG_RESULT(yes)
1937                 AC_DEFINE(HAVE_IDR_NEW_INTERFACE, 1,
1938                           [idr_Alloc is defined])
1939         ],[
1940                 AC_MSG_RESULT(no)
1941         ])
1942
1943 ])
1944 #
1945 # COMPAT_CONFIG_HEADERS
1946 #
1947 # add -include config.h
1948 #
1949 AC_DEFUN([COMPAT_CONFIG_HEADERS],[
1950         AC_CONFIG_HEADERS([config.h])
1951         EXTRA_KCFLAGS="-include $PWD/config.h $EXTRA_KCFLAGS"
1952         AC_SUBST(EXTRA_KCFLAGS)
1953 ])
1954
1955 AC_DEFUN([OFA_PROG_LINUX],
1956 [
1957
1958 LB_LINUX_PATH
1959 LB_LINUX_SYMVERFILE
1960 LB_LINUX_CONFIG([MODULES],[],[
1961     AC_MSG_ERROR([module support is required to build mlnx kernel modules.])
1962 ])
1963 LB_LINUX_CONFIG([MODVERSIONS])
1964 LB_LINUX_CONFIG([KALLSYMS],[],[
1965     AC_MSG_ERROR([compat_mlnx requires that CONFIG_KALLSYMS is enabled in your kernel.])
1966 ])
1967
1968 LINUX_CONFIG_COMPAT
1969 COMPAT_CONFIG_HEADERS
1970
1971 ])