Bug 93879 - [PATCH] FIXED systemc installation problem and cleaned up Makefile
Summary: [PATCH] FIXED systemc installation problem and cleaned up Makefile
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-27 00:50 UTC by Daniel Thiele
Modified: 2006-04-01 23:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Thiele 2006-02-27 00:50:02 UTC
1.)
After a "make install" in /usr/ports/cad/systemc I got the following error message:

===>  Installing for systemc-2.1.v1
===>   Generating temporary packing list
===>  Checking if cad/systemc already installed
Making install in src
gmake[1]: Entering directory `/usr/ports/cad/systemc/work/systemc-2.1.v1/objdir/src'
Making install in sysc
gmake[2]: Entering directory `/usr/ports/cad/systemc/work/systemc-2.1.v1/objdir/src/sysc'
Making install in kernel
gmake[3]: Entering directory `/usr/ports/cad/systemc/work/systemc-2.1.v1/objdir/src/sysc/kernel'
gmake[4]: Entering directory `/usr/ports/cad/systemc/work/systemc-2.1.v1/objdir/src/sysc/kernel'
gmake[4]: Nothing to be done for `install-exec-am'.
/usr/local/bin/bash ../../../../config/mkinstalldirs ../include/sysc/kernel
mkdir 
mkdir: .: No such file or directory
gmake[4]: *** [install-data-local] Error 1
gmake[4]: Leaving directory `/usr/ports/cad/systemc/work/systemc-2.1.v1/objdir/src/sysc/kernel'
gmake[3]: *** [install-am] Error 2
gmake[3]: Leaving directory `/usr/ports/cad/systemc/work/systemc-2.1.v1/objdir/src/sysc/kernel'
gmake[2]: *** [install-recursive] Error 1
gmake[2]: Leaving directory `/usr/ports/cad/systemc/work/systemc-2.1.v1/objdir/src/sysc'
gmake[1]: *** [install-recursive] Error 1
gmake[1]: Leaving directory `/usr/ports/cad/systemc/work/systemc-2.1.v1/objdir/src'
gmake: *** [install-recursive] Error 1
*** Error code 2

Stop in /usr/ports/cad/systemc.


2.)
Since the systemc port is restricted (see: http://www.systemc.org/account/register.php) it should also be listet in ports/LEGAL:
systemc-2.1.v1.tgz      cad/systemc          License agreement required


3.)
I also cleaned up the Makefile to let the FreeBSD ports infrastucture do most of the configure, make and install work. While doing this I also removed the utilization of the autotools and thus files/patch-configure.in is replaced by files/patch-configure (see fix below).
One thing that may need some testing is whether a restriction with "ONLY_FOR_ARCHS= i386" is neccessary. Since I do not own any amd64 hardware I am not sure whether systemc works on this architecture too.


4.)
Finally I made pkg-descr look pretty and made some sligth adjustments to pkg-plist

Fix: Apply the following patch to cad/systemc:
--------------------------------------------------------------------


Then in cad/systemc do:
% rm files/patch-configure.in*
% rm *.orig
% mv patch-configure files/--wvFo2PnrHHkfogpAdTtC865wk3tdGfmeGEjFxxbLX6XDEiIw
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -Nur /usr/ports/cad/systemc/Makefile ./Makefile
--- /usr/ports/cad/systemc/Makefile	Sun Dec 18 12:23:43 2005
+++ ./Makefile	Mon Feb 27 00:22:50 2006
@@ -7,20 +7,24 @@
 
 PORTNAME=	systemc
 PORTVERSION=	2.1.v1
+PORTREVISION=	1
 CATEGORIES=	cad devel
 EXTRACT_SUFX=	.tgz
 
 MAINTAINER=	dthiele@gmx.net
 COMMENT=	A modeling platform for system-level C++ models
 
-RESTRICTED=	"You have to register at http://www.systemc.org/account/register.php first"
+RESTRICTED=	You have to register at http://www.systemc.org/account/register.php first
 
-USE_AUTOTOOLS=	aclocal:19 automake:19 autoheader:259 autoconf:259
 USE_GMAKE=	yes
 HAS_CONFIGURE=	yes
-GNU_CONFIGURE=	yes
 
 CONFIGURE_SCRIPT=	../configure
+CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_ARGS=	--prefix=${PREFIX}/systemc ${CONFIGURE_TARGET}
+CONFIGURE_WRKSRC=	${WRKSRC}/objdir
+BUILD_WRKSRC=	${WRKSRC}/objdir
+INSTALL_WRKSRC=	${WRKSRC}/objdir
 
 .include <bsd.port.pre.mk>
 
@@ -28,20 +32,7 @@
 IGNORE=		is restricted. You have to register at http://www.systemc.org/account/register.php and download ${DISTFILES} from there first. Then put ${DISTFILES} into ${DISTDIR} and run make again
 .endif
 
-do-configure:
+pre-configure:
 	@${MKDIR} ${WRKSRC}/objdir
-	@(cd ${WRKSRC}/objdir && \
-	${CONFIGURE_ENV} && \
-	${CONFIGURE_SCRIPT} --prefix=${PREFIX}/${PORTNAME})
-
-do-build:
-	@(cd ${WRKSRC}/objdir && \
-	${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} \
-	${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
-
-do-install:
-	@(cd ${WRKSRC}/objdir && \
-	${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} \
-	${MAKEFILE} ${MAKE_ARGS} ${INSTALL_TARGET})
 
 .include <bsd.port.post.mk>
diff -Nur /usr/ports/cad/systemc/files/patch-configure ./files/patch-configure
--- /usr/ports/cad/systemc/files/patch-configure	Thu Jan  1 01:00:00 1970
+++ ./files/patch-configure	Sun Feb 26 23:36:43 2006
@@ -0,0 +1,36 @@
+--- configure.orig	Sun Feb 26 23:35:41 2006
++++ configure	Sun Feb 26 23:34:39 2006
+@@ -3309,6 +3309,25 @@
+ 	AS=as
+         QT_ARCH="sparc-os2"
+         ;;
++    *freebsd*)
++        case "$CXX_COMP" in
++            c++ | g++)
++                EXTRA_CXXFLAGS="-Wall"
++                DEBUG_CXXFLAGS="-g"
++                OPT_CXXFLAGS="-O3"
++                TARGET_ARCH="freebsd"
++        	CC="$CXX"
++        	CFLAGS="$EXTRA_CXXFLAGS $OPT_CXXFLAGS"
++                ;;
++            *)
++                { { echo "$as_me:$LINENO: error: \"sorry...compiler not supported\"" >&5
++echo "$as_me: error: \"sorry...compiler not supported\"" >&2;}
++   { (exit 1); exit 1; }; }
++		;;
++        esac
++	AS=as
++        QT_ARCH="iX86"
++        ;;
+     *linux*)
+         case "$CXX_COMP" in
+             c++ | g++)
+@@ -3387,7 +3406,6 @@
+ 
+ 
+ test "x$prefix" = xNONE && prefix=$srcdir
+-current_dir=`pwd`; cd $prefix; prefix=`pwd`; cd $current_dir
+ 
+ 
+ 
diff -Nur /usr/ports/cad/systemc/files/patch-configure.in ./files/patch-configure.in
--- /usr/ports/cad/systemc/files/patch-configure.in	Sat Feb 25 16:12:58 2006
+++ ./files/patch-configure.in	Thu Jan  1 01:00:00 1970
@@ -1,35 +0,0 @@
---- configure.in.orig	Mon Apr 11 23:49:25 2005
-+++ configure.in	Fri Dec 16 23:06:05 2005
-@@ -111,6 +111,23 @@
- 	AS=as
-         QT_ARCH="sparc-os2"
-         ;;
-+    *freebsd*)
-+        case "$CXX_COMP" in
-+            c++ | g++)
-+                EXTRA_CXXFLAGS="-Wall"
-+                DEBUG_CXXFLAGS="-g"
-+                OPT_CXXFLAGS="-O3"
-+                TARGET_ARCH="freebsd"
-+        	CC="$CXX"
-+        	CFLAGS="$EXTRA_CXXFLAGS $OPT_CXXFLAGS"
-+                ;;
-+            *)
-+                AC_MSG_ERROR("sorry...compiler not supported")
-+		;;
-+        esac
-+	AS=as
-+        QT_ARCH="iX86"
-+        ;;
-     *linux*)
-         case "$CXX_COMP" in
-             c++ | g++)
-@@ -187,7 +204,7 @@
- dnl
-
- test "x$prefix" = xNONE && prefix=$srcdir
--current_dir=`pwd`; cd $prefix; prefix=`pwd`; cd $current_dir
-+dnl current_dir=`pwd`; cd $prefix; prefix=`pwd`; cd $current_dir
-
- dnl
- dnl Substitution variables.
diff -Nur /usr/ports/cad/systemc/pkg-descr ./pkg-descr
--- /usr/ports/cad/systemc/pkg-descr	Sun Dec 18 12:23:43 2005
+++ ./pkg-descr	Sun Feb 26 23:07:06 2006
@@ -1,11 +1,9 @@
 SystemC provides hardware-oriented constructs within the context of C++ 
-as a
-class library implemented in standard C++.  Its use spans design and
+as a class library implemented in standard C++.  Its use spans design and
 verification from concept to implementation in hardware and software.
 
 SystemC provides an interoperable modeling platform which enables the
 development and exchange of very fast system-level C++ models. It also 
-provides
-a  stable platform for development of system-level tools.
+provides a  stable platform for development of system-level tools.
 
 WWW:	http://www.systemc.org/
diff -Nur /usr/ports/cad/systemc/pkg-plist ./pkg-plist
--- /usr/ports/cad/systemc/pkg-plist	Sun Jan 22 02:26:41 2006
+++ ./pkg-plist	Sun Feb 26 23:07:06 2006
@@ -280,10 +280,10 @@
 systemc/include/systemc.h
 systemc/lib-freebsd/libsystemc.a
 @dirrmtry systemc/docs
-@dirrm systemc/examples/sysc/2.1
-@dirrm systemc/examples/sysc/fft
-@dirrm systemc/examples/sysc
-@dirrm systemc/examples/systemc
+@dirrmtry systemc/examples/sysc/2.1
+@dirrmtry systemc/examples/sysc/fft
+@dirrmtry systemc/examples/sysc
+@dirrmtry systemc/examples/systemc
 @dirrmtry systemc/examples
 @dirrm systemc/include/sysc/communication
 @dirrm systemc/include/sysc/datatypes/bit
--------------------------------------------------------------------
How-To-Repeat: 1.)
With a recently checked out ports tree do:
cd /usr/ports/cad/systemc && make install
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-02-27 00:52:45 UTC
Class Changed
From-To: update->maintainer-update

Fix category (submitter is maintainer)
Comment 2 Thierry Thomas freebsd_committer freebsd_triage 2006-03-24 15:29:25 UTC
Hello,

> diff -Nur /usr/ports/cad/systemc/files/patch-configure ./files/patch-configure
> --- /usr/ports/cad/systemc/files/patch-configure	Thu Jan  1 01:00:00 1970
> +++ ./files/patch-configure	Sun Feb 26 23:36:43 2006
> @@ -0,0 +1,36 @@
> +--- configure.orig	Sun Feb 26 23:35:41 2006
> ++++ configure	Sun Feb 26 23:34:39 2006
> +@@ -3309,6 +3309,25 @@
> + 	AS=as
> +         QT_ARCH="sparc-os2"
> +         ;;
> ++    *freebsd*)
> ++        case "$CXX_COMP" in
> ++            c++ | g++)
> ++                EXTRA_CXXFLAGS="-Wall"
> ++                DEBUG_CXXFLAGS="-g"
> ++                OPT_CXXFLAGS="-O3"
> ++                TARGET_ARCH="freebsd"
> ++        	CC="$CXX"
> ++        	CFLAGS="$EXTRA_CXXFLAGS $OPT_CXXFLAGS"

Why do you force optimization flag to -O3? In these cases, you don't
respect the original CFLAGS. Please run

find /usr/ports -name Makefile | xargs grep OPTIMIZED_CFLAGS

to find some examples of ports dealing with this.

Regards,
-- 
Th. Thomas.
Comment 3 Daniel Thiele 2006-03-29 21:03:08 UTC
Hello,

thank you for your hint at OPTIMIZED_CFLAGS. I went through the 
information you provided and adjusted the port's Makefile 
(hopefully in the right way). The new Makefile should now look 
like this (except for the $FreeBSD line):

--- Makefile start ---
# New ports collection makefile for:   systemc
# Date created:        15 December 2005
# Whom:                Daniel Thiele
#
# $FreeBSD: ports/cad/systemc/Makefile,v 1.1 2005/12/18 11:23:43 lawrance Exp $
#

PORTNAME=	systemc
PORTVERSION=	2.1.v1
PORTREVISION=	1
CATEGORIES=	cad devel
EXTRACT_SUFX=	.tgz

MAINTAINER=	dthiele@gmx.net
COMMENT=	A modeling platform for system-level C++ models

RESTRICTED=	You have to register at http://www.systemc.org/account/register.php first

USE_GMAKE=	yes
HAS_CONFIGURE=	yes

CONFIGURE_SCRIPT=	../configure
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS=	--prefix=${PREFIX}/systemc ${CONFIGURE_TARGET}
CONFIGURE_WRKSRC=	${WRKSRC}/objdir
BUILD_WRKSRC=	${WRKSRC}/objdir
INSTALL_WRKSRC=	${WRKSRC}/objdir

.include <bsd.port.pre.mk>

.if !exists(${DISTDIR}/${DISTNAME}${EXTRACT_SUFX})
IGNORE=		is restricted. You have to register at http://www.systemc.org/account/register.php and download ${DISTFILES} from there first. Then put ${DISTFILES} into ${DISTDIR} and run make again
.endif

.if defined(WITH_OPTIMIZED_CFLAGS)
CXXFLAGS+=	-O3
.endif

pre-everything::
.if !defined(WITH_OPTIMIZED_CFLAGS)
	@${ECHO_MSG} "You can enable additional compilation optimizations"
	@${ECHO_MSG} "by defining WITH_OPTIMIZED_CFLAGS"
.endif

pre-configure:
	@${MKDIR} ${WRKSRC}/objdir
	@${REINPLACE_CMD} -e 's|\(OPT_CXXFLAGS="\).*"|\1${CXXFLAGS}"|g' \
		${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}

.include <bsd.port.post.mk>
--- Makefile end ---

Since REINPLACE_CMD with the above arguments replaces the entire 
OPT_CXXFLAGS lines of the configure script the file patch-configure
can remain as it is or the CXXFLAGS line may be canged to 
OPT_CXXFLAGS="".




Regards,

Daniel
Comment 4 Thierry Thomas freebsd_committer freebsd_triage 2006-04-01 23:51:05 UTC
State Changed
From-To: open->closed


Committed, thanks!