Bug 190865 - [patch] print/cups-base build fails if both AVAHI AND MDNSRESPONDER options are disabled
Summary: [patch] print/cups-base build fails if both AVAHI AND MDNSRESPONDER options a...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Jason E. Hale
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-10 06:34 UTC by Don Lewis
Modified: 2014-07-04 23:12 UTC (History)
1 user (show)

See Also:


Attachments
print/cups-base/Makefile patch (524 bytes, patch)
2014-06-10 06:34 UTC, Don Lewis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Lewis freebsd_committer freebsd_triage 2014-06-10 06:34:55 UTC
Created attachment 143603 [details]
print/cups-base/Makefile patch

FreeBSD scratch.catspoiler.org 8.4-STABLE FreeBSD 8.4-STABLE #80 r266818M: Thu May 29 02:41:55 PDT 2014     dl@scratch.catspoiler.org:/usr/obj/usr/src/sys/GENERICDDB  i386

cups-base-1.7.2_1

cups-base/Makefile r356868

If "make config" is run and both the AVAHI and MDNSRESPONDER options are disabled, the build notices that it should not try to link against -lavahi*. Unfortunately the source code attempts to call avahi routines, which causes the build to fail with linker errors.

Linking ippserver...
cc -L../cgi-bin -L../cups -L../filter -L../ppdc -L../scheduler -L/usr/local/lib -Wl,-rpath,/usr/lib:/usr/local/lib -L/usr/lib -Wl,-R/usr/local/lib  -fPIE -pie -Wall -Wno-format-y2k -Wunused -fPIC -Os -g -fstack-protector -o ippserver ippserver.o  ../cups/libcups.a \
	 -lssl -lcrypto  -pthread -lm -lcrypt -lssp_nonshared -liconv  -lz -lz
../cups/libcups.a(http-support.o)(.text+0x6a9): In function `http_client_cb':
/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1871: undefined reference to `avahi_simple_poll_quit'
../cups/libcups.a(http-support.o)(.text+0x12b7): In function `http_resolve_cb':
/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:2266: undefined reference to `avahi_service_resolver_free'
../cups/libcups.a(http-support.o)(.text+0x12c7):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:2267: undefined reference to `avahi_simple_poll_quit'
../cups/libcups.a(http-support.o)(.text+0x1337):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:2288: undefined reference to `avahi_string_list_find'
../cups/libcups.a(http-support.o)(.text+0x1365):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:2290: undefined reference to `avahi_string_list_get_pair'
../cups/libcups.a(http-support.o)(.text+0x1422):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:2379: undefined reference to `avahi_simple_poll_quit'
../cups/libcups.a(http-support.o)(.text+0x1659):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:2275: undefined reference to `avahi_string_list_find'
../cups/libcups.a(http-support.o)(.text+0x2225): In function `_httpResolveURI':
/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1739: undefined reference to `avahi_simple_poll_new'
../cups/libcups.a(http-support.o)(.text+0x2259):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1741: undefined reference to `avahi_simple_poll_set_func'
../cups/libcups.a(http-support.o)(.text+0x2267):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1743: undefined reference to `avahi_simple_poll_get'
../cups/libcups.a(http-support.o)(.text+0x229b):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1743: undefined reference to `avahi_client_new'
../cups/libcups.a(http-support.o)(.text+0x230f):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1747: undefined reference to `avahi_service_resolver_new'
../cups/libcups.a(http-support.o)(.text+0x2348):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1758: undefined reference to `avahi_simple_poll_iterate'
../cups/libcups.a(http-support.o)(.text+0x23db):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1768: undefined reference to `avahi_service_resolver_new'
../cups/libcups.a(http-support.o)(.text+0x2427):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1776: undefined reference to `avahi_simple_poll_iterate'
../cups/libcups.a(http-support.o)(.text+0x24fb):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1800: undefined reference to `avahi_client_free'
../cups/libcups.a(http-support.o)(.text+0x2509):/usr/ports/print/cups-client/work/cups-1.7.2/cups/http-support.c:1803: undefined reference to `avahi_simple_poll_free'
gmake[1]: *** [ippserver] Error 1
gmake[1]: *** Waiting for unfinished jobs....
gmake[1]: Leaving directory `/usr/ports/print/cups-base/work/cups-1.7.2/test'
gmake: *** [all] Error 1
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop in /usr/ports/print/cups-base.
*** Error code 1

Stop in /usr/ports/print/cups-base.


The attached patch attempts to avoid this user error by grouping the AVAHI and MDNSRESPONDER options in an OPTIONS_SINGLE group to enforce the selection of exactly one of these options.
Comment 1 Jason E. Hale freebsd_committer freebsd_triage 2014-07-02 13:44:29 UTC
This should be fixed in version 1.7.3.  Can you confirm?
Comment 2 Don Lewis freebsd_committer freebsd_triage 2014-07-04 23:12:46 UTC
(In reply to Jason E. Hale from comment #1)
> This should be fixed in version 1.7.3.  Can you confirm?

Yes, this appears to be fixed.  I was able to build the port with either the
AVAHI or MDNSRESPONDER option, as well as with both options disabled.  The Makefile does not permit both options to be selected at the same time.

Thanks!