forked from networkupstools/nut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
2927 lines (2656 loc) · 106 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
dnl +------------------------------------------------------------------+
dnl | Network UPS Tools: configure.ac |
dnl +------------------------------------------------------------------+
dnl NUT version number is defined here, with a Git suffixed macro like
dnl NUT_VERSION_MACRO "2.7.4-2838-gdfc3ac08"
dnl in include/nut_version.h (generated by make)
AC_INIT([nut],[2.7.4.1],[https://github.com/networkupstools/nut/issues])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_SRCDIR(server/upsd.c)
AC_CONFIG_MACRO_DIR([m4])
echo "Network UPS Tools version ${PACKAGE_VERSION}"
AC_CANONICAL_TARGET
NUT_CHECK_OS
NUT_STASH_WARNINGS
AC_CONFIG_HEADERS([include/config.h])
AC_PREFIX_DEFAULT(/usr/local/ups)
AM_INIT_AUTOMAKE([subdir-objects])
dnl we need Autoconf 2.61 or better to enable features of Posix that are extensions to C
AC_MSG_CHECKING(for autoconf macro to enable system extensions)
m4_version_prereq(2.61, [
AC_MSG_RESULT(yes)
AC_USE_SYSTEM_EXTENSIONS
], [
AC_MSG_RESULT(no)
])
dnl Use "./configure --enable-maintainer-mode" to keep Makefile.in and Makefile
dnl in sync after Git updates.
AM_MAINTAINER_MODE
dnl Some systems have older autotools without direct macro support for PKG_CONF*
NUT_CHECK_PKGCONFIG
dnl Various version related processing
dnl ----------------------------------
dnl # the following is commented out, because the UPS_VERSION macro now
dnl # resides in include/nut_version.h, which is generated by Makefile.am,
dnl # rather than in include/config.h, which is generated by configure. The
dnl # reason is that the SVN revision should be computed at compile time,
dnl # not configure time.
dnl AC_DEFINE_UNQUOTED(UPS_VERSION, "${PACKAGE_VERSION}", [NUT version])
dnl However, automatically define the tree version (mostly for AC_SUBST)
TREE_VERSION="`echo ${PACKAGE_VERSION} | awk '{ print substr($0,1,3) }'`"
AC_DEFINE_UNQUOTED(TREE_VERSION, "${TREE_VERSION}", [NUT tree version])
dnl Should not be necessary, since old servers have well-defined errors for
dnl unsupported commands:
NUT_NETVERSION="1.2"
AC_DEFINE_UNQUOTED(NUT_NETVERSION, "${NUT_NETVERSION}", [NUT network protocol version])
dnl Fix this early so we can expand with eval later
test "${prefix}" = "NONE" && prefix="${ac_default_prefix}"
test "${exec_prefix}" = "NONE" && exec_prefix='${prefix}'
CFLAGS=${CFLAGS-"-O"}
dnl NOTE: for definition of NUT_* autoconf macros, see m4/ directory
dnl and docs/macros.txt
dnl +------------------------------------------------------------------+
dnl | default values for things later on (can be overridden) |
STATEPATH="/var/state/ups"
cgiexecdir='${exec_prefix}/cgi-bin'
driverexecdir='${exec_prefix}/bin'
htmldir='${prefix}/html'
pkgconfigdir='${libdir}/pkgconfig'
auglensdir='/usr/share/augeas/lenses/dist'
if test ! -d "${auglensdir}"; then
auglensdir='/usr/share/augeas/lenses'
if test ! -d "${auglensdir}"; then
auglensdir=''
fi
fi
hotplugdir='/etc/hotplug'
if test ! -d "${hotplugdir}"; then
hotplugdir=''
fi
udevdir='/lib/udev'
if test ! -d "${udevdir}"; then
udevdir='/etc/udev'
if test ! -d "${udevdir}"; then
udevdir=''
fi
fi
devddir='/usr/local/etc/devd'
if test ! -d "${devddir}"; then
devddir='/etc/devd'
if test ! -d "${devddir}"; then
devddir=''
fi
fi
RUN_AS_USER="nobody"
RUN_AS_GROUP="nobody"
AS_IF([test -n "`getent group nogroup`" && ! test -n "`getent group "${RUN_AS_GROUP}"`"],
[RUN_AS_GROUP="nogroup"]
)
PIDPATH="/var/run"
dnl Define directory where LIBOBJS replacement functions are
AC_CONFIG_LIBOBJ_DIR([common])
dnl +-------------------------------------------------------------------
dnl AC_PROG_CC
dnl Macro AC_PROG_CC_C99 is obsolete; use AC_PROG_CC
dnl Note that NUT does not support building with C89 anyway
dnl AC_PROG_CC_C99
dnl Needed for per-target flags
AM_PROG_CC_C_O
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXX_C_O
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_LN_S
AC_PROG_EGREP
AC_PATH_PROG(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :)
dnl Postpone call to LT_INIT/AC_CONFIG_FILES to allow disabling static lib
AC_C_BIGENDIAN
AC_C_INLINE
AC_C_FLEXIBLE_ARRAY_MEMBER
AC_C_VARARRAYS
dnl Note: the compiler/pragma/attr methods below are custom for NUT codebase:
NUT_COMPILER_FAMILY
dnl Help find warning/error details in a wall of text (must be processed before NUT_COMPILER_FAMILY_FLAGS):
NUT_ARG_ENABLE([Wcolor],
[Request that compiler output is colorized (no = leave it up to compiler defaults)],
[no])
NUT_COMPILER_FAMILY_FLAGS
AX_C_PRAGMAS
AX_C___ATTRIBUTE__
AX_C_PRINTF_STRING_NULL
AC_CHECK_FUNCS(flock lockf fcvt fcvtl pow10 round abs_val abs)
AC_CHECK_HEADER([float.h],
[AC_DEFINE([HAVE_FLOAT_H], [1],
[Define to 1 if you have <float.h>.])])
AC_CHECK_HEADER([math.h],
[AC_DEFINE([HAVE_MATH_H], [1],
[Define to 1 if you have <math.h>.])])
AC_CHECK_FUNCS(fabs fabsf fabsl, [], [],
[#ifdef HAVE_MATH_H
# include <math.h>
#endif
#ifdef HAVE_FLOAT_H
# include <float.h>
#endif])
AC_CHECK_HEADER([limits.h],
[AC_DEFINE([HAVE_LIMITS_H], [1],
[Define to 1 if you have <limits.h>.])])
AC_CHECK_HEADER([signal.h],
[AC_DEFINE([HAVE_SIGNAL_H], [1],
[Define to 1 if you have <signal.h>.])])
AC_CHECK_HEADER([sys/signal.h],
[AC_DEFINE([HAVE_SYS_SIGNAL_H], [1],
[Define to 1 if you have <sys/signal.h>.])])
AC_CHECK_HEADER([sys/resource.h],
[AC_MSG_CHECKING([for struct rlimit and getrlimit()])
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <sys/resource.h>
],
[struct rlimit limit;
getrlimit(RLIMIT_NOFILE, &limit);
/* Do not care about actual return value in this test,
* normally check for non-zero meaning to look in errno */
]
)],
[AC_DEFINE([HAVE_SYS_RESOURCE_H], [1],
[Define to 1 if you have <sys/resource.h> with usable struct rlimit and getrlimit().])
AC_MSG_RESULT([ok])
],
[AC_MSG_RESULT([no])]
)
AC_LANG_POP([C])
]
)
AC_CHECK_HEADER([semaphore.h],
[AC_DEFINE([HAVE_SEMAPHORE_H], [1],
[Define to 1 if you have <sys/semaphore.h>.])
AC_MSG_CHECKING([for sem_t, sem_init() and sem_destroy()])
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#include <semaphore.h>
],
[sem_t semaphore;
sem_init(&semaphore, 0, 4);
sem_destroy(&semaphore);
/* Do not care about actual return value in this test,
* normally check for non-zero meaning to look in errno */
]
)],
[AC_DEFINE([HAVE_SEMAPHORE], [1],
[Define to 1 if you have <sys/semaphore.h> with usable sem_t sem_init() and sem_destroy().])
AC_MSG_RESULT([ok])
],
[AC_MSG_RESULT([no])]
)
AC_LANG_POP([C])
]
)
AC_CHECK_FUNCS(cfsetispeed tcsendbreak)
AC_CHECK_FUNCS(seteuid setsid getpassphrase)
AC_CHECK_FUNCS(on_exit strptime setlogmask)
AC_CHECK_DECLS(LOG_UPTO, [], [], [#include <syslog.h>])
dnl These common routines are not available in strict C standard library
dnl compilation modes (not part of ANSI or later standard), only in GNU,
dnl POSIX or other extension modes. Note that on modern systems they are
dnl available, just hidden in headers - so AC_CHECK_FUNCS() finds them
dnl by adding a declaration, while the "real" codebase can't use them.
AC_MSG_NOTICE(
[-----------------------------------------------------------------------
The next few tests look for required C library routines; if something is
not found, you may need to enable a different C standard or extension macro
version. You may also have to configure without extreme warning levels
since autotools tests fail those on their own and assume system lacks
stuff (although note we try to not involve standard -W* flags here).
-----------------------------------------------------------------------])
dnl# AC_CHECK_FUNCS(strcasecmp strncasecmp,
dnl# [], [AC_MSG_WARN([Required C library routine not found; try adding __EXTENSIONS__])])
dnl These appear with CFLAGS="-std=c99 -D_POSIX_C_SOURCE=200112L":
dnl# Methods below currently do not cause build errors for C99+ modes so are
dnl# not tested as thoroughly as those further below:
AC_CHECK_FUNCS(strtok_r fileno localtime_r sigemptyset sigaction,
[], [AC_MSG_WARN([Required C library routine not found; try adding -D_POSIX_C_SOURCE=200112L])])
AC_LANG_PUSH([C])
AC_CHECK_HEADER([string.h],
[AC_DEFINE([HAVE_STRING_H], [1],
[Define to 1 if you have <string.h>.])])
AC_CHECK_HEADER([strings.h],
[AC_DEFINE([HAVE_STRINGS_H], [1],
[Define to 1 if you have <strings.h>.])])
CODE_STRINGINCL='#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif'
AC_CACHE_CHECK([for strcasecmp(s1,s2)],
[ac_cv_func_strcasecmp],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([$CODE_STRINGINCL],
[if (strcasecmp("STR1", "str1") != 0) return 1])],
[ac_cv_func_strcasecmp=yes], [ac_cv_func_strcasecmp=no]
)])
AS_IF([test x"${ac_cv_func_strcasecmp}" = xyes],
[AC_DEFINE([HAVE_STRCASECMP], 1, [defined if standard library has, and C standard allows, the strcasecmp(s1,s2) method])],
[AC_MSG_WARN([Required C library routine strcasecmp not found; try adding __EXTENSIONS__])]
)
AC_CACHE_CHECK([for strncasecmp(s1,s2,n)],
[ac_cv_func_strncasecmp],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([$CODE_STRINGINCL],
[if (strncasecmp("STR1", "strX", 2) != 0) return 1])],
[ac_cv_func_strncasecmp=yes], [ac_cv_func_strncasecmp=no]
)])
AS_IF([test x"${ac_cv_func_strncasecmp}" = xyes],
[AC_DEFINE([HAVE_STRNCASECMP], 1, [defined if standard library has, and C standard allows, the strncasecmp(s1,s2,n) method])],
[AC_MSG_WARN([Required C library routine strncasecmp not found; try adding __EXTENSIONS__])]
)
AC_CACHE_CHECK([for strdup(s)],
[ac_cv_func_strdup],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([$CODE_STRINGINCL],
[[int res = 0;
char *t = "Test";
char *s = strdup(t);
if (!s || !(s[0]=='T'&&s[1]=='e'&&s[2]=='s'&&s[3]=='t'&&s[4]=='\0') || s == t) res = 1;
if (s) free (s);
if (res != 0) return res
/* autoconf adds ";return 0;" */
]])],
[ac_cv_func_strdup=yes], [ac_cv_func_strdup=no]
)])
AS_IF([test x"${ac_cv_func_strdup}" = xyes],
[AC_DEFINE([HAVE_STRDUP], 1, [defined if standard library has, and C standard allows, the strdup(s) method])],
[AC_MSG_WARN([Required C library routine strdup not found; try adding -D_POSIX_C_SOURCE=200112L])]
)
AC_CACHE_CHECK([for usleep(us)],
[ac_cv_func_usleep],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <unistd.h>
]],
[[useconds_t us = 1000;
if (usleep(us) != 0) return 1 /* per doc, no erros are returned actually*/
/* autoconf adds ";return 0;" */
]])],
[ac_cv_func_usleep=yes], [ac_cv_func_usleep=no]
)])
AS_IF([test x"${ac_cv_func_usleep}" = xyes],
[AC_DEFINE([HAVE_USLEEP], 1, [defined if standard library has, and C standard allows, the usleep(us) method])],
[AC_MSG_WARN([Required C library routine usleep not found; try adding -D_POSIX_C_SOURCE=200112L])]
)
AC_LANG_POP([C])
dnl These routines' arg types differ in strict C standard mode
dnl from what they use in the modes expected by NUT codebase:
dnl bind() : /usr/include/x86_64-linux-gnu/sys/socket.h:123:12: note: expected '__CONST_SOCKADDR_ARG {aka union <anonymous>}' but argument is of type 'struct sockaddr *'
dnl accept() : /usr/include/x86_64-linux-gnu/sys/socket.h:243:12: note: expected '__SOCKADDR_ARG {aka union <anonymous>}' but argument is of type 'struct sockaddr *'
dnl connect() : /usr/include/x86_64-linux-gnu/sys/socket.h:137:12: note: expected '__CONST_SOCKADDR_ARG {aka union <anonymous>}' but argument is of type 'const struct sockaddr *'
dnl sendto() : /usr/include/x86_64-linux-gnu/sys/socket.h:163:16: note: expected '__CONST_SOCKADDR_ARG {aka union <anonymous>}' but argument is of type 'struct sockaddr *'
dnl recvfrom() : /usr/include/x86_64-linux-gnu/bits/socket2.h:64:1: note: expected '__SOCKADDR_ARG {aka union <anonymous>}' but argument is of type 'struct sockaddr *'
AC_MSG_CHECKING([whether ln -sr works])
dnl We need to relative-symlink some files. Or hardlink. Or copy...
LN_S_R="cp -pR"
if test "$as_ln_s" = "ln -s" ; then
LN_S_R="ln"
DIR1="$(mktemp -d "dir1.XXXXXXX")" && \
DIR2="$(mktemp -d "dir2.XXXXXXX")" && \
touch "${DIR1}/a" && \
$as_ln_s -r "${DIR1}/a" "${DIR2}/b" && \
ls -la "${DIR2}/b" | grep '\.\./' > /dev/null && \
LN_S_R="$as_ln_s -r"
rm -rf "${DIR1}" "${DIR2}"
fi
AC_SUBST([LN_S_R], [${LN_S_R}])
if test "$LN_S_R" = "ln -s -r" ; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, using $LN_S_R])
fi
dnl the following may add stuff to LIBOBJS (is this still needed?)
AC_CHECK_FUNCS(vsnprintf snprintf, [], [
AC_LIBOBJ(snprintf)
AC_TYPE_LONG_DOUBLE
AC_TYPE_LONG_LONG_INT
])
AC_REPLACE_FUNCS(setenv strerror atexit)
case ${target_os} in
solaris2* )
dnl On Solaris, this allows errno to use thread local storage
CFLAGS="${CFLAGS} -D_REENTRANT"
;;
aix* )
dnl On AIX, this allows errno to use thread local storage
CFLAGS="${CFLAGS} -D_REENTRANT"
;;
hpux11* )
dnl It seems like the thread safe string functions will not be included
dnl on 64 bit HP-UX unless we define _REENTRANT
CFLAGS="${CFLAGS} -D_REENTRANT"
;;
esac
dnl optind handling:
dnl need to check if unistd.h is enough, else try getopt.h, else need decls
AC_CHECK_DECLS(optind, [], [
AC_CHECK_HEADERS(getopt.h, [
AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h is needed])
], [
AC_DEFINE(NEED_GETOPT_DECLS, 1, [Define to use explicit getopt declarations])
], [AC_INCLUDES_DEFAULT])
], [AC_INCLUDES_DEFAULT])
dnl do a 2nd check to ensure inclusion of getopt.h, in case optind is known
AC_CHECK_HEADERS(getopt.h, [
AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h is needed])
], [
AC_DEFINE(NEED_GETOPT_DECLS, 1, [Define to use explicit getopt declarations])
], [AC_INCLUDES_DEFAULT])
dnl also check for getopt_long
AC_CHECK_FUNCS(getopt_long)
dnl FreeBSD serial locking compatibility - look for uu_lock in libutil.h
AC_CHECK_DECLS(uu_lock, [
AC_DEFINE(HAVE_UU_LOCK, 1, [Use uu_lock for locking (FreeBSD)])
SERLIBS="-lutil"
dnl put in some better defaults for FreeBSD
RUN_AS_USER="uucp"
], [
SERLIBS=""
], [
#include <sys/types.h>
#include <libutil.h>
])
AC_CHECK_DECLS(__func__, [], [
AC_CHECK_DECLS(__FUNCTION__, [
AC_DEFINE(__func__, __FUNCTION__, [Replace missing __func__ declaration])
], [
AC_DEFINE(__func__, __LINE__, [Replace missing __func__ declaration])
], [AC_INCLUDES_DEFAULT])
], [AC_INCLUDES_DEFAULT])
dnl Solaris compatibility - check for -lnsl and -lsocket
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(connect, socket)
dnl All current systems provide time.h; it need not be checked for.
dnl Not all systems provide sys/time.h, but those that do, all allow
dnl you to include it and time.h simultaneously.
dnl NUT codebase provides the include/timehead.h to wrap these nuances.
AC_CHECK_HEADERS_ONCE([sys/time.h time.h sys/types.h sys/socket.h netdb.h])
AS_IF([test "$ac_cv_header_sys_time_h" = yes],
[AC_DEFINE([TIME_WITH_SYS_TIME],[1],[Define to 1 if you can safely include both <sys/time.h>
and <time.h>. This macro is deemed obsolete by autotools.])
], [])
AC_CHECK_HEADERS(sys/modem.h stdarg.h varargs.h, [], [], [AC_INCLUDES_DEFAULT])
dnl pthread related checks
dnl Note: pthread_tryjoin_np() should be available since glibc 2.3.3, according
dnl to https://man7.org/linux/man-pages/man3/pthread_tryjoin_np.3.html
AC_SEARCH_LIBS([pthread_create], [pthread],
[AC_DEFINE(HAVE_PTHREAD, 1, [Define to enable pthread support code])
AC_SEARCH_LIBS([pthread_tryjoin_np], [pthread],
[AC_DEFINE(HAVE_PTHREAD_TRYJOIN, 1, [Define to enable pthread_tryjoin support code])],
[])
],
[])
dnl ----------------------------------------------------------------------
dnl Check for types and define possible replacements
NUT_TYPE_SOCKLEN_T
NUT_FUNC_GETNAMEINFO_ARGTYPES
dnl ----------------------------------------------------------------------
dnl Check for python binary program names per language version
dnl to embed into scripts and Make rules
NUT_CHECK_PYTHON
NUT_CHECK_PYTHON2
NUT_CHECK_PYTHON3
dnl ----------------------------------------------------------------------
dnl check for --with-drivers=all (or --with-drivers=name[,name...]) flag
dnl Autoconf versions before 2.62 do not allow consecutive quadrigraphs
dnl (square brackets), so the help string depends on the version used
AC_MSG_CHECKING(which drivers to build)
AC_ARG_WITH(drivers,
AS_HELP_STRING([m4_version_prereq(2.62,
[@<:@--with-drivers=driver@<:@,driver@:>@@:>@],
[[[[--with-drivers=driver@<:@,driver@:>@]]]])],
[Only build specific drivers (all)]),
[
case "${withval}" in
yes|no|'')
AC_MSG_ERROR(invalid option --with(out)-drivers - see docs/configure.txt)
;;
all)
dnl Explicit request to build all drivers (unless specified), or fail
DRIVER_BUILD_LIST="all"
if test -z "${with_serial}"; then with_serial="yes"; fi
if test -z "${with_usb}"; then with_usb="yes"; fi
if test -z "${with_snmp}"; then with_snmp="yes"; fi
if test -z "${with_neon}"; then with_neon="yes"; fi
if test -z "${with_powerman}"; then with_powerman="yes"; fi
if test -z "${with_modbus}"; then with_modbus="yes"; fi
if test -z "${with_ipmi}"; then with_ipmi="yes"; fi
dnl Platform-dependent snowflakes that are required or auto:
if test -z "${with_linux_i2c}"; then
case ${target_os} in
linux*) with_linux_i2c="yes";;
*) with_linux_i2c="auto";;
esac
fi
if test -z "${with_macosx_ups}"; then
if test -d /System/Library/Frameworks/IOKit.framework/ ; then
with_macosx_ups="yes"
else
with_macosx_ups="auto"
fi
fi
AC_MSG_RESULT(${DRIVER_BUILD_LIST})
;;
auto)
dnl Explicit request to build all drivers that we can
DRIVER_BUILD_LIST="all"
if test -z "${with_serial}"; then with_serial="${withval}"; fi
if test -z "${with_usb}"; then with_usb="${withval}"; fi
if test -z "${with_snmp}"; then with_snmp="${withval}"; fi
if test -z "${with_neon}"; then with_neon="${withval}"; fi
if test -z "${with_powerman}"; then with_powerman="${withval}"; fi
if test -z "${with_modbus}"; then with_modbus="${withval}"; fi
if test -z "${with_ipmi}"; then with_ipmi="${withval}"; fi
if test -z "${with_linux_i2c}"; then with_linux_i2c="${withval}"; fi
if test -z "${with_macosx_ups}"; then with_macosx_ups="${withval}"; fi
AC_MSG_RESULT(${DRIVER_BUILD_LIST})
;;
*)
DRIVER_BUILD_LIST="`echo ${withval} | sed 's/,/ /g'`"
AC_MSG_RESULT(${DRIVER_BUILD_LIST})
AS_IF([test -n "$DRIVER_BUILD_LIST"],
[dnl DRVLIST is occasionally synced with drivers/Makefile.am
dnl NOTE: Currently "USB_DRIVERLIST" is not used standalone:
DRVLIST_NAMES="
SERIAL_DRIVERLIST USB_LIBUSB_DRIVERLIST SERIAL_USB_DRIVERLIST
SNMP_DRIVERLIST NEONXML_DRIVERLIST
MACOSX_DRIVERLIST MODBUS_DRIVERLIST LINUX_I2C_DRIVERLIST
POWERMAN_DRIVERLIST IPMI_DRIVERLIST"
get_drvlist() (
dnl Note escaped brackets - "against" m4 parser
m4_version_prereq(2.62,
[LB="@<:@"; RB="@:>@"],
[LB="[["; RB="]]"]
)
SPACE="`printf "$LB"' \t'"$RB"`"
SPACES="${SPACE}*"
sed -e "s/${SPACES}""$LB"'+'"$RB"'*='"${SPACES}/=/" \
-e "s/^${SPACES}//" < drivers/Makefile.am \
| {
C=false; V=false
while read LINE ; do
case "$LINE" in
*'\') C=true; if $V ; then echo "$LINE" ; fi ;;
*) C=false; V=false ;;
esac
case "$LINE" in
"$1"=*)
echo "$LINE" | sed -e 's,^'"$LB"'^='"$RB"'*=,,' -e 's,\$,,'
V=$C
;;
esac
done
} | tr '\n' ' ' | sed -e "s,${SPACE}${SPACES}, ," -e "s,${SPACES}\$,,"
)
for DRVLIST_NAME in $DRVLIST_NAMES; do
OUT="`get_drvlist "$DRVLIST_NAME"`" \
&& test -n "$OUT" || OUT=""
eval $DRVLIST_NAME="\$OUT"
AC_MSG_NOTICE([Will check custom driver selection against $DRVLIST_NAME="$OUT"])
done
dnl Note: do not quote the expansion below to keep it multi-token:
for DRV in $DRIVER_BUILD_LIST ; do
DRV_HITS=""
dnl #DEVEL-DEBUG# AC_MSG_NOTICE([= Checking DRV="$DRV"])
for DRVLIST_NAME in $DRVLIST_NAMES; do
dnl #DEVEL-DEBUG# AC_MSG_NOTICE([== Checking DRVLIST_NAME="$DRVLIST_NAME"])
eval DRVLIST="\${$DRVLIST_NAME}"
dnl #DEVEL-DEBUG# AC_MSG_NOTICE([== Contents DRVLIST="$DRVLIST"])
for DN in $DRVLIST ; do
dnl #DEVEL-DEBUG# AC_MSG_NOTICE([=== Checking DN="$DN"])
AS_IF([test x"$DN" = x"$DRV"], [
DRV_HITS="$DRV_HITS $DRVLIST_NAME"
AS_CASE(["$DRVLIST_NAME"],
[SERIAL_DRIVERLIST], [
AS_IF([test -z "${with_serial}"],
[AC_MSG_NOTICE([Requiring --with-serial=yes for driver "$DRV"])
with_serial=yes]
)],
[USB_LIBUSB_DRIVERLIST], [
AS_IF([test -z "${with_usb}"],
[AC_MSG_NOTICE([Requiring --with-usb=yes for driver "$DRV"])
with_usb=yes]
)],
[SERIAL_USB_DRIVERLIST], [
dnl e.g. nutdrv_qx that can do both
AS_IF([test -z "${with_usb}"],
[AC_MSG_NOTICE([Requiring --with-usb=yes for driver "$DRV"])
with_usb=yes]
)
AS_IF([test -z "${with_serial}"],
[AC_MSG_NOTICE([Requiring --with-serial=yes for driver "$DRV"])
with_serial=yes]
)],
[SNMP_DRIVERLIST], [
AS_IF([test -z "${with_snmp}"],
[AC_MSG_NOTICE([Requiring --with-snmp=yes for driver "$DRV"])
with_snmp=yes]
)],
[NEONXML_DRIVERLIST], [
AS_IF([test -z "${with_neon}"],
[AC_MSG_NOTICE([Requiring --with-neon=yes for driver "$DRV"])
with_neon=yes]
)],
[MACOSX_DRIVERLIST], [
dnl NOTE: This one is a bit special,
dnl just one certain driver so far
AS_IF([test -z "${with_macosx_ups}"],
[AC_MSG_NOTICE([Requiring --with-macosx-ups=yes for driver "$DRV"])
with_macosx_ups=yes]
)],
[MODBUS_DRIVERLIST], [
AS_IF([test -z "${with_modbus}"],
[AC_MSG_NOTICE([Requiring --with-modbus=yes for driver "$DRV"])
with_modbus=yes]
)],
[LINUX_I2C_DRIVERLIST], [
AS_IF([test -z "${with_linux_i2c}"],
[AC_MSG_NOTICE([Requiring --with-linux-i2c=yes for driver "$DRV"])
with_linux_i2c=yes]
)],
[POWERMAN_DRIVERLIST], [
AS_IF([test -z "${with_powerman}"],
[AC_MSG_NOTICE([Requiring --with-powerman=yes for driver "$DRV"])
with_powerman=yes]
)],
[IPMI_DRIVERLIST], [
AS_IF([test -z "${with_ipmi}"],
[AC_MSG_NOTICE([Requiring --with-ipmi=yes for driver "$DRV"])
with_ipmi=yes]
)],
[AC_MSG_WARN([Unhandled DRVLIST_NAME=$DRVLIST_NAME])]
)
break
dnl Break once, maybe a driver hits several categories
])
done
done
AS_IF([test -z "${DRV_HITS}"],
[AC_MSG_ERROR([Requested driver '$DRV' is not defined in drivers/Makefile.am (or configure.ac has a bug/lag detecting driver lists)])])
done
])
;;
esac
], [
dnl Implicit request to build whatever is enabled;
dnl do not force --with-all here:
DRIVER_BUILD_LIST="all"
AC_MSG_RESULT(all available)
])
AM_CONDITIONAL(SOME_DRIVERS, test "${DRIVER_BUILD_LIST}" != "all")
if test "${DRIVER_BUILD_LIST}" != "all"; then
NUT_REPORT([only build specific drivers], [${DRIVER_BUILD_LIST}])
fi
dnl ----------------------------------------------------------------------
dnl check for --with-all (or --without-all, or --with-all=auto) flag
AC_MSG_CHECKING(for --with-all)
AC_ARG_WITH(all,
AS_HELP_STRING([--with-all], [enable serial, usb, snmp, neon, ipmi, powerman, modbus, cgi, dev, avahi, linux_i2c]),
[
if test -n "${withval}"; then
dnl Note: we allow "no" as a positive value, because
dnl this is what the user expects from --without-all
dnl Note: these settings do not touch generation of
dnl "--with-docs=...", that is handled separately
if test -z "${with_serial}"; then with_serial="${withval}"; fi
if test -z "${with_usb}"; then with_usb="${withval}"; fi
if test -z "${with_snmp}"; then with_snmp="${withval}"; fi
if test -z "${with_neon}"; then with_neon="${withval}"; fi
if test -z "${with_powerman}"; then with_powerman="${withval}"; fi
if test -z "${with_modbus}"; then with_modbus="${withval}"; fi
if test -z "${with_ipmi}"; then with_ipmi="${withval}"; fi
dnl Platform-dependent snowflakes that are required or auto:
if test -z "${with_linux_i2c}"; then
with_linux_i2c="${withval}"
case ${target_os} in
linux*) ;;
*) test x"${withval}" = xno || with_linux_i2c="auto" ;;
esac
fi
if test -z "${with_macosx_ups}"; then
with_macosx_ups="${withval}"
if ! test -d /System/Library/Frameworks/IOKit.framework/ ; then
test x"${withval}" = xno || with_macosx_ups="auto"
fi
fi
dnl These are not driver families, but other features:
if test -z "${with_cgi}"; then with_cgi="${withval}"; fi
if test -z "${with_dev}"; then with_dev="${withval}"; fi
if test -z "${with_avahi}"; then with_avahi="${withval}"; fi
AC_MSG_RESULT("${withval}")
else
AC_MSG_RESULT(not given)
fi
], [
AC_MSG_RESULT(not given)
])
dnl ----------------------------------------------------------------------
dnl declare a number of --with-FEATURE options. Do this early, so that
dnl they are listed near the top by "./configure --help"; however,
dnl note that options with further investigation methods are listed
dnl a bit below to be grouped with their additional with/enable help.
NUT_ARG_WITH([dev], [build and install the development files], [no])
dnl The NUT legacy option was --with-doc; however to simplify configuration
dnl in some common packaging frameworks, we also allow --with-docs as
dnl a second-class citizen (if both are set, the old option name wins).
dnl Also note that the legacy default was "man=yes" due to requirements
dnl of the "make distcheck", but it was reduced to "man=auto" so that
dnl the usual builds can pass by default on systems without asciidoc.
NUT_ARG_WITH([docs], [build and install documentation (alias to --with-doc)], [man=auto])
NUT_ARG_WITH([doc], [build and install documentation (see docs/configure.txt for many variants of the option)], [${nut_with_docs}])
dnl NOTE: Until X-Mas 2021, the default was "legacy" (now "medium")
NUT_ARG_ENABLE([warnings],
[enable warning presets that were picked as useful in maintainership and CI practice (variants include gcc-minimal, gcc-medium, gcc-hard, clang-minimal, clang-medium, clang-hard, all; auto-choosers: hard, medium, minimal, yes=auto='gcc or clang or all at hardcoded default difficulty')],
[medium])
NUT_ARG_ENABLE([Werror],
[fail the build if compiler emits any warnings (treat them as errors)],
[no])
dnl To help find warning/error details in a wall of text, see --enable-Wcolor handled above
dnl ----------------------------------------------------------------------
dnl Check for presence and compiler flags of various libraries
NUT_ARG_WITH([serial], [build and install serial drivers], [yes])
dnl These checks are performed unconditionally, even if the corresponding
dnl --with-* options are not given. This is because we cannot predict
dnl what will be in the --with-drivers argument.
NUT_ARG_WITH([usb], [build and install USB drivers, optionally require build with specified version of libusb library and API: (auto|libusb-0.1|libusb-1.0)], [auto])
nut_usb_lib=""
NUT_CHECK_LIBUSB
NUT_ARG_WITH([snmp], [build and install SNMP drivers], [auto])
NUT_CHECK_LIBNETSNMP
NUT_ARG_WITH([neon], [build and install neon based XML/HTTP driver], [auto])
NUT_CHECK_LIBNEON
NUT_ARG_WITH([powerman], [build and install Powerman PDU client driver], [auto])
NUT_CHECK_LIBPOWERMAN
NUT_ARG_WITH([modbus], [build and install modbus drivers], [auto])
NUT_CHECK_LIBMODBUS
NUT_ARG_WITH([avahi], [build and install Avahi support], [auto])
NUT_CHECK_LIBAVAHI
dnl ----------------------------------------------------------------------
dnl checks related to --with-serial
dnl ${nut_with_serial}: any value except "yes" or "no" is treated as "auto".
dnl Below we try to detect if we can build serial drivers, and if we must?
AS_IF([test "${nut_with_serial}" != "no"],
[AS_IF([test "${nut_with_serial}" != "yes"],[nut_with_serial="auto"])
CFLAGS_SAVED_SERIAL="${CFLAGS}"
AS_IF([test "${GCC}" = yes],
[CFLAGS_SAVED_WERROR="${CFLAGS} -Wall -Werror"
CFLAGS_SAVED_WNOERROR="${CFLAGS} -Wno-error"
],
[CFLAGS_SAVED_WERROR="${CFLAGS}"
CFLAGS_SAVED_WNOERROR="${CFLAGS}"
])
dnl At least recent *BSD distros have deprecated sys/termios.h and spew
dnl warnings that termios.h should be used instead. This is redundantly
dnl fatal for pedantic builds where we aim to have no warnings in code.
dnl So there AC_CHECK_HEADERS does find the header, but we don't really
dnl want to use it unless we have no choice: if there is a warning while
dnl trying sys/ version, try the plain header path (without fatal warnings),
dnl and only if that is missing - retry with the sys/ version again (and
dnl no warnings still).
CFLAGS="${CFLAGS_SAVED_WERROR}"
AC_CHECK_HEADERS(sys/termios.h, [], [
CFLAGS="${CFLAGS_SAVED_WNOERROR}"
AC_CHECK_HEADERS(termios.h, [], [
AC_CHECK_HEADERS(sys/termios.h, [], [], [AC_INCLUDES_DEFAULT])
], [AC_INCLUDES_DEFAULT])
], [AC_INCLUDES_DEFAULT])
dnl CFLAGS at this point suffice for surviving a compilation with termios.h
dnl Don't mind the stupid code below, it just probes the tokens and
dnl sails around compiler warnings
AC_MSG_CHECKING([for struct termios and speed_t])
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
#if defined(HAVE_SYS_TERMIOS_H)
# include <sys/termios.h> /* for speed_t */
#else
# if defined(HAVE_TERMIOS_H)
# include <termios.h>
# endif /* HAVE_TERMIOS_H */
#endif /* HAVE_SYS_TERMIOS_H */
void getspeed(speed_t* b) { *b = B19200; }
],
[struct termios tio;
if (!tcgetattr(0, &tio)) { return 1; }
speed_t baudrate;
getspeed(&baudrate);
]
)],
[AC_MSG_RESULT([ok])
nut_have_serial_types=yes
],
[AC_MSG_RESULT([no, struct termios and/or speed_t not found in discovered headers])
nut_have_serial_types=no
]
)
AC_LANG_POP([C])
dnl Restore common set-or-discovered CFLAGS
CFLAGS="${CFLAGS_SAVED_SERIAL}"
AC_MSG_CHECKING([whether we can build serial drivers])
AS_IF([test "${nut_have_serial_types}" = yes],
[AS_IF([test "${nut_with_serial}" = "auto"],[nut_with_serial="yes"])],
[AS_IF([test "${nut_with_serial}" = "auto"],[nut_with_serial="no"])
AS_IF([test "${nut_with_serial}" = "yes"],[AC_MSG_ERROR([no, and were required to])])
])
AS_IF([test "${nut_with_serial}" = "yes"],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
])
NUT_REPORT_FEATURE([build serial drivers], [${nut_with_serial}], [],
[WITH_SERIAL], [Define to enable serial support])
dnl ----------------------------------------------------------------------
dnl checks related to --with-usb are in its m4 file and NUT_CHECK_LIBUSB() called above
dnl Note: there is no libusb-config script (and variable) for libusb-1.0
AM_CONDITIONAL(WITH_LIBUSB_1_0, test "${nut_usb_lib}" = "(libusb-1.0)")
AM_CONDITIONAL(WITH_LIBUSB_0_1, test "${nut_usb_lib}" = "(libusb-0.1)" -o "${nut_usb_lib}" = "(libusb-0.1-config)")
NUT_REPORT_FEATURE([build USB drivers], [${nut_with_usb}], [${nut_usb_lib}],
[WITH_USB], [Define to enable USB support])
dnl ----------------------------------------------------------------------
dnl checks related to --with-neon
dnl ${nut_with_neon}: any value except "yes" or "no" is treated as "auto".
if test "${nut_with_neon}" = "yes" -a "${nut_have_neon}" != "yes"; then
AC_MSG_ERROR([neon libraries not found, required for neon based XML/HTTP driver])
fi
if test "${nut_with_neon}" != "no"; then
nut_with_neon="${nut_have_neon}"
fi
NUT_REPORT_FEATURE([build neon based XML driver], [${nut_with_neon}], [],
[WITH_NEON], [Define to enable Neon HTTP support])
AM_CONDITIONAL([HAVE_NEON], [test "${nut_have_neon}" = "yes"])
dnl ----------------------------------------------------------------------
dnl checks related to --with-avahi
dnl ${nut_with_avahi}: any value except "yes" or "no" is treated as "auto".
if test "${nut_with_avahi}" = "yes" -a "${nut_have_avahi}" != "yes"; then
AC_MSG_ERROR([avahi libraries not found])
fi
if test "${nut_with_avahi}" != "no"; then
nut_with_avahi="${nut_have_avahi}"
fi
NUT_REPORT_FEATURE([enable Avahi support], [${nut_with_avahi}], [],
[WITH_AVAHI], [Define to enable Avahi support])
dnl ----------------------------------------------------------------------
dnl checks related to --with-powerman
dnl ${nut_with_powerman}: any value except "yes" or "no" is treated as "auto".
if test "${nut_with_powerman}" = "yes" -a "${nut_have_libpowerman}" != "yes"; then
AC_MSG_ERROR([Powerman client libraries not found, required for Powerman PDU client driver])
fi
if test "${nut_with_powerman}" != "no"; then
nut_with_powerman="${nut_have_libpowerman}"
fi
NUT_REPORT_FEATURE([build Powerman PDU client driver], [${nut_with_powerman}], [],
[WITH_LIBPOWERMAN], [Define to enable Powerman PDU support])
dnl ----------------------------------------------------------------------
dnl checks related to --with-modbus
dnl ${nut_with_modbus}: any value except "yes" or "no" is treated as "auto".
if test "${nut_with_modbus}" = "yes" -a "${nut_have_libmodbus}" != "yes"; then
AC_MSG_ERROR([modbus library not found, required for Modbus driver])
fi
if test "${nut_with_modbus}" != "no"; then
nut_with_modbus="${nut_have_libmodbus}"
fi
NUT_REPORT_FEATURE([build Modbus driver], [${nut_with_modbus}], [],
[WITH_MODBUS], [Define to enable Modbus support])
dnl ----------------------------------------------------------------------
dnl Check for with-ipmi, and --with-freeipmi (or --with-openipmi)
dnl Only one can be enabled at a time, with a preference for FreeIPMI
dnl if both are available (since it is the only one supported ATM!!)
nut_ipmi_lib=""
NUT_ARG_WITH([ipmi], [build and install IPMI PSU driver], [auto])
NUT_ARG_WITH([freeipmi], [enable IPMI support using FreeIPMI], [auto])
dnl NUT_ARG_WITH([openipmi], [enable IPMI support using OpenIPMI], [auto])
dnl ${nut_with_ipmi}: any value except "yes" or "no" is treated as "auto".
if test "${nut_with_ipmi}" != "no"; then
dnl check if FreeIPMI (and maybe later OpenIPMI) was explicitly requested
if test "${nut_with_freeipmi}" = "yes"; then
NUT_CHECK_LIBFREEIPMI
if test "${nut_have_freeipmi}" != "yes"; then
AC_MSG_ERROR([FreeIPMI not found, required for IPMI support])
fi
dnl Implies --with-ipmi
nut_with_ipmi="yes"
dnl elif test "${nut_with_openipmi}" = "yes"; then
dnl AC_MSG_ERROR([OpenIPMI is not yet supported])
dnl NUT_CHECK_LIBOPENIPMI
dnl if test "${nut_have_openipmi}" != "yes"; then
dnl AC_MSG_ERROR([OpenIPMI not found, required for IPMI support])
dnl fi
dnl Implies --with-ipmi
dnl nut_with_ipmi="yes"
dnl AC_DEFINE(WITH_OPENIPMI, 1, [Define to enable IPMI support using OpenIPMI])
else
dnl Prefer FreeIPMI over OpenIPMI otherwise
NUT_CHECK_LIBFREEIPMI
if test "${nut_have_freeipmi}" != "yes"; then
if test "${nut_with_ipmi}" = "yes"; then
AC_MSG_ERROR([FreeIPMI not found, required for IPMI support])
fi
nut_with_ipmi="no"
dnl NUT_CHECK_OPENIPMI
dnl if test "${nut_have_openipmi}" != "yes"; then
dnl if test "${nut_with_ipmi}" = "yes"; then
dnl AC_MSG_ERROR([Neither GNU FreeIPMI nor OpenIPMI was found (required for IPMI support)])
dnl fi
dnl nut_with_ipmi="no"
dnl else
dnl Implies --with-ipmi
dnl nut_with_ipmi="yes"
dnl nut_with_openipmi="yes"
dnl fi
else
dnl Implies --with-ipmi
nut_with_ipmi="yes"
nut_with_freeipmi="yes"
AC_DEFINE(WITH_FREEIPMI, 1, [Define to enable IPMI support using FreeIPMI])
fi
fi
fi
NUT_REPORT_FEATURE([build IPMI driver], [${nut_with_ipmi}], [${nut_ipmi_lib}],
[WITH_IPMI], [Define to enable IPMI support])
dnl Note: we still have to manually enable complementary AC_DEFINEs (see above)
dnl and AM_CONDITIONALs (see below)...
AM_CONDITIONAL(WITH_FREEIPMI, test "${nut_with_freeipmi}" = "yes")
dnl AM_CONDITIONAL(WITH_OPENIPMI, test "${nut_with_openipmi}" = "yes")
dnl ----------------------------------------------------------------------
dnl The Mac OS X meta-driver looks at IOKit Power Sources keys managed by
dnl the internal USB UPS driver.
dnl
dnl FIXME: be slightly more clever here:
NUT_ARG_WITH([macosx_ups], [build and install Mac OS X Power Sources meta-driver], [auto])
if test "${nut_with_macosx_ups}" != no; then
if test -d /System/Library/Frameworks/IOKit.framework/ ; then
nut_with_macosx_ups="yes"
else
if test "${nut_with_macosx_ups}" = yes; then
AC_MSG_ERROR([macosx-ups was required but can not be fulfilled for this build: not MacOS])
fi
nut_with_macosx_ups="no"
fi