Makefile revision 1265
e20788e1216ed720aefa84f3295f7899d9f28c22Mark Andrews###############################################################################
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Permission is hereby granted, free of charge, to any person obtaining a
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# copy of this software and associated documentation files (the "Software"),
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# to deal in the Software without restriction, including without limitation
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# the rights to use, copy, modify, merge, publish, distribute, sublicense,
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# and/or sell copies of the Software, and to permit persons to whom the
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Software is furnished to do so, subject to the following conditions:
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# The above copyright notice and this permission notice (including the next
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# paragraph) shall be included in all copies or substantial portions of the
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews# Software.
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer#
12178c86525332bb0ab66155feb61fbf32eca6acEvan Hunt# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# DEALINGS IN THE SOFTWARE.
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer#
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews#
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer
dab4aac006fadcaf3c5a9ccd983188b37ead08eeMark Andrews# Package name used in tarballs
dab4aac006fadcaf3c5a9ccd983188b37ead08eeMark AndrewsMODULE_NAME=util-macros
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt# pkg(5) name we deliver the files in (override default)
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael SawyerMODULE_PKGNAME=developer/build/autoconf/xorg-macros
12178c86525332bb0ab66155feb61fbf32eca6acEvan HuntMODULE_PKGNAME_SET=yes
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# Version number (used in path names)
3cac42f8db0eaf7c600424cca919e83740852f7eAndreas GustafssonMODULE_VERSION=1.16.2
0e40083fdd5445703bd30e46e5bfe7d047bced12Brian Wellington
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington# Checksums for upstream tarball
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael SawyerTARBALL_MD5 = b54342201bb8fef7bafaf335ce8c9c52
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉TARBALL_SHA1 = 17340193e7ba5d9fd5a787a9401e84d223fcc918
210258491445269a27fe4eac3d9f3d12ae8733c2Mark AndrewsTARBALL_SHA256= 70986a05efab7557f54d719f55b8d65bc459ed13048f8a59e2d9e5efdb9af9e5
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer
3cac42f8db0eaf7c600424cca919e83740852f7eAndreas Gustafsson# Patches to apply to source after unpacking, in order
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael SawyerSOURCE_PATCHES=
b493dfe8bce94b05efc0f161238d32f1234c5670Brian Wellington
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# Additional rules for generating sources
210258491445269a27fe4eac3d9f3d12ae8733c2Mark AndrewsMODULE_ADD_SOURCE_TARGETS=source_fix_pkgname
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# Need to autoreconf after running source_fix_pkgname
dbb012765c735ee0d82dedb116cdc7cf18957814Evan HuntAUTORECONF=yes
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# Additional install rules beyond what upstream installs
d514c0dc9b7f369a94d79c709b77a8f3a08afd84Evan HuntMODULE_ADD_INSTALL_TARGETS=install_libtool_fix
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer
ba751492fcc4f161a18b983d4f018a1a52938cb9Evan Hunt# xorg-macro pkg-config files are architecture independent, so install in share
2f4d747a267026e6298ba9ece22c9dfa0ac254daFrancis DupontMODTYPE_PKGCONFIG_DIR=$(PKGCONFIG_DIR_SHARE)
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉MODTYPE_PKGCONFIG_DIR_SET=yes
7e2a4f6ad6c18a2a31cdc1daa10700055626cb2eMichael Sawyer
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer### Include common rulesets
f4cbe536b11da614fe05aeaeff41e324854cda7bMark Andrewsinclude ../Makefile.inc
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer
f8fec75ee8f429821137aee090f56ab678404a56Michael Sawyer# Install additional data files under xorg-macros instead of the
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# too-generic "util-macros"
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrencesource_fix_pkgname: $(PATCHED_TARGET)
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer $(PERL) -i.orig -p -e 's{util-macros}{xorg-macros}g' \
f8fec75ee8f429821137aee090f56ab678404a56Michael Sawyer $(SOURCE_DIR)/configure.ac
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews# Libtool versions before 2.2.2 fail to work with LD=cc in 64 bit builds,
01b8865b1462ba219c90cf6c00f1bf0fdf780d9bBrian Wellington# so install fixed libtool m4 macros here as well, so that modules that
819fe493f97078521bb6b9a7b97583bef89f5abcMark Andrews# run autoreconf get the fixed sources
875542855a3462b2da53def764d01e52e05688b7Bob Halley#
875542855a3462b2da53def764d01e52e05688b7Bob Halley# S11U1 now has libtool 2.4.2, but not everyone has updated yet to a build
875542855a3462b2da53def764d01e52e05688b7Bob Halley# with the new version, so for now, we check the version number before trying
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# to apply the patch, to avoid failures on versions with the bug already fixed.
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer# This will be removed in the future, once everyone has had a chance to upgrade.
f4cbe536b11da614fe05aeaeff41e324854cda7bMark Andrewsinstall_libtool_fix: $(TOOLS_ACLOCAL_DIR)/libtool.m4
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt$(TOOLS_ACLOCAL_DIR)/libtool.m4: $(TOOLS_ACLOCAL_DIR) libtool-64.patch
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 -rm -f $(TOOLS_ACLOCAL_DIR)/libtool.m4
ebbfa36a628b935891b2f8a2c5936aef48b87151Michael Sawyer SYSTEM_ACLOCAL_DIR=$$($(ACLOCAL_PATH) --print-ac-dir) ; \
f4cbe536b11da614fe05aeaeff41e324854cda7bMark Andrews cp $${SYSTEM_ACLOCAL_DIR}/libtool.m4 \
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 $(TOOLS_ACLOCAL_DIR)/libtool.m4
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt @libtool_version=$$(libtool --version | \
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 awk '/^libtool / {print $$NF ; exit}') ; \
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer if [[ $${libtool_version%%.[0-9.]*} -lt 2 ]] ; then \
f4cbe536b11da614fe05aeaeff41e324854cda7bMark Andrews $(START_CMD_ECHO) ; \
6330174f805eb5c0f38912bdabe74d8dbdafbf1dEvan Hunt gpatch -d $(TOOLS_ACLOCAL_DIR) < libtool-64.patch ; \
dbb012765c735ee0d82dedb116cdc7cf18957814Evan Hunt else \
a27fe4c990f96bd792f2a07ca4d38c78d5b9df2cTatuya JINMEI 神明達哉 print 'libtool version 2 in use, skipping libtool-64.patch' ; \
cefd68008fbba3488a077052ae62aa12b6de502bMichael Sawyer fi
893612590b1cc64e0c989b8b6e1ff595aea7e48aAndreas Gustafsson
875542855a3462b2da53def764d01e52e05688b7Bob Halley# autoreconf fails if the aclocal include directories don't exist yet
893612590b1cc64e0c989b8b6e1ff595aea7e48aAndreas Gustafsson$(AUTOCONF_TARGET): $(TOOLS_ACLOCAL_DIR) $(PROTODIR)$(X11_ACLOCAL_DIR)
893612590b1cc64e0c989b8b6e1ff595aea7e48aAndreas Gustafsson
875542855a3462b2da53def764d01e52e05688b7Bob Halley$(TOOLS_ACLOCAL_DIR) $(PROTODIR)$(X11_ACLOCAL_DIR):
875542855a3462b2da53def764d01e52e05688b7Bob Halley mkdir -p $@
cc5ea458fe9f12f247e2549b6dc24fe475a824c2Michael Sawyer