mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-17 03:25:46 +00:00
6325529f71
function now has one more parameter to pass, I collected all the individual file patches in a single patch for that purpose, so if/when the original software is up to Tk 8.4, this patch file can easily be removed again.
75 lines
2.4 KiB
Makefile
75 lines
2.4 KiB
Makefile
SHLIB_NAME= libimg.so.1
|
|
|
|
PORTVERSION?= 1.2.4
|
|
LOCALBASE?= /usr/local
|
|
X11BASE?= /usr/X11R6
|
|
TCL_VER?= 8.4
|
|
|
|
.if exists(${LOCALBASE}/lib/tk${TCL_VER}/tkConfig.sh)
|
|
# If for some reason the file does not exist -- make the best guess. In
|
|
# reality, it will exist by the time we are actually doing the build, so
|
|
# the quality of the guess does not matter. But we still try well. -mi
|
|
TCL_STUB_LIB_SPEC!= . ${LOCALBASE}/lib/tcl${TCL_VER}/tclConfig.sh; \
|
|
echo $$TCL_STUB_LIB_SPEC
|
|
TK_STUB_LIB_SPEC!= . ${LOCALBASE}/lib/tk${TCL_VER}/tkConfig.sh; \
|
|
echo $$TK_STUB_LIB_SPEC
|
|
.else
|
|
TCL_STUB_LIB_SPEC= -L${LOCALBASE}/lib -ltclstub${TCL_VER:S/.//}
|
|
TK_STUB_LIB_SPEC= -L${LOCALBASE}/lib -ltkstub${TCL_VER:S/.//}
|
|
.endif
|
|
|
|
LDADD= -lm -lz -L${LOCALBASE}/lib -lpng -ljpeg -ltiff \
|
|
${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC} \
|
|
-L${X11BASE}/lib -lX11
|
|
|
|
CFLAGS+= -I${LOCALBASE}/include/tcl${TCL_VER}
|
|
CFLAGS+= -I${LOCALBASE}/include/tcl${TCL_VER}/generic
|
|
CFLAGS+= -D__X11__ -I${X11BASE}/include
|
|
CFLAGS+= -I${LOCALBASE}/include/tk${TCL_VER}
|
|
CFLAGS+= -DNDEBUG -Wall -I. -DUSE_TCL_STUBS -DUSE_TK_STUBS
|
|
CFLAGS+= -DVERSION=\"${PORTVERSION}\" -I${LOCALBASE}/include
|
|
CFLAGS+= -DHAVE_JPEGLIB_H -DHAVE_TIFF_H -DHAVE_DLFCN_H -DHAVE_IMG_H
|
|
|
|
# This seems terrible... The package uses libtiff's interfaces, which are
|
|
# clearly marked as internal... It includes the libtiff's header files, which
|
|
# libtiff itself does NOT install. -mi
|
|
CFLAGS+= -I${.CURDIR}/libtiff
|
|
|
|
all: pkgIndex.tcl
|
|
|
|
pkgIndex.tcl: pkgIndex.tcl.in
|
|
sed -e 's,@IMG_PATCH_LEVEL@,${PORTVERSION},g' \
|
|
-e 's,@IMG_SHARED_LIB_FILE@,../${SHLIB_NAME},g' \
|
|
< pkgIndex.tcl.in > pkgIndex.tcl
|
|
|
|
DIR = lib/Img1.2
|
|
INSTDIR = ${LOCALBASE}/${DIR}
|
|
LIBDIR = ${LOCALBASE}/lib
|
|
|
|
${INSTDIR} ${INSTDIR}/msgs:
|
|
${MKDIR} $@
|
|
|
|
beforeinstall: ${INSTDIR} ${INSTDIR}/msgs
|
|
${INSTALL_DATA} pkgIndex.tcl ${.CURDIR}/demo.tcl ${.CURDIR}/tkv.tcl \
|
|
${.CURDIR}/imgmsg.tcl ${INSTDIR}
|
|
${INSTALL_DATA} ${.CURDIR}/msgs/* ${INSTDIR}/msgs/
|
|
|
|
environ:
|
|
@${ECHO} SHLIB_NAME=${SHLIB_NAME} SHLIB_LINK=${SHLIB_LINK} DIR=${DIR}
|
|
|
|
# fundamentals of this library
|
|
SRCS = imgInit.c imgObj.c imgUtil.c imgPmap.c imgUnixPmap.c \
|
|
imgBMP.c imgGIF.c imgJPEG.c imgPNG.c imgPS.c \
|
|
imgTIFF.c imgTIFFjpeg.c imgTIFFpixar.c imgTIFFzip.c \
|
|
imgWindow.c imgXBM.c imgXPM.c
|
|
|
|
test: $(SHLIB_NAME)
|
|
PATH=${TK_BIN_DIR}:${PATH}; export PATH; \
|
|
TCLLIBPATH=`pwd`; export TCLLIBPATH; \
|
|
export SHLIB_PATH; \
|
|
LD_LIBRARY_PATH=`pwd`; \
|
|
export LD_LIBRARY_PATH; \
|
|
wish${TCL_VER} demo.tcl
|
|
|
|
.include <bsd.lib.mk>
|