1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00

Second part of the stlport-icc fix for 4.x. [1]

This patch modifies some gcc parts too, but basically it makes the port
respect CFLAGS. Because of bugs in combination with gcc 3.x and some
optimization options the CFLAGS are hardcoded (better safe than sorry).

I've tested the gcc part of the fix on 4-stable and two 5.x systems.

Submitted by:	Marius Strobl <marius@alchemy.franken.de> [1]
Approved by:	maintainer timeout (for devel/stlport)
This commit is contained in:
Alexander Leidinger 2003-12-22 15:28:18 +00:00
parent ecaff98d5a
commit 0af58e8725
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=96441
7 changed files with 79 additions and 40 deletions

View File

@ -5,11 +5,12 @@
# $FreeBSD$
PORTNAME= ${MASTERPORTNAME}
PORTREVISION= 2
MAINTAINER= netchild@FreeBSD.org
COMMENT= Adaptation of SGI's Standard Template Library for icc
COMMENT= Adaptation of SGI's Standard Template Library for ICC
BUILD_DEPENDS= icc:${PORTSDIR}/lang/icc
BUILD_DEPENDS= icc:${PORTSDIR}/lang/icc icpc:${PORTSDIR}/lang/icc
ONLY_FOR_ARCHS= i386

View File

@ -8,7 +8,7 @@
PORTNAME= stlport
PORTVERSION= 4.5.3
PORTREVISION= 1
PORTREVISION?= 1
CATEGORIES= devel
MASTER_SITES= http://www.stlport.com/archive/
PKGNAMESUFFIX= -${COMPILER}
@ -28,9 +28,10 @@ PATCH_WRKSRC= ${WRKDIR}/STLport-${PORTVERSION:S/.b/b/}
USE_GMAKE= yes
COMPILER?= gcc
MAKEFILE= ${COMPILER}-freebsd.mak
MAKE_ENV+= CC=${CC} CXX=${CXX}
MAKE_ARGS+= INSTALLDIR=${PREFIX} PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \
PTHREAD_LIBS=${PTHREAD_LIBS}
PLIST_SUB= COMPILER=${COMPILER}
PLIST_SUB+= COMPILER=${COMPILER}
INSTALL_TARGET= install_unix
INSTALLS_SHLIB= yes
@ -40,8 +41,13 @@ BROKEN= "Not supported on systems prior to FreeBSD 4.4"
.endif
.if ${COMPILER} == icc
CC= icc
CXX= icpc
CC= icc
CXX= icpc
CFLAGS= -O -ip -axiMKW
CXXFLAGS= ${CFLAGS}
.else
CFLAGS=
CXXFLAGS=
.endif
.if ${COMPILER} == gcc && ${OSVERSION} < 460000
@ -73,9 +79,7 @@ post-build: test
.endif
test: do-build
cd ${WRKSRC}/../test/eh && ${SETENV} CC=${CC} CXX=${CXX} \
${GMAKE} -f ${MAKEFILE} PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \
PTHREAD_LIBS=${PTHREAD_LIBS} PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \
PTHREAD_LIBS=${PTHREAD_LIBS} CC=${CC} CXX=${CXX}
@cd ${WRKSRC}/../test/eh && ${SETENV} ${MAKE_ENV} \
${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} check_d
.include <bsd.port.post.mk>

View File

@ -6,8 +6,8 @@
#
-CC = gcc -pthread
-CXX = c++ -pthread -fexceptions
+CC+= ${PTHREAD_CFLAGS} -D_REENTRANT
+CXX+= ${PTHREAD_CFLAGS} -D_REENTRANT -fexceptions
+CC+= $(PTHREAD_CFLAGS) -D_REENTRANT
+CXX+= $(PTHREAD_CFLAGS) -D_REENTRANT -fexceptions
#
# Basename for libraries
@ -16,18 +16,18 @@
LINK=ar cr
# 2.95 flag
-DYN_LINK=c++ -pthread -fexceptions -shared -o
+DYN_LINK=$(CXX) ${PTHREAD_LIBS} -shared -o
+DYN_LINK=$(CXX) $(PTHREAD_LIBS) -shared -o
OBJEXT=o
DYNEXT=so
@@ -41,8 +41,8 @@
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS}
CXXFLAGS_COMMON = -I$(STLPORT_DIR) $(WARNING_FLAGS)
-CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O2
-CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O2 -fPIC
+CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) ${CXXFLAGS}
+CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) ${CXXFLAGS} -fPIC
+CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) $(CXXFLAGS)
+CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) $(CXXFLAGS) -fPIC
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -fPIC

