Nick: anonymous E-mail: none Board: unknown Contents: $ gmake Replacing all version templates with v1.2-193-g5905270-dirty. Checking for a C compiler... found. Target arch is x86 Target OS is FreeBSD Checking for libpci headers... found. Checking version of pci_get_dev... new version (including PCI domain parameter). Checking if libpci is present and sufficient... yes. Checking for libusb-1.0 headers... found. Checking if libusb-1.0 is usable... yes. Checking for FTDI support... found. Checking for FT232H support in libftdi... found. Checking for utsname support... found. Checking for clock_gettime support... found. cc -MMD -std=c99 -D_DEFAULT_SOURCE -D_BSD_SOURCE -Os -Wall -Wextra -Wno-unused-parameter -Wshadow -Wmissing-prototypes -Wwrite-strings -Werror -D_POSIX_C_SOURCE=200809L -I/usr/local/include -D'CONFIG_DEFAULT_PROGRAMMER=PROGRAMMER_INVALID' -D'CONFIG_DEFAULT_PROGRAMMER_ARGS="''"' -D'CONFIG_INTERNAL=1' -D'CONFIG_INTERNAL_DMI=1' -D'CONFIG_ENE_LPC=1' -D'CONFIG_MEC1308=1' -D'CONFIG_SERPROG=1' -D'CONFIG_RAYER_SPI=1' -D'CONFIG_RAIDEN_DEBUG_SPI=1' -D'CONFIG_PONY_SPI=1' -D'CONFIG_BITBANG_SPI=1' -D'CONFIG_NIC3COM=1' -D'CONFIG_GFXNVIDIA=1' -D'CONFIG_SATASII=1' -D'CONFIG_ATAVIA=1' -D'CONFIG_IT8212=1' -D'CONFIG_FT2232_SPI=1' -D'CONFIG_USBBLASTER_SPI=1' -D'CONFIG_PICKIT2_SPI=1' -D'CONFIG_STLINKV3_SPI=1' -D'HAVE_FT232H=1' -I/usr/local/include/libftdi1 -D'CONFIG_DUMMY=1' -D'CONFIG_DRKAISER=1' -D'CONFIG_NICREALTEK=1' -D'CONFIG_NICINTEL=1' -D'CONFIG_NICINTEL_SPI=1' -D'CONFIG_NICINTEL_EEPROM=1' -D'CONFIG_OGP_SPI=1' -D'CONFIG_BUSPIRATE_SPI=1' -D'CONFIG_DEDIPROG=1' -D'CONFIG_DEVELOPERBOX_SPI=1' -D'CONFIG_SATAMV=1' -D'CONFIG_CH341A_SPI=1' -D'CONFIG_DIGILENT_SPI=1' -D'NEED_PCI=1' -D'NEED_RAW_ACCESS=1' -D'NEED_LIBUSB1=1' -D'HAVE_UTSNAME=1' -D'HAVE_CLOCK_GETTIME=1' -D'FLASHROM_VERSION="v1.2-193-g5905270-dirty"' -o chipset_enable.o -c chipset_enable.c In file included from chipset_enable.c:37: In file included from ./hwaccess.h:149: /usr/include/machine/cpufunc.h:68:25: error: unknown type name 'u_int' static __inline __pure2 u_int ^ /usr/include/machine/cpufunc.h:69:6: error: unknown type name 'u_int' bsfl(u_int mask) ^ /usr/include/machine/cpufunc.h:71:2: error: use of undeclared identifier 'u_int' u_int result; ^ /usr/include/machine/cpufunc.h:73:40: error: use of undeclared identifier 'result' __asm __volatile("bsfl %1,%0" : "=r" (result) : "rm" (mask)); ^ /usr/include/machine/cpufunc.h:74:10: error: use of undeclared identifier 'result' return (result); ^ /usr/include/machine/cpufunc.h:77:25: error: unknown type name 'u_long'; did you mean 'long'? static __inline __pure2 u_long ^ /usr/include/machine/cpufunc.h:78:6: error: unknown type name 'u_long'; did you mean 'long'? bsfq(u_long mask) ^ /usr/include/machine/cpufunc.h:80:2: error: use of undeclared identifier 'u_long'; did you mean 'long'? u_long result; ^ /usr/include/machine/cpufunc.h:86:25: error: unknown type name 'u_int' static __inline __pure2 u_int ^ /usr/include/machine/cpufunc.h:87:6: error: unknown type name 'u_int' bsrl(u_int mask) ^ /usr/include/machine/cpufunc.h:89:2: error: use of undeclared identifier 'u_int' u_int result; ^ /usr/include/machine/cpufunc.h:91:40: error: use of undeclared identifier 'result' __asm __volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask)); ^ /usr/include/machine/cpufunc.h:92:10: error: use of undeclared identifier 'result' return (result); ^ /usr/include/machine/cpufunc.h:95:25: error: unknown type name 'u_long'; did you mean 'long'? static __inline __pure2 u_long ^ /usr/include/machine/cpufunc.h:96:6: error: unknown type name 'u_long'; did you mean 'long'? bsrq(u_long mask) ^ /usr/include/machine/cpufunc.h:98:2: error: use of undeclared identifier 'u_long'; did you mean 'long'? u_long result; ^ /usr/include/machine/cpufunc.h:105:9: error: unknown type name 'u_long'; did you mean 'long'? clflush(u_long addr) ^ /usr/include/machine/cpufunc.h:112:12: error: unknown type name 'u_long'; did you mean 'long'? clflushopt(u_long addr) ^ /usr/include/machine/cpufunc.h:119:6: error: unknown type name 'u_long'; did you mean 'long'? clwb(u_long addr) ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. gmake: *** [Makefile:1284: chipset_enable.o] Error 1 $ git diff diff --git a/Makefile b/Makefile index 6d37d55..d749e82 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ INSTALL = install DIFF = diff PREFIX ?= /usr/local MANDIR ?= $(PREFIX)/share/man -CFLAGS ?= -std=c99 -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE -Os -Wall -Wextra -Wno-unused-parameter -Wshadow -Wmissing-prototypes -Wwrite-strings +CFLAGS ?= -std=c99 -D_DEFAULT_SOURCE -D_BSD_SOURCE -Os -Wall -Wextra -Wno-unused-parameter -Wshadow -Wmissing-prototypes -Wwrite-strings EXPORTDIR ?= . RANLIB ?= ranlib PKG_CONFIG ?= pkg-config @@ -98,6 +98,9 @@ ifeq ($(findstring MINGW, $(HOST_OS)), MINGW) # Explicitly set CC = gcc on MinGW, otherwise: "cc: command not found". CC = gcc endif +ifneq ($(findstring BSD, $(HOST_OS)), FreeBSD) +CFLAGS += -D_POSIX_C_SOURCE=200809L +endif ifneq ($(HOST_OS), SunOS) STRIP_ARGS = -s diff --git a/chipset_enable.c b/chipset_enable.c index 040b151..d20093e 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -25,6 +25,7 @@ */ #define _LARGEFILE64_SOURCE +//#define __BSD_VISIBLE 1 #include #include diff --git a/hwaccess.h b/hwaccess.h index 5602c15..79eb430 100644 --- a/hwaccess.h +++ b/hwaccess.h @@ -13,6 +13,8 @@ * GNU General Public License for more details. */ +//#define __BSD_VISIBLE 1 + /* * Header file for hardware access and OS abstraction. Included from flash.h. */