Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8184 closed defect (fixed)

FreeBSD build issues

Reported by: Raymond Wagner Owned by: Janne Grunau
Priority: minor Milestone: 0.23
Component: Ports - *BSD Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Compilation of libmythfreemheg under FreeBSD fails due to a lack of ftime() or gettimeofday(). Tests for both failed in configure because of the addition of '-D_POSIX_C_SOURCE=200112' in CFLAGS.

BEGIN /tmp/mythtv_conf.eyYs8ZMk.c
    1
    2   #include <sys/time.h>
    3   int main(int argc, char **argv){
    4       return (long) gettimeofday;
    5   }
END /tmp/mythtv_conf.eyYs8ZMk.c
gcc -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -std=c99 -fPIC -I/usr/local/include -fomit-frame-pointer -c -o /tmp/mythtv_conf.IuHG9kdP.o /tmp/mythtv_conf.eyYs8ZMk.c
/tmp/mythtv_conf.eyYs8ZMk.c: In function 'main':
/tmp/mythtv_conf.eyYs8ZMk.c:4: error: 'gettimeofday' undeclared (first use in this function)
/tmp/mythtv_conf.eyYs8ZMk.c:4: error: (Each undeclared identifier is reported only once
/tmp/mythtv_conf.eyYs8ZMk.c:4: error: for each function it appears in.)

Removal of that define allows the test to run successfully, which in turn allows the library to compile successfully.

BEGIN /tmp/mythtv_conf.54M5QoG7.c
    1
    2   #include <sys/time.h>
    3   int main(int argc, char **argv){
    4       return (long) gettimeofday;
    5   }
END /tmp/mythtv_conf.54M5QoG7.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -std=c99 -fPIC -I/usr/local/include -fomit-frame-pointer -c -o /tmp/mythtv_conf.2mmRB4kP.o /tmp/mythtv_conf.54M5QoG7.c
gcc -L/usr/local/lib -o /tmp/mythtv_conf.f4MwxabZ /tmp/mythtv_conf.2mmRB4kP.o

The fix already exists in configure on line 2856, but it is not being applied to the parameters given to the compile tests, causing the test to fail.

Change History (5)

comment:1 Changed 10 years ago by Raymond Wagner

Summary: FreeBSD specific fixes not being applied during configure testsFreeBSD build issues

FreeBSD does not include a libdl, and all functionality is provided by libc. [23641] forces MythTV to be linked against a non-existent libdl and breaks compiling when XvMC is enabled.

comment:2 Changed 10 years ago by Janne Grunau

Milestone: unknown0.23
Owner: changed from Isaac Richards to Janne Grunau
Status: newaccepted

comment:3 Changed 10 years ago by Janne Grunau

(In [23856]) configure: FreeBSD strip POSIX_C_SOURCE from CPPFLAGS

fixes a regression caused by the ffmpeg sync in [23525]. Refs #7233, Refs #8184

comment:4 Changed 10 years ago by Janne Grunau

Resolution: fixed
Status: acceptedclosed

(In [23857]) configure: only add -ldl to XVMC_LIBS if it's required for dlopen

FreeBSD implements dlopen in its libc and has no libdl. reuse the existing check for ldl. Restores compiling on FreeBSD with XvMC enabled after [23641]. Fixes #8184

comment:5 Changed 10 years ago by Janne Grunau

(In [23858]) Backports [23856] and [23857] from trunk

FreeBSD related configure changes. Refs #8184

Note: See TracTickets for help on using tickets.