freeimage shared

This commit is contained in:
Charles Prévot 2018-11-05 18:52:25 +01:00
parent 43bb33562c
commit eb21f0277b
1 changed files with 34 additions and 2 deletions

View File

@ -17,7 +17,7 @@ define $(PKG)_UPDATE
head -1
endef
define $(PKG)_BUILD
define $(PKG)_BUILD_STATIC
$(MAKE) -C '$(1)' -j '$(JOBS)' -f Makefile.mingw \
CXX='$(TARGET)-g++' \
CC='$(TARGET)-gcc' \
@ -66,4 +66,36 @@ define $(PKG)_BUILD
`'$(TARGET)-pkg-config' freeimageplus --cflags --libs`
endef
$(PKG)_BUILD_SHARED =
define $(PKG)_BUILD_SHARED
$(MAKE) -C '$(1)' -j '$(JOBS)' -f Makefile.mingw \
CXX='$(TARGET)-g++' \
CC='$(TARGET)-gcc' \
AR='$(TARGET)-ar' \
RC='$(TARGET)-windres' \
DLLTOOL='$(TARGET)-dlltool' \
LD='$(TARGET)-g++' \
FREEIMAGE_LIBRARY_TYPE=SHARED \
SHAREDLIB=libfreeimage.dll \
IMPORTLIB=libfreeimage.dll.a \
TARGET=freeimage
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
$(INSTALL) -m644 '$(1)/libfreeimage.dll.a' '$(PREFIX)/$(TARGET)/lib/'
$(INSTALL) -d '$(PREFIX)/$(TARGET)/bin'
$(INSTALL) -m644 '$(1)/libfreeimage.dll' '$(PREFIX)/$(TARGET)/bin/'
$(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
$(INSTALL) -m644 '$(1)/Source/FreeImage.h' '$(PREFIX)/$(TARGET)/include/'
# create pkg-config files
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
(echo 'Name: freeimage'; \
echo 'Version: $(freeimage_VERSION)'; \
echo 'Description: FreeImage'; \
echo 'Libs: -lfreeimage -lws2_32 -lstdc++';) \
> '$(PREFIX)/$(TARGET)/lib/pkgconfig/freeimage.pc'
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(PWD)/src/$(PKG)-test.c' -o '$(PREFIX)/$(TARGET)/bin/test-freeimage.exe' \
`'$(TARGET)-pkg-config' freeimage --cflags --libs`
endef