forked from ribalda/ethercat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
1028 lines (881 loc) · 29.2 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#------------------------------------------------------------------------------
#
# $Id$
#
# 版权所有 (C) 2006-2012 Florian Pose, Ingenieurgemeinschaft IgH
#
# 此文件是 IgH EtherCAT Master 的一部分。
#
# IgH EtherCAT Master 是自由软件;您可以根据 GNU General Public License 第2版的条款重新分发和修改它,该许可证由自由软件基金会发布。
#
# IgH EtherCAT Master 希望它是有用的,但没有任何担保;甚至没有暗示的担保,适销性或适用于特定目的的担保。有关更多详细信息,请参阅 GNU General Public License。
#
# 您应该收到了 GNU General Public License 的副本;如果没有,请写信给 Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA。
#
# ---
#
# 上述许可证仅涉及源代码。使用 EtherCAT 技术和品牌仅在遵守 Beckhoff Automation GmbH 的工业产权和类似权利的情况下允许。
#
#------------------------------------------------------------------------------
#
# 发布流程
# - 更新以发布内核版本的以太网驱动程序
# - 编写自上次发布以来的变更的 NEWS 条目
# - 检查是否有完整的 Doxygen 注释
# - 更新文档中的版本号
# - 更新 ChangeLog -> hg log -bstable-1.5 --style=changelog > ChangeLog
# - 在下方更新版本号
# - 运行 make dist-bzip2
AC_PREREQ(2.59) # 检查Autoconf版本是否满足要求
AC_INIT([ethercat],[1.5.2],[[email protected]]) # 设置软件包的名称、版本和联系人信息
AC_CONFIG_AUX_DIR([autoconf]) # 指定辅助文件的目录
AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 subdir-objects]) # 初始化Automake,并设置编译选项
AC_CONFIG_HEADERS([config.h]) # 生成config.h文件
AC_CONFIG_SRCDIR([config.h.in]) # 指定源代码目录中的配置文件
AC_CONFIG_MACRO_DIR([m4]) # 指定宏文件的目录
#------------------------------------------------------------------------------
# Global
#------------------------------------------------------------------------------
AM_PROG_CC_C_O # 检查并设置C编译器
m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # 检查并设置静态库工具(可选)
AC_PROG_CXX # 检查并设置C++编译器
AC_PROG_LIBTOOL # 检查并设置libtool工具
#------------------------------------------------------------------------------
# Kernel modules
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build kernel modules])
AC_ARG_ENABLE([kernel],
AS_HELP_STRING([--enable-kernel],
[Enable building kernel modules]),
[
case "${enableval}" in
yes) enablekernel=1
;;
no) enablekernel=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-generic])
;;
esac
],
[enablekernel=1]
)
if test "x$enablekernel" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_KERNEL, test "x$enablekernel" = "x1")
AC_SUBST(ENABLE_KERNEL,[$enablekernel])
#------------------------------------------------------------------------------
# Linux sources
#------------------------------------------------------------------------------
if test "x$enablekernel" = "x1"; then
# 检查是否启用内核配置
AC_ARG_WITH([linux-dir],
AC_HELP_STRING(
[--with-linux-dir=<DIR>],
[Linux kernel sources @<:@running kernel@:>@]
),
[
sourcedir=[$withval]
],
[
version=[`uname -r`]
modulesdir=/lib/modules/${version}
if test \! -d ${modulesdir} || test \! -d ${modulesdir}/build; then
echo
AC_MSG_ERROR([Failed to find Linux sources. Use --with-linux-dir!])
fi
sourcedir=`cd ${modulesdir}/build && pwd -P`
]
)
AC_MSG_CHECKING([for Linux kernel sources])
# 检查Linux内核源代码路径
if test \! -r ${sourcedir}/.config; then
echo
AC_MSG_ERROR([No configured Linux kernel sources in $sourcedir])
fi
# 检查是否存在配置的Linux内核源代码
# 尝试获取内核版本字符串
if test -r ${sourcedir}/include/config/kernel.release; then
kernelrelease=`cat $sourcedir/include/config/kernel.release`
elif test -r ${sourcedir}/.kernelrelease; then
kernelrelease=`cat $sourcedir/.kernelrelease`
elif test -r ${sourcedir}/include/linux/utsrelease.h; then
hdr=${sourcedir}/include/linux/utsrelease.h
kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
elif test -r ${sourcedir}/include/linux/version.h; then
hdr=${sourcedir}/include/linux/version.h
kernelrelease=`grep UTS_RELEASE $hdr | cut -d " " -f 3- | tr -d \"`
fi
if test -z "$kernelrelease"; then
echo
AC_MSG_ERROR([Failed to extract Linux kernel version!])
fi
# 检查是否成功提取了Linux内核版本号
if test ${kernelrelease%%.*} -gt 2; then
regex="^[[0-9]]+\.[[0-9]]+"
else
regex="^[[0-9]]+\.[[0-9]]+\.[[0-9]]+"
fi
# 根据内核版本号的格式设置正则表达式
# 从内核版本中提取数字
linuxversion=`echo $kernelrelease | grep -oE "$regex"`
AC_SUBST(LINUX_SOURCE_DIR,[$sourcedir])
AC_MSG_RESULT([$LINUX_SOURCE_DIR (Kernel $linuxversion)])
# 保存内核源代码路径和版本信息
fi
#------------------------------------------------------------------------------
# Linux module installation subdirectory
#------------------------------------------------------------------------------
AC_ARG_WITH([module-dir],
AC_HELP_STRING(
[--with-module-dir=<DIR>],
[Linux module installation dir. Default: ethercat]
),
[moddir=[$withval]],
[moddir="ethercat"]
)
AC_SUBST(INSTALL_MOD_DIR,[$moddir])
AC_MSG_CHECKING([for Linux modules installation directory])
AC_MSG_RESULT([$INSTALL_MOD_DIR])
#------------------------------------------------------------------------------
# Generic Ethernet driver
#------------------------------------------------------------------------------
AC_ARG_ENABLE([generic],
AS_HELP_STRING([--enable-generic],
[Enable generic Ethernet driver]),
[
case "${enableval}" in
yes) enablegeneric=1
;;
no) enablegeneric=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-generic])
;;
esac
],
[enablegeneric=$enablekernel]
)
AM_CONDITIONAL(ENABLE_GENERIC, test "x$enablegeneric" = "x1")
AC_SUBST(ENABLE_GENERIC,[$enablegeneric])
#------------------------------------------------------------------------------
# CCAT driver
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the CCAT driver])
AC_ARG_ENABLE([ccat],
AS_HELP_STRING([--enable-ccat],
[Enable CCAT driver]),
[
case "${enableval}" in
yes) enableccat=1
;;
no) enableccat=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-ccat])
;;
esac
],
[enableccat=0] # disabled by default
)
if test "x${enableccat}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_CCAT, test "x$enableccat" = "x1")
AC_SUBST(ENABLE_CCAT,[$enableccat])
#------------------------------------------------------------------------------
# RTAI path (optional)
#------------------------------------------------------------------------------
AC_ARG_WITH([rtai-dir],
AC_HELP_STRING(
[--with-rtai-dir=<DIR>],
[RTAI path, for RTDM interface and RTAI examples]
),
[
rtaidir=[$withval]
rtai=1
],
[
rtaidir=""
rtai=0
]
)
AC_MSG_CHECKING([for RTAI path])
if test -z "${rtaidir}"; then
AC_MSG_RESULT([not specified.])
else
if test \! -r ${rtaidir}/include/rtai.h; then
AC_MSG_ERROR([no RTAI installation found in ${rtaidir}!])
fi
AC_MSG_RESULT([$rtaidir])
rtai_lxrt_cflags=`$rtaidir/bin/rtai-config --lxrt-cflags`
rtai_lxrt_ldflags=`$rtaidir/bin/rtai-config --lxrt-ldflags`
fi
AC_SUBST(RTAI_DIR,[$rtaidir])
AM_CONDITIONAL(ENABLE_RTAI, test "x$rtai" = "x1")
AC_SUBST(ENABLE_RTAI,[$rtai])
AC_SUBST(RTAI_LXRT_CFLAGS,[$rtai_lxrt_cflags])
AC_SUBST(RTAI_LXRT_LDFLAGS,[$rtai_lxrt_ldflags])
#------------------------------------------------------------------------------
# Xenomai path (optional)
#------------------------------------------------------------------------------
AC_ARG_WITH([xenomai-dir],
AC_HELP_STRING(
[--with-xenomai-dir=<DIR>],
[Xenomai path, for RTDM interface and Xenomai examples]
),
[
xenomaidir=[$withval]
xeno=1
],
[
xenomaidir=""
xeno=0
]
)
AC_MSG_CHECKING([for Xenomai path])
if test -z "${xenomaidir}"; then
AC_MSG_RESULT([not specified.])
else
if test \! -r ${xenomaidir}/include/xeno_config.h; then
AC_MSG_ERROR([no Xenomai installation found in ${xenomaidir}!])
fi
AC_MSG_RESULT([$xenomaidir])
xenomai_ver=`grep -R "VERSION_STRING" ${xenomaidir}/include/xeno_config.h | awk '{print $3}'`
xenomai_ver=${xenomai_ver##\"}
xenomai_ver=${xenomai_ver%%\"}
echo "xenomai version: " $xenomai_ver
if test ${xenomai_ver%%.*} -gt 2; then
xeno_alchemy_cflags=`$xenomaidir/bin/xeno-config --skin alchemy --cflags`
xeno_alchemy_ldflags=`$xenomaidir/bin/xeno-config --skin alchemy --auto-init-solib --ldflags`
xeno_posix_ldflags=`$xenomaidir/bin/xeno-config --skin posix --auto-init-solib --ldflags`
xeno_rtdm_ldflags=`$xenomaidir/bin/xeno-config --skin rtdm --auto-init-solib --ldflags`
xeno_v3=1
xeno=0
else
xeno_native_cflags=`$xenomaidir/bin/xeno-config --skin native --cflags`
xeno_native_ldflags=`$xenomaidir/bin/xeno-config --skin native --ldflags`
xeno_posix_ldflags=`$xenomaidir/bin/xeno-config --skin posix --ldflags`
xeno_rtdm_ldflags=`$xenomaidir/bin/xeno-config --skin rtdm --ldflags`
fi
xeno_posix_cflags=`$xenomaidir/bin/xeno-config --skin posix --cflags`
xeno_rtdm_cflags=`$xenomaidir/bin/xeno-config --skin rtdm --cflags`
fi
AC_SUBST(XENOMAI_DIR,[$xenomaidir])
AM_CONDITIONAL(ENABLE_XENOMAI, test "x$xeno" = "x1")
AC_SUBST(ENABLE_XENOMAI,[$xeno])
AM_CONDITIONAL(ENABLE_XENOMAI_V3, test "x$xeno_v3" = "x1")
AC_SUBST(ENABLE_XENOMAI_V3,[$xeno_v3])
AC_SUBST(XENOMAI_ALCHEMY_CFLAGS,[$xeno_alchemy_cflags])
AC_SUBST(XENOMAI_ALCHEMY_LDFLAGS,[$xeno_alchemy_ldflags])
AC_SUBST(XENOMAI_NATIVE_CFLAGS,[$xeno_native_cflags])
AC_SUBST(XENOMAI_NATIVE_LDFLAGS,[$xeno_native_ldflags])
AC_SUBST(XENOMAI_POSIX_CFLAGS,[$xeno_posix_cflags])
AC_SUBST(XENOMAI_POSIX_LDFLAGS,[$xeno_posix_ldflags])
AC_SUBST(XENOMAI_RTDM_CFLAGS,[$xeno_rtdm_cflags])
AC_SUBST(XENOMAI_RTDM_LDFLAGS,[$xeno_rtdm_ldflags])
#------------------------------------------------------------------------------
# RTDM interface (optional)
#------------------------------------------------------------------------------
AC_ARG_ENABLE([rtdm],
AC_HELP_STRING(
[--enable-rtdm],
[Enable RTDM interface, depends on RTAI or Xenomai]
),
[
case "${enableval}" in
yes) rtdm=1
;;
no) rtdm=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-rtdm])
;;
esac
],
[rtdm=0]
)
AC_MSG_CHECKING([whether to build RTDM interface])
if test "x${rtdm}" = "x1"; then
AC_DEFINE([EC_RTDM], [1], [RTDM interface enabled])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_RTDM, test "x$rtdm" = "x1")
AC_SUBST(ENABLE_RTDM,[$rtdm])
#------------------------------------------------------------------------------
# Debug interface
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the debug interface])
AC_ARG_ENABLE([debug-if],
AS_HELP_STRING([--enable-debug-if],
[Create a debug interface for each master @<:@NO@:>@]),
[
case "${enableval}" in
yes) dbg=1
;;
no) dbg=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-debug-if])
;;
esac
],
[dbg=0]
)
if test "x${dbg}" = "x1"; then
AC_DEFINE([EC_DEBUG_IF], [1], [Debug interfaces enabled])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_DEBUG_IF, test "x$dbg" = "x1")
AC_SUBST(ENABLE_DEBUG_IF,[$dbg])
#------------------------------------------------------------------------------
# Debug ring
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the debug ring])
AC_ARG_ENABLE([debug-ring],
AS_HELP_STRING([--enable-debug-ring],
[Create a debug ring to record frames @<:@NO@:>@]),
[
case "${enableval}" in
yes) debugring=1
;;
no) debugring=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-debug-ring])
;;
esac
],
[debugring=0]
)
if test "x${debugring}" = "x1"; then
AC_DEFINE([EC_DEBUG_RING], [1], [Debug ring enabled])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Ethernet over EtherCAT support
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build with EoE support])
AC_ARG_ENABLE([eoe],
AS_HELP_STRING([--enable-eoe],
[Enable EoE support (default: yes)]),
[
case "${enableval}" in
yes) eoe=1
;;
no) eoe=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-eoe])
;;
esac
],
[eoe=1]
)
if test "x${eoe}" = "x1"; then
AC_DEFINE([EC_EOE], [1], [EoE support enabled])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_EOE, test "x$eoe" = "x1")
AC_SUBST(ENABLE_EOE,[$eoe])
#------------------------------------------------------------------------------
# CPU timestamp counter support
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to use the CPU timestamp counter])
AC_ARG_ENABLE([cycles],
AS_HELP_STRING([--enable-cycles],
[Use CPU timestamp counter (default: no)]),
[
case "${enableval}" in
yes) cycles=1
;;
no) cycles=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-cycles])
;;
esac
],
[cycles=0]
)
if test "x${cycles}" = "x1"; then
AC_DEFINE([EC_HAVE_CYCLES], [1], [Use CPU timestamp counter])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Realtime Mutex support
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to use rtmutexes])
AC_ARG_ENABLE([rtmutex],
AS_HELP_STRING([--enable-rtmutex],
[Use rtmutexes for synchronization (default: no)]),
[
case "${enableval}" in
yes) rtmutex=1
;;
no) rtmutex=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-rtmutex])
;;
esac
],
[rtmutex=0]
)
if test "x${rtmutex}" = "x1"; then
AC_DEFINE([EC_USE_RTMUTEX], [1], [Use rtmutex for synchronization])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# High-resolution timer support
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to use high-resolution timers for scheduling])
AC_ARG_ENABLE([hrtimer],
AS_HELP_STRING([--enable-hrtimer],
[Use high-resolution timer for scheduling (default: no)]),
[
case "${enableval}" in
yes) hrtimer=1
;;
no) hrtimer=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-hrtimer])
;;
esac
],
[hrtimer=0]
)
if test "x${hrtimer}" = "x1"; then
AC_DEFINE([EC_USE_HRTIMER], [1], [Use hrtimer for scheduling])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Read alias address from register
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to read alias addresses from registers])
AC_ARG_ENABLE([regalias],
AS_HELP_STRING([--enable-regalias],
[Read alias adresses from register (default: no)]),
[
case "${enableval}" in
yes) regalias=1
;;
no) regalias=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-regalias])
;;
esac
],
[regalias=0]
)
if test "x${regalias}" = "x1"; then
AC_DEFINE([EC_REGALIAS], [1], [Read alias adresses from register])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Force the reference clock to OP even if unconfigured
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to force the reference clock to OP])
AC_ARG_ENABLE([refclkop],
AS_HELP_STRING([--enable-refclkop],
[Force reference clock to OP (default: no)]),
[
case "${enableval}" in
yes) refclkop=1
;;
no) refclkop=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-refclkop])
;;
esac
],
[refclkop=0]
)
if test "x${refclkop}" = "x1"; then
AC_DEFINE([EC_REFCLKOP], [1], [Force refclk to OP])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Command-line tool
#-----------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the command-line tool])
AC_ARG_ENABLE([tool],
AS_HELP_STRING([--enable-tool],
[Build command-line tool (default: yes)]),
[
case "${enableval}" in
yes) tool=1
;;
no) tool=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-tool])
;;
esac
],
[tool=1]
)
if test "x${tool}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(BUILD_TOOL, test "x$tool" = "x1")
#------------------------------------------------------------------------------
# mailbox gateway server
#-----------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the mailbox gateway server])
AC_ARG_ENABLE([mbg],
AS_HELP_STRING([--enable-mbg],
[Build mailbox gateway server (default: yes)]),
[
case "${enableval}" in
yes) mbg=1
;;
no) mbg=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-mbg])
;;
esac
],
[mbg=1]
)
if test "x${mbg}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(BUILD_MBG, test "x$mbg" = "x1")
#------------------------------------------------------------------------------
# Userspace library generation
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the userspace library])
AC_ARG_ENABLE([userlib],
AS_HELP_STRING([--enable-userlib],
[Generation of the userspace library (default: yes)]),
[
case "${enableval}" in
yes) userlib=1
;;
no) userlib=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-userlib])
;;
esac
],
[userlib=1]
)
if test "x${userlib}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_USERLIB, test "x$userlib" = "x1")
#------------------------------------------------------------------------------
# TTY driver
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to build the tty driver])
AC_ARG_ENABLE([tty],
AS_HELP_STRING([--enable-tty],
[Generation of the ec_tty module (default: no)]),
[
case "${enableval}" in
yes) tty=1
;;
no) tty=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-tty])
;;
esac
],
[tty=0]
)
if test "x${tty}" = "x1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AM_CONDITIONAL(ENABLE_TTY, test "x$tty" = "x1")
AC_SUBST(ENABLE_TTY,[$tty])
#------------------------------------------------------------------------------
# Slave identification wildcards
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to allow identification wildcards])
AC_ARG_ENABLE([wildcards],
AS_HELP_STRING([--enable-wildcards],
[Enable vendor ID / product code wildcards (default: no)]),
[
case "${enableval}" in
yes) wildcards=1
;;
no) wildcards=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-wildcards])
;;
esac
],
[wildcards=0]
)
if test "x${wildcards}" = "x1"; then
AC_DEFINE([EC_IDENT_WILDCARDS], [1],
[Use vendor id / product code wildcards])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Redundancy (number of devices)
#------------------------------------------------------------------------------
AC_ARG_WITH([devices],
AC_HELP_STRING(
[--with-devices=<NUMBER>],
[Number of Ethernet devices per master. Default: 1]
),
[
devices=[$withval]
],
[
devices=1
]
)
AC_MSG_CHECKING([for number of Ethernet devices])
if test "${devices}" -lt 1; then
AC_MSG_ERROR([Number must be greater zero!])
else
if test "${devices}" -gt 1; then
AC_MSG_RESULT([$devices (Redundancy enabled)])
else
AC_MSG_RESULT([$devices (Redundancy disabled)])
fi
fi
AC_DEFINE_UNQUOTED([EC_MAX_NUM_DEVICES], $devices,
[Max. number of Ethernet devices per master])
#------------------------------------------------------------------------------
# SII assignment
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to assign the SII to PDI])
AC_ARG_ENABLE([sii-assign],
AS_HELP_STRING([--enable-sii-assign],
[Enable SII assignment to PDI (default: yes)]),
[
case "${enableval}" in
yes) siiassign=1
;;
no) siiassign=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-sii-assign])
;;
esac
],
[siiassign=1]
)
if test "x${siiassign}" = "x1"; then
AC_DEFINE([EC_SII_ASSIGN], [1], [Assign SII to PDI])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# SII cache
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to cache the SII for re-use])
AC_ARG_ENABLE([sii-cache],
AS_HELP_STRING([--disable-sii-cache],
[Disable SII cache for devices with aliases or serials]),
[
case "${enableval}" in
yes) siicache=1
;;
no) siicache=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-sii-cache])
;;
esac
],
[siicache=1]
)
if test "x${siicache}" = "x1"; then
AC_DEFINE([EC_SII_CACHE], [1], [Cache the SII images to improve ]
[slave re-scan performance in operational state.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Quick OP
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to allow quick OP])
AC_ARG_ENABLE([quick-op],
AS_HELP_STRING([--disable-quick-op],
[Disable quick return to OP]),
[
case "${enableval}" in
yes) quickop=1
;;
no) quickop=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-quick-op])
;;
esac
],
[quickop=1]
)
if test "x${quickop}" = "x1"; then
AC_DEFINE([EC_QUICK_OP], [1], [Allow quick return to OP ]
[from SAFEOP+PD_watchdog.])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# Alternate SII firmware loading
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to load SII locally if available])
AC_ARG_ENABLE([sii-override],
AS_HELP_STRING([--enable-sii-override],
[Enable SII override (default: no)
--enable-sii-override=/lib/firmware to load directly]),
[
case "${enableval}" in
yes) siioverride=1
siidir=""
;;
no) siioverride=0
siidir=""
;;
*/) AC_MSG_ERROR([Must omit trailing slash in --enable-sii-override.])
;;
*) siioverride=1
siidir="${enableval}"
;;
esac
],
[siioverride=0]
[siidir=""]
)
if test "x${siioverride}" = "x1"; then
AC_DEFINE([EC_SII_OVERRIDE], [1], [Allow locally loadable SII])
if test "x${siidir}" = "x"; then
AC_MSG_RESULT([yes, from hotplug])
else
AC_MSG_RESULT([yes, from $siidir])
AC_DEFINE_UNQUOTED([EC_SII_DIR], ["$siidir"], [Direct SII firmware base path])
fi
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# syslog output in realtime context
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to syslog in realtime context])
AC_ARG_ENABLE([rt-syslog],
AS_HELP_STRING([--enable-rt-syslog],
[Enable RT syslog (default: yes)]),
[
case "${enableval}" in
yes) rtsyslog=1
;;
no) rtsyslog=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-rt-syslog])
;;
esac
],
[rtsyslog=1]
)
if test "x${rtsyslog}" = "x1"; then
AC_DEFINE([EC_RT_SYSLOG], [1], [Output to syslog in RT context])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
# use loop control registers to open slave ports
#------------------------------------------------------------------------------
AC_MSG_CHECKING([whether to use loop control registers])
AC_ARG_ENABLE([loop-control],
AS_HELP_STRING([--enable-loop-control],
[Use loop control registers (default: no)]),
[
case "${enableval}" in
yes) loopctl=1
;;
no) loopctl=0
;;
*) AC_MSG_ERROR([Invalid value for --enable-loop-control])
;;
esac
],
[loopctl=0]
)
if test "x${loopctl}" = "x1"; then
AC_DEFINE([EC_LOOP_CONTROL], [1], [Use loop control registers])
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
#------------------------------------------------------------------------------
AC_CONFIG_FILES([
Doxyfile
Kbuild
Makefile
devices/Kbuild
devices/Makefile
devices/ccat/Kbuild
devices/ccat/Makefile
devices/cx2100/Kbuild
devices/cx2100/Makefile
devices/e1000/Kbuild
devices/e1000/Makefile
devices/e1000e/Kbuild
devices/e1000e/Makefile
devices/igb/Kbuild
devices/igb/Makefile
ethercat.spec
examples/Kbuild
examples/Makefile
examples/dc_rtai/Kbuild
examples/dc_rtai/Makefile
examples/dc_user/Makefile
examples/mini/Kbuild
examples/mini/Makefile