Apache OpenOffice (AOO) Bugzilla – Issue 24142
FreeBSD support in ODK
Last modified: 2005-02-15 15:27:30 UTC
Fix odk/settings/settings.mk to add FreeBSD case.
Created attachment 12572 [details] draft of patch-odk+settings+settings.mk
maho: this is probably not enough, because: - I need to add -pthread to pavel@leda:~/OpenOffice.org1.1_SDK/examples/cpp/DocumentLoader> gcc -Wl -L../../../FREEBSDexample.out/lib -L../../../FreeBSD/lib -L/home/pavel/OpenOffice.org1.1.1/program -o ../../../FREEBSDexample.out/bin/DocumentLoader ../../../FREEBSDexample.out/obj/DocumentLoader/DocumentLoader.o -lcppuhelpergcc3 -lcppu -lsalhelpergcc3 -lsal -lstlport_gcc - setsdkenv_unix.in does not contain FreeBSD case, see odk/ setsdkenv_unix.in Otherwise SDK works perfectly. How do we solve PTHREAD issue? Something similar like in configure.in?
Created attachment 12715 [details] Add FreeBSD case to setsdk...
thanks pjanik, for thread safty, we need -pthread or -lc_r when linking. please see /usr/ports/Mk/bsd.port.mk .if ${OSVERSION} < 500016 PTHREAD_CFLAGS= -D_THREAD_SAFE PTHREAD_LIBS= -pthread .else PTHREAD_CFLAGS= -D_THREAD_SAFE PTHREAD_LIBS= -lc_r .endif we pass this when configureing: CONFIGURE_ENV= PTHREAD_CFLAGS=${PTHREAD_CFLAGS} \ PTHREAD_LIBS=${PTHREAD_LIBS}
So we should add those settings to patch-odk+settings+settings.mk. Will you do that?
Thanks pjanik, how are you? anyway I cannot commit by myself, so please do it...
Created attachment 12835 [details] support thread related flags for settings.mk
sorry i misunderstood. attached improved patch. thanks.
Thanks for updated patch, but please consider that SDK is used separately out of the solver - thus you muset define PTHREADS_* first: pavel@leda:~/OpenOffice.org1.1_SDK> grep -r PTHREAD_CFLAGS * pavel@leda:~/OpenOffice.org1.1_SDK>
Maho: are patches complete? I'd like to merge them in early 1.1.2 cws.
maho->pjanik No. in FreeBSD port, I manually replace using sed...
Please provide full patch. I currently do not have working FreeBSD machine to test.
pjanik: would you please give me some clue, how to pass pthread related flags (PTHREAD_CFLAGS) to odk/settings/settings.mk? in the frame work of ports, we hardcode these flags according to PTHREAD_FLAGS defined at /usr/ports/Mk/bsd.port.mk thank you very much
jsc: for you. I do not know how to solve this.
i would like to add an additonal section like the following in the settings.mk .if ${OSVERSION} < 500016 PTHREAD_CFLAGS= -D_THREAD_SAFE PTHREAD_LIBS= -pthread PTHREAD_LIBPATH= -L$(PTHREAD_HOME)/.... .else PTHREAD_CFLAGS= -D_THREAD_SAFE PTHREAD_LIBS= -lc_r PTHREAD_LIBPATH= -L$(PTHREAD_HOME)/.... .endif PTHREAD_HOME should be configured during the configure procedure of the SDK. So there are two open questions. - Which call is used to get the OSVERSION? - When i have the pthread home directory, in which sub directory can i find the necessary libraries?
accepted
it is not a good idea to add .if ${OSVERSION} < 500016 in settings.mk since PTHREAD related flags are given at configure. we have to maintain settings.mk as well, it makes situation a little bit complicated. o OSVERSION in /usr/ports/Mk/bsd.port.subdir.mk .if !defined(OSVERSION) .if exists(/sbin/sysctl) OSVERSION!= /sbin/sysctl -n kern.osreldate .else OSVERSION!= /usr/sbin/sysctl -n kern.osreldate .endif .endif o PTHREAD flags .if ${OSVERSION} < 500016 PTHREAD_CFLAGS?= -D_THREAD_SAFE PTHREAD_LIBS?= -pthread .elif ${OSVERSION} < 502102 PTHREAD_CFLAGS?= -D_THREAD_SAFE PTHREAD_LIBS?= -lc_r .else PTHREAD_CFLAGS?= PTHREAD_LIBS?= -lpthread .endif (so it is also double effort that this section exists at ${SRCROOT}/config_office/configure.in "FreeBSD") test_x=yes test_gtk=yes AC_MSG_CHECKING([the FreeBSD operating system release]) if test -n "$with_os_version"; then OSVERSION="$with_os_version" else OSVERSION=`/sbin/sysctl -n kern.osreldate` fi AC_MSG_RESULT([found OSVERSION=$OSVERSION]) PTHREAD_CFLAGS="-D_THREAD_SAFE" if test "$OSVERSION" -lt "500016"; then PTHREAD_LIBS="-pthread" elif test "$OSVERSION" -lt "502102"; then PTHREAD_LIBS="-lc_r" else PTHREAD_LIBS="-lpthread" fi ) o When i have the pthread home directory don't worry about -lpthread (/usr/lib) and -pthread (just a flag) -lc_r (/usr/lib)
I need this info in the SKD because the SDK env is completely independent from the normal office env. Does it mean that i don't need the pthread home directory and that i don't need a -L option?
> Does it mean that i don't need the pthread home directory and that i don't need a -L option? yes.
see man gcc -Ldir Add directory dir to the list of directories to be searched for -l
sorry, this is japanese style of yes/no. I mean we don't need -L option.
sorry, it was my mistake. Your answer was clear but my last comment was nonsense. I read and put my own comment in the wrong context ;-)
fixed on cws sdksample. I can't really check it because i haven't a FreeBSD machne. But i have integrated your patch and have checked the used conditions. So please test it if the cws is available in the master and let me know if everything works.
integrate patch
jsc: what does it mean? cws is nominated?
patch was confirmed on sdksample. I'll test it (some fixes might be needed, though) thank you very much
reopen. souce with cws_src680_sdksample doesn't work for FreeBSD. better patch is supplied against cws_src680_sdksample thanks
Created attachment 21702 [details] better FreeBSD support. actually working.
integrate patch -> fixed maho can you please verify this because i have no FreeBSD environment, thanks
jsc: Index: odk/settings/settings.mk =================================================================== RCS file: /cvs/api/odk/settings/settings.mk,v retrieving revision 1.9.14.17 diff -u -r1.9.14.17 settings.mk --- odk/settings/settings.mk 20 Jan 2005 08:20:31 -0000 1.9.14.17 +++ odk/settings/settings.mk 20 Jan 2005 08:39:25 -0000 @@ -477,9 +477,9 @@ # -O is necessary for inlining (see gcc documentation) ifeq "$(DEBUG)" "yes" -CC_FLAGS=-c -g -fpic -DPIC $(PTHREAD_CFLAGS) +CC_FLAGS=-c -g -fPIC -DPIC $(PTHREAD_CFLAGS) else -CC_FLAGS=-c -O -fpic -DPIC $(PTHREAD_CFLAGS) +CC_FLAGS=-c -O -fPIC -DPIC $(PTHREAD_CFLAGS) endif SDK_JAVA_INCLUDES = -I$(OO_SDK_JAVA_HOME)/include -I$(OO_SDK_JAVA_HOME)/include/freebsd this part is missing. please commit. thanks a lot.
reopen. still - if [ $OSVERSION -lt 500016] + if [ $OSVERSION -lt 500016 ] is not applied. thanks!
Created attachment 21779 [details] the place if ] is wrong. a white space is needed
opps, this is not reopened... reopend.
integrate patch -> fixed maho can you please verify again
set to verified, the patches are integrated and i got the ok for this fix per mail. We have two follow up task 41142 and 41147 which will be fixed independently
verified in cws sdksample thank you very much!
checked on master m78