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

configure.ac: add option to disable image output #35

Merged
merged 1 commit into from Dec 23, 2015

Conversation

rrebello
Copy link
Contributor

Even when the gd library is present, it may be desirable to not build
'vnstati' as image output is an optional feature.

Also, when testing for the gd library, use gdImagePng() instead of
gdImageLine() since it's possible that the installed gd library doesn't
have PNG support. In such cases, the test in the configure script passed
(because gdImageLine() is always present), but the build failed with:

src/vnstati.o: In function 'writeoutput':
vnstati.c:(.text+0x3fc): undefined reference to 'gdImagePng'
collect2: error: ld returned 1 exit status

Even when the gd library is present, it may be desirable to not build
'vnstati' as image output is an optional feature.

Also, when testing for the gd library, use gdImagePng() instead of
gdImageLine() since it's possible that the installed gd library doesn't
have PNG support. In such cases, the test in the configure script passed
(because gdImageLine() is always present), but the build failed with:

  src/vnstati.o: In function `writeoutput':
  vnstati.c:(.text+0x3fc): undefined reference to `gdImagePng'
  collect2: error: ld returned 1 exit status
@vergoh
Copy link
Owner

vergoh commented Dec 23, 2015

Thanks, that's a good finding and improvement. I was somewhat expecting something to get reported after the build system was changed. Out of curiosity, in which distribution / environment did this issue occur?

vergoh added a commit that referenced this pull request Dec 23, 2015
configure.ac: add option to disable image output and improve gd library availability check
@vergoh vergoh merged commit f975470 into vergoh:master Dec 23, 2015
@rrebello
Copy link
Contributor Author

I caught that while using Buildroot (https://buildroot.org), which is a tool for generating embedded Linux systems through cross-compilation. I'm both a user and a casual contributor of this open source project, and I decided to update the recipes for vnStat to match the latest released version (1.15). While doing that, I realised there was the possibility of building the gd library without PNG support (by not including libpng in the system), so I went for a test to see if the new autotools-based build system would correctly detect that and bingo!

I suppose this issue is unlikely to get noticed in most distributions / environments, though, since the gd library is probably built with full support for different image formats in such cases. Nevertheless, it's always good to cover as many setups as possible.

I'm glad the PR was merged since that will allow the patch for this specific issue to be removed from Buildroot when the next vnStat release comes out.

@rrebello rrebello deleted the image-output-option branch December 23, 2015 14:27
@anthonyryan1
Copy link

Just encountered this in Gentoo and was about to start on the same patch. Happy to see this resolved already.

Thanks for your work @rrebello

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

Successfully merging this pull request may close these issues.

None yet

3 participants