build.info 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. # libcommon.a Contains common building blocks and other routines,
  2. # potentially needed by any of our providers.
  3. #
  4. # libfips.a Contains all algorithm implementations that should
  5. # go in the FIPS provider. The compilations for this
  6. # library are all done with FIPS_MODULE defined.
  7. #
  8. # liblegacy.a Contains all algorithm implementations that should
  9. # go into the legacy provider. The compilations for
  10. # this library are all done with STATIC_LEGACY defined.
  11. #
  12. # libdefault.a Contains all algorithm implementations that should
  13. # into the default or base provider.
  14. #
  15. # To be noted is that the FIPS provider shares source code with libcrypto,
  16. # which means that select source files from crypto/ are compiled for
  17. # libfips.a the sources from providers/implementations.
  18. #
  19. # This is how a provider module should be linked:
  20. #
  21. # -o {modulename}.so {object files...} lib{modulename}.a libcommon.a
  22. #
  23. # It is crucial that code that checks the FIPS_MODULE macro ends up in
  24. # libfips.a.
  25. # It is crucial that code that checks the STATIC_LEGACY macro ends up in
  26. # liblegacy.a.
  27. # It is recommended that code that is written for libcommon.a doesn't end
  28. # up depending on libfips.a, liblegacy.a or libdefault.a
  29. #
  30. # Code in providers/implementations/ should be written in such a way that
  31. # the OSSL_DISPATCH arrays (and preferably the majority of the actual code)
  32. # end up in either libfips.a, liblegacy.a or libdefault.a.
  33. SUBDIRS=common implementations
  34. INCLUDE[../libcrypto]=common/include
  35. # Libraries we're dealing with
  36. $LIBCOMMON=libcommon.a
  37. $LIBFIPS=libfips.a
  38. $LIBLEGACY=liblegacy.a
  39. $LIBDEFAULT=libdefault.a
  40. LIBS{noinst}=$LIBDEFAULT $LIBCOMMON
  41. # Enough of our implementations include prov/ciphercommon.h (present in
  42. # providers/implementations/include), which includes crypto/*_platform.h
  43. # (present in include), which in turn may include very internal header
  44. # files in crypto/, so let's have a common include list for them all.
  45. $COMMON_INCLUDES=../crypto ../include implementations/include common/include
  46. INCLUDE[$LIBCOMMON]=$COMMON_INCLUDES
  47. INCLUDE[$LIBFIPS]=.. $COMMON_INCLUDES
  48. INCLUDE[$LIBLEGACY]=.. $COMMON_INCLUDES
  49. INCLUDE[$LIBDEFAULT]=.. $COMMON_INCLUDES
  50. DEFINE[$LIBFIPS]=FIPS_MODULE
  51. # Weak dependencies to provide library order information. What is actually
  52. # used is determined by non-weak dependencies.
  53. DEPEND[$LIBCOMMON]{weak}=../libcrypto
  54. # Strong dependencies. This ensures that any time an implementation library
  55. # is used, libcommon gets included as well.
  56. # The $LIBFIPS dependency on $LIBCOMMON is extra strong, to mitigate for
  57. # linking problems because they are interdependent
  58. SOURCE[$LIBFIPS]=$LIBCOMMON
  59. DEPEND[$LIBLEGACY]=$LIBCOMMON
  60. DEPEND[$LIBDEFAULT]=$LIBCOMMON
  61. #
  62. # Default provider stuff
  63. #
  64. # Because the default provider is built in, it means that libcrypto must
  65. # include all the object files that are needed (we do that indirectly,
  66. # by using the appropriate libraries as source). Note that for shared
  67. # libraries, SOURCEd libraries are considered as if they were specified
  68. # with DEPEND.
  69. $DEFAULTGOAL=../libcrypto
  70. SOURCE[$DEFAULTGOAL]=$LIBDEFAULT defltprov.c
  71. INCLUDE[$DEFAULTGOAL]=implementations/include
  72. #
  73. # Base provider stuff
  74. #
  75. # Because the base provider is built in, it means that libcrypto must
  76. # include all of the object files that are needed, just like the default
  77. # provider.
  78. $BASEGOAL=../libcrypto
  79. SOURCE[$BASEGOAL]=$LIBDEFAULT baseprov.c
  80. INCLUDE[$BASEGOAL]=implementations/include
  81. #
  82. # FIPS provider stuff
  83. #
  84. # We define it this way to ensure that configdata.pm will have all the
  85. # necessary information even if we don't build the module. This will allow
  86. # us to make all kinds of checks on the source, based on what we specify in
  87. # diverse build.info files. libfips.a, fips.so and their sources aren't
  88. # built unless the proper LIBS or MODULES statement has been seen, so we
  89. # have those and only those within a condition.
  90. IF[{- !$disabled{fips} -}]
  91. SUBDIRS=fips
  92. $FIPSGOAL=fips
  93. # This is the trigger to actually build the FIPS module. Without these
  94. # statements, the final build file will not have a trace of it.
  95. MODULES{fips}=$FIPSGOAL
  96. LIBS{noinst}=$LIBFIPS
  97. DEPEND[$FIPSGOAL]=$LIBFIPS
  98. INCLUDE[$FIPSGOAL]=../include
  99. DEFINE[$FIPSGOAL]=FIPS_MODULE
  100. IF[{- defined $target{shared_defflag} -}]
  101. SOURCE[$FIPSGOAL]=fips.ld
  102. GENERATE[fips.ld]=../util/providers.num
  103. ENDIF
  104. DEPEND[|build_modules_nodep|]=fipsmodule.cnf
  105. GENERATE[fipsmodule.cnf]=../util/mk-fipsmodule-cnf.pl \
  106. -module $(FIPSMODULE) -section_name fips_sect -key $(FIPSKEY)
  107. DEPEND[fipsmodule.cnf]=$FIPSGOAL
  108. # Add VERSIONINFO resource for windows
  109. IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-|BC-)/ -}]
  110. GENERATE[fips.rc]=../util/mkrc.pl fips
  111. SOURCE[$FIPSGOAL]=fips.rc
  112. ENDIF
  113. ENDIF
  114. #
  115. # Legacy provider stuff
  116. #
  117. IF[{- !$disabled{legacy} -}]
  118. LIBS{noinst}=$LIBLEGACY
  119. IF[{- $disabled{module} -}]
  120. # Become built in
  121. # In this case, we need to do the same thing a for the default provider,
  122. # and make the liblegacy object files end up in libcrypto. We could also
  123. # just say that for the built-in legacy, we put the source directly in
  124. # libcrypto instead of going via liblegacy, but that makes writing the
  125. # implementation specific build.info files harder to write, so we don't.
  126. $LEGACYGOAL=../libcrypto
  127. SOURCE[$LEGACYGOAL]=$LIBLEGACY
  128. DEFINE[$LEGACYGOAL]=STATIC_LEGACY
  129. ELSE
  130. # Become a module
  131. # In this case, we can work with dependencies
  132. $LEGACYGOAL=legacy
  133. MODULES=$LEGACYGOAL
  134. DEPEND[$LEGACYGOAL]=$LIBLEGACY ../libcrypto
  135. IF[{- defined $target{shared_defflag} -}]
  136. SOURCE[legacy]=legacy.ld
  137. GENERATE[legacy.ld]=../util/providers.num
  138. ENDIF
  139. # Add VERSIONINFO resource for windows
  140. IF[{- $config{target} =~ /^(?:Cygwin|mingw|VC-|BC-)/ -}]
  141. GENERATE[legacy.rc]=../util/mkrc.pl legacy
  142. SOURCE[$LEGACYGOAL]=legacy.rc
  143. ENDIF
  144. SOURCE[$LIBLEGACY]=prov_running.c
  145. ENDIF
  146. # Common things that are valid no matter what form the Legacy provider
  147. # takes.
  148. SOURCE[$LEGACYGOAL]=legacyprov.c
  149. INCLUDE[$LEGACYGOAL]=../include implementations/include common/include
  150. ENDIF
  151. #
  152. # Null provider stuff
  153. #
  154. # Because the null provider is built in, it means that libcrypto must
  155. # include all the object files that are needed.
  156. $NULLGOAL=../libcrypto
  157. SOURCE[$NULLGOAL]=nullprov.c prov_running.c