Ignore:
Timestamp:
Jul 19, 2019, 10:31:53 AM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8ac3b0e
Parents:
6f15121
Message:

More robust fix for optionally linking threads

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/Makefile.am

    r6f15121 r2026bb6  
    2222
    2323libdir = ${CFA_LIBDIR}
    24 lib_LTLIBRARIES =  libcfa.la
     24lib_LTLIBRARIES =  libcfa.la libcfathread.la
    2525
    2626VPATH += :../prelude
     
    4141          containers/maybe.hfa containers/pair.hfa containers/result.hfa containers/vector.hfa
    4242
    43 # not all platforms support concurrency, add option do disable it
    44 headers_nosrc += concurrency/invoke.h
    45 headers += concurrency/coroutine.hfa concurrency/thread.hfa concurrency/kernel.hfa concurrency/monitor.hfa concurrency/mutex.hfa
    46 
    4743libsrc = startup.cfa interpose.cfa bits/debug.cfa assert.cfa exception.c virtual.c heap.cfa ${headers:.hfa=.cfa}
    4844
    4945# not all platforms support concurrency, add option do disable it
    50 libsrc += concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/preemption.cfa
     46thread_headers_nosrc = concurrency/invoke.h
     47thread_headers = concurrency/coroutine.hfa concurrency/thread.hfa concurrency/kernel.hfa concurrency/monitor.hfa concurrency/mutex.hfa
     48thread_libsrc = concurrency/CtxSwitch-@ARCHITECTURE@.S concurrency/alarm.cfa concurrency/invoke.c concurrency/preemption.cfa ${thread_headers:.hfa=.cfa}
    5149else
    5250headers =
     51thread_headers =
    5352headers_nosrc =
     53thread_headers_nosrc =
    5454libsrc =
    5555endif
     
    6464$(libobjs) : @CFACC@ @CFACPP@ prelude.cfa
    6565
     66thread_libobjs = $(addsuffix .lo, $(basename $(filter %.cfa,$(thread_libsrc))))
     67$(thread_libobjs) : @CFACC@ @CFACPP@ prelude.cfa
     68
    6669
    6770# .deps inclusion is not done automatically by automake for new languages
     
    7275
    7376-include $(libdeps)
     77
     78thread_libdeps = $(join \
     79        $(addsuffix $(DEPDIR)/ , $(dir $(thread_libobjs) ) ), \
     80        $(notdir ${thread_libobjs:.lo=.Plo}) \
     81)
     82
     83-include $(thread_libdeps)
     84
    7485
    7586prelude.o : prelude.cfa extras.cf gcc-builtins.cf builtins.cf @CFACC@ @CFACPP@
     
    8596libcfa_la_LDFLAGS = -version-info @CFA_VERSION@
    8697
     98libcfathread_la_SOURCES = ${thread_libsrc}
     99libcfathread_la_LDFLAGS = -version-info @CFA_VERSION@
     100
    87101stdhdr = $(shell find $(srcdir)/stdhdr -type f -printf "%p ")
    88102
    89103cfa_includedir = $(CFA_INCDIR)
    90 nobase_cfa_include_HEADERS = ${stdhdr} ${headers} ${headers_nosrc}
     104nobase_cfa_include_HEADERS = ${stdhdr} ${headers} ${headers_nosrc} ${thread_headers} ${thread_headers_nosrc}
    91105
    92106#----------------------------------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.