Add OpenSSL portability layer
[folly.git] / folly / Makefile.am
1 if FOLLY_TESTMAIN
2 SUBDIRS = . experimental init test
3 else
4 SUBDIRS = . test
5 endif
6
7 ACLOCAL_AMFLAGS = -I m4
8
9 CLEANFILES =
10
11
12 noinst_PROGRAMS = generate_fingerprint_tables
13 generate_fingerprint_tables_SOURCES = build/GenerateFingerprintTables.cpp
14 generate_fingerprint_tables_LDADD = libfollybase.la
15
16 noinst_LTLIBRARIES = \
17         libfollybasesse42.la \
18         libfollybase.la
19
20 lib_LTLIBRARIES = \
21         libfolly.la \
22         libfollybenchmark.la
23
24 follyincludedir = $(includedir)/folly
25
26 nobase_follyinclude_HEADERS = \
27         ApplyTuple.h \
28         Arena.h \
29         Arena-inl.h \
30         Array.h \
31         Assume.h \
32         AtomicBitSet.h \
33         AtomicHashArray.h \
34         AtomicHashArray-inl.h \
35         AtomicHashMap.h \
36         AtomicHashMap-inl.h \
37         AtomicIntrusiveLinkedList.h \
38         AtomicLinkedList.h \
39         AtomicStruct.h \
40         AtomicUnorderedMap.h \
41         Baton.h \
42         Benchmark.h \
43         Bits.h \
44         CachelinePadded.h \
45         CallOnce.h \
46         Checksum.h \
47         ClockGettimeWrappers.h \
48         ConcurrentSkipList.h \
49         ConcurrentSkipList-inl.h \
50         ContainerTraits.h \
51         Conv.h \
52         CppAttributes.h \
53         CpuId.h \
54         CPortability.h \
55         detail/AtomicHashUtils.h \
56         detail/AtomicUnorderedMapUtils.h \
57         detail/BitIteratorDetail.h \
58         detail/BitsDetail.h \
59         detail/CacheLocality.h \
60         detail/CachelinePaddedImpl.h \
61         detail/ChecksumDetail.h \
62         detail/DiscriminatedPtrDetail.h \
63         detail/FileUtilDetail.h \
64         detail/FingerprintPolynomial.h \
65         detail/Futex.h \
66         detail/GroupVarintDetail.h \
67         detail/IPAddress.h \
68         detail/IPAddressSource.h \
69         detail/Malloc.h \
70         detail/MemoryIdler.h \
71         detail/MPMCPipelineDetail.h \
72         detail/RangeCommon.h \
73         detail/RangeSse42.h \
74         detail/Sleeper.h \
75         detail/SlowFingerprint.h \
76         detail/SocketFastOpen.h \
77         detail/SpinLockImpl.h \
78         detail/StaticSingletonManager.h \
79         detail/Stats.h \
80         detail/ThreadLocalDetail.h \
81   detail/TryDetail.h \
82         detail/TurnSequencer.h \
83         detail/UncaughtExceptionCounter.h \
84         Demangle.h \
85         DiscriminatedPtr.h \
86         DynamicConverter.h \
87         dynamic.h \
88         dynamic-inl.h \
89         Enumerate.h \
90         EvictingCacheMap.h \
91         Exception.h \
92         ExceptionString.h \
93         ExceptionWrapper.h \
94         Executor.h \
95         Expected.h \
96         experimental/AsymmetricMemoryBarrier.h \
97         experimental/AutoTimer.h \
98         experimental/Bits.h \
99         experimental/BitVectorCoding.h \
100         experimental/DynamicParser.h \
101         experimental/DynamicParser-inl.h \
102         experimental/ExecutionObserver.h \
103         experimental/EliasFanoCoding.h \
104         experimental/EventCount.h \
105         experimental/Instructions.h \
106         experimental/bser/Bser.h \
107         experimental/FunctionScheduler.h \
108         experimental/FutureDAG.h \
109         experimental/io/FsUtil.h \
110         experimental/JemallocNodumpAllocator.h \
111         experimental/JSONSchema.h \
112         experimental/LockFreeRingBuffer.h \
113         experimental/NestedCommandLineApp.h \
114         experimental/observer/detail/Core.h \
115         experimental/observer/detail/GraphCycleDetector.h \
116         experimental/observer/detail/ObserverManager.h \
117         experimental/observer/detail/Observer-pre.h \
118         experimental/observer/Observable.h \
119         experimental/observer/Observable-inl.h \
120         experimental/observer/Observer.h \
121         experimental/observer/Observer-inl.h \
122         experimental/observer/SimpleObservable.h \
123         experimental/observer/SimpleObservable-inl.h \
124         experimental/ProgramOptions.h \
125         experimental/ReadMostlySharedPtr.h \
126         experimental/symbolizer/Elf.h \
127         experimental/symbolizer/Elf-inl.h \
128         experimental/symbolizer/ElfCache.h \
129         experimental/symbolizer/Dwarf.h \
130         experimental/symbolizer/LineReader.h \
131         experimental/symbolizer/SignalHandler.h \
132         experimental/symbolizer/StackTrace.h \
133         experimental/symbolizer/Symbolizer.h \
134         experimental/Select64.h \
135         experimental/StringKeyedCommon.h \
136         experimental/StringKeyedMap.h \
137         experimental/StringKeyedSet.h \
138         experimental/StringKeyedUnorderedMap.h \
139         experimental/StringKeyedUnorderedSet.h \
140         experimental/TestUtil.h \
141         experimental/TLRefCount.h \
142         experimental/TupleOps.h \
143         FBString.h \
144         FBVector.h \
145         File.h \
146         FileUtil.h \
147         Fingerprint.h \
148         FixedString.h \
149         folly-config.h \
150         Foreach.h \
151         FormatArg.h \
152         FormatTraits.h \
153         Format.h \
154         Format-inl.h \
155         futures/Barrier.h \
156         futures/DrivableExecutor.h \
157         futures/Future-pre.h \
158         futures/helpers.h \
159         futures/Future.h \
160         futures/Future-inl.h \
161         futures/FutureException.h \
162         futures/InlineExecutor.h \
163         futures/ManualExecutor.h \
164         futures/OpaqueCallbackShunt.h \
165         futures/Promise-inl.h \
166         futures/Promise.h \
167         futures/QueuedImmediateExecutor.h \
168         futures/ScheduledExecutor.h \
169         futures/SharedPromise.h \
170         futures/SharedPromise-inl.h \
171         futures/ThreadWheelTimekeeper.h \
172         futures/Timekeeper.h \
173         futures/detail/Core.h \
174         futures/detail/FSM.h \
175         futures/detail/Types.h \
176         gen/Base.h \
177         gen/Base-inl.h \
178         gen/Combine.h \
179         gen/Combine-inl.h \
180         gen/Core.h \
181         gen/Core-inl.h \
182         gen/File.h \
183         gen/File-inl.h \
184         gen/Parallel.h \
185         gen/Parallel-inl.h \
186         gen/ParallelMap.h \
187         gen/ParallelMap-inl.h \
188         gen/String.h \
189         gen/String-inl.h \
190         GroupVarint.h \
191         Hash.h \
192         IPAddress.h \
193         IPAddressV4.h \
194         IPAddressV6.h \
195         IPAddressException.h \
196         Indestructible.h \
197         IndexedMemPool.h \
198         init/Init.h \
199         IntrusiveList.h \
200         io/Compression.h \
201         io/Cursor.h \
202         io/Cursor-inl.h \
203         io/IOBuf.h \
204         io/IOBufQueue.h \
205         io/RecordIO.h \
206         io/RecordIO-inl.h \
207         io/TypedIOBuf.h \
208         io/ShutdownSocketSet.h \
209         io/async/AsyncPipe.h \
210         io/async/AsyncTimeout.h \
211         io/async/AsyncTransport.h \
212         io/async/AsyncUDPServerSocket.h \
213         io/async/AsyncUDPSocket.h \
214         io/async/AsyncServerSocket.h \
215         io/async/AsyncSignalHandler.h \
216         io/async/AsyncSocket.h \
217         io/async/AsyncSocketBase.h \
218         io/async/AsyncSSLSocket.h \
219         io/async/AsyncSocketException.h \
220         io/async/DecoratedAsyncTransportWrapper.h \
221         io/async/DelayedDestructionBase.h \
222         io/async/DelayedDestruction.h \
223         io/async/EventBase.h \
224         io/async/EventBaseLocal.h \
225         io/async/EventBaseManager.h \
226         io/async/EventBaseThread.h \
227         io/async/EventFDWrapper.h \
228         io/async/EventHandler.h \
229         io/async/EventUtil.h \
230         io/async/NotificationQueue.h \
231         io/async/HHWheelTimer.h \
232         io/async/ssl/OpenSSLPtrTypes.h \
233         io/async/ssl/OpenSSLUtils.h \
234         io/async/ssl/SSLErrors.h \
235         io/async/ssl/TLSDefinitions.h \
236         io/async/Request.h \
237         io/async/SSLContext.h \
238         io/async/ScopedEventBaseThread.h \
239         io/async/TimeoutManager.h \
240         io/async/VirtualEventBase.h \
241         io/async/WriteChainAsyncTransportWrapper.h \
242         io/async/test/AsyncSSLSocketTest.h \
243         io/async/test/BlockingSocket.h \
244         io/async/test/MockAsyncSocket.h \
245         io/async/test/MockAsyncServerSocket.h \
246         io/async/test/MockAsyncSSLSocket.h \
247         io/async/test/MockAsyncTransport.h \
248         io/async/test/MockAsyncUDPSocket.h \
249         io/async/test/MockTimeoutManager.h \
250         io/async/test/ScopedBoundPort.h \
251         io/async/test/SocketPair.h \
252         io/async/test/TimeUtil.h \
253         io/async/test/UndelayedDestruction.h \
254         io/async/test/Util.h \
255         json.h \
256         Lazy.h \
257         LifoSem.h \
258         Likely.h \
259         LockTraits.h \
260         LockTraitsBoost.h \
261         Logging.h \
262         MacAddress.h \
263         MallctlHelper.h \
264         Malloc.h \
265         MapUtil.h \
266         Math.h \
267         Memory.h \
268         MemoryMapping.h \
269         MicroSpinLock.h \
270         MicroLock.h \
271         MoveWrapper.h \
272         MPMCPipeline.h \
273         MPMCQueue.h \
274         Optional.h \
275         PackedSyncPtr.h \
276         Padded.h \
277         Partial.h \
278         PicoSpinLock.h \
279         Portability.h \
280         portability/Asm.h \
281         portability/Atomic.h \
282         portability/BitsFunctexcept.h \
283         portability/Builtins.h \
284         portability/Config.h \
285         portability/Constexpr.h \
286         portability/Dirent.h \
287         portability/Environment.h \
288         portability/Event.h \
289         portability/Fcntl.h \
290         portability/GFlags.h \
291         portability/GMock.h \
292         portability/GTest.h \
293         portability/IOVec.h \
294         portability/Libgen.h \
295         portability/Malloc.h \
296         portability/Math.h \
297         portability/Memory.h \
298         portability/OpenSSL.h \
299         portability/PThread.h \
300         portability/Sockets.h \
301         portability/Stdio.h \
302         portability/Stdlib.h \
303         portability/String.h \
304         portability/Syslog.h \
305         portability/SysFile.h \
306         portability/SysMembarrier.h \
307         portability/SysMman.h \
308         portability/SysResource.h \
309         portability/SysStat.h \
310         portability/SysSyscall.h \
311         portability/SysTime.h \
312         portability/SysTypes.h \
313         portability/SysUio.h \
314         portability/Time.h \
315         portability/TypeTraits.h \
316         portability/Windows.h \
317         portability/Unistd.h \
318         Preprocessor.h \
319         ProducerConsumerQueue.h \
320         Random.h \
321         Random-inl.h \
322         Range.h \
323         RWSpinLock.h \
324         SafeAssert.h \
325         ScopeGuard.h \
326         SharedMutex.h \
327         Shell.h \
328         Singleton.h \
329         Singleton-inl.h \
330         SingletonThreadLocal.h \
331         SmallLocks.h \
332         small_vector.h \
333         SocketAddress.h \
334         sorted_vector_types.h \
335         SparseByteSet.h \
336         SpinLock.h \
337         SpookyHashV1.h \
338         SpookyHashV2.h \
339         ssl/OpenSSLHash.h \
340         ssl/OpenSSLVersionFinder.h \
341         ssl/SSLSession.h \
342         ssl/detail/SSLSessionImpl.h \
343         stats/BucketedTimeSeries-defs.h \
344         stats/BucketedTimeSeries.h \
345         stats/Histogram-defs.h \
346         stats/Histogram.h \
347         stats/MultiLevelTimeSeries-defs.h \
348         stats/MultiLevelTimeSeries.h \
349         stats/TimeseriesHistogram-defs.h \
350         stats/TimeseriesHistogram.h \
351         stop_watch.h \
352         String.h \
353         String-inl.h \
354         Subprocess.h \
355         Synchronized.h \
356         test/FBStringTestBenchmarks.cpp.h \
357         test/FBVectorTestBenchmarks.cpp.h \
358         test/function_benchmark/benchmark_impl.h \
359         test/function_benchmark/test_functions.h \
360         test/SynchronizedTestLib.h \
361         test/SynchronizedTestLib-inl.h \
362         test/TestUtils.h \
363         ThreadCachedArena.h \
364         ThreadCachedInt.h \
365         ThreadId.h \
366         ThreadLocal.h \
367         ThreadName.h \
368         TimeoutQueue.h \
369         TokenBucket.h \
370         tracing/StaticTracepoint.h \
371         Traits.h \
372         Try-inl.h \
373         Try.h \
374         Unicode.h \
375         Function.h \
376         UncaughtExceptions.h \
377         Unit.h \
378         Uri.h \
379         Uri-inl.h \
380         Utility.h \
381         Varint.h \
382         VersionCheck.h
383
384 FormatTables.cpp: build/generate_format_tables.py
385         $(PYTHON) build/generate_format_tables.py
386 CLEANFILES += FormatTables.cpp
387
388 EscapeTables.cpp: build/generate_escape_tables.py
389         $(PYTHON) build/generate_escape_tables.py
390 CLEANFILES += EscapeTables.cpp
391
392 GroupVarintTables.cpp: build/generate_varint_tables.py
393         $(PYTHON) build/generate_varint_tables.py
394 CLEANFILES += GroupVarintTables.cpp
395
396 libfollybasesse42_la_SOURCES = \
397         detail/RangeSse42.cpp
398
399 libfollybase_la_SOURCES = \
400         Conv.cpp \
401         Demangle.cpp \
402         detail/RangeCommon.cpp \
403         EscapeTables.cpp \
404         Format.cpp \
405         FormatTables.cpp \
406         MallctlHelper.cpp \
407         portability/BitsFunctexcept.cpp \
408         StringBase.cpp \
409         String.cpp \
410         Unicode.cpp
411
412 libfolly_la_SOURCES = \
413         Assume.cpp \
414         Bits.cpp \
415         Checksum.cpp \
416         ClockGettimeWrappers.cpp \
417         detail/CacheLocality.cpp \
418         detail/IPAddress.cpp \
419         dynamic.cpp \
420         ExceptionWrapper.cpp \
421         Executor.cpp \
422         File.cpp \
423         FileUtil.cpp \
424         FingerprintTables.cpp \
425         futures/Barrier.cpp \
426         futures/Future.cpp \
427         futures/InlineExecutor.cpp \
428         futures/ManualExecutor.cpp \
429         futures/QueuedImmediateExecutor.cpp \
430         futures/ThreadWheelTimekeeper.cpp \
431         detail/Futex.cpp \
432         detail/StaticSingletonManager.cpp \
433         detail/ThreadLocalDetail.cpp \
434         GroupVarint.cpp \
435         GroupVarintTables.cpp \
436         IPAddress.cpp \
437         IPAddressV4.cpp \
438         IPAddressV6.cpp \
439         LifoSem.cpp \
440         init/Init.cpp \
441         io/Compression.cpp \
442         io/Cursor.cpp \
443         io/IOBuf.cpp \
444         io/IOBufQueue.cpp \
445         io/RecordIO.cpp \
446         io/ShutdownSocketSet.cpp \
447         io/async/AsyncPipe.cpp \
448         io/async/AsyncTimeout.cpp \
449         io/async/AsyncUDPSocket.cpp \
450         io/async/AsyncServerSocket.cpp \
451         io/async/AsyncSignalHandler.cpp \
452         io/async/AsyncSocket.cpp \
453         io/async/AsyncSSLSocket.cpp \
454         io/async/EventBase.cpp \
455         io/async/EventBaseLocal.cpp \
456         io/async/EventBaseManager.cpp \
457         io/async/EventBaseThread.cpp \
458         io/async/EventHandler.cpp \
459         io/async/Request.cpp \
460         io/async/SSLContext.cpp \
461         io/async/ScopedEventBaseThread.cpp \
462         io/async/VirtualEventBase.cpp \
463         io/async/HHWheelTimer.cpp \
464         io/async/TimeoutManager.cpp \
465         io/async/test/ScopedBoundPort.cpp \
466         io/async/test/SocketPair.cpp \
467         io/async/test/TimeUtil.cpp \
468         io/async/ssl/OpenSSLUtils.cpp \
469         io/async/ssl/SSLErrors.cpp \
470         json.cpp \
471         detail/MemoryIdler.cpp \
472         detail/SocketFastOpen.cpp \
473         MacAddress.cpp \
474         MemoryMapping.cpp \
475         portability/Dirent.cpp \
476         portability/Environment.cpp \
477         portability/Fcntl.cpp \
478         portability/Libgen.cpp \
479         portability/Malloc.cpp \
480         portability/Memory.cpp \
481         portability/OpenSSL.cpp \
482         portability/Sockets.cpp \
483         portability/Stdio.cpp \
484         portability/Stdlib.cpp \
485         portability/String.cpp \
486         portability/SysFile.cpp \
487         portability/SysMembarrier.cpp \
488         portability/SysMman.cpp \
489         portability/SysResource.cpp \
490         portability/SysStat.cpp \
491         portability/SysTime.cpp \
492         portability/SysUio.cpp \
493         portability/Time.cpp \
494         portability/Unistd.cpp \
495         Random.cpp \
496         SafeAssert.cpp \
497         ScopeGuard.cpp \
498         SharedMutex.cpp \
499         Shell.cpp \
500         MicroLock.cpp \
501         Singleton.cpp \
502         SocketAddress.cpp \
503         SpookyHashV1.cpp \
504         SpookyHashV2.cpp \
505         ssl/OpenSSLHash.cpp \
506         ssl/detail/SSLSessionImpl.cpp \
507         stats/Instantiations.cpp \
508         Subprocess.cpp \
509         ThreadCachedArena.cpp \
510         TimeoutQueue.cpp \
511         Uri.cpp \
512         Version.cpp \
513         experimental/AsymmetricMemoryBarrier.cpp \
514         experimental/bser/Dump.cpp \
515         experimental/bser/Load.cpp \
516         experimental/DynamicParser.cpp \
517         experimental/FunctionScheduler.cpp \
518         experimental/io/FsUtil.cpp \
519         experimental/JemallocNodumpAllocator.cpp \
520         experimental/JSONSchema.cpp \
521         experimental/NestedCommandLineApp.cpp \
522         experimental/observer/detail/Core.cpp \
523         experimental/observer/detail/ObserverManager.cpp \
524         experimental/ProgramOptions.cpp \
525         experimental/Select64.cpp \
526         experimental/TestUtil.cpp
527
528 if HAVE_LINUX
529 nobase_follyinclude_HEADERS += \
530         experimental/io/HugePages.h
531 libfolly_la_SOURCES += \
532         experimental/io/HugePages.cpp
533 endif
534
535 if !HAVE_WEAK_SYMBOLS
536 libfollybase_la_SOURCES += detail/MallocImpl.cpp
537 endif
538
539 if HAVE_BOOST_CONTEXT
540 nobase_follyinclude_HEADERS += \
541         fibers/AddTasks.h \
542         fibers/AddTasks-inl.h \
543         fibers/AtomicBatchDispatcher.h \
544         fibers/AtomicBatchDispatcher-inl.h \
545         fibers/Baton.h \
546         fibers/Baton-inl.h \
547         fibers/BatchDispatcher.h \
548         fibers/BoostContextCompatibility.h \
549         fibers/EventBaseLoopController.h \
550         fibers/EventBaseLoopController-inl.h \
551         fibers/Fiber.h \
552         fibers/Fiber-inl.h \
553         fibers/FiberManager.h \
554         fibers/FiberManager-inl.h \
555         fibers/FiberManagerInternal.h \
556         fibers/FiberManagerInternal-inl.h \
557         fibers/FiberManagerMap.h \
558         fibers/ForEach.h \
559         fibers/ForEach-inl.h \
560         fibers/GenericBaton.h \
561         fibers/GuardPageAllocator.h \
562         fibers/LoopController.h \
563         fibers/Promise.h \
564         fibers/Promise-inl.h \
565         fibers/Semaphore.h \
566         fibers/SimpleLoopController.h \
567         fibers/TimedMutex.h \
568         fibers/TimedMutex-inl.h \
569         fibers/TimeoutController.h \
570         fibers/traits.h \
571         fibers/WhenN.h \
572         fibers/WhenN-inl.h
573
574 libfolly_la_SOURCES += \
575         fibers/Baton.cpp \
576         fibers/Fiber.cpp \
577         fibers/FiberManager.cpp \
578         fibers/FiberManagerMap.cpp \
579         fibers/GuardPageAllocator.cpp \
580         fibers/Semaphore.cpp \
581         fibers/TimeoutController.cpp
582 endif
583
584 libfollybasesse42_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
585 libfollybasesse42_la_CXXFLAGS = -msse4.2
586
587 libfollybase_la_LIBADD = libfollybasesse42.la
588 libfollybase_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
589
590 libfolly_la_LIBADD = libfollybase.la
591 libfolly_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION) -lssl
592
593 FingerprintTables.cpp: generate_fingerprint_tables
594         ./generate_fingerprint_tables
595 CLEANFILES += FingerprintTables.cpp
596
597 libfollybenchmark_la_SOURCES = Benchmark.cpp
598 libfollybenchmark_la_LIBADD = libfolly.la
599 libfollybenchmark_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
600
601 # install pkg-config metadata file
602 pkgconfigdir = $(libdir)/pkgconfig
603 nodist_pkgconfig_DATA = libfolly.pc