Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#6800 closed defect (fixed)

BUG: exclude darwintracelib1.0 on non-darwin operating systems

Reported by: cssdev@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 1.0
Keywords: Cc: pguyot (Paul Guyot)
Port:

Description (last modified by jmpalacios (Juan Manuel Palacios))

Because darwintrace is very specific to darwin, consider excluding it from the build process in order to build on non-darwin operating systems such as FreeBSD. Attempting to compile on FreeBSD 5.4 using the DarwinPorts-1.2 tarball results in the following error:

$ uname -a
FreeBSD thoth 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May  8 10:21:06 UTC 2005     root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
$ ./configure --prefix=/home/dp --mandir=/home/dp/share/man --with-curlprefix=/usr/local --with-tcl=/usr/local/lib/tcl8.4 --with-tclinclude=/usr/local/include/tcl8.4/
[ ... ]
$ gmake
[ ... ]
gcc -c -DUSE_TCL_STUBS -W -Wall -pedantic -g -O -DHAVE_CONFIG_H -I.. -I.  -I"/usr/local/include/tcl8.4/" -I/usr/local/include -DDARWINTRACE_LOG_CREATE -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DHAVE_READDIR_R=1 -DHAVE_THREE_ARG_READDIR_R=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1  -fPIC darwintrace.c -o darwintrace.o
darwintrace.c:34:25: crt_externs.h: No such file or directory
darwintrace.c: In function `log_op':
darwintrace.c:94: error: `F_GETPATH' undeclared (first use in this function)
darwintrace.c:94: error: (Each undeclared identifier is reported only once
darwintrace.c:94: error: for each function it appears in.)
gmake[2]: *** [darwintrace.o] Error 1
gmake[2]: Leaving directory `/usr/home/css/DarwinPorts-1.2/src/darwintracelib1.0'
gmake[1]: *** [all] Error 1
gmake[1]: Leaving directory `/usr/home/css/DarwinPorts-1.2/src'
gmake: *** [all] Error 1

Perhaps the base configure script could only build darwintracelib for darwin. It looks like porttrace.tcl won't do anything on non-darwin operating systems anyway. After a little poking around, I modified the configure script to only build darwintracelib1.0 if it could find the crt_extensions.h header. This header should (?) only be available on darwin-based systems.

Attachments (1)

patches-exclude-darwintracelib.tar.gz (778 bytes) - added by cssdev@… 19 years ago.
Patches to exclude darwintracelib

Download all attachments as: .zip

Change History (10)

Changed 19 years ago by cssdev@…

Patches to exclude darwintracelib

comment:1 Changed 19 years ago by cssdev@…

op_sys: Mac OS X 10.0FreeBSD

Set OS for this bug to FreeBSD.

comment:2 Changed 19 years ago by jmpp@…

Cc: pguyot@… added

Cc'ing Paul here as he authored the trace feature in dp, he's surelly the best person to weight in and approve/deny this. One question though, why do you include readline stuff in your new "AC_CHECK_HEADERS" directive?

-jmpp

comment:3 Changed 19 years ago by cssdev@…

That was already in the existing one. That one line isn't changed by the patch. I modified AC_CHECK_HEADERS to remove crt_externs.h since it's checked for later when doing the darwintrace check.

comment:4 Changed 19 years ago by cssdev@…

blocked: 6804

comment:5 Changed 19 years ago by pguyot (Paul Guyot)

Sorry, I'm coming late. I don't understand the status of this bug and 6804 considering Landon's latest commits.

In other words, does this still happen with HEAD code or is it resolved?

comment:6 Changed 19 years ago by cssdev@…

This particular bug has not been resolved. Attempting to build darwintracelib on non-darwin systems causes build errors that terminate the build process. The attached patches simply build darwintracelib if configure finds a darwin-only header. This bug is a build-time error, so it's a precursor to the run-time error later reported as BUG #6804.

comment:7 Changed 19 years ago by pguyot (Paul Guyot)

Sorry, Chris, I was able to build and run port on Linux with latest HEAD. darwintracelib doesn't do much on this system, but compilation works. Of course, -t option doesn't work there.

port -t build fortune

can't read "trace_thread": no such variable Error: The following dependencies failed to build: libcompat Error: Status 1 encountered during processing.

I was able to compile darwinports on FreeBSD as well:

===> making all in src/darwintracelib1.0 gmake[2]: Entering directory `/usr/home/paul/temp/darwinports/base/src/darwintracelib1.0' gcc -c -DUSE_TCL_STUBS -I/home/paul/temp/include -W -Wall -pedantic -g -O -DHAVE_CONFIG_H -I.. -I. -I"/home/paul/temp/include" -I/usr/local/include -DDARWINTRACE_LOG_CREATE -DNO_VALUES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1 -fPIC darwintrace.c -o darwintrace.o In file included from darwintrace.c:45: /usr/include/stdlib.h:111: warning: ANSI C does not support `long long' /usr/include/stdlib.h:117: warning: ANSI C does not support `long long' darwintrace.c:72: warning: ANSI does not permit the keyword `inline' darwintrace.c: In function `log_op': darwintrace.c:144: warning: label `finish' defined but not used darwintrace.c:97: warning: unused parameter `fd' ld -Bshareable -x darwintrace.o -o darwintrace.so -L/home/paul/temp/lib -ltclstub8.4 -L/home/paul/temp/lib -L/usr/local/lib -lcurl -lssl -lcrypto -lreadline -lmd gmake[2]: Leaving directory `/usr/home/paul/temp/darwinports/base/src/darwintracelib1.0'

uname -a

FreeBSD amaterasu.continuity.cx 4.10-STABLE FreeBSD 4.10-STABLE #1: Sat Nov 6 11:15:27 PST 2004 root@…:/usr/obj/usr/src/sys/AMATERASU i386

comment:8 Changed 19 years ago by cssdev@…

Resolution: fixed
Status: newclosed

You're right. I wasn't using a clean checkout, so some extra stuff got in the way. It's working fine now! Using the autoheader #define in darwintrace.c resolved the build error.

comment:9 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Description: modified (diff)
Note: See TracTickets for help on using tickets.