[Mono-bugs] [Bug 74616][Wis] New - Fix configure for freebsd

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 15 Apr 2005 06:51:35 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by flashdict@gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=74616

--- shadow/74616	2005-04-15 06:51:34.000000000 -0400
+++ shadow/74616.tmp.13481	2005-04-15 06:51:34.000000000 -0400
@@ -0,0 +1,117 @@
+Bug#: 74616
+Product: Mono Tasks
+Version: 0%
+OS: other
+OS Details: FreeBSD configure bug + changes
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Build
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: flashdict@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Fix configure for freebsd
+
+configure.in has now two *freebsd6* sections, due to simultaneously-applied
+patches which enabled support for freebsd6.  This configure will produce a
+non-working build on freebsd > 4.  
+
+Only one of the sections is necessary - the one which enables
+--with-sigaltstack and libthr for freebsd5/6 by default.  Here is a patch
+to remove the incorrect section, and set up configure to properly use the
+now-working sigaltstack and libthr for freebsd>4, as tested and verified
+during the beta process.
+
+
+
+
+Index: configure.in
+===================================================================
+--- configure.in        (revision 43023)
++++ configure.in        (working copy)
+@@ -114,8 +114,8 @@
+                        libmono_cflags="$PTHREAD_CFLAGS"
+                fi
+                if test "x$PTHREAD_LIBS" = "x"; then
+-                       LDFLAGS="$LDFLAGS -lpthread"
+-                       libmono_ldflags="-lpthread"
++                       LDFLAGS="$LDFLAGS -lthr"
++                       libmono_ldflags="-lthr"
+                else
+                        LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+                        libmono_ldflags="$PTHREAD_LIBS"
+@@ -123,11 +123,11 @@
+                need_link_unlink=yes
+                AC_DEFINE(PTHREAD_POINTER_ID)
+                libdl=
++               with_sigaltstack=yes
+                libgc_threads=pthreads
+ # TLS is only partially implemented on 5-STABLE (compiler support
+ # but NOT library support)
+ #
+-               with_nptl=no
+                with_tls=pthread
+                ;;
+        *-*-*freebsd6*)
+@@ -136,37 +136,12 @@
+                        CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
+                        libmono_cflags=
+                else
+-                       CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS
+-DGC_FREEBSD_THREADS"
+-                       libmono_cflags="$PTHREAD_CFLAGS"
+-               fi
+-               if test "x$PTHREAD_LIBS" = "x"; then
+-                       LDFLAGS="$LDFLAGS -pthread"
+-                       libmono_ldflags="-pthread"
+-               else
+-                       LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+-                       libmono_ldflags="$PTHREAD_LIBS"
+-               fi
+-               need_link_unlink=yes
+-               AC_DEFINE(PTHREAD_POINTER_ID)
+-               libdl=
+-               libgc_threads=pthreads
+-# TLS is only partially implemented on -CURRENT (compiler support
+-# but NOT library support)
+-#
+-               with_tls=pthread
+-               ;;
+-       *-*-*freebsd6*)
+-               platform_win32=no
+-               if test "x$PTHREAD_CFLAGS" = "x"; then
+-                       CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
+-                       libmono_cflags=
+-               else
+                        CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS
+-DGC_FREEBSD_THREADS"
+                        libmono_cflags="$PTHREAD_CFLAGS"
+                fi
+                if test "x$PTHREAD_LIBS" = "x"; then
+-                       LDFLAGS="$LDFLAGS -lpthread"
+-                       libmono_ldflags="-lpthread"
++                       LDFLAGS="$LDFLAGS -lthr"
++                       libmono_ldflags="-lthr"
+                else
+                        LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
+                        libmono_ldflags="$PTHREAD_LIBS"
+@@ -866,6 +841,14 @@
+                *-*-*freebsd4*)
+                        AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
+                ;;
++               *-*-*freebsd5*)
++                       # libthr is preferrable on CURRENT
++                       AC_CHECK_LIB(thr, main, LIBS="$LIBS -lthr")
++               ;;
++               *-*-*freebsd6*)
++                       # libthr is preferrable on CURRENT
++                       AC_CHECK_LIB(thr, main, LIBS="$LIBS -lthr")
++               ;;
+                *)
+                        AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
+                ;;
+@@ -1616,8 +1599,8 @@