Bug 111544 - WITH_JAVA_AWT=yes does not work with lang/gcc41
Summary: WITH_JAVA_AWT=yes does not work with lang/gcc41
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: Gerald Pfeifer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-13 20:50 UTC by Jonas Wolz
Modified: 2007-04-21 08:50 UTC (History)
0 users

See Also:


Attachments
file.diff (724 bytes, patch)
2007-04-13 20:50 UTC, Jonas Wolz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Wolz 2007-04-13 20:50:01 UTC
When building devel/gcc41-withgcjawt or devel/gcc41 with WITH_JAVA_AWT defined the AWT library seems not to be built.
This results in the error "java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit" when you try to run a java application.

Fix: Apply the attached patch to the port's Makefile.
I don't know if it is the cleanest or best solution because I have no experience with creating ports but it works for me.

Patch attached with submission follows:
How-To-Repeat: Copy the following source code into the file "Hello2.java", compile it with "gcj41 Hello2.java --main=Hello2" and execute ./a.out

//// begin Hello2.java ////
import javax.swing.*;
public class Hello2 extends JFrame {
	public static void main(String[] args) {
		Hello2 h = new Hello2();
		h.setVisible(true);
	}

	public Hello2() {
		super("Hello World");
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		pack();
	}
}
//// end Hello2.java ////
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-04-13 20:50:07 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gerald

Over to maintainer
Comment 2 Gerald Pfeifer freebsd_committer freebsd_triage 2007-04-14 16:16:57 UTC
State Changed
From-To: open->closed

Thanks for the report and the patch.  We could not take the patch in its 
current form since that would have defeated the main purpose of the original 
changes (namely, to use OPTIONS in the future). 

Based on discussions with some fellow FreeBSD ports committers I have, 
however, committed a patch we believe resolves the problem you have seen 
in a different way, keeping the road for the use of OPTIONS open. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=111544 

Adding to audit trail from misfiled email message caught in spamtrap:

Comment 3 Jonas Wolz 2007-04-16 09:50:29 UTC
I might be wrong, but doesn't the Makefile still have a problem?
(I haven't tested it so far, but I doubt it will work correctly.)
The logic currently seems to be:

.if ! defined(WITHOUT_JAVA)
	# Java stuff 
.else # i.e: "if defined(WITHOUT_JAVA)"
	# Non-Java stuff
	.if defined(WITH_JAVA_AWT)  # Executed only if WITHOUT_JAVA defined?
		# ...
	.endif
.endif

I think the WITH_JAVA_AWT block should be moved in the !defined(WITHOUT_JAVA) 
block (if you want AWT, it doesn't make sense to define WITHOUT_JAVA...).

Regards,
Jonas
Comment 4 gerald 2007-04-16 14:04:56 UTC
On Mon, 16 Apr 2007, Jonas Wolz wrote:
> I might be wrong, but doesn't the Makefile still have a problem?

I'm afraid you're right.  I am not actually using this functionality,
just hosting it in my lang/gcc ports, and none of those interested have
spotted the issue so far it seems.

A fix is in testing right now...

Gerald
Comment 5 dfilter service freebsd_committer freebsd_triage 2007-04-16 15:26:14 UTC
gerald      2007-04-16 14:26:08 UTC

  FreeBSD ports repository

  Modified files:
    lang/gcc42           Makefile 
  Log:
  Move the WITH_JAVA_AWT bits into the ! WITHOUT_JAVA branch, that is,
  enable this only when Java is enabled.
  
  PR:             111544
  
  Revision  Changes    Path
  1.310     +3 -3      ports/lang/gcc42/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 dfilter service freebsd_committer freebsd_triage 2007-04-17 06:23:46 UTC
gerald      2007-04-17 05:23:40 UTC

  FreeBSD ports repository

  Modified files:
    lang/gcc41           Makefile distinfo 
  Log:
  Update to the 20070416 snapshot of GCC 4.1.3.
  
  Move the WITH_JAVA_AWT bits into the ! WITHOUT_JAVA branch, that is,
  enable this only when Java is enabled.
  
  PR:             111544
  
  Revision  Changes    Path
  1.320     +4 -4      ports/lang/gcc41/Makefile
  1.198     +15 -18    ports/lang/gcc41/distinfo
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 7 dfilter service freebsd_committer freebsd_triage 2007-04-21 08:41:10 UTC
gerald      2007-04-21 07:41:05 UTC

  FreeBSD ports repository

  Modified files:
    lang/gcc43           Makefile distinfo 
  Log:
  Update to the 20070420 snapshot of GCC 4.3.0.
  
  Move the WITH_JAVA_AWT bits into the ! WITHOUT_JAVA branch, that is,
  enable this only when Java is enabled.
  
  PR:             111544
  
  Revision  Changes    Path
  1.309     +4 -4      ports/lang/gcc43/Makefile
  1.197     +18 -18    ports/lang/gcc43/distinfo
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"