summaryrefslogtreecommitdiffstats
path: root/src/netpbm.mk
blob: e0a7de0144972212b9642e340ee5206b0f79092e (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
38
39
40
41
42
43
44
# This file is part of MXE.
# See index.html for further information.

PKG             := netpbm
$(PKG)_IGNORE   :=
$(PKG)_CHECKSUM := faf4f4e65ede1a22ed38d84596e68446b7970a8b
$(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
$(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tgz
$(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/netpbm/super_stable/$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_DEPS     := gcc

define $(PKG)_UPDATE
    echo 'TODO: write update script for $(PKG).' >&2;
    echo $($(PKG)_VERSION)
endef

# The Netpbm package has its own weird build system...
# Parallel builds don't work, so we use -j1 explicitly.

define $(PKG)_BUILD
    # Create a suitable configuration
    cp '$(1)/Makefile.config.in' '$(1)/Makefile.config'
    echo 'DEFAULT_TARGET=nonmerge'          >> '$(1)/Makefile.config'
    echo 'CC=$(TARGET)-gcc'                 >> '$(1)/Makefile.config'
    echo 'LD=$(TARGET)-gcc'                 >> '$(1)/Makefile.config'
    echo 'LINKERISCOMPILER=Y'               >> '$(1)/Makefile.config'
    echo 'LINKER_CAN_DO_EXPLICIT_LIBRARY=Y' >> '$(1)/Makefile.config'
    echo 'AR=$(TARGET)-ar'                  >> '$(1)/Makefile.config'
    echo 'RANLIB=$(TARGET)-ranlib'          >> '$(1)/Makefile.config'
    echo 'OMIT_NETWORK=y'                   >> '$(1)/Makefile.config'
    echo 'DONT_HAVE_PROCESS_MGMT=Y'         >> '$(1)/Makefile.config'
    echo 'NETPBMLIBTYPE=unixstatic'         >> '$(1)/Makefile.config'
    echo 'NETPBMLIBSUFFIX=a'                >> '$(1)/Makefile.config'
    # Build only the library
    $(MAKE) -C '$(1)' -j1 PROG_SUBDIRS=
    # Package everything into a package directory. Use '-i' to ignore
    # failures that happen because we did not build all the tools.
    $(MAKE) -C '$(1)' -j1 -i package pkgdir='$(1)/mxe-pkgdir'
    # Install only the library from that package directory
    $(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
    $(INSTALL) -m644 '$(1)/mxe-pkgdir/include/'* '$(PREFIX)/$(TARGET)/include'
    $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
    $(INSTALL) -m644 '$(1)/mxe-pkgdir/link/libnetpbm.a' '$(PREFIX)/$(TARGET)/lib/'
endef