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

Port does not compile on systems older than 5.1-RELEASE

(needs _SC_NPROCESSORS_ONLN).
Respect CC, CXX, CFLAGS and CXXFLAGS.

Pointed out by:	kris
Approved by:	fjoe (mentor)
This commit is contained in:
Sergey A. Osokin 2003-06-25 14:37:49 +00:00
parent be48a67e7f
commit 48c379e356
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=83589
4 changed files with 75 additions and 38 deletions

View File

@ -7,6 +7,7 @@
PORTNAME= libhoard
PORTVERSION= 2.1.2d
PORTREVISION?= 1
CATEGORIES= devel
MASTER_SITES= http://www.cs.umass.edu/~emery/software/
@ -21,25 +22,10 @@ INSTALLS_SHLIB= YES
.include <bsd.port.pre.mk>
TESTPROG= testos
check-os:
.if !defined(SKIP_OS_TEST)
-@${MKDIR} ${WRKSRC} ; \
${RM} -f ${WRKSRC}/${TESTPROG} ; \
${CC} ${PTHREAD_CFLAGS} ${PTHREAD_LIBS} -o ${WRKSRC}/${TESTPROG} \
${PATCHDIR}/${TESTPROG}.c > /dev/null 2>&1 ;
@if [ ! -f ${WRKSRC}/${TESTPROG} ] ; \
then \
${ECHO_MSG} "You must have a version of FreeBSD later than 4.8-STABLE" ; \
${ECHO_MSG} "27 May 2003 or 5.1-RELEASE to compile and use libhoard" ; \
exit 1 ; \
fi
@${WRKSRC}/${TESTPROG} 2>/dev/null
.if ${OSVERSION} < 501100
IGNORE= "You must have a FreeBSD 5.1-RELEASE or better"
.endif
pre-fetch: check-os
do-install:
${INSTALL_DATA} ${WRKSRC}/libhoard.so ${PREFIX}/lib/libhoard.so.1
${LN} -sf ${PREFIX}/lib/libhoard.so.1 ${PREFIX}/lib/libhoard.so

View File

@ -0,0 +1,11 @@
--- Makefile.orig Wed Jun 25 17:44:34 2003
+++ Makefile Wed Jun 25 17:45:03 2003
@@ -37,7 +37,7 @@
$(LIBSO) libhoard.o $(OBJS) -o $@ $(LIBS)
libhoard.o: libhoard.cpp $(SRCS)
- $(CXX) $(CXXFLAGS) -c $< -o $@
+ $(CXX) $(CXXFLAGS) $(FEATURESXX) -c $< -o $@
endif
ifeq ($(WINDOWS),1)

View File

@ -1,5 +1,5 @@
--- Makefile.common.orig Mon Apr 7 19:57:11 2003
+++ Makefile.common Sun May 25 12:53:38 2003
+++ Makefile.common Wed Jun 25 17:41:29 2003
@@ -21,8 +21,17 @@
# or supply new values as parameters to make, e.g.:
# make USE_WINDOWS=1 DEBUG=1
@ -66,12 +66,68 @@
ifdef BROKEN
CPATH = /usr/bin/
endif
@@ -127,7 +149,7 @@
@@ -125,10 +147,8 @@
endif
ifdef GNUC
CC = $(CPATH)gcc
CXX = $(CPATH)g++
- CC = $(CPATH)gcc
- CXX = $(CPATH)g++
- FEATURES = -fPIC -D__STRICT_ANSI__ -D_GNU_SOURCE -D_REENTRANT -Wall -fno-exceptions #-fPIC
- OPTIMIZE = -O6 -fexpensive-optimizations -finline-functions -fomit-frame-pointer -ffast-math
+ FEATURES = -fPIC -D__STRICT_ANSI__ -D_GNU_SOURCE -D_REENTRANT -Wall -fno-exceptions -Wno-deprecated
OPTIMIZE = -O6 -fexpensive-optimizations -finline-functions -fomit-frame-pointer -ffast-math
+ OPTIMIZE =
FEATURESXX = $(FEATURES)
OPTIMIZEXX = $(OPTIMIZE)
LIBSO = $(CC) -shared #-nostartfiles
@@ -144,40 +164,40 @@
endif
else
- CFLAGS = $(FEATURES) -DNDEBUG $(OPTIMIZE)
- CXXFLAGS = $(FEATURESXX) -DNDEBUG $(OPTIMIZEXX)
+# CFLAGS = $(FEATURES) -DNDEBUG $(OPTIMIZE)
+# CXXFLAGS = $(FEATURESXX) -DNDEBUG $(OPTIMIZEXX)
# CFLAGS = $(FEATURES) /Zi /DEBUG $(OPTIMIZE)
# CXXFLAGS = $(FEATURESXX) /Zi /DEBUG $(OPTIMIZEXX)
endif
-LIBS = $(LIBTHREAD)
+LIBS = ${PTHREAD_LIBS}
.SUFFIXES: .c .cpp .o .a .so .tex .dvi .ps .png .bmp .ppm .eps .s .obj
.s.o:
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(FEATURES) -c -o $@ $<
.c.o:
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(FEATURES) -c -o $@ $<
.cpp.o:
- $(CXX) $(CXXFLAGS) -c -o $@ $<
+ $(CXX) $(CXXFLAGS) $(FEATURESXX) -c -o $@ $<
.c.obj:
- $(CC) $(CFLAGS) -c -o $@ $<
+ $(CC) $(CFLAGS) $(FEATURES) -c -o $@ $<
.cpp.obj:
- $(CXX) $(CXXFLAGS) -c -o $@ $<
+ $(CXX) $(CXXFLAGS) $(FEATURESXX) -c -o $@ $<
.o:
- $(CC) $(CFLAGS) $< -o $@ $(LIBS)
+ $(CC) $(CFLAGS) $(FEATURES) $< -o $@ $(LIBS)
.c:
- $(CC) $(CFLAGS) $< -o $@ $(LIBS)
+ $(CC) $(CFLAGS) $(FEATURES) $< -o $@ $(LIBS)
.cpp:
- $(CXX) $(CXXFLAGS) $< -o $@ $(LIBS)
+ $(CXX) $(CXXFLAGS) $(FEATURESXX) $< -o $@ $(LIBS)
.o.a:
-rm -f $@

View File

@ -1,16 +0,0 @@
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
int
main(int argc, char *argv[])
{
static int level;
level = pthread_getconcurrency();
(void)pthread_setconcurrency(level++);
printf("LIBC_R TEST PASSED: All ok\n");
exit(0);
}