View File

@ -11,12 +11,12 @@
# also, test_slist won't compile with -O3/-O2 when targeting PPC. It fails
# in the assembler with 'invalid relocation type'
-CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW
+CXXFLAGS= $(PTHREAD_CFLAGS) -D_REENTRANT -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
+CXXFLAGS += $(PTHREAD_CFLAGS) -D_REENTRANT -fexceptions -Wall $(STL_INCL) -I. $(CXX_EXTRA_FLAGS) -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
-D_CXXFLAGS = -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
-NOSGI_CXXFLAGS = -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW
+D_CXXFLAGS = $(PTHREAD_CFLAGS) -D_REENTRANT -Wall -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
+NOSGI_CXXFLAGS = $(PTHREAD_CFLAGS) -D_REENTRANT -Wall -g -O2 ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
+D_CXXFLAGS = $(CXXFLAGS) -g -D_STLP_DEBUG
+NOSGI_CXXFLAGS = $(CXXFLAGS) -D_STLP_NO_OWN_IOSTREAMS -D_STLP_DEBUG_UNINITIALIZED
check: $(TEST)

View File

@ -1,12 +1,14 @@
#
# Note : this makefile is for Intel(R) C++ Compiler Version 6.0 !
# Note : This makefile is for Intel(R) C++ Compiler
#
#
# compiler
#
CC= icc
CXX= icpc
#CC= icc
#CXX= icpc
#CFLAGS= -O -ip -axiMKW
#CXXFLAGS= -O -ip -axiMKW
#
# Basename for libraries
@ -18,7 +20,9 @@ LIB_BASENAME = libstlport_icc
#
#
LINK=ar cr
DYN_LINK=$(CXX) -Qoption,ld,-BOOTSTRAPSTLPORT -mt -shared -o
# Using icc here is a hack while icpc on FreeBSD is set up to automatically
# link against libstlport_icc.
DYN_LINK=$(CC) -mt -shared -o
OBJEXT=o
DYNEXT=so
@ -38,13 +42,13 @@ include common_macros.mak
WARNING_FLAGS= -w1
CXXFLAGS_COMMON = -I${STLPORT_DIR} ${WARNING_FLAGS} ${PTHREAD_CFLAGS} -D_REENTRANT -mt
CXXFLAGS_COMMON = -I$(STLPORT_DIR) $(WARNING_FLAGS) $(PTHREAD_CFLAGS) -D_REENTRANT
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) -O -ip -axiMKW
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) -O -ip -axiMKW -KPIC
CXXFLAGS_RELEASE_static = $(CXXFLAGS_COMMON) $(CXXFLAGS)
CXXFLAGS_RELEASE_dynamic = $(CXXFLAGS_COMMON) $(CXXFLAGS) -KPIC
CXXFLAGS_DEBUG_static = $(CXXFLAGS_COMMON) -O -g
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -g -KPIC
CXXFLAGS_DEBUG_dynamic = $(CXXFLAGS_COMMON) -O -KPIC
CXXFLAGS_STLDEBUG_static = $(CXXFLAGS_DEBUG_static) -D_STLP_DEBUG
CXXFLAGS_STLDEBUG_dynamic = $(CXXFLAGS_DEBUG_dynamic) -D_STLP_DEBUG

View File

