Bug 166377 - [PATCH] make net-mgmt/ettercap compile with clang
Summary: [PATCH] make net-mgmt/ettercap compile with clang
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: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-24 18:10 UTC by Niclas Zeising
Modified: 2012-04-10 17:10 UTC (History)
0 users

See Also:


Attachments
patch-aclocal.m4 (1.39 KB, text/plain)
2012-03-24 18:10 UTC, Niclas Zeising
no flags Details
patch-configure (3.57 KB, text/plain)
2012-03-24 18:10 UTC, Niclas Zeising
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Niclas Zeising 2012-03-24 18:10:05 UTC
	Currently, net-mgmt/ettercap does not compile with clang.  This is due to bugs in the configure script.  The configure script contains C code looking like this:

int main() {
	int main(int argc, char *argv[] {
		/* test code here */
		return 0;
	}
	return 0;
}

This code is not accepted by clang (but accepted by gcc, for some reason).

Fix: The files patch-aclocal.m4 and patch-acinclude.m4 contains fixes to the m4 files used to generate the configure script.  They can be used by patching the corresponding files in work/ettercap and run ./autogen.sh. The patch-configure is the resulting changes to the configure script from this, and it also includes the changes already in the current patch file files/patch-configure.
To fix the port, either use the new patch-configure, or use the patched *.m4 files and run autogen.sh during make install.  The latter suggestion has the drawbak of making ettercap require autoconf and automake.

--- acinclude.m4.orig	2012-03-24 18:22:51.000000000 +0100
+++ acinclude.m4	2012-03-24 18:23:49.000000000 +0100
@@ -56,11 +56,8 @@
          #include <pthread.h>
          ],
          [
-            int main(int argc, char **argv)
-            {
                pthread_create(NULL, NULL, NULL, NULL);
                return 0;
-            }
          ],
          [AC_MSG_RESULT(yes)],
          [AC_MSG_RESULT(no)
@@ -182,7 +179,7 @@
    AC_TRY_RUN([
       #include <arpa/nameser.h>
 
-      int main()
+      int main(int argc, char *argv[])
       {
          int i;
          char *p = "\x01\x02\x03\x04";
@@ -214,13 +211,10 @@
                #include <resolv.h>
             ],
             [
-               int main(int argc, char **argv)
-               {
                   char *q;
                   char p[NS_MAXDNAME];
 
                   dn_expand(q, q, q, p, sizeof(p));
-               } 
             ],
             [AC_MSG_RESULT(not needed)],
             [AC_MSG_RESULT(needed)
@@ -239,13 +233,10 @@
                #include <resolv.h>
             ],
             [
-               int main(int argc, char **argv)
-               {
                   char *q;
                   char p[NS_MAXDNAME];
 
                   __dn_expand(q, q, q, p, sizeof(p));
-               } 
 	    ],
 	    [AC_MSG_RESULT(not needed)],
             [AC_MSG_RESULT(needed)
@@ -274,13 +265,10 @@
                #include <resolv.h>
             ],
             [
-               int main(int argc, char **argv)
-               {
                   char *q;
                   char p[NS_MAXDNAME];
 
                   __dn_expand(q, q, q, p, sizeof(p));
-               } 
             ],
             [AC_MSG_RESULT(not needed)],
             [AC_MSG_RESULT(needed)
--- patch-acinclude.m4 ends here ---
How-To-Repeat: 	compile net-mgmt/ettercap with clang instead of gcc.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-03-24 18:10:20 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sunpoet

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2012-04-10 17:02:45 UTC
sunpoet     2012-04-10 16:02:36 UTC

  FreeBSD ports repository

  Modified files:
    net-mgmt/ettercap/files patch-configure 
  Log:
  - Fix build with clang
  
  PR:             ports/166377
  Submitted by:   Niclas Zeising <zeising@daemonic.se>
  
  Revision  Changes    Path
  1.3       +56 -7     ports/net-mgmt/ettercap/files/patch-configure
_______________________________________________
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 3 Po-Chuan Hsieh freebsd_committer freebsd_triage 2012-04-10 17:02:53 UTC
State Changed
From-To: open->closed

Committed. Thanks!