Portable build framework for OpenNTPD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

167 lines
3.6 KiB

  1. #
  2. # Copyright (c) 2014 Brent Cook
  3. #
  4. # Permission to use, copy, modify, and distribute this software for any
  5. # purpose with or without fee is hereby granted, provided that the above
  6. # copyright notice and this permission notice appear in all copies.
  7. #
  8. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  9. # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  10. # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  11. # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  12. # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  13. # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  14. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -DSHA2_SMALL
  16. noinst_LTLIBRARIES = libcompat.la libcompatnoopt.la
  17. # compatibility functions that need to be built without optimizations
  18. libcompatnoopt_la_CFLAGS = -O0
  19. libcompatnoopt_la_SOURCES =
  20. if !HAVE_EXPLICIT_BZERO
  21. libcompatnoopt_la_SOURCES += explicit_bzero.c
  22. endif
  23. # other compatibility functions
  24. libcompat_la_SOURCES =
  25. libcompat_la_LIBADD = $(PLATFORM_LDADD)
  26. libcompat_la_SOURCES += socket.c
  27. if !HAVE_ADJFREQ
  28. if HOST_FREEBSD
  29. libcompat_la_SOURCES += adjfreq_freebsd.c
  30. endif
  31. if HOST_LINUX
  32. libcompat_la_SOURCES += adjfreq_linux.c
  33. endif
  34. if HOST_NETBSD
  35. libcompat_la_SOURCES += adjfreq_netbsd.c
  36. endif
  37. if HOST_DARWIN
  38. libcompat_la_SOURCES += adjfreq_osx.c
  39. endif
  40. if HOST_SOLARIS
  41. libcompat_la_SOURCES += adjfreq_solaris.c
  42. endif
  43. endif
  44. if HOST_OPENBSD
  45. libcompat_la_SOURCES += adjfreq_openbsd.c
  46. endif
  47. if !HAVE_ASPRINTF
  48. libcompat_la_SOURCES += bsd-asprintf.c
  49. endif
  50. if !HAVE_CLOCK_GETRES
  51. libcompat_la_SOURCES += clock_getres.c
  52. endif
  53. if !HAVE_CLOCK_GETTIME
  54. if HOST_DARWIN
  55. libcompat_la_SOURCES += clock_gettime_osx.c
  56. endif
  57. endif
  58. if !HAVE_CLOSEFROM
  59. libcompat_la_SOURCES += closefrom.c
  60. endif
  61. if !HAVE_FREEZERO
  62. libcompat_la_SOURCES += freezero.c
  63. endif
  64. if !HAVE_IMSG
  65. libcompat_la_SOURCES += imsg.c
  66. libcompat_la_SOURCES += imsg-buffer.c
  67. endif
  68. libcompat_la_SOURCES += md5.c
  69. libcompat_la_SOURCES += progname.c
  70. if !HAVE_REALLOCARRAY
  71. libcompat_la_SOURCES += reallocarray.c
  72. endif
  73. if !HAVE_RECALLOCARRAY
  74. libcompat_la_SOURCES += recallocarray.c
  75. endif
  76. if !HAVE_SETPROCTITLE
  77. libcompat_la_SOURCES += setproctitle.c
  78. endif
  79. if !HAVE_STRLCAT
  80. libcompat_la_SOURCES += strlcat.c
  81. endif
  82. if !HAVE_STRLCPY
  83. libcompat_la_SOURCES += strlcpy.c
  84. endif
  85. if !HAVE_STRTONUM
  86. libcompat_la_SOURCES += strtonum.c
  87. endif
  88. if !HAVE_SETRESGID
  89. libcompat_la_SOURCES += bsd-setresgid.c
  90. endif
  91. if !HAVE_SETRESUID
  92. libcompat_la_SOURCES += bsd-setresuid.c
  93. endif
  94. if !HAVE_ARC4RANDOM
  95. libcompat_la_SOURCES += arc4random.c
  96. if !HAVE_GETENTROPY
  97. if HOST_FREEBSD
  98. libcompat_la_SOURCES += getentropy_freebsd.c
  99. endif
  100. if HOST_LINUX
  101. libcompat_la_SOURCES += getentropy_linux.c
  102. libcompat_la_SOURCES += sha2.c
  103. endif
  104. if HOST_NETBSD
  105. libcompat_la_SOURCES += getentropy_netbsd.c
  106. endif
  107. if HOST_DARWIN
  108. libcompat_la_SOURCES += getentropy_osx.c
  109. libcompat_la_SOURCES += sha2.c
  110. endif
  111. if HOST_SOLARIS
  112. libcompat_la_SOURCES += getentropy_solaris.c
  113. libcompat_la_SOURCES += sha2.c
  114. endif
  115. endif
  116. endif
  117. if !HAVE_IFADDRS_H
  118. if HOST_SOLARIS
  119. libcompat_la_SOURCES += getifaddrs_solaris.c
  120. endif
  121. endif
  122. if !HAVE_DAEMON
  123. if HOST_SOLARIS
  124. libcompat_la_SOURCES += daemon_solaris.c
  125. endif
  126. endif
  127. if !HAVE_ARC4RANDOM_UNIFORM
  128. libcompat_la_SOURCES += arc4random_uniform.c
  129. endif
  130. noinst_HEADERS = arc4random.h
  131. noinst_HEADERS += arc4random_freebsd.h
  132. noinst_HEADERS += arc4random_linux.h
  133. noinst_HEADERS += arc4random_netbsd.h
  134. noinst_HEADERS += arc4random_osx.h
  135. noinst_HEADERS += arc4random_solaris.h
  136. noinst_HEADERS += arc4random_win.h
  137. noinst_HEADERS += chacha_private.h