Skip to content

Commit

Permalink
also build and install FreeImagePlus
Browse files Browse the repository at this point in the history
  • Loading branch information
WSoptics committed Dec 17, 2015
1 parent 8e89598 commit 196a241
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/freeimage-test.cpp
@@ -0,0 +1,15 @@
/*
* This file is part of MXE.
* See index.html for further information.
*/

#include <FreeImagePlus.h>

int main()
{
fipImage fi;

fi.setSize(FIT_BITMAP, 800, 600, 24);

return 0;
}
23 changes: 22 additions & 1 deletion src/freeimage.mk
Expand Up @@ -25,24 +25,45 @@ define $(PKG)_BUILD
FREEIMAGE_LIBRARY_TYPE=STATIC \
TARGET=freeimage

$(MAKE) -C '$(1)' -j '$(JOBS)' -f Makefile.fip \
CXX='$(TARGET)-g++' \
CXXFLAGS='-DFREEIMAGE_LIB' \
CC='$(TARGET)-gcc' \
AR='$(TARGET)-ar' \
RC='$(TARGET)-windres' \
libfreeimageplus.a

$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
$(INSTALL) -m644 '$(1)/libfreeimage.a' '$(PREFIX)/$(TARGET)/lib/'
$(INSTALL) -m644 '$(1)/libfreeimageplus.a' '$(PREFIX)/$(TARGET)/lib/'
$(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
$(INSTALL) -m644 '$(1)/Source/FreeImage.h' '$(PREFIX)/$(TARGET)/include/'
$(INSTALL) -m644 '$(1)/Wrapper/FreeImagePlus/FreeImagePlus.h' '$(PREFIX)/$(TARGET)/include/'

# create pkg-config file
# create pkg-config files
$(INSTALL) -d '$(PREFIX)/$(TARGET)/lib/pkgconfig'
(echo 'Name: freeimage'; \
echo 'Version: $(freeimage_VERSION)'; \
echo 'Description: FreeImage'; \
echo 'Cflags: -DFREEIMAGE_LIB'; \
echo 'Libs: -lfreeimage -lws2_32 -lstdc++';) \
> '$(PREFIX)/$(TARGET)/lib/pkgconfig/freeimage.pc'
(echo 'Name: freeimageplus'; \
echo 'Version: $(freeimage_VERSION)'; \
echo "Description: FreeImagePlus"; \
echo 'Cflags: -DFREEIMAGE_LIB'; \
echo 'Libs: -lfreeimage -lfreeimageplus -lws2_32';) \
> '$(PREFIX)/$(TARGET)/lib/pkgconfig/freeimageplus.pc'

'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-freeimage.exe' \
`'$(TARGET)-pkg-config' freeimage --cflags --libs`

'$(TARGET)-g++' \
-W -Wall -Werror -ansi -pedantic \
'$(2).cpp' -o '$(PREFIX)/$(TARGET)/bin/test-freeimageplus.exe' \
`'$(TARGET)-pkg-config' freeimageplus --cflags --libs`
endef

$(PKG)_BUILD_SHARED =

0 comments on commit 196a241

Please sign in to comment.