components/cloog/Makefile
author Stefan Teleman <stefan.teleman@oracle.com>
Thu, 28 Jan 2016 10:36:09 -0800
changeset 5359 57359db17e2a
child 5682 94c0ca64c022
permissions -rw-r--r--
21459215 introduce ClooG in Solaris

#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
#

COMPILER=gcc

include ../../make-rules/shared-macros.mk

COMPONENT_NAME=		cloog
COMPONENT_VERSION=	0.18.3
COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
COMPONENT_PROJECT_URL=	http://www.cloog.org/
COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
COMPONENT_ARCHIVE_HASH=	\
    sha256:460c6c740acb8cdfbfbb387156b627cf731b3837605f2ec0001d079d89c69734
COMPONENT_ARCHIVE_URL=	http://www.bastoul.net/cloog/pages/download/$(COMPONENT_ARCHIVE)
COMPONENT_BUGDB=	library/cloog

TPNO=			23800

include ../../make-rules/prep.mk
include ../../make-rules/configure.mk
include ../../make-rules/ips.mk

PATCH_LEVEL := 0
PKG_PROTO_DIRS += $(COMPONENT_DIR)/Solaris
PATH="/usr/gnu/bin:/usr/perl5/bin:/usr/bin:/usr/sbin"

# Don't use SSE3 or SSSE3 on Intel, because it's not completely portable.
# Do not tell GCC to assume strictly correct pointer aliasing. CLooG
# employs casts from incompatible pointer types.
# General-purpose SPARC incantations:
# - build for UltraSPARC-III (use fp registers for int whenever possible)
# - use VIS-2 Instructions whenever possible
# - there are no misaligned doubles in this code
# - don't do software float (we're not using quat-precision).
CLOOG_GCC_ARCH_i386 = -mtune=opteron -march=opteron -mno-sse3 -mno-ssse3
CLOOG_GCC_ARCH_i386 += -fno-omit-frame-pointer -fno-strict-aliasing
CLOOG_GCC_ARCH_sparc = -mtune=ultrasparc3 -mcpu=ultrasparc3 -mvis2 -mhard-float
CLOOG_GCC_ARCH_sparc += -fno-strict-aliasing -mno-unaligned-doubles
CLOOG_GCC_ARCH = $(CLOOG_GCC_ARCH_$(MACH))
CLOOG_GCC_ARCH += -Wall -Wextra -Wcast-qual -Wcast-align

CFLAGS = $(CC_BITS)
CFLAGS += -O2 -std=c99
CFLAGS += -D__C99FEATURES__
CFLAGS += -D_STDC_C99
CFLAGS += $(CPP_XPG6MODE)
CFLAGS += $(CLOOG_GCC_ARCH)
CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align

CXXFLAGS = $(CC_BITS)
CXXFLAGS += -O2 -std=c++03
CXXFLAGS += $(CPP_XPG5MODE)
CXXFLAGS += $(CLOOG_GCC_ARCH)
CXXFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align

CPPFLAGS += $(CPP_LARGEFILES)
CPPFLAGS += `pkg-config --cflags libgmp`
CPPFLAGS += `pkg-config --cflags libmpfr`
CPPFLAGS += `pkg-config --cflags isl`

CONFIGURE_ENV +=	CFLAGS="$(CFLAGS)"
CONFIGURE_ENV +=	CXXFLAGS="$(CXXFLAGS)"
CONFIGURE_ENV +=	CPPFLAGS="$(CPPFLAGS)"
CONFIGURE_ENV +=	LDFLAGS="$(LDFLAGS)"
CONFIGURE_ENV +=	LD_OPTIONS="$(LD_OPTIONS)"
CONFIGURE_ENV +=	CCLD="$(CC) $(CFLAGS) $(LDFLAGS)"
CONFIGURE_ENV +=	LIBS="$(LIBS)"
CONFIGURE_ENV +=	PATH="$(PATH)"

COMPONENT_BUILD_ENV += LD_OPTIONS="$(LD_OPTIONS)"

CONFIGURE_OPTIONS  +=		--localstatedir=/var
CONFIGURE_OPTIONS  +=		--infodir=$(CONFIGURE_INFODIR)
CONFIGURE_OPTIONS  +=		--enable-shared
CONFIGURE_OPTIONS  +=		--disable-silent-rules
CONFIGURE_OPTIONS  +=		--disable-libtool-lock
CONFIGURE_OPTIONS  +=		--with-gcc-arch="$(CLOOG_GCC_ARCH)"
CONFIGURE_OPTIONS  +=		--with-isl=system
CONFIGURE_OPTIONS  +=		--with-isl-prefix=$(CONFIGURE_PREFIX)
CONFIGURE_OPTIONS  +=		--with-gmp=system
CONFIGURE_OPTIONS  +=		--with-gmp-prefix=$(CONFIGURE_PREFIX)

COMPONENT_POST_INSTALL_ACTION = \
  ( cd $(PROTOUSRDIR) ; \
    $(MKDIR) $(PROTOUSRLIBDIR)/pkgconfig ; \
    $(CP) $(COMPONENT_DIR)/Solaris/cloog-isl.pc \
      $(PROTOUSRLIBDIR)/pkgconfig/ ; \
    $(GSED) -i 's^LIBDIR^$(USRLIBDIR)^g' \
      $(PROTOUSRLIBDIR)/pkgconfig/cloog-isl.pc ; \
    $(MKDIR) $(PROTOUSRLIBDIR64)/pkgconfig ; \
    $(CP) $(COMPONENT_DIR)/Solaris/cloog-isl.pc \
      $(PROTOUSRLIBDIR64)/pkgconfig/ ; \
    $(GSED) -i 's^LIBDIR^$(USRLIBDIR64)^g' \
      $(PROTOUSRLIBDIR64)/pkgconfig/cloog-isl.pc )

COMPONENT_TEST_ENV +=   libtool_install_magic='%%%MAGIC variable%%%'
COMPONENT_TEST_ENV +=   libtool_execute_magic='%%%MAGIC variable%%%'
COMPONENT_TEST_ENV +=	$(TEST_PATH)
COMPONENT_TEST_ENV +=	$(TARGET_ENV)

ASLR_MDOE=$(ASLR_NOT_APPLICABLE)

COMPONENT_TEST_MASTER = \
        $(COMPONENT_TEST_RESULTS_DIR)/results-cloog.master

COMPONENT_TEST_TRANSFORMS += \
     '-e "/libtool/d"' \
     '-e "/-m32/d"' \
     '-e "/-m64/d"' \
     '-e "/ld: warning/d"' \
     '-e "/warning/d"' \
     '-e "/prototype:/d"' \
     '-e "/argument/d"' \
     '-e "/Entering/d"' \
     '-e "/Leaving/d"' \
     '-e "/check-TESTS/d"' \
     '-e "/all-recursive/d"' \
     '-e "/Making all/d"' \
     '-e "/Making check/d"' \
     '-e "/gnu/d"' \
     '-e "/Nothing to be done/d"' \
     '-e "/is up to date/d"' \
     '-e "s/[0-9]\{1,\}\.[0-9]\{1,\} s, //g"' \
     '-e "s^[0-9]\{1,\} kB/s^^g"'  \
     '-e "s^[0-9]\{1,\}  kB/s^^g"'  \
     '-e "s^[0-9]\{1,\}\.[0-9]\{1,\}  MB/s^^g"' \
     '-e "s^[0-9]\{1,\}\.[0-9]\{1,\} MB/s^^g"' \
     '-e "s/([0-9]\{1,\} B)//g"' \
     '-e "s/([0-9]\{1,\}  B)//g"' \
     '-e "s/copied,/copied/g"'  \
     '-e "s/ \{1,\}copied/ copied/g"'  \
     '-e "s/copied $$/copied/g"'  \
     '-e "s/copied [0-9]\{1,\}\./copied/g"'

build: $(BUILD_32_and_64)

install: $(INSTALL_32_and_64)

test: $(TEST_32_and_64)

system-test:	$(SYSTEM_TESTS_NOT_IMPLEMENTED)

REQUIRED_PACKAGES += library/gmp
REQUIRED_PACKAGES += library/mpfr
REQUIRED_PACKAGES += library/isl
REQUIRED_PACKAGES += system/library