A local copy of OpenSSL from GitHub
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.

163 lines
6.0 KiB

  1. # We place all implementations in static libraries, and then let the
  2. # provider mains pilfer what they want through symbol resolution when
  3. # linking.
  4. #
  5. # The non-legacy implementations (libimplementations) must be made FIPS
  6. # agnostic as much as possible, as well as the common building blocks
  7. # (libcommon). The legacy implementations (liblegacy) will never be
  8. # part of the FIPS provider.
  9. #
  10. # If there is anything that isn't FIPS agnostic, it should be set aside
  11. # in its own source file, which is then included directly into other
  12. # static libraries geared for FIPS and non-FIPS providers, and built
  13. # separately.
  14. #
  15. # libcommon.a Contains common building blocks, potentially
  16. # needed both by non-legacy and legacy code.
  17. #
  18. # libimplementations.a Contains all non-legacy implementations.
  19. # liblegacy.a Contains all legacy implementations.
  20. #
  21. # libfips.a Contains all things needed to support
  22. # FIPS implementations, such as code from
  23. # crypto/ and object files that contain
  24. # FIPS-specific code. FIPS_MODE is defined
  25. # for this library. The FIPS module uses
  26. # this.
  27. # libnonfips.a Corresponds to libfips.a, but built with
  28. # FIPS_MODE undefined. The default and legacy
  29. # providers use this.
  30. SUBDIRS=common implementations
  31. INCLUDE[../libcrypto]=common/include
  32. # Libraries we're dealing with
  33. $LIBCOMMON=libcommon.a
  34. $LIBIMPLEMENTATIONS=libimplementations.a
  35. $LIBLEGACY=liblegacy.a
  36. $LIBNONFIPS=libnonfips.a
  37. $LIBFIPS=libfips.a
  38. # Enough of our implementations include prov/ciphercommon.h (present in
  39. # providers/implementations/include), which includes crypto/*_platform.h
  40. # (present in include), which in turn may include very internal header
  41. # files in crypto/, so let's have a common include list for them all.
  42. $COMMON_INCLUDES=../crypto ../include implementations/include common/include
  43. INCLUDE[$LIBCOMMON]=$COMMON_INCLUDES
  44. INCLUDE[$LIBIMPLEMENTATIONS]=.. $COMMON_INCLUDES
  45. INCLUDE[$LIBLEGACY]=.. $COMMON_INCLUDES
  46. INCLUDE[$LIBNONFIPS]=$COMMON_INCLUDES
  47. INCLUDE[$LIBFIPS]=.. $COMMON_INCLUDES
  48. DEFINE[$LIBFIPS]=FIPS_MODE
  49. # Weak dependencies to provide library order information.
  50. # We make it weak so they aren't both used always; what is
  51. # actually used is determined by non-weak dependencies.
  52. DEPEND[$LIBIMPLEMENTATIONS]{weak}=$LIBFIPS $LIBNONFIPS
  53. DEPEND[$LIBCOMMON]{weak}=$LIBFIPS
  54. # Strong dependencies. This ensures that any time libimplementations
  55. # is used, libcommon gets included as well.
  56. DEPEND[$LIBIMPLEMENTATIONS]=$LIBCOMMON
  57. DEPEND[$LIBNONFIPS]=../libcrypto
  58. # It's tempting to make libcommon depend on ../libcrypto. However,
  59. # since the FIPS provider module must NOT depend on ../libcrypto, we
  60. # need to set that dependency up specifically for the final products
  61. # that use $LIBCOMMON or anything that depends on it.
  62. # Libraries common to all providers, must be built regardless
  63. LIBS{noinst}=$LIBCOMMON
  64. # Libraries that are common for all non-FIPS providers, must be built regardless
  65. LIBS{noinst}=$LIBNONFIPS $LIBIMPLEMENTATIONS
  66. #
  67. # Default provider stuff
  68. #
  69. # Because the default provider is built in, it means that libcrypto must
  70. # include all the object files that are needed (we do that indirectly,
  71. # by using the appropriate libraries as source). Note that for shared
  72. # libraries, SOURCEd libraries are considered as if the where specified
  73. # with DEPEND.
  74. $DEFAULTGOAL=../libcrypto
  75. SOURCE[$DEFAULTGOAL]=$LIBIMPLEMENTATIONS $LIBNONFIPS
  76. SOURCE[$DEFAULTGOAL]=defltprov.c
  77. # Some legacy implementations depend on provider header files
  78. INCLUDE[$DEFAULTGOAL]=implementations/include
  79. LIBS=$DEFAULTGOAL
  80. #
  81. # FIPS provider stuff
  82. #
  83. # We define it this way to ensure that configdata.pm will have all the
  84. # necessary information even if we don't build the module. This will allow
  85. # us to make all kinds of checks on the source, based on what we specify in
  86. # diverse build.info files. libfips.a, fips.so and their sources aren't
  87. # built unless the proper LIBS or MODULES statement has been seen, so we
  88. # have those and only those within a condition.
  89. SUBDIRS=fips
  90. $FIPSGOAL=fips
  91. DEPEND[$FIPSGOAL]=$LIBIMPLEMENTATIONS $LIBFIPS
  92. INCLUDE[$FIPSGOAL]=../include
  93. DEFINE[$FIPSGOAL]=FIPS_MODE
  94. IF[{- defined $target{shared_defflag} -}]
  95. SOURCE[$FIPSGOAL]=fips.ld
  96. GENERATE[fips.ld]=../util/providers.num
  97. ENDIF
  98. IF[{- !$disabled{fips} -}]
  99. # This is the trigger to actually build the FIPS module. Without these
  100. # statements, the final build file will not have a trace of it.
  101. MODULES=$FIPSGOAL
  102. LIBS{noinst}=$LIBFIPS
  103. ENDIF
  104. #
  105. # Legacy provider stuff
  106. #
  107. IF[{- !$disabled{legacy} -}]
  108. # The legacy implementation library
  109. LIBS{noinst}=$LIBLEGACY
  110. DEPEND[$LIBLEGACY]=$LIBCOMMON $LIBNONFIPS
  111. # The Legacy provider
  112. IF[{- $disabled{module} -}]
  113. # Become built in
  114. # In this case, we need to do the same thing a for the default provider,
  115. # and make the liblegacy object files end up in libcrypto. We could also
  116. # just say that for the built-in legacy, we put the source directly in
  117. # libcrypto instead of going via liblegacy, but that makes writing the
  118. # implementation specific build.info files harder to write, so we don't.
  119. $LEGACYGOAL=../libcrypto
  120. SOURCE[$LEGACYGOAL]=$LIBLEGACY
  121. DEFINE[$LIBLEGACY]=STATIC_LEGACY
  122. DEFINE[$LEGACYGOAL]=STATIC_LEGACY
  123. ELSE
  124. # Become a module
  125. # In this case, we can work with dependencies
  126. $LEGACYGOAL=legacy
  127. MODULES=$LEGACYGOAL
  128. DEPEND[$LEGACYGOAL]=$LIBLEGACY
  129. IF[{- defined $target{shared_defflag} -}]
  130. SOURCE[legacy]=legacy.ld
  131. GENERATE[legacy.ld]=../util/providers.num
  132. ENDIF
  133. ENDIF
  134. # Common things that are valid no matter what form the Legacy provider
  135. # takes.
  136. SOURCE[$LEGACYGOAL]=legacyprov.c
  137. INCLUDE[$LEGACYGOAL]=../include implementations/include
  138. ENDIF
  139. #
  140. # Null provider stuff
  141. #
  142. # Because the null provider is built in, it means that libcrypto must
  143. # include all the object files that are needed.
  144. $NULLGOAL=../libcrypto
  145. SOURCE[$NULLGOAL]=nullprov.c