Makefile revision 5680
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# CDDL HEADER START
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# The contents of this file are subject to the terms of the
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# Common Development and Distribution License (the "License").
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# You may not use this file except in compliance with the License.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
d4ef65050feac78554addf6e16a06c6e2e0bd331Brian Wellington# or http://www.opensolaris.org/os/licensing.
19c7b1a0293498a3e36692c59646ed6e15ffc8d0Tinderbox User# See the License for the specific language governing permissions
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# and limitations under the License.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# When distributing Covered Code, include this CDDL HEADER in each
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# If applicable, add the following below this CDDL HEADER, with the
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# fields enclosed by brackets "[]" replaced with your own identifying
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# information: Portions Copyright [yyyy] [name of copyright owner]
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# CDDL HEADER END
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
c40265eba0c99708887d68e67901924065ba2514Brian Wellington#
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonBUILD_BITS=64
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# While the tree currently builds with Studio, we need to make sure it also
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# builds with gcc when submitting patches upstream, and having both sets of
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# options in the CFLAGS below makes it easy to switch when needed.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# COMPILER=gcc
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeininclude ../../../make-rules/shared-macros.mk
c1a883f2e04d94e99c433b1f6cfd0c0338f4ed85Mark Andrews
fd4dcaddae08b0fb28b0ec4faf26a9d8b1f923caAutomatic UpdaterCOMPONENT_NAME= xscreensaver
a7c412f37cc73d0332887a746e81220cbf09dd00Mark AndrewsCOMPONENT_VERSION= 5.34
6a6ceba6fe09c81558362f238dd727576af7108dTinderbox UserCOMPONENT_PROJECT_URL= https://www.jwz.org/xscreensaver/
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark AndrewsCOMPONENT_ARCHIVE_HASH= \
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein sha256:6fff7ec4be743e5c042647ea9687dd0cdf48d1dd5e8e15098e5018bbd02e5e27
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCOMPONENT_ARCHIVE_URL= https://www.jwz.org/xscreensaver/$(COMPONENT_ARCHIVE)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCOMPONENT_BUGDB= gnome/screensaver
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinTPNO= 26341
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
f5d30e2864e048a42c4dc1134993ae7efdb5d6c3Mark AndrewsTEST_TARGET = $(NO_TESTS)
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austeininclude $(WS_MAKE_RULES)/common.mk
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Enable additional warnings, since we've modified this code a lot
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonCFLAGS.studio += -v
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonCFLAGS.gcc += -Wall
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# Additional optimization flags, to make the hacks show off the hardware
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# better and because for just a screensaver display we can get away with
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# using optimizations that may change strict correctness of floating point ops.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCFLAGS.studio += -fsimple=2 -nofstore -xlibmil -xprefetch
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonCFLAGS.gcc += -funsafe-math-optimizations
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Fix 64-bit linking; compiler is used for the linking.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntLDFLAGS += $(CC_BITS)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# Regenerate configure after patches modify configure.in; the automake -af
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# forces the update of the standard automake files that autoreconf will not
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# update because Makefile.am does not exist. This is needed to ensure we have
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt# a recent version of config.guess, etc. used for configure; the | true is
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# because automake will exit with an error because Makefile.am does not exist,
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# but it will update the required files.
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonCOMPONENT_PREP_ACTION += (cd $(@D); autoreconf -fiv; automake -af | true)
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews# Need to pick up the GNU version of xgettext.
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinPATH=$(GNUBIN):$(USRBINDIR)
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt# Libraries & programs to depend on
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += --with-gl=$(USRDIR)
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += --with-gtk=$(USRDIR)
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += --with-jpeg=$(USRDIR)
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += --without-motif
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += --with-pixbuf=$(USRDIR)
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += --with-xft=$(USRDIR)
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += PTHREAD_CFLAGS="-D_POSIX_PTHREAD_SEMANTICS"
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += PTHREAD_LIBS="-lc"
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += PERL=$(PERL.5.12)
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += INTLTOOL_PERL=$(PERL.5.12)
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt
85c5ed3577655f4f710f0af5ee93edd71c336055Evan Hunt# X extensions to support
85c5ed3577655f4f710f0af5ee93edd71c336055Evan HuntCONFIGURE_OPTIONS += --with-dpms-ext
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonCONFIGURE_OPTIONS += --with-randr-ext
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntCONFIGURE_OPTIONS += --with-xinerama-ext
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonCONFIGURE_OPTIONS += --with-xinput-ext # required for accessibility
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt
30eec077db2bdcb6f2a0dc388a3cdde2ede75ec1Mark Andrews# Support locking the screen by normal users and by root
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonCONFIGURE_OPTIONS += --enable-locking
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonCONFIGURE_OPTIONS += --enable-root-passwd
c40265eba0c99708887d68e67901924065ba2514Brian Wellington# and allow user switching from the lock screen with gdmflexiserver
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark AndrewsCONFIGURE_OPTIONS += --with-login-manager
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews# Use only PAM, not direct /etc/shadow or kerberos access
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark AndrewsCONFIGURE_OPTIONS += --with-pam=$(USRDIR)
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark AndrewsCONFIGURE_OPTIONS += --without-shadow
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark AndrewsCONFIGURE_OPTIONS += --without-kerberos
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark Andrews# Paths to install to
0f8c9b5eed7e8714ceb7d6d3675555df9c5f6350Mark AndrewsAPP_DEFAULTS_DIR = $(CONFIGURE_PREFIX)/share/X11/app-defaults
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonXSS_LIBDIR = $(CONFIGURE_PREFIX)/lib/xscreensaver
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --libexecdir=$(XSS_LIBDIR)/bin
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-hackdir=$(XSS_LIBDIR)/hacks
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark AndrewsCONFIGURE_OPTIONS += --with-configdir=$(XSS_LIBDIR)/config/control-center-2.0
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-x-app-defaults=$(APP_DEFAULTS_DIR)
2637d30fbd235fe98145f4312b10cc41a13bf7dcJeremy C. Reed
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Data sources for images & text in hacks
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCONFIGURE_OPTIONS += --with-image-directory=$(USRSHAREDIR)/pixmaps/backgrounds
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonCONFIGURE_OPTIONS += --with-text-file=/etc/motd
c40265eba0c99708887d68e67901924065ba2514Brian Wellington
a26ad011f382d12058478704cb5e90e6f4366d01Andreas Gustafsson# Do not install setuid hacks
a26ad011f382d12058478704cb5e90e6f4366d01Andreas GustafssonCONFIGURE_OPTIONS += --without-setuid-hacks
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# The potfiles.in updates don't work unless source is cloned to build dir
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinCOMPONENT_PRE_CONFIGURE_ACTION += ($(CLONEY) $(SOURCE_DIR) $(@D));
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# Update potfiles.in to pick up our added sources like lock-Gtk.c
268a4475065fe6a8cd7cc707820982cf5e98f430Rob Austein# The "-o Makefile" & touch stamp-it is needed to avoid infinite looping.
a26ad011f382d12058478704cb5e90e6f4366d01Andreas GustafssonCOMPONENT_POST_CONFIGURE_ACTION += ( \
a26ad011f382d12058478704cb5e90e6f4366d01Andreas Gustafsson cd $(@D)/po ; \
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews $(MAKE) -o Makefile generate_potfiles_in ; \
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews $(MAKE) -o Makefile POTFILES ; \
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews $(MAKE) -o Makefile xscreensaver.pot ; \
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews touch stamp-it )
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews# Recognizing DESTDIR as most autotools packages do would be too easy,
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews# so xscreensaver makes us override install_prefix instead for the same effect.
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark AndrewsCOMPONENT_INSTALL_ARGS += install_prefix=$(PROTO_DIR)
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews
3bc4221346e5045c5679dd0d84f4f7d888a9da79Mark Andrews# Remove hacks we've chosen not to ship at all for various reasons
ff6de396a93b9b73a37173059a595f3d295b57cbMark AndrewsREMOVED_HACKS="extrusion flyingtoasters ljlatest sonar webcollage"
ff6de396a93b9b73a37173059a595f3d295b57cbMark AndrewsCOMPONENT_POST_INSTALL_ACTION += ( \
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrewsfor h in $(REMOVED_HACKS) ; do \
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews rm -f $(PROTO_DIR)$(XSS_LIBDIR)/hacks/$${h} \
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews $(PROTO_DIR)$(CONFIGURE_MANDIR)/man6/$${h}.6 \
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews $(PROTO_DIR)$(XSS_LIBDIR)/config/control-center-2.0/$${h}.xml ;\
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrewsdone ; \
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrewsrm -f $(PROTO_DIR)$(XSS_LIBDIR)/hacks/webcollage-helper );
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews
ff6de396a93b9b73a37173059a595f3d295b57cbMark Andrews
ff6de396a93b9b73a37173059a595f3d295b57cbMark AndrewsREQUIRED_PACKAGES += gnome/accessibility/gnome-a11y-libs
ff6de396a93b9b73a37173059a595f3d295b57cbMark AndrewsREQUIRED_PACKAGES += gnome/config/gconf
ff6de396a93b9b73a37173059a595f3d295b57cbMark AndrewsREQUIRED_PACKAGES += image/library/libjpeg
ff6de396a93b9b73a37173059a595f3d295b57cbMark AndrewsREQUIRED_PACKAGES += library/desktop/atk
ff6de396a93b9b73a37173059a595f3d295b57cbMark AndrewsREQUIRED_PACKAGES += library/desktop/gdk-pixbuf
92551304a9abff9284de5b79a48e83d781989339Mark AndrewsREQUIRED_PACKAGES += library/desktop/gtk2
92551304a9abff9284de5b79a48e83d781989339Mark AndrewsREQUIRED_PACKAGES += library/desktop/libglade
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/desktop/pango
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/glib2
561a29af8c54a216e7d30b5b4f6e0d21661654ecMark AndrewsREQUIRED_PACKAGES += library/gnome/gnome-component
561a29af8c54a216e7d30b5b4f6e0d21661654ecMark AndrewsREQUIRED_PACKAGES += library/libxml2
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += library/perl-5/xml-parser
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += runtime/perl-512
92551304a9abff9284de5b79a48e83d781989339Mark AndrewsREQUIRED_PACKAGES += system/library/math
92551304a9abff9284de5b79a48e83d781989339Mark AndrewsREQUIRED_PACKAGES += x11/library/libx11
7791dd06ea69d0fb2494788ad4c24d568f40bcdfMark AndrewsREQUIRED_PACKAGES += x11/library/libxext
e9359db5e958bf05f9b9c5fe3c27d533f0f05550Mark AndrewsREQUIRED_PACKAGES += x11/library/libxft
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxi
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxinerama
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxmu
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxrandr
268a4475065fe6a8cd7cc707820982cf5e98f430Rob AusteinREQUIRED_PACKAGES += x11/library/libxxf86misc
7791dd06ea69d0fb2494788ad4c24d568f40bcdfMark AndrewsREQUIRED_PACKAGES += x11/library/libxxf86vm
7791dd06ea69d0fb2494788ad4c24d568f40bcdfMark AndrewsREQUIRED_PACKAGES += x11/library/mesa
c40265eba0c99708887d68e67901924065ba2514Brian WellingtonREQUIRED_PACKAGES += x11/library/toolkit/libxt
c40265eba0c99708887d68e67901924065ba2514Brian Wellington