@ -1,8 +1,38 @@
/*
* STLport configuration file
* It is internal STLport header - DO NOT include it directly
*/
// STLport configuration file
// It is internal STLport header - DO NOT include it directly
// A list of Intel compiler for Linux portion of STLport settings.
#define _STLP_NO_CSTD_FUNCTION_IMPORTS
# define _STLP_LONG_LONG long long
#define _STLP_LONG_LONG long long
// Edit relative path below (or put full path) to get native
// compiler headers included. Default is "../include".
// C headers may reside in different directory, so separate macro is provided.
# if (__INTEL_COMPILER >= 800)
# define _STLP_NATIVE_INCLUDE_PATH ../include/c++
# define _STLP_NATIVE_C_INCLUDE_PATH ../include
//# define _STLP_NATIVE_CPP_C_INCLUDE_PATH ../include
# ifndef __GNUC__
// If GCC compatability is disabled (-no-gcc is specified) STD needs to be redefined.
# define _STLP_REDEFINE_STD 1
# endif /* __GNUC__ */
//#define _STLP_HAS_NO_NEW_C_HEADERS 1
# endif /* __INTEL_COMPILER >= 800 */
#ifndef __FreeBSD__ // FreeBSD system headers use unsupported GCC extensions.
# ifndef __GNUC__
# define __GNUC__ 3
# endif
#endif
# define _STLP_NO_NATIVE_WIDE_FUNCTIONS 1
#ifdef __FreeBSD__
# include <osreldate.h>
# define _STLP_HAS_NATIVE_FLOAT_ABS
# define _STLP_NO_CSTD_FUNCTION_IMPORTS
# define _STLP_NO_LONG_DOUBLE
#endif

View File

@ -16,7 +16,7 @@ test_deque.cpp test_set.cpp test_map.cpp \
test_hash_map.cpp test_hash_set.cpp test_rope.cpp \
test_string.cpp test_bitset.cpp test_valarray.cpp
LIST=${AUX_LIST} ${TEST_LIST}
LIST=$(AUX_LIST) $(TEST_LIST)
OBJECTS = $(LIST:%.cpp=obj/%.o) $(STAT_MODULE)
D_OBJECTS = $(LIST:%.cpp=d_obj/%.o) $(STAT_MODULE)
@ -29,12 +29,12 @@ D_TEST_EXE = ./eh_test_d
TEST = ./eh_test.out
D_TEST = ./eh_test_d.out
CXXFLAGS= $(PTHREAD_CFLAGS) -D_REENTRANT -mt -w1 -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
D_CXXFLAGS = $(PTHREAD_CFLAGS) -D_REENTRANT -mt -w1 -g -O ${STL_INCL} -I. ${CXX_EXTRA_FLAGS} -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC -D_STLP_DEBUG -D_STLP_USE_STATIC_LIB
CXXFLAGS += $(PTHREAD_CFLAGS) -D_REENTRANT -w1 $(STL_INCL) -I. $(CXX_EXTRA_FLAGS) -DEH_VECTOR_OPERATOR_NEW -DEH_DELETE_HAS_THROW_SPEC
D_CXXFLAGS = $(CXXFLAGS) -g -D_STLP_DEBUG
check: $(TEST)
LIBS = -lm
LIBS = -lm -mt
D_LIBSTLPORT = -L../../lib -lstlport_icc_stldebug
LIBSTLPORT = -L../../lib -lstlport_icc
@ -52,10 +52,10 @@ $(D_OBJDIR):
$(TEST_EXE) : $(OBJDIR) $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(CC) $(CXXFLAGS) $(OBJECTS) $(LIBSTLPORT) $(LIBS) -o $(TEST_EXE)
$(D_TEST_EXE) : $(D_OBJDIR) $(D_OBJECTS)
$(CXX) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(CC) $(D_CXXFLAGS) $(D_OBJECTS) $(D_LIBSTLPORT) $(LIBS) -o $(D_TEST_EXE)
$(TEST) : $(TEST_EXE)
@ -73,4 +73,4 @@ obj/%.o : %.cpp
$(CXX) $(CXXFLAGS) $< -c -o $@
clean:
rm -rf ${TEST_EXE} *.o */*.o *.core
-rm -rf $(TEST_EXE) *.o */*.o *.core