summaryrefslogtreecommitdiffstats
path: root/contrib/pthreadw32/module.defs
blob: 029fcf3f9702ceed2b609fa884b468fadaa3419e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$(eval $(call import.MODULE.defs,PTHREADW32,pthreadw32))
$(eval $(call import.CONTRIB.defs,PTHREADW32))

PTHREADW32.FETCH.url     = https://download.handbrake.fr/handbrake/contrib/pthreads-w32-2-9-1-release.tar.gz
PTHREADW32.FETCH.url    += ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.tar.gz
PTHREADW32.FETCH.sha256  = e6aca7aea8de33d9c8580bcb3a0ea3ec0a7ace4ba3f4e263ac7c7b66bc95fb4d

PTHREADW32.CONFIGURE = $(TOUCH.exe) $@

PTHREADW32.CLEAN.ntargets = realclean

PTHREADW32.BUILD.extra = CROSS=$(BUILD.cross.prefix)
PTHREADW32.BUILD.ntargets = GC-static

define PTHREADW32.INSTALL
    $(CP.exe) $(PTHREADW32.EXTRACT.dir/)pthread.h $(CONTRIB.build/)include/
    $(SED.exe) -i.sedbak -e 's/ __declspec (dllexport)//g' -e 's/__declspec (dllexport) //g' -e 's/ __declspec (dllimport)//g' -e 's/__declspec (dllimport) //g' $(CONTRIB.build/)include/pthread.h
    $(RM.exe) -f $(CONTRIB.build/)include/pthread.h.sedbak
    $(CP.exe) $(PTHREADW32.EXTRACT.dir/)sched.h $(CONTRIB.build/)include/
    $(SED.exe) -i.sedbak -e 's/ __declspec (dllexport)//g' -e 's/__declspec (dllexport) //g' -e 's/ __declspec (dllimport)//g' -e 's/__declspec (dllimport) //g' $(CONTRIB.build/)include/sched.h
    $(RM.exe) -f $(CONTRIB.build/)include/sched.h.sedbak
    $(CP.exe) $(PTHREADW32.EXTRACT.dir/)semaphore.h $(CONTRIB.build/)include/
    $(SED.exe) -i.sedbak -e 's/ __declspec (dllexport)//g' -e 's/__declspec (dllexport) //g' -e 's/ __declspec (dllimport)//g' -e 's/__declspec (dllimport) //g' $(CONTRIB.build/)include/semaphore.h
    $(RM.exe) -f $(CONTRIB.build/)include/semaphore.h.sedbak
    $(CP.exe) $(PTHREADW32.EXTRACT.dir/)libpthreadGC2.a $(CONTRIB.build/)lib/
    $(LN.exe) -sf ./libpthreadGC2.a $(CONTRIB.build/)lib/libpthread.a
    $(TOUCH.exe) $@
endef

define PTHREADW32.UNINSTALL
    $(RM.exe) -f $(CONTRIB.build/)lib/libpthreadGC2.a
    $(RM.exe) -f $(CONTRIB.build/)lib/libpthread.a
    $(RM.exe) -f $(CONTRIB.build/)include/pthread.h
    $(RM.exe) -f $(CONTRIB.build/)include/sched.h
    $(RM.exe) -f $(CONTRIB.build/)include/semaphore.h
    $(RM.exe) -f $(PTHREADW32.INSTALL.target)
endef