Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeBSD Makefile problem with json. #21

Open
lagagne opened this issue Feb 22, 2017 · 2 comments
Open

FreeBSD Makefile problem with json. #21

lagagne opened this issue Feb 22, 2017 · 2 comments

Comments

@lagagne
Copy link

lagagne commented Feb 22, 2017

I just built host-sflow from sources for FreeBSD 11.0

The "make" command brings these errors for the json Makefile: Lines 24 and 27: Missing dependency operator. Line 30: Need an operator.

I tried running "gmake" but after leaving the json directory successfully (Nothing to be done for 'all') it doesn't understand the FreeBSD Makefile.

I commented out the "cd src/json; $(MAKE)" from the main Makefile and ran "make" again and successfully completed the installation.

@sflow
Copy link
Owner

sflow commented Mar 22, 2017

Thanks. It seems like we should allow each platform to compile cJSON in it's own way.

@donatid
Copy link

donatid commented Aug 12, 2023

Hello,

I have the same problem installing host-sflow v2.0.51-26 on FreeBSD 13.2, and here is the error messages:

# gmake 
cd src/sflow; gmake
gmake[1]: Entering directory '/root/installer/host-sflow-2.0.51-26/src/sflow'
Makefile:32: warning: ignoring prerequisites on suffix rule definition
gcc -D_GNU_SOURCE -DSTDC_HEADERS -O3 -DNDEBUG -Wall -Wcast-align -I. -c sflow_agent.c
gcc -D_GNU_SOURCE -DSTDC_HEADERS -O3 -DNDEBUG -Wall -Wcast-align -I. -c sflow_sampler.c
gcc -D_GNU_SOURCE -DSTDC_HEADERS -O3 -DNDEBUG -Wall -Wcast-align -I. -c sflow_poller.c
gcc -D_GNU_SOURCE -DSTDC_HEADERS -O3 -DNDEBUG -Wall -Wcast-align -I. -c sflow_notifier.c
gcc -D_GNU_SOURCE -DSTDC_HEADERS -O3 -DNDEBUG -Wall -Wcast-align -I. -c sflow_receiver.c
ar cru libsflow.a sflow_agent.o sflow_sampler.o sflow_poller.o sflow_notifier.o sflow_receiver.o
ranlib libsflow.a
gmake[1]: Leaving directory '/root/installer/host-sflow-2.0.51-26/src/sflow'
cd src/json; gmake
gmake[1]: Entering directory '/root/installer/host-sflow-2.0.51-26/src/json'
gcc -std=c89 -c -fPIC -pedantic -Wall -Werror -Wstrict-prototypes -Wwrite-strings -Wshadow -Winit-self -Wcast-align -Wformat=2 -Wmissing-prototypes -Wstrict-overflow=2 -Wcast-qual -Wc++-compat -Wundef -Wswitch-default -Wconversion -fstack-protector cJSON.c
In file included from cJSON.c:42:
cJSON.c: In function 'print_number':
cJSON.c:561:15: error: conversion from 'double' to 'float' may change value [-Werror=float-conversion]
  561 |     if (isnan(d) || isinf(d))
      |               ^
cJSON.c:561:27: error: conversion from 'double' to 'float' may change value [-Werror=float-conversion]
  561 |     if (isnan(d) || isinf(d))
      |                           ^
cc1: all warnings being treated as errors
gmake[1]: *** [Makefile:83: cJSON.o] Error 1
gmake[1]: Leaving directory '/root/installer/host-sflow-2.0.51-26/src/json'
gmake: *** [Makefile:15: hsflowd] Error 2

When using make:

 # make 
cd src/sflow; make
`libsflow.a' is up to date.
cd src/json; make
make[1]: "/root/installer/host-sflow-2.0.51-26/src/json/Makefile" line 33: Invalid line type
make[1]: "/root/installer/host-sflow-2.0.51-26/src/json/Makefile" line 35: Invalid line type
make[1]: "/root/installer/host-sflow-2.0.51-26/src/json/Makefile" line 37: Invalid line type
make[1]: "/root/installer/host-sflow-2.0.51-26/src/json/Makefile" line 49: Invalid line type
make[1]: "/root/installer/host-sflow-2.0.51-26/src/json/Makefile" line 53: Invalid line type
make[1]: Fatal errors encountered -- cannot continue
make[1]: stopped in /root/installer/host-sflow-2.0.51-26/src/json
*** Error code 1

Stop.
make: stopped in /root/installer/host-sflow-2.0.51-26

Although I can disable the json as mentioned by @lagagne, I hope this issue can be fixed.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants