[Flightgear-devel] FreeBSD autoconf fixes
The attached diffs (relative to todays CVS) detect pthreads on FreeBSD. Even when the app itself doesn't need threading, any app linked against Mesa must by compile with g++ -pthread (otherwise, gssInit called without valid rendering context rears its ugly but helpful head). The checks only kick in when pthread.h is present but pthread_exit can't be found. This seems to me to be the more generic way of testing it in autoconf. Needless to say, testing to see if ${host} matches *freebsd* would be a quicker way to stuff -pthread into C{,XX}FLAGS :-) Todays CVS snapshot of FlightGear crashes in the new XML menu stuff; haven't investigated yet where menubar.xml is supposed to come from (just joined the list). That said, with the attached patches it pops up the splash screen, whereas without it, it would die early on. For what it's worth, the flightgear patch also applies cleanly to 0.9.1-release and makes it work on FreeBSD. Cheers, -- Bert -- Bert Driehuis -- [EMAIL PROTECTED] -- +31-20-3116119 If the only tool you've got is an axe, every problem looks like fun! Index: configure.ac === RCS file: /var/cvs/SimGear-0.3/SimGear/configure.ac,v retrieving revision 1.15 diff -c -r1.15 configure.ac *** configure.ac30 Dec 2002 21:33:56 - 1.15 --- configure.ac19 Jan 2003 18:19:47 - *** *** 147,152 --- 147,169 CXXFLAGS=$CXXFLAGS -D_REENTRANT CFLAGS=$CFLAGS -D_REENTRANT fi + if test x$ac_cv_lib_pthread_pthread_exit != xyes -a x$ac_cv_header_pthread_h = +xyes; then + dnl See if we need -pthread instead of -lpthread + save_CXXFLAGS=$CXXFLAGS + save_CFLAGS=$FLAGS + CXXFLAGS=-pthread $CXXFLAGS + CFLAGS=-pthread $FLAGS + save_LIBS=$LIBS + AC_CHECK_LIB(c_r, pthread_exit) + if test x$ac_cv_lib_c_r_pthread_exit != xyes; then + CXXFLAGS=$save_CXXFLAGS + CFLAGS=$save_CFLAGS + else + dnl This is cheating a bit. pthread_exit comes with using -pthread, not +-lpthread + ac_cv_lib_pthread_pthread_exit=yes + fi + LIBS=$save_LIBS + fi AM_CONDITIONAL(HAVE_THREADS, test x$ac_cv_lib_pthread_pthread_exit = xyes -a x$ac_cv_header_pthread_h = xyes) AC_CHECK_LIB(socket, socket) Index: configure.ac === RCS file: /var/cvs/FlightGear-0.9/FlightGear/configure.ac,v retrieving revision 1.22 diff -c -r1.22 configure.ac *** configure.ac18 Jan 2003 17:36:59 - 1.22 --- configure.ac19 Jan 2003 18:27:35 - *** *** 98,105 AC_DEFINE([ENABLE_THREADS], 1, [Define to enable threaded tile paging]) CXXFLAGS=$CXXFLAGS -D_REENTRANT CFLAGS=$CFLAGS -D_REENTRANT - AC_CHECK_HEADER(pthread.h) fi AM_CONDITIONAL(WITH_THREADS, test x$with_threads = xyes) # specify the plib location --- 98,105 AC_DEFINE([ENABLE_THREADS], 1, [Define to enable threaded tile paging]) CXXFLAGS=$CXXFLAGS -D_REENTRANT CFLAGS=$CFLAGS -D_REENTRANT fi + AC_CHECK_HEADER(pthread.h) AM_CONDITIONAL(WITH_THREADS, test x$with_threads = xyes) # specify the plib location *** *** 204,209 --- 204,223 dnl Thread related checks AC_CHECK_LIB(pthread, pthread_exit) + if test x$ac_cv_lib_pthread_pthread_exit != xyes -a x$ac_cv_header_pthread_h = +xyes; then + dnl See if we need -pthread instead of -lpthread + save_CXXFLAGS=$CXXFLAGS + save_CFLAGS=$FLAGS + CXXFLAGS=-pthread $CXXFLAGS + CFLAGS=-pthread $FLAGS + save_LIBS=$LIBS + AC_CHECK_LIB(c_r, pthread_exit) + if test x$ac_cv_lib_c_r_pthread_exit != xyes; then + CXXFLAGS=$save_CXXFLAGS + CFLAGS=$save_CFLAGS + fi + LIBS=$save_LIBS + fi AC_CHECK_LIB(socket, socket) dnl check for glut location
Re: [Flightgear-devel] FreeBSD autoconf fixes
Follow up to self: Todays CVS snapshot of FlightGear crashes in the new XML menu stuff; haven't investigated yet where menubar.xml is supposed to come from (just joined the list). Hm. It helps to not just download, but also install, the updated fgfs_base :-) So, I can report the current CVS snapshot works on FreeBSD 4.7 with the autoconf patches in my previous post. Cheers, -- Bert -- Bert Driehuis -- [EMAIL PROTECTED] -- +31-20-3116119 If the only tool you've got is an axe, every problem looks like fun! ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] FreeBSD autoconf fixes
Bert Driehuis writes: So, I can report the current CVS snapshot works on FreeBSD 4.7 with the autoconf patches in my previous post. Excellent. Which version of G++ did you use? All the best, David -- David Megginson, [EMAIL PROTECTED], http://www.megginson.com/ ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] FreeBSD autoconf fixes
On Sun, 19 Jan 2003, David Megginson wrote: So, I can report the current CVS snapshot works on FreeBSD 4.7 with the autoconf patches in my previous post. Excellent. Which version of G++ did you use? Sorry for not mentioning that -- I specifically checked it with the intent of sharing it in the light of the discussion w.r.t. versions going on. It's the 2.95.4 that comes with FreeBSD 4.7. Cheers, -- Bert -- Bert Driehuis -- [EMAIL PROTECTED] -- +31-20-3116119 If the only tool you've got is an axe, every problem looks like fun! ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] FreeBSD autoconf fixes
Bert Driehuis writes: On Sun, 19 Jan 2003, David Megginson wrote: So, I can report the current CVS snapshot works on FreeBSD 4.7 with the autoconf patches in my previous post. Excellent. Which version of G++ did you use? Sorry for not mentioning that -- I specifically checked it with the intent of sharing it in the light of the discussion w.r.t. versions going on. It's the 2.95.4 that comes with FreeBSD 4.7. David, What compiler options do you build with? I usually override the default and build with -Wall -O2, I'll do a rebuild with default options and see if that helps. Often building with -g (the default) masks buffer overruns because there's a better chance when you overrun your buffer you copy over debugging infrastructure, and not actually code/data. Regards, Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities[EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] FreeBSD autoconf fixes
Curtis L. Olson writes: What compiler options do you build with? I usually override the default and build with -Wall -O2, I'll do a rebuild with default options and see if that helps. With 3.2, I usually build with -g -O1 -finline-limit=6 -finline-functions For the 2.95 test, however, I just used vanilla ./configure and didn't mess with the options at all. All the best, David -- David Megginson, [EMAIL PROTECTED], http://www.megginson.com/ ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] FreeBSD autoconf fixes
David Megginson writes: Curtis L. Olson writes: What compiler options do you build with? I usually override the default and build with -Wall -O2, I'll do a rebuild with default options and see if that helps. With 3.2, I usually build with -g -O1 -finline-limit=6 -finline-functions For the 2.95 test, however, I just used vanilla ./configure and didn't mess with the options at all. For what it's worth, the Apply button seems to work (and triggers one fire() call, but the OK button triggers 2 fire() calls and then the size of the vector get's corrupted. The Cancel button also causes a crash. It makes 1 fire() call, corrupts the vector and then segfaults. Could there be something related to deleting the dialog box that is corrupting memory? Regards, Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities[EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] FreeBSD autoconf fixes
Curtis L. Olson writes: For what it's worth, the Apply button seems to work (and triggers one fire() call, but the OK button triggers 2 fire() calls and then the size of the vector get's corrupted. The Cancel button also causes a crash. It makes 1 fire() call, corrupts the vector and then segfaults. Could there be something related to deleting the dialog box that is corrupting memory? I still haven't figured out the code, but is one of the call backs deleting the dialog box? Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities[EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] FreeBSD autoconf fixes
Curtis L. Olson writes: I still haven't figured out the code, but is one of the call backs deleting the dialog box? That might be it -- try dropping this in instead: /** * Action callback. */ static void action_callback (puObject * object) { GUIInfo * info = (GUIInfo *)object-getUserData(); NewGUI * gui = (NewGUI *)globals-get_subsystem(gui); gui-setCurrentWidget(info-widget); int nBindings = info-bindings.size(); for (int i = 0; i nBindings; i++) { info-bindings[i]-fire(); if (gui-getCurrentWidget() == 0) break; } gui-setCurrentWidget(0); } All the best, David -- David Megginson, [EMAIL PROTECTED], http://www.megginson.com/ ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel