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.

146 lines
3.3 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
  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_CFLAGS = $(CFLAGS) $(USER_CFLAGS)
  25. libcompat_la_SOURCES =
  26. libcompat_la_LIBADD = $(PLATFORM_LDADD)
  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 !HAVE_ASPRINTF
  45. libcompat_la_SOURCES += bsd-asprintf.c
  46. endif
  47. if !HAVE_CLOCK_GETRES
  48. libcompat_la_SOURCES += clock_getres.c
  49. endif
  50. if !HAVE_CLOCK_GETTIME
  51. if HOST_DARWIN
  52. libcompat_la_SOURCES += clock_gettime_osx.c
  53. endif
  54. endif
  55. if !HAVE_IMSG
  56. libcompat_la_SOURCES += imsg.c
  57. libcompat_la_SOURCES += imsg-buffer.c
  58. endif
  59. if !HAVE_MD5
  60. libcompat_la_SOURCES += md5.c
  61. endif
  62. libcompat_la_SOURCES += progname.c
  63. if !HAVE_REALLOCARRAY
  64. libcompat_la_SOURCES += reallocarray.c
  65. endif
  66. if !HAVE_SETPROCTITLE
  67. libcompat_la_SOURCES += setproctitle.c
  68. endif
  69. if !HAVE_STRLCAT
  70. libcompat_la_SOURCES += strlcat.c
  71. endif
  72. if !HAVE_STRLCPY
  73. libcompat_la_SOURCES += strlcpy.c
  74. endif
  75. if !HAVE_STRTONUM
  76. libcompat_la_SOURCES += strtonum.c
  77. endif
  78. if !HAVE_SETRESGID
  79. libcompat_la_SOURCES += bsd-setresgid.c
  80. endif
  81. if !HAVE_SETRESUID
  82. libcompat_la_SOURCES += bsd-setresuid.c
  83. endif
  84. if !HAVE_ARC4RANDOM
  85. libcompat_la_SOURCES += arc4random.c
  86. if !HAVE_GETENTROPY
  87. if HOST_FREEBSD
  88. libcompat_la_SOURCES += getentropy_freebsd.c
  89. endif
  90. if HOST_LINUX
  91. libcompat_la_SOURCES += getentropy_linux.c
  92. if !HAVE_SHA512
  93. libcompat_la_SOURCES += sha2.c
  94. endif
  95. endif
  96. if HOST_NETBSD
  97. libcompat_la_SOURCES += getentropy_netbsd.c
  98. endif
  99. if HOST_DARWIN
  100. libcompat_la_SOURCES += getentropy_osx.c
  101. if !HAVE_SHA512
  102. libcompat_la_SOURCES += sha2.c
  103. endif
  104. endif
  105. if HOST_SOLARIS
  106. libcompat_la_SOURCES += getentropy_solaris.c
  107. if !HAVE_SHA512
  108. libcompat_la_SOURCES += sha2.c
  109. endif
  110. endif
  111. endif
  112. endif
  113. if !HAVE_ARC4RANDOM_UNIFORM
  114. libcompat_la_SOURCES += arc4random_uniform.c
  115. endif
  116. noinst_HEADERS = arc4random.h
  117. noinst_HEADERS += arc4random_freebsd.h
  118. noinst_HEADERS += arc4random_linux.h
  119. noinst_HEADERS += arc4random_netbsd.h
  120. noinst_HEADERS += arc4random_osx.h
  121. noinst_HEADERS += arc4random_solaris.h
  122. noinst_HEADERS += arc4random_win.h
  123. noinst_HEADERS += chacha_private.h