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.

165 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. if !HAVE_ADJFREQ
  27. if HOST_FREEBSD
  28. libcompat_la_SOURCES += adjfreq_freebsd.c
  29. endif
  30. if HOST_LINUX
  31. libcompat_la_SOURCES += adjfreq_linux.c
  32. endif
  33. if HOST_NETBSD
  34. libcompat_la_SOURCES += adjfreq_netbsd.c
  35. endif
  36. if HOST_DARWIN
  37. libcompat_la_SOURCES += adjfreq_osx.c
  38. endif
  39. if HOST_SOLARIS
  40. libcompat_la_SOURCES += adjfreq_solaris.c
  41. endif
  42. endif
  43. if HOST_OPENBSD
  44. libcompat_la_SOURCES += adjfreq_openbsd.c
  45. endif
  46. if !HAVE_ASPRINTF
  47. libcompat_la_SOURCES += bsd-asprintf.c
  48. endif
  49. if !HAVE_CLOCK_GETRES
  50. libcompat_la_SOURCES += clock_getres.c
  51. endif
  52. if !HAVE_CLOCK_GETTIME
  53. if HOST_DARWIN
  54. libcompat_la_SOURCES += clock_gettime_osx.c
  55. endif
  56. endif
  57. if !HAVE_CLOSEFROM
  58. libcompat_la_SOURCES += closefrom.c
  59. endif
  60. if !HAVE_FREEZERO
  61. libcompat_la_SOURCES += freezero.c
  62. endif
  63. if !HAVE_IMSG
  64. libcompat_la_SOURCES += imsg.c
  65. libcompat_la_SOURCES += imsg-buffer.c
  66. endif
  67. libcompat_la_SOURCES += md5.c
  68. libcompat_la_SOURCES += progname.c
  69. if !HAVE_REALLOCARRAY
  70. libcompat_la_SOURCES += reallocarray.c
  71. endif
  72. if !HAVE_RECALLOCARRAY
  73. libcompat_la_SOURCES += recallocarray.c
  74. endif
  75. if !HAVE_SETPROCTITLE
  76. libcompat_la_SOURCES += setproctitle.c
  77. endif
  78. if !HAVE_STRLCAT
  79. libcompat_la_SOURCES += strlcat.c
  80. endif
  81. if !HAVE_STRLCPY
  82. libcompat_la_SOURCES += strlcpy.c
  83. endif
  84. if !HAVE_STRTONUM
  85. libcompat_la_SOURCES += strtonum.c
  86. endif
  87. if !HAVE_SETRESGID
  88. libcompat_la_SOURCES += bsd-setresgid.c
  89. endif
  90. if !HAVE_SETRESUID
  91. libcompat_la_SOURCES += bsd-setresuid.c
  92. endif
  93. if !HAVE_ARC4RANDOM
  94. libcompat_la_SOURCES += arc4random.c
  95. if !HAVE_GETENTROPY
  96. if HOST_FREEBSD
  97. libcompat_la_SOURCES += getentropy_freebsd.c
  98. endif
  99. if HOST_LINUX
  100. libcompat_la_SOURCES += getentropy_linux.c
  101. libcompat_la_SOURCES += sha2.c
  102. endif
  103. if HOST_NETBSD
  104. libcompat_la_SOURCES += getentropy_netbsd.c
  105. endif
  106. if HOST_DARWIN
  107. libcompat_la_SOURCES += getentropy_osx.c
  108. libcompat_la_SOURCES += sha2.c
  109. endif
  110. if HOST_SOLARIS
  111. libcompat_la_SOURCES += getentropy_solaris.c
  112. libcompat_la_SOURCES += sha2.c
  113. endif
  114. endif
  115. endif
  116. if !HAVE_IFADDRS_H
  117. if HOST_SOLARIS
  118. libcompat_la_SOURCES += getifaddrs_solaris.c
  119. endif
  120. endif
  121. if !HAVE_DAEMON
  122. if HOST_SOLARIS
  123. libcompat_la_SOURCES += daemon_solaris.c
  124. endif
  125. endif
  126. if !HAVE_ARC4RANDOM_UNIFORM
  127. libcompat_la_SOURCES += arc4random_uniform.c
  128. endif
  129. noinst_HEADERS = arc4random.h
  130. noinst_HEADERS += arc4random_freebsd.h
  131. noinst_HEADERS += arc4random_linux.h
  132. noinst_HEADERS += arc4random_netbsd.h
  133. noinst_HEADERS += arc4random_osx.h
  134. noinst_HEADERS += arc4random_solaris.h
  135. noinst_HEADERS += arc4random_win.h
  136. noinst_HEADERS += chacha_private.h