This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Next configuration patch for *-*-freebsd


OK, I have applied the minimal boehm-gc configuration patch for
*-*-freebsd to the mainline.  With this next patch, I now have libjava
building (and thus the entire ``make bootstrap'' completing) when
--enable-threads=posix was given to the top-level configure (recent
reports are that it already built without that option, but I have not
tested it myself in a while).

I have attempted to use the same technique suggested by Bryce for the
last configuration patch.  Here is the simple part of the patch
(although not entirely clear from context, it does not affect the port
when --disable-threads was configured or any other port):

Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libjava/configure.in,v
retrieving revision 1.81
diff -c -r1.81 configure.in
*** configure.in	2001/05/01 17:45:09	1.81
--- configure.in	2001/05/05 00:24:25
***************
*** 326,331 ****
--- 326,338 ----
         AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
      fi
      AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Required define if using POSIX threads])
+     case "$host" in
+      *-*-freebsd*)
+ 	THREADINCS=-pthread
+ 	THREADLIBS=-pthread
+ 	THREADSPEC=-lc_r
+      ;;
+     esac
      ;;
  
   none)

On FreeBSD before version 5.0, -lc can't be provided, from any source,
during linking when -lc_r is provided (on Linux and many other UNIX
platforms, -lc_r is called -lpthread but also does not usually
conflict with the C library).  FreeBSD 5.0 will be similar to other
UNIX platforms when it is released.  Here is the hard part of the
patch (which also includes the easy part given above) to encode this
platform issue:

Index: libgcj.spec.in
===================================================================
RCS file: /cvs/gcc/egcs/libjava/libgcj.spec.in,v
retrieving revision 1.16
diff -c -r1.16 libgcj.spec.in
*** libgcj.spec.in	2001/05/01 17:45:08	1.16
--- libgcj.spec.in	2001/05/07 22:45:34
***************
*** 4,10 ****
  # to link with libgcj.
  #
  %rename lib liborig
! *lib: -lgcj -lm @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) %(liborig)
  
  *jc1: @DIVIDESPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@
  
--- 4,10 ----
  # to link with libgcj.
  #
  %rename lib liborig
! *lib: -lgcj -lm @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(libgcc) @LIBORIG@
  
  *jc1: @DIVIDESPEC@ @JC1GCSPEC@ @EXCEPTIONSPEC@
  
Index: configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libjava/configure.in,v
retrieving revision 1.81
diff -c -r1.81 configure.in
*** configure.in	2001/05/01 17:45:09	1.81
--- configure.in	2001/05/07 22:45:34
***************
*** 213,218 ****
--- 213,221 ----
  SYSTEMSPEC=
  AC_SUBST(SYSTEMSPEC)
  
+ LIBORIG='%(liborig)'
+ AC_SUBST(LIBORIG)
+ 
  LIBGCJTESTSPEC="-L`pwd`/.libs -rpath `pwd`/.libs"
  AC_SUBST(LIBGCJTESTSPEC)
  
***************
*** 326,331 ****
--- 329,348 ----
         AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads])
      fi
      AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Required define if using POSIX threads])
+     case "$host" in
+      *-*-freebsd*)
+ 	THREADINCS=-pthread
+ 	THREADLIBS=-pthread
+ 	THREADSPEC=-lc_r
+      ;;
+     esac
+     changequote(<<,>>)
+     case "$host" in
+      *-*-freebsd[1234]*)
+ 	LIBORIG=
+      ;;
+     esac
+     changequote([,])
      ;;
  
   none)

If this is OK, I can apply it to the mainline.  However, I do have a
question: since LIBORIG is only used by libjava top-level configure,
do all the Makefile.in files in libjava need to be regenerated from
associated Makefile.am files?  I note that I did not and logically I
see why it works without doing so; but I need to know if I am expected
to rebuild them in this case.  For the record, I note that Makefile.in
files were not rebuilt when EXCEPTIONSPEC was added to configure.in on
2001-04-30 (of course, that doesn't make it right ;-).

It has been fully bootstrapped on i386-unknown-freebsd4.2.  Since this
configuration change affects all other ports, I hope that (hint, hint
Bryce) someone else with the power to approve it, might add it to
their tree for a bootstrap cycle before approval unless, of course, it
appears obviously right or wrong.

Regards,
Loren


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]