add folly::init to libfolly for OSS build
[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 noinst_PROGRAMS = generate_fingerprint_tables
12 generate_fingerprint_tables_SOURCES = build/GenerateFingerprintTables.cpp
13 generate_fingerprint_tables_LDADD = libfollybase.la
14
15 noinst_LTLIBRARIES = \
16         libfollybasesse42.la \
17         libfollybase.la
18
19 lib_LTLIBRARIES = \
20         libfolly.la \
21         libfollybenchmark.la
22
23 follyincludedir = $(includedir)/folly
24
25 nobase_follyinclude_HEADERS = \
26         ApplyTuple.h \
27         Arena.h \
28         Arena-inl.h \
29         Array.h \
30         Assume.h \
31         AtomicBitSet.h \
32         AtomicHashArray.h \
33         AtomicHashArray-inl.h \
34         AtomicHashMap.h \
35         AtomicHashMap-inl.h \
36         AtomicIntrusiveLinkedList.h \
37         AtomicLinkedList.h \
38         AtomicStruct.h \
39         AtomicUnorderedMap.h \
40         Baton.h \
41         Benchmark.h \
42         Bits.h \
43         CachelinePadded.h \
44         CallOnce.h \
45         Checksum.h \
46         ClockGettimeWrappers.h \
47         ConcurrentSkipList.h \
48         ConcurrentSkipList-inl.h \
49         ContainerTraits.h \
50         Conv.h \
51         CppAttributes.h \
52         CpuId.h \
53         CPortability.h \
54         detail/AtomicHashUtils.h \
55         detail/AtomicUnorderedMapUtils.h \
56         detail/BitIteratorDetail.h \
57         detail/BitsDetail.h \
58         detail/CacheLocality.h \
59         detail/CachelinePaddedImpl.h \
60         detail/ChecksumDetail.h \
61         detail/DiscriminatedPtrDetail.h \
62         detail/ExceptionWrapper.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/EventFDWrapper.h \
227         io/async/EventHandler.h \
228         io/async/EventUtil.h \
229         io/async/NotificationQueue.h \
230         io/async/HHWheelTimer.h \
231         io/async/ssl/OpenSSLPtrTypes.h \
232         io/async/ssl/OpenSSLUtils.h \
233         io/async/ssl/SSLErrors.h \
234         io/async/ssl/TLSDefinitions.h \
235         io/async/Request.h \
236         io/async/SSLContext.h \
237         io/async/ScopedEventBaseThread.h \
238         io/async/TimeoutManager.h \
239         io/async/VirtualEventBase.h \
240         io/async/WriteChainAsyncTransportWrapper.h \
241         io/async/test/AsyncSSLSocketTest.h \
242         io/async/test/BlockingSocket.h \
243         io/async/test/MockAsyncSocket.h \
244         io/async/test/MockAsyncServerSocket.h \
245         io/async/test/MockAsyncSSLSocket.h \
246         io/async/test/MockAsyncTransport.h \
247         io/async/test/MockAsyncUDPSocket.h \
248         io/async/test/MockTimeoutManager.h \
249         io/async/test/ScopedBoundPort.h \
250         io/async/test/SocketPair.h \
251         io/async/test/TimeUtil.h \
252         io/async/test/UndelayedDestruction.h \
253         io/async/test/Util.h \
254         json.h \
255         Lazy.h \
256         LifoSem.h \
257         Likely.h \
258         LockTraits.h \
259         LockTraitsBoost.h \
260         Logging.h \
261         MacAddress.h \
262         MallctlHelper.h \
263         Malloc.h \
264         MapUtil.h \
265         Math.h \
266         Memory.h \
267         MemoryMapping.h \
268         MicroSpinLock.h \
269         MicroLock.h \
270         MoveWrapper.h \
271         MPMCPipeline.h \
272         MPMCQueue.h \
273         Optional.h \
274         PackedSyncPtr.h \
275         Padded.h \
276         Partial.h \
277         PicoSpinLock.h \
278         Portability.h \
279         portability/Asm.h \
280         portability/Atomic.h \
281         portability/BitsFunctexcept.h \
282         portability/Builtins.h \
283         portability/Config.h \
284         portability/Constexpr.h \
285         portability/Dirent.h \
286         portability/Environment.h \
287         portability/Event.h \
288         portability/Fcntl.h \
289         portability/GFlags.h \
290         portability/GMock.h \
291         portability/GTest.h \
292         portability/IOVec.h \
293         portability/Libgen.h \
294         portability/Malloc.h \
295         portability/Math.h \
296         portability/Memory.h \
297         portability/PThread.h \
298         portability/Sockets.h \
299         portability/Stdio.h \
300         portability/Stdlib.h \
301         portability/String.h \
302         portability/Syslog.h \
303         portability/SysFile.h \
304         portability/SysMembarrier.h \
305         portability/SysMman.h \
306         portability/SysResource.h \
307         portability/SysStat.h \
308         portability/SysSyscall.h \
309         portability/SysTime.h \
310         portability/SysTypes.h \
311         portability/SysUio.h \
312         portability/Time.h \
313         portability/TypeTraits.h \
314         portability/Windows.h \
315         portability/Unistd.h \
316         Preprocessor.h \
317         ProducerConsumerQueue.h \
318         Random.h \
319         Random-inl.h \
320         Range.h \
321         RWSpinLock.h \
322         SafeAssert.h \
323         ScopeGuard.h \
324         SharedMutex.h \
325         Shell.h \
326         Singleton.h \
327         Singleton-inl.h \
328         SingletonThreadLocal.h \
329         SmallLocks.h \
330         small_vector.h \
331         SocketAddress.h \
332         sorted_vector_types.h \
333         SparseByteSet.h \
334         SpinLock.h \
335         SpookyHashV1.h \
336         SpookyHashV2.h \
337         ssl/OpenSSLHash.h \
338         ssl/SSLSession.h \
339         ssl/detail/OpenSSLVersionFinder.h \
340         ssl/detail/SSLSessionImpl.h \
341         stats/BucketedTimeSeries-defs.h \
342         stats/BucketedTimeSeries.h \
343         stats/Histogram-defs.h \
344         stats/Histogram.h \
345         stats/MultiLevelTimeSeries-defs.h \
346         stats/MultiLevelTimeSeries.h \
347         stats/TimeseriesHistogram-defs.h \
348         stats/TimeseriesHistogram.h \
349         stop_watch.h \
350         String.h \
351         String-inl.h \
352         Subprocess.h \
353         Synchronized.h \
354         test/FBStringTestBenchmarks.cpp.h \
355         test/FBVectorTestBenchmarks.cpp.h \
356         test/function_benchmark/benchmark_impl.h \
357         test/function_benchmark/test_functions.h \
358         test/SynchronizedTestLib.h \
359         test/SynchronizedTestLib-inl.h \
360         test/TestUtils.h \
361         ThreadCachedArena.h \
362         ThreadCachedInt.h \
363         ThreadId.h \
364         ThreadLocal.h \
365         ThreadName.h \
366         TimeoutQueue.h \
367         TokenBucket.h \
368         tracing/StaticTracepoint.h \
369         Traits.h \
370         Try-inl.h \
371         Try.h \
372         Unicode.h \
373         Function.h \
374         Unit.h \
375         Uri.h \
376         Uri-inl.h \
377         Varint.h \
378         VersionCheck.h
379
380 FormatTables.cpp: build/generate_format_tables.py
381         $(PYTHON) build/generate_format_tables.py
382 CLEANFILES += FormatTables.cpp
383
384 EscapeTables.cpp: build/generate_escape_tables.py
385         $(PYTHON) build/generate_escape_tables.py
386 CLEANFILES += EscapeTables.cpp
387
388 GroupVarintTables.cpp: build/generate_varint_tables.py
389         $(PYTHON) build/generate_varint_tables.py
390 CLEANFILES += GroupVarintTables.cpp
391
392 libfollybasesse42_la_SOURCES = \
393         detail/RangeSse42.cpp
394
395 libfollybase_la_SOURCES = \
396         Conv.cpp \
397         Demangle.cpp \
398         detail/RangeCommon.cpp \
399         EscapeTables.cpp \
400         Format.cpp \
401         FormatTables.cpp \
402         MallctlHelper.cpp \
403         portability/BitsFunctexcept.cpp \
404         StringBase.cpp \
405         String.cpp \
406         Unicode.cpp
407
408 libfolly_la_SOURCES = \
409         Assume.cpp \
410         Bits.cpp \
411         Checksum.cpp \
412         ClockGettimeWrappers.cpp \
413         detail/CacheLocality.cpp \
414         detail/IPAddress.cpp \
415         dynamic.cpp \
416         ExceptionWrapper.cpp \
417         Executor.cpp \
418         File.cpp \
419         FileUtil.cpp \
420         FingerprintTables.cpp \
421         futures/Barrier.cpp \
422         futures/Future.cpp \
423         futures/InlineExecutor.cpp \
424         futures/ManualExecutor.cpp \
425         futures/QueuedImmediateExecutor.cpp \
426         futures/ThreadWheelTimekeeper.cpp \
427         detail/Futex.cpp \
428         detail/StaticSingletonManager.cpp \
429         detail/ThreadLocalDetail.cpp \
430         GroupVarint.cpp \
431         GroupVarintTables.cpp \
432         IPAddress.cpp \
433         IPAddressV4.cpp \
434         IPAddressV6.cpp \
435         LifoSem.cpp \
436         init/Init.cpp \
437         io/Compression.cpp \
438         io/Cursor.cpp \
439         io/IOBuf.cpp \
440         io/IOBufQueue.cpp \
441         io/RecordIO.cpp \
442         io/ShutdownSocketSet.cpp \
443         io/async/AsyncPipe.cpp \
444         io/async/AsyncTimeout.cpp \
445         io/async/AsyncUDPSocket.cpp \
446         io/async/AsyncServerSocket.cpp \
447         io/async/AsyncSignalHandler.cpp \
448         io/async/AsyncSocket.cpp \
449         io/async/AsyncSSLSocket.cpp \
450         io/async/EventBase.cpp \
451         io/async/EventBaseLocal.cpp \
452         io/async/EventBaseManager.cpp \
453         io/async/EventHandler.cpp \
454         io/async/Request.cpp \
455         io/async/SSLContext.cpp \
456         io/async/ScopedEventBaseThread.cpp \
457         io/async/VirtualEventBase.cpp \
458         io/async/HHWheelTimer.cpp \
459         io/async/TimeoutManager.cpp \
460         io/async/test/ScopedBoundPort.cpp \
461         io/async/test/SocketPair.cpp \
462         io/async/test/TimeUtil.cpp \
463         io/async/ssl/OpenSSLUtils.cpp \
464         io/async/ssl/SSLErrors.cpp \
465         json.cpp \
466         detail/MemoryIdler.cpp \
467         detail/SocketFastOpen.cpp \
468         MacAddress.cpp \
469         MemoryMapping.cpp \
470         portability/Dirent.cpp \
471         portability/Environment.cpp \
472         portability/Fcntl.cpp \
473         portability/Libgen.cpp \
474         portability/Malloc.cpp \
475         portability/Memory.cpp \
476         portability/Sockets.cpp \
477         portability/Stdio.cpp \
478         portability/Stdlib.cpp \
479         portability/String.cpp \
480         portability/SysFile.cpp \
481         portability/SysMembarrier.cpp \
482         portability/SysMman.cpp \
483         portability/SysResource.cpp \
484         portability/SysStat.cpp \
485         portability/SysTime.cpp \
486         portability/SysUio.cpp \
487         portability/Time.cpp \
488         portability/Unistd.cpp \
489         Random.cpp \
490         SafeAssert.cpp \
491         ScopeGuard.cpp \
492         SharedMutex.cpp \
493         Shell.cpp \
494         MicroLock.cpp \
495         Singleton.cpp \
496         SocketAddress.cpp \
497         SpookyHashV1.cpp \
498         SpookyHashV2.cpp \
499         ssl/OpenSSLHash.cpp \
500         ssl/detail/SSLSessionImpl.cpp \
501         stats/Instantiations.cpp \
502         Subprocess.cpp \
503         ThreadCachedArena.cpp \
504         TimeoutQueue.cpp \
505         Uri.cpp \
506         Version.cpp \
507         experimental/AsymmetricMemoryBarrier.cpp \
508         experimental/bser/Dump.cpp \
509         experimental/bser/Load.cpp \
510         experimental/DynamicParser.cpp \
511         experimental/FunctionScheduler.cpp \
512         experimental/io/FsUtil.cpp \
513         experimental/JemallocNodumpAllocator.cpp \
514         experimental/JSONSchema.cpp \
515         experimental/NestedCommandLineApp.cpp \
516         experimental/observer/detail/Core.cpp \
517         experimental/observer/detail/ObserverManager.cpp \
518         experimental/ProgramOptions.cpp \
519         experimental/Select64.cpp \
520         experimental/TestUtil.cpp
521
522 if HAVE_LINUX
523 nobase_follyinclude_HEADERS += \
524         experimental/io/HugePages.h
525 libfolly_la_SOURCES += \
526         experimental/io/HugePages.cpp
527 endif
528
529 if !HAVE_WEAK_SYMBOLS
530 libfollybase_la_SOURCES += detail/MallocImpl.cpp
531 endif
532
533 if HAVE_BOOST_CONTEXT
534 nobase_follyinclude_HEADERS += \
535         fibers/AddTasks.h \
536         fibers/AddTasks-inl.h \
537         fibers/AtomicBatchDispatcher.h \
538         fibers/AtomicBatchDispatcher-inl.h \
539         fibers/Baton.h \
540         fibers/Baton-inl.h \
541         fibers/BatchDispatcher.h \
542         fibers/BoostContextCompatibility.h \
543         fibers/EventBaseLoopController.h \
544         fibers/EventBaseLoopController-inl.h \
545         fibers/Fiber.h \
546         fibers/Fiber-inl.h \
547         fibers/FiberManager.h \
548         fibers/FiberManager-inl.h \
549         fibers/FiberManagerInternal.h \
550         fibers/FiberManagerInternal-inl.h \
551         fibers/FiberManagerMap.h \
552         fibers/ForEach.h \
553         fibers/ForEach-inl.h \
554         fibers/GenericBaton.h \
555         fibers/GuardPageAllocator.h \
556         fibers/LoopController.h \
557         fibers/Promise.h \
558         fibers/Promise-inl.h \
559         fibers/Semaphore.h \
560         fibers/SimpleLoopController.h \
561         fibers/TimedMutex.h \
562         fibers/TimedMutex-inl.h \
563         fibers/TimeoutController.h \
564         fibers/traits.h \
565         fibers/WhenN.h \
566         fibers/WhenN-inl.h
567
568 libfolly_la_SOURCES += \
569         fibers/Baton.cpp \
570         fibers/Fiber.cpp \
571         fibers/FiberManager.cpp \
572         fibers/FiberManagerMap.cpp \
573         fibers/GuardPageAllocator.cpp \
574         fibers/Semaphore.cpp \
575         fibers/TimeoutController.cpp
576 endif
577
578 libfollybasesse42_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
579 libfollybasesse42_la_CXXFLAGS = -msse4.2
580
581 libfollybase_la_LIBADD = libfollybasesse42.la
582 libfollybase_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
583
584 libfolly_la_LIBADD = libfollybase.la
585 libfolly_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION) -lssl
586
587 FingerprintTables.cpp: generate_fingerprint_tables
588         ./generate_fingerprint_tables
589 CLEANFILES += FingerprintTables.cpp
590
591 libfollybenchmark_la_SOURCES = Benchmark.cpp
592 libfollybenchmark_la_LIBADD = libfolly.la
593 libfollybenchmark_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LT_VERSION)
594
595 # install pkg-config metadata file
596 pkgconfigdir = $(libdir)/pkgconfig
597 nodist_pkgconfig_DATA = libfolly.pc