Patchwork update superiotool support for FreeBSD

login
register
about
Submitter Idwer Vollering
Date 2010-10-18 14:26:44
Message ID <AANLkTinMXMfqLWFihKjps=4w2jHCatfPRYyyX-pFDJcu@mail.gmail.com>
Download mbox | patch
Permalink /patch/2131/
State Accepted
Headers show

Comments

Idwer Vollering - 2010-10-18 14:26:44
2010/10/18 Warren Turkal <wt@penguintechs.org>

> On Sunday, October 17, 2010 09:37:27 am Idwer Vollering wrote:
> > Update support for FreeBSD.
> >
> > Signed-off-by: Idwer Vollering <vidwer@gmail.com>
>

Updated patch attached.
Signed-off-by: Idwer Vollering <vidwer@gmail.com>


> A few questions:
> * Would it be better set LIBS to -lz and make LDFLAGS default to $(LIBS) on
> all platforms?
> * I thought that FreeBSD used GCC?
>

It does, but you need GNU make (gmake):
http://www.freebsd.org/cgi/url.cgi?ports/devel/gmake/pkg-descr to be able to
do a native compile (from trunk/ code -- from fbsd's ports is a different
story).


>  - If so, why remove -ansi and -pedantic on FreeBSD?
>

This happens when leaving -pedantic (ergo not overriding CFLAGS that's
outside of the ifeq()..endif) alone:
- patch:


- error:

$ gmake clean ; gmake
rm -f superiotool *.o
gcc -O2 -Wall -Werror -Wstrict-prototypes -Wundef -Wstrict-aliasing
-Werror-implicit-function-declaration -ansi -pedantic
-D'SUPERIOTOOL_VERSION="5728"' -I/usr/local/include -DPCI_SUPPORT   -c -o
superiotool.o superiotool.c
cc1: warnings being treated as errors
In file included from superiotool.h:41,
                 from superiotool.c:24:
/usr/local/include/pci/pci.h:238: warning: comma at end of enumerator list
gmake: *** [superiotool.o] Error 1


>  - In either case, would it be better to replace -ansi with something like
> -
> std=c90 on all platforms and leave -pedantic? Would that be enough to work?
>

cc1: error: unrecognized command line option "-std=c90"


>
> Thanks,
> wt
>
Uwe Hermann - 2010-10-24 13:45:33
On Mon, Oct 18, 2010 at 04:26:44PM +0200, Idwer Vollering wrote:
> Updated patch attached.
> Signed-off-by: Idwer Vollering <vidwer@gmail.com>

Thanks, r5980.


Uwe.

Patch

Index: Makefile
===================================================================
--- Makefile	(revision 5965)
+++ Makefile	(working copy)
@@ -39,6 +39,13 @@ 
 ifeq ($(OS_ARCH), Darwin)
 LIBS = -framework IOKit -framework DirectIO -lpci -lz
 endif
+ifeq ($(OS_ARCH), FreeBSD)
+CFLAGS = -O2 -Wall -Werror -Wstrict-prototypes -Wundef -Wstrict-aliasing \
+         -Werror-implicit-function-declaration -ansi $(SVNDEF) \
+         -I/usr/local/include
+LDFLAGS += -L/usr/local/lib
+LIBS = -lz
+endif
 
 # Support for PCI-attached "Super I/Os" (e.g. in VIA VT82686A/B).
 CONFIG_PCI = yes