2001-08-25 07:23:46 -04:00
|
|
|
#-*- mode: Fundamental; tab-width: 4; -*-
|
|
|
|
# ex:ts=4 sw=4 filetype=make:
|
2009-03-14 06:46:56 -04:00
|
|
|
# $OpenBSD: gnu.port.mk,v 1.36 2009/03/14 10:46:56 ajacoutot Exp $
|
2001-08-25 07:23:46 -04:00
|
|
|
# Based on bsd.port.mk, originally by Jordan K. Hubbard.
|
|
|
|
# This file is in the public domain.
|
|
|
|
|
2006-12-01 19:10:24 -05:00
|
|
|
MODGNU_AUTOCONF_DEPENDS = ::devel/metaauto \
|
|
|
|
:autoconf-${AUTOCONF_VERSION}:devel/autoconf/${AUTOCONF_VERSION}
|
|
|
|
MODGNU_AUTOMAKE_DEPENDS = ::devel/metaauto \
|
2009-03-09 19:07:33 -04:00
|
|
|
:${_AUTOMAKE_SPEC}:devel/automake/${AUTOMAKE_VERSION}
|
2003-02-15 11:38:48 -05:00
|
|
|
|
2006-12-01 19:10:24 -05:00
|
|
|
AUTOMAKE_VERSION ?= 1.4
|
2009-03-14 06:46:56 -04:00
|
|
|
.if ${AUTOMAKE_VERSION} == 1.4
|
2009-03-09 19:07:33 -04:00
|
|
|
_AUTOMAKE_SPEC = automake->=${AUTOMAKE_VERSION},<1.5
|
2009-03-14 06:46:56 -04:00
|
|
|
.elif ${AUTOMAKE_VERSION} == 1.8
|
2009-03-09 19:07:33 -04:00
|
|
|
_AUTOMAKE_SPEC = automake->=${AUTOMAKE_VERSION},<1.9
|
2009-03-14 06:46:56 -04:00
|
|
|
.elif ${AUTOMAKE_VERSION} == 1.9
|
2009-03-09 19:07:33 -04:00
|
|
|
_AUTOMAKE_SPEC = automake->=${AUTOMAKE_VERSION},<1.10
|
2009-03-14 06:46:56 -04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${CONFIGURE_STYLE:L:Mautomake}
|
2006-12-01 19:10:24 -05:00
|
|
|
BUILD_DEPENDS += ${MODGNU_AUTOMAKE_DEPENDS}
|
|
|
|
MAKE_ENV += AUTOMAKE_VERSION=${AUTOMAKE_VERSION}
|
2009-03-14 06:46:56 -04:00
|
|
|
. if ${CONFIGURE_STYLE:L:Mautoupdate}
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIGURE_STYLE += autoconf
|
2009-03-14 06:46:56 -04:00
|
|
|
. endif
|
2002-03-15 20:09:23 -05:00
|
|
|
.endif
|
2003-02-15 11:38:48 -05:00
|
|
|
|
2002-03-15 20:09:23 -05:00
|
|
|
.if ${CONFIGURE_STYLE:L:Mautoconf}
|
2006-12-01 19:10:24 -05:00
|
|
|
AUTOCONF_VERSION ?= 2.13
|
|
|
|
BUILD_DEPENDS += ${MODGNU_AUTOCONF_DEPENDS}
|
|
|
|
AUTOCONF ?= autoconf
|
|
|
|
AUTOUPDATE ?= autoupdate
|
|
|
|
AUTOHEADER ?= autoheader
|
|
|
|
AUTOCONF_DIR ?= ${WRKSRC}
|
2002-03-15 20:09:23 -05:00
|
|
|
# missing ?= not an oversight
|
2006-12-01 19:10:24 -05:00
|
|
|
AUTOCONF_ENV = PATH=${PORTPATH} AUTOCONF_VERSION=${AUTOCONF_VERSION}
|
|
|
|
MAKE_ENV += AUTOCONF_VERSION=${AUTOCONF_VERSION}
|
2004-05-05 07:17:22 -04:00
|
|
|
. if !${CONFIGURE_STYLE:L:Mno-autoheader}
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIGURE_STYLE += autoheader
|
2004-05-05 07:17:22 -04:00
|
|
|
. endif
|
2002-03-15 20:09:23 -05:00
|
|
|
.endif
|
2006-11-20 18:18:25 -05:00
|
|
|
.if !defined(CONFIG_SITE)
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIG_SITE = ${PORTSDIR}/infrastructure/db/config.site
|
2006-11-20 18:18:25 -05:00
|
|
|
. if ${USE_X11:L} == "yes"
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIG_SITE += ${PORTSDIR}/infrastructure/db/config.x11.site
|
2006-11-20 18:18:25 -05:00
|
|
|
. endif
|
|
|
|
.endif
|
2004-10-03 05:51:21 -04:00
|
|
|
.if !empty(CONFIG_SITE)
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIGURE_ENV += CONFIG_SITE='${CONFIG_SITE}'
|
2004-10-03 05:51:21 -04:00
|
|
|
.endif
|
2002-03-15 20:09:23 -05:00
|
|
|
|
2006-12-01 19:10:24 -05:00
|
|
|
MODGNU_CONFIG_GUESS_DIRS ?=${WRKSRC}
|
|
|
|
MODGNU_SAVE_CACHE ?= No
|
|
|
|
MODGNU_SAVE_CACHE_LOCATION =${PORTSDIR}/config
|
2001-09-16 10:56:42 -04:00
|
|
|
|
2006-12-01 19:10:24 -05:00
|
|
|
MODGNU_configure = for d in ${MODGNU_CONFIG_GUESS_DIRS}; \
|
|
|
|
do \
|
2006-07-10 06:12:05 -04:00
|
|
|
cp -f ${PORTSDIR}/infrastructure/db/config.guess $$d; \
|
|
|
|
chmod a+rx $$d/config.guess; \
|
|
|
|
cp -f ${PORTSDIR}/infrastructure/db/config.sub $$d; \
|
|
|
|
chmod a+rx $$d/config.sub; \
|
|
|
|
done; ${MODSIMPLE_configure}
|
|
|
|
|
2005-02-07 07:22:28 -05:00
|
|
|
.if ${MODGNU_SAVE_CACHE:L} == "yes"
|
|
|
|
MODGNU_configure += ; mkdir -p ${MODGNU_SAVE_CACHE_LOCATION}; \
|
|
|
|
cp ${WRKBUILD}/config.cache ${MODGNU_SAVE_CACHE_LOCATION}/${FULLPKGNAME} \
|
|
|
|
|| true
|
|
|
|
.endif
|
2001-09-02 22:00:48 -04:00
|
|
|
|
2003-02-27 14:27:00 -05:00
|
|
|
.if ${CONFIGURE_STYLE:L:Mgnu}
|
2005-02-07 07:22:28 -05:00
|
|
|
. if ${MODGNU_SAVE_CACHE:L} == "yes"
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIGURE_ARGS += --cache-file=${WRKBUILD}/config.cache
|
2005-02-07 07:22:28 -05:00
|
|
|
. endif
|
2003-02-27 14:27:00 -05:00
|
|
|
. if ${CONFIGURE_STYLE:L:Mdest}
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIGURE_ARGS += --prefix='$${${DESTDIRNAME}}${PREFIX}'
|
2003-02-27 14:27:00 -05:00
|
|
|
. else
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIGURE_ARGS += --prefix='${PREFIX}'
|
2003-02-27 14:27:00 -05:00
|
|
|
. endif
|
2001-08-25 07:23:46 -04:00
|
|
|
|
2003-02-27 14:27:00 -05:00
|
|
|
. if empty(CONFIGURE_STYLE:L:Mold)
|
|
|
|
. if ${CONFIGURE_STYLE:L:Mdest}
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIGURE_ARGS += --sysconfdir='$${${DESTDIRNAME}}${SYSCONFDIR}'
|
|
|
|
CONFIGURE_ARGS += --mandir='$${${DESTDIRNAME}}${PREFIX}/man'
|
|
|
|
CONFIGURE_ARGS += --infodir='$${${DESTDIRNAME}}${PREFIX}/info'
|
2003-02-27 14:27:00 -05:00
|
|
|
. else
|
2006-12-01 19:10:24 -05:00
|
|
|
CONFIGURE_ARGS += --sysconfdir='${SYSCONFDIR}'
|
|
|
|
CONFIGURE_ARGS += --mandir='${PREFIX}/man'
|
|
|
|
CONFIGURE_ARGS += --infodir='${PREFIX}/info'
|
2003-02-27 14:27:00 -05:00
|
|
|
. endif
|
2001-08-25 07:23:46 -04:00
|
|
|
. endif
|
|
|
|
.endif
|
2001-09-30 13:14:33 -04:00
|
|
|
|
2006-12-01 19:10:24 -05:00
|
|
|
REGRESS_TARGET ?= check
|
2002-03-15 20:09:23 -05:00
|
|
|
|
2004-02-25 16:50:26 -05:00
|
|
|
# internal stuff to run on each directory.
|
2006-12-01 19:10:24 -05:00
|
|
|
MODGNU_post-patch = for d in ${AUTOCONF_DIR}; do cd $$d; ${_MODGNU_loop} done;
|
|
|
|
_MODGNU_loop =
|
2004-02-25 16:50:26 -05:00
|
|
|
|
2006-12-01 19:10:24 -05:00
|
|
|
PATCH_CHECK_ONLY ?= No
|
2002-03-15 20:09:23 -05:00
|
|
|
.if ${PATCH_CHECK_ONLY:L} != "yes"
|
|
|
|
. if ${CONFIGURE_STYLE:L:Mautoupdate}
|
2006-12-01 19:10:24 -05:00
|
|
|
_MODGNU_loop += echo "Running autoupdate-${AUTOCONF_VERSION} in $$d";
|
|
|
|
_MODGNU_loop += ${_SYSTRACE_CMD} ${SETENV} ${AUTOCONF_ENV} ${AUTOUPDATE};
|
2002-03-15 20:09:23 -05:00
|
|
|
. endif
|
|
|
|
. if ${CONFIGURE_STYLE:L:Mautoconf}
|
2007-04-02 06:43:39 -04:00
|
|
|
_MODGNU_loop += if test -f $$d/configure; then \
|
|
|
|
grep -iq 'Generated by.*autoconf.*${AUTOCONF_VERSION}' $$d/configure || { \
|
2007-03-30 09:55:07 -04:00
|
|
|
echo ">>> Can't find autoconf ${AUTOCONF_VERSION} signature in $$d/configure:"; \
|
2007-04-02 06:43:39 -04:00
|
|
|
grep -i 'Generated by.*autoconf' $$d/configure; }; \
|
|
|
|
fi;
|
2006-12-01 19:10:24 -05:00
|
|
|
_MODGNU_loop += echo "Running autoconf-${AUTOCONF_VERSION} in $$d";
|
|
|
|
_MODGNU_loop += ${_SYSTRACE_CMD} ${SETENV} ${AUTOCONF_ENV} ${AUTOCONF};
|
2004-02-25 17:23:20 -05:00
|
|
|
. if ${CONFIGURE_STYLE:L:Mautoheader}
|
2006-12-01 19:10:24 -05:00
|
|
|
_MODGNU_loop += echo "Running autoheader-${AUTOCONF_VERSION} in $$d";
|
|
|
|
_MODGNU_loop += ${_SYSTRACE_CMD} ${SETENV} ${AUTOCONF_ENV} ${AUTOHEADER};
|
2004-02-25 17:23:20 -05:00
|
|
|
. endif
|
2004-02-25 16:50:26 -05:00
|
|
|
. if !${CONFIGURE_STYLE:L:Mautomake}
|
2006-12-01 19:10:24 -05:00
|
|
|
REORDER_DEPENDENCIES += ${PORTSDIR}/infrastructure/mk/automake.dep
|
2004-02-25 16:50:26 -05:00
|
|
|
. endif
|
2002-03-15 20:09:23 -05:00
|
|
|
. endif
|
2005-12-24 15:11:03 -05:00
|
|
|
.endif
|
2005-12-23 07:41:37 -05:00
|
|
|
|
2008-01-18 15:58:15 -05:00
|
|
|
MAKE_FLAGS += mkdir_p='mkdir -p --'
|
2006-12-01 19:10:24 -05:00
|
|
|
# XXX to be killed
|
|
|
|
MODGNU_SHARED_LIBS ?=
|
2005-12-23 07:41:37 -05:00
|
|
|
.for _n _e in ${MODGNU_SHARED_LIBS}
|
|
|
|
. if defined(LIB${_n}_ALIAS)
|
2006-12-01 19:10:24 -05:00
|
|
|
MAKE_FLAGS += lib${LIB${_n}_ALIAS}_la_LDFLAGS='-version-info ${LIB${_n}_VERSION:S/./:/}:0 '${_e}
|
2005-12-23 07:41:37 -05:00
|
|
|
. else
|
2006-12-01 19:10:24 -05:00
|
|
|
MAKE_FLAGS += lib${_n}_la_LDFLAGS='-version-info ${LIB${_n}_VERSION:S/./:/}:0 '${_e}
|
2005-12-23 07:41:37 -05:00
|
|
|
. endif
|
|
|
|
.endfor
|