On Wed, 26 Jun 2002 13:25:57 +0200, Sheldon Hearn wrote:
> I think I have a handle on this now. If you fix it before you hear back
> from me, let me know so I can stop wasting time on it. XF84-4 test
> builds are slow. :-)
Okay, it looks like a bit of a mess.
I've copied the XFree86-4 maintainer.
I think there are three problems causing the XFree86-4 installation to
fail on -CURRENT:
*) Our imake-4 port doesn't arrange for a SharedDepCplusplusLibraryTarget
rule. I _think_ such a rule would, by default, add $(CXXLIB) to the
deplist for -CURRENT.
*) Our imake-4 port doesn't arrange for a CXXLIB definition. It should
be -lstdc++ on at least -CURRENT. The stock bsdLib.tmpl explicitly
sets CplusplusLibC empty, Imake.tmpl sets it to /**/ if not defined
and FreeBSD.cf doesn't set it at all.
*) The XFree86-4 distribution contains some bad C++ code.
Here's what I did to get XFree86-4 to build with the base system's
toolchain in -CURRENT:
a) ports/devel/imake-4:
Replace files/patch-d and files/patch-xthreads with the attached
patch-config::cf::FreeBSD.cf.
Add the attached patch-config::cf::bsdLib.tmpl.
b) ports/x11/XFree86-4-libraries:
Replace files/patch-z45 with the attached patch-z45.
Note that this isn't quite right, because the linking gets done with
cc as a front-end, not c++. But the job gets done, all the same,
and I'm not writing a SharedDepCplusplusLibraryTarget rule myself.
:-)
c) ports/x11-servers/XFree86-4-Server:
Add the attached patch-gcc31, taken from Motoyuki Konno's post to
<[EMAIL PROTECTED]> with the following Message-ID:
<[EMAIL PROTECTED]>
That's all.
Ciao,
Sheldon.
-------- patch-config::cf::FreeBSD.cf
--- config/cf/FreeBSD.cf.orig Wed Jun 26 15:44:29 2002
+++ config/cf/FreeBSD.cf Wed Jun 26 16:21:18 2002
@@ -80,7 +80,6 @@
/*
* math.h uses _REENTRANT and stdio.h uses _THREAD_SAFE, so define both.
*/
-# define SystemMTDefines -D_REENTRANT -D_THREAD_SAFE
/*
* FreeBSD has tread-safe api but no getpwnam_r yet.
*/
@@ -91,8 +90,12 @@
# else
# define BuildThreadStubLibrary YES
# define NeedUIThrStubs YES
-# define ThreadsCompileFlags -pthread
-# define ThreadsLibraries -pthread
+# if (OSRelVersion >= 500016)
+# define ThreadsLibraries -lc_r
+# else
+# define SystemMTDefines -D_REENTRANT -D_THREAD_SAFE
+# define ThreadsLibraries -pthread
+# endif
# define SharedX11Reqs $(LDPRELIB) $(XTHRSTUBLIB)
# define SharedXtReqs $(LDPRELIB) $(XLIBONLY) $(SMLIB) $(ICELIB)
$(XTHRSTUBLIB)
# endif
@@ -151,6 +154,7 @@
# define CcCmd cc
# define CplusplusCmd c++
#endif
+#define CplusplusLibC -lstdc++
#define CppCmd /usr/bin/cpp
#define PreProcessCmd CppCmd
-------- patch-config::cf::bsdLib.tmpl
--- config/cf/bsdLib.tmpl.orig Wed Jun 26 16:19:42 2002
+++ config/cf/bsdLib.tmpl Wed Jun 26 16:20:34 2002
@@ -39,7 +39,9 @@
#define XawClientLibs $(XAWLIB) $(XMULIBONLY) $(XTOOLLIB) $(XPMLIB) $(XLIB)
#endif
-#define CplusplusLibC
+#ifndef CplusplusLibC
+#define CplusplusLibC $(CXX)
+#endif
#define FrescoSysLibs CplusplusLibC MathLibrary
/* Allow for libpthread, as overridden by OS definitions */
-------- patch-z45
--- lib/GLU/Imakefile.orig Wed Jun 6 01:03:20 2001
+++ lib/GLU/Imakefile Wed Jun 26 15:27:14 2002
@@ -103,6 +103,7 @@
#undef _LinkBuildLibrary
#define _LinkBuildLibrary(lib) LinkBuildLibrary(lib)
+#if !defined(LibInstall) || LibInstall
#if NormalLibGlu
NormalDepLibraryTarget($(LIBNAME),$(SUBDIRS) $(DONES),$(STATIC_OBJS))
InstallLibrary($(LIBNAME),$(USRLIBDIR))
@@ -110,9 +111,9 @@
#if SharedLibGlu
#ifdef SharedDepCplusplusLibraryTarget
-SharedDepCplusplusLibraryTarget($(LIBNAME),$(SOREV),$(SUBDIRS)
$(DONES),$(SHARED_OBJS),.,.)
+SharedDepCplusplusLibraryTarget($(LIBNAME),$(SOREV),$(SUBDIRS)
+$(DONES),$(SHARED_OBJS) $(CXXLIB),.,.)
#else
-SharedDepLibraryTarget($(LIBNAME),$(SOREV),$(SUBDIRS) $(DONES),$(SHARED_OBJS),.,.)
+SharedDepLibraryTarget($(LIBNAME),$(SOREV),$(SUBDIRS) $(DONES),$(SHARED_OBJS)
+$(CXXLIB),.,.)
#endif
InstallSharedLibrary($(LIBNAME),$(SOREV),$(SHLIBDIR))
#endif
@@ -126,6 +127,7 @@
ProfiledDepLibraryTarget($(LIBNAME),$(SUBDIRS) $(DONES),$(PROFILE_OBJS))
InstallLibrary($(LIBNAME)_p,$(USRLIBDIR))
#endif /* ProfileLibFont */
+#endif
ForceSubdirs($(SUBDIRS))
-------- patch-gcc31
--- lib/XThrStub/UIThrStubs.c.old Mon Nov 19 06:13:26 2001
+++ lib/XThrStub/UIThrStubs.c Tue Jun 4 11:39:19 2002
@@ -99,6 +99,21 @@
#else
#include <pthread.h>
typedef pthread_t xthread_t;
+#if __GNUC__ >= 3
+xthread_t pthread_self() __attribute__ ((weak, alias ("_Xthr_self_stub_")));
+int pthread_mutex_init() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_mutex_destroy() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_mutex_lock() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_mutex_unlock() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_cond_init() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_cond_destroy() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_cond_wait() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_cond_signal() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_cond_broadcast() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_key_create() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+void *pthread_getspecific() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+int pthread_setspecific() __attribute__ ((weak, alias ("_Xthr_zero_stub_")));
+#else /* __GNUC__ */
#pragma weak pthread_self = _Xthr_self_stub_
#pragma weak pthread_mutex_init = _Xthr_zero_stub_
#pragma weak pthread_mutex_destroy = _Xthr_zero_stub_
@@ -113,6 +128,7 @@
#pragma weak pthread_key_create = _Xthr_zero_stub_
#pragma weak pthread_getspecific = _Xthr_zero_stub_
#pragma weak pthread_setspecific = _Xthr_zero_stub_
+#endif /* __GNUC__ */
#if defined(_DECTHREADS_) || defined(linux)
#pragma weak pthread_equal = _Xthr_equal_stub_ /* See Xthreads.h! */
int
--------
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message