Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / bsd / ntp / dist / m4 / os_cflags.m4
blobc6d40cdd71509c242ca39f8ee666dc4fc4d61ee2
1 dnl ######################################################################
2 dnl Specify additional compile options based on the OS and the compiler
3 AC_DEFUN([AMU_OS_CFLAGS],
5 AC_CACHE_CHECK(additional compiler flags,
6 ac_cv_os_cflags,
8 case "${host_os}" in
9         irix6* )
10                 case "${CC}" in
11                         cc )
12                                 # do not use 64-bit compiler
13                                 ac_cv_os_cflags="-n32 -mips3 -Wl,-woff,84"
14                                 ;;
15                 esac
16                 ;;
17 # HMS: am-utils needed this but we don't (apparently)
18 #       osf[[1-3]]* )
19 #               # get the right version of struct sockaddr
20 #               case "${CC}" in
21 #                       cc )
22 #                               ac_cv_os_cflags="-std -D_SOCKADDR_LEN -D_NO_PROTO"
23 #                               ;;
24 #                       * )
25 #                               ac_cv_os_cflags="-D_SOCKADDR_LEN -D_NO_PROTO"
26 #                               ;;
27 #               esac
28 #               ;;
29 #       osf* )
30 #               # get the right version of struct sockaddr
31 #               case "${CC}" in
32 #                       cc )
33 #                               ac_cv_os_cflags="-std -D_SOCKADDR_LEN"
34 #                               ;;
35 #                       * )
36 #                               ac_cv_os_cflags="-D_SOCKADDR_LEN"
37 #                               ;;
38 #               esac
39 #               ;;
40         aix[[1-3]]* )
41                 ac_cv_os_cflags="" ;;
42         aix4.[[0-2]]* )
43                 # turn on additional headers
44                 ac_cv_os_cflags="-D_XOPEN_EXTENDED_SOURCE"
45                 ;;
46         aix5.3* )
47                 # avoid circular dependencies in yp headers, and more
48                 ac_cv_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE -D_USE_IRS -D_MSGQSUPPORT"
49                 ;;
50         aix* )
51                 # avoid circular dependencies in yp headers
52                 ac_cv_os_cflags="-DHAVE_BAD_HEADERS -D_XOPEN_EXTENDED_SOURCE -D_USE_IRS"
53                 ;;
54         OFF-sunos4* )
55                 # make sure passing whole structures is handled in gcc
56                 case "${CC}" in
57                         gcc )
58                                 ac_cv_os_cflags="-fpcc-struct-return"
59                                 ;;
60                 esac
61                 ;;
62         sunos[[34]]* | solaris1* | solaris2.[[0-5]] | sunos5.[[0-5]] | solaris2.5.* | sunos5.5.* )
63                 ac_cv_os_cflags="" ;;
64         solaris2* | sunos5* )
65                 # turn on 64-bit file offset interface
66                 case "${CC}" in
67                         * )
68                                 ac_cv_os_cflags="-D_LARGEFILE64_SOURCE"
69                                 ;;
70                 esac
71                 ;;
72         hpux* )
73                 # use Ansi compiler on HPUX
74                 case "${CC}" in
75                         cc )
76                                 ac_cv_os_cflags="-Ae"
77                                 ;;
78                 esac
79                 ;;
80         darwin* | macosx* | rhapsody* )
81                 ac_cv_os_cflags="-D_P1003_1B_VISIBLE"
82                 ;;
83         * )
84                 ac_cv_os_cflags=""
85                 ;;
86 esac
88 CFLAGS="$CFLAGS $ac_cv_os_cflags"
90 dnl ======================================================================