#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Enable hardening build flags
export DEB_BUILD_MAINT_OPTIONS=hardening=+all

include /usr/share/dpkg/architecture.mk

# LFS support
ifeq ($(shell grep '^[[:space:]]*Linux Large File Support (LFS)' /usr/lib/*/hdf5/*/libhdf5.settings | sed 's/^[[:space:]]*Linux Large File Support (LFS):[[:space:]]*//'),yes)
  CPPFLAGS += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_POSIX_SOURCE -D_BSD_SOURCE
endif

ifneq ($(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial/libhdf5.so),)
  CPPFLAGS += -I/usr/include/hdf5/serial
  LDFLAGS += -Wl,-L/usr/lib/$(DEB_HOST_MULTIARCH)/hdf5/serial
endif

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --with-hdf4
