1 dnl ######################################################################
2 dnl Specify additional compile options based on the OS and the compiler
3 AC_DEFUN([NTP_OS_CFLAGS], [
4 AC_MSG_CHECKING([additional compiler flags])
5 # allow ntp_os_cflags to be preset to skip this stuff
6 case "${ntp_os_cflags+set}" in
15 # turn on additional headers
16 ntp_os_cflags="-D_XOPEN_EXTENDED_SOURCE"
19 # avoid circular dependencies in yp headers, and more
20 ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE"
21 ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS -D_MSGQSUPPORT"
24 # XXX Only verified thru AIX6.
25 # aix7 seems to need a different XOPEN_SOURCE_EXTENDED thing.
26 # avoid circular dependencies in yp headers
27 # _XOPEN_SOURCE=500 = X/Open 5: POSIX 1995
28 # _XOPEN_SOURCE=600 = X/Open 6: POSIX 2004
29 # _XOPEN_SOURCE=700 = X/Open 7: POSIX 2008
30 ntp_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_SOURCE=600"
31 ntp_os_cflags="${ntp_os_cflags} -D_USE_IRS"
34 ntp_os_cflags="-DSYS_AMIGA"
36 darwin*|macosx*|rhapsody*)
37 ntp_os_cflags="-D_P1003_1B_VISIBLE"
39 hpux10.*) # at least for hppa2.0-hp-hpux10.20
44 # use Ansi compiler on HPUX, and some -Wp magic
45 ntp_os_cflags="-Ae -Wp,-H18816"
48 ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE -D__STDC_VERSION__=199901L"
55 # use Ansi compiler on HPUX
58 ntp_os_cflags="${ntp_os_cflags} -D_HPUX_SOURCE -D__STDC_VERSION__=199901L"
63 # do not use 64-bit compiler
64 ntp_os_cflags="-n32 -mips3 -Wl,-woff,84"
68 ntp_os_cflags="-posix"
70 solaris1*|solaris2.[[0-5]]|solaris2.5.*)
72 sunos[[34]]*|sunos5.[[0-5]]|sunos5.5.*)
75 # turn on 64-bit file offset interface
76 ntp_os_cflags="-D_LARGEFILE64_SOURCE"
83 # Quick and dirty sanity check
86 AC_MSG_ERROR([See html/build/hints/vxworks.html])
88 ntp_os_cflags="-DSYS_VXWORKS"
93 case "$ntp_os_cflags" in
95 ntp_os_cflags_msg="none needed"
98 ntp_os_cflags_msg="$ntp_os_cflags"
100 CFLAGS_NTP="$CFLAGS_NTP $ntp_os_cflags"
101 AC_MSG_RESULT([$ntp_os_cflags_msg])
102 AS_UNSET([ntp_os_cflags_msg])
104 AC_MSG_CHECKING([additional linker flags])
105 # HMS: The following might still need tweaking
106 # allow ntp_os_ldflags to be preset to skip this stuff
107 case "${ntp_os_ldflags+set}" in
116 ntp_os_ldflags="-Wl,+allowdups"
123 case "$ntp_os_ldflags" in
125 ntp_os_ldflags_msg="none needed"
128 ntp_os_ldflags_msg="$ntp_os_ldflags"
130 LDFLAGS_NTP="$LDFLAGS_NTP $ntp_os_ldflags"
131 AC_MSG_RESULT([$ntp_os_ldflags_msg])
132 AS_UNSET([ntp_os_ldflags_msg])
134 dnl ======================================================================