AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
+AC_PROG_CXXCPP
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
CFLAGS="$CFLAGS -D_REENTRANT"
fi
AC_CHECK_HEADER(pthread.h)
-AM_CONDITIONAL(WITH_THREADS, test "x$with_threads" = "xyes")
dnl Used by JSBSim to conditionally compile in fgfs interface code
AC_DEFINE([FGFS], 1, [Define so that JSBSim compiles in 'library' mode])
if test "x$ac_cv_search_pthread_exit" = "x-lc_r"; then
CXXFLAGS="-pthread $CXXFLAGS"
CFLAGS="-pthread $CFLAGS"
+ LIBS="-lsgthreads $LIBS"
fi
fi
dnl CygWin under Windoze.
INCLUDES="$INCLUDES -I/usr/local/include/"
LIBS="$LIBS -L/usr/local/lib"
- AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal ] )
+ AC_SEARCH_LIBS(alGenBuffers, [ openal32 openal 'openal -ldsound -lwinmm' ] )
AC_SEARCH_LIBS(alutInit, [ openal32 ALut alut ] )
LIBS="$LIBS -lwinmm -ldsound -ldxguid -lole32"
openal_LIBS="$LIBS"
AC_CHECK_LIB(osgViewerd,osgViewerGetVersion)
AC_CHECK_LIB(osgSimd,osgSimGetVersion)
AC_CHECK_LIB(osgParticled,osgParticleGetVersion)
- LIBS="$LIBS -losgFXd"
+ LIBS="$LIBS -losgFXd $opengl_LIBS"
else
AC_CHECK_LIB(OpenThreads,OpenThreadsGetVersion)
AC_CHECK_LIB(osg,osgGetVersion)
AC_CHECK_LIB(osgViewer,osgViewerGetVersion)
AC_CHECK_LIB(osgSim,osgSimGetVersion)
AC_CHECK_LIB(osgParticle,osgParticleGetVersion)
- LIBS="$LIBS -losgFX"
+ LIBS="$LIBS -losgFX $opengl_LIBS"
fi
;;
esac
[AC_DEFINE([HAVE_CULLSETTINGS_CLEAR_MASK],1,[define if OSG has CullSettings::CLEAR_MASK])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
+
+# Special handling for static version of OSG
+if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_LIBRARY_STATIC" 2>/dev/null`" ; then
+ saved_LIBS="$LIBS"
+ LIBS=""
+ #***** Check image support (needed for static build) *****
+ AC_SEARCH_LIBS([jpeg_read_header], [jpeg], [CPPFLAGS="$CPPFLAGS -DOSG_JPEG_ENABLED"])
+ AC_SEARCH_LIBS([png_read_image], [png 'png -lz'], [CPPFLAGS="$CPPFLAGS -DOSG_PNG_ENABLED"])
+ AC_SEARCH_LIBS([TIFFOpen], [tiff], [CPPFLAGS="$CPPFLAGS -DOSG_TIFF_ENABLED"])
+ img_LIBS="$LIBS"
+ LIBS="$saved_LIBS"
+
+ if test "x$with_osg" != "x" ; then
+ osg_prefix="$with_osg"
+ else
+ osg_prefix="/usr"
+ fi
+ PKG_CHECK_EXISTS([openscenegraph], [osg_version="`$PKG_CONFIG --modversion openscenegraph 2>/dev/null`"])
+ LIBS="-L$osg_prefix/lib/osgPlugins-$osg_version -losgdb_bmp -losgdb_dds -losgdb_hdr -losgdb_pic -losgdb_pnm -losgdb_rgb -losgdb_tga \
+ -losgdb_3ds -losgdb_ac -losgdb_ive -losgdb_osg -losgdb_txf \
+ -losgVolume -losgTerrain $LIBS -losgUtil"
+
+ if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_JPEG_ENABLED" 2>/dev/null`" ; then
+ LIBS="$LIBS -losgdb_jpeg"
+ fi
+ if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_PNG_ENABLED" 2>/dev/null`" ; then
+ LIBS="$LIBS -losgdb_png"
+ fi
+ if test -n "`echo "$CPPFLAGS" "$CXXFLAGS" "$CFLAGS" | grep "\-DOSG_TIFF_ENABLED" 2>/dev/null`" ; then
+ LIBS="$LIBS -losgdb_tiff"
+ fi
+
+ LIBS="$LIBS $img_LIBS"
+fi
+
AC_LANG_POP
dnl Check for system installed zlib
extern void fgHiResDumpWrapper();
extern void fgHiResDump();
#endif
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
+#if defined( _WIN32 ) && !defined(__MINGW32__)
extern void printScreen();
#endif
extern void helpCb();
#include <Main/viewmgr.hxx>
#include <GUI/new_gui.hxx>
-#if defined( WIN32 ) && !defined( __CYGWIN__ ) && !defined(__MINGW32__)
+#ifdef _WIN32
+# include <shellapi.h>
+# if !defined(__MINGW32__)
# include <simgear/screen/win32-printer.h>
# include <simgear/screen/GlBitmaps.h>
-#endif
-#ifdef __MINGW32__
-#include <shellapi.h>
+# endif
#endif
#include "gui.h"
{"dumpHiResSnapShot", fgHiResDumpWrapper},
#endif
{"dumpSnapShot", fgDumpSnapShotWrapper},
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
+#if defined( _WIN32 ) && !defined(__MINGW32__)
{"printScreen", printScreen},
#endif
// Help
SGPath path( globals->get_fg_root() );
path.append( "Docs/index.html" );
-#if !defined(WIN32)
+#ifndef _WIN32
command = globals->get_browser();
string::size_type pos;
command += " &";
system( command.c_str() );
-#else // WIN32
+#else // _WIN32
// Look for favorite browser
char Dummy[1024], ExecName[1024], browserParameter[1024];
#endif // #if defined( TR_HIRES_SNAP)
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
+#if defined( _WIN32 ) && !defined(__MINGW32__)
void rotateView( double roll, double pitch, double yaw )
{
}
#endif
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
+#if defined( _WIN32 ) && !defined(__MINGW32__)
// win32 print screen function
void printScreen () {
int mouse = fgGetMouseCursor();
fgSetMouseCursor(mouse);
}
-#endif // #ifdef WIN32
+#endif // #ifdef _WIN32
void fgDumpSnapShotWrapper () {
}
#endif // TR_HIRES_SNAP
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
+#if defined( _WIN32 ) && !defined(__MINGW32__)
extern void printScreen ();
static bool
do_print_dialog (const SGPropertyNode * arg)
#if defined(TR_HIRES_SNAP)
{ "old-hires-snapshot-dialog", do_hires_snapshot_dialog },
#endif
-#if defined( WIN32 ) && !defined( __CYGWIN__) && !defined(__MINGW32__)
+#if defined( _WIN32 ) && !defined(__MINGW32__)
{ "old-print-dialog", do_print_dialog },
#endif
{ "old-help-dialog", do_help_dialog },
// Alterations: Copyright C. Hotchkiss 1996
//
// $Log$
-// Revision 1.1 2002/09/10 01:14:04 curt
-// Initial revision
+// Revision 1.2 2010/01/23 22:26:52 fredb
+// MINGW patch from Benoît Laniel
+//
+// Revision 1.1.1.1 2002-09-10 01:14:04 curt
+// Initial revision of FlightGear-0.9.0
//
// Revision 1.2 2001/05/16 21:27:59 curt
// Added David Megginson's patch for reconfigurable keyboard bindings.
typedef unsigned long ULONG ; // 32-bit unsigned data
typedef unsigned short UWORD; // Unsigned 16 bit quantity (WIN=SHORT)
-#if !defined(WIN32)
+#ifndef _WIN32
typedef signed short WORD; // Signed 16 bit quantity
#endif
typedef BYTE UBYTE; // Used in some 3rd party code
-#ifndef WIN32
+#ifndef _WIN32
typedef int BOOLEAN; //
#endif
fgjs_SOURCES = fgjs.cxx jsinput.cxx jsinput.h jssuper.cxx jssuper.h
fgjs_LDADD = $(js_demo_PLIB_LIBS) $(base_LIBS) $(joystick_LIBS) \
- -lsgprops -lsgmisc -lsgio -lsgdebug -lsgstructure -lsgxml -lz
+ -lsgprops -lsgmisc -lsgio -lsgdebug -lsgstructure -lsgxml -lz $(network_LIBS)
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(top_srcdir)/src/Main \
$(libInput_Event_INCLUDES)
#include <simgear/compiler.h>
-#if defined( _MSC_VER ) || defined( __MINGW32__ )
-# include <Winsock2.h>
+#ifdef _WIN32
+# include <winsock2.h>
#endif
#include <math.h>
// find fg-root any other way.
if ( root.empty() ) {
#if defined( __CYGWIN__ )
- root = "/FlightGear";
-#elif defined( WIN32 )
- root = "\\FlightGear";
+ root = "../data";
+#elif defined( _WIN32 )
+ root = "..\\data";
#elif defined(OSX_BUNDLE)
/* the following code looks for the base package directly inside
the application bundle. This can be changed fairly easily by
/* give other processes a chance */
-#ifdef WIN32
+#ifdef _WIN32
Sleep ( 1 ) ;
#elif defined(sgi)
sginap ( 1 ) ;
SP_FDM_LIBS =
endif
-if WITH_THREADS
-THREAD_LIBS = -lsgthreads $(thread_LIBS)
-else
-THREAD_LIBS =
-endif
-
if WITH_EVENTINPUT
EVENT_LIBS = $(eventinput_LIBS)
else
-lsgserial -lsgstructure -lsgenvironment \
$(fgfs_PLIB_LIBS) \
$(OSG_LIBS) \
- $(THREAD_LIBS) \
+ $(thread_LIBS) \
$(network_LIBS) \
-lz \
$(opengl_LIBS) \
}
initFPE();
#endif
-#if !defined( _MSC_VER ) && !defined( __MINGW32__ )
+#ifndef _WIN32
signal(SIGPIPE, SIG_IGN);
#endif
fgSetBool("/sim/signals/exit", true);
if (fgGetBool("/sim/startup/save-on-exit")) {
-#ifdef _MSC_VER
+#ifdef _WIN32
char* envp = ::getenv( "APPDATA" );
if ( envp != NULL ) {
SGPath config( envp );
#if defined( unix ) || defined( __CYGWIN__ )
# include <unistd.h> // for gethostname()
#endif
-#if defined( _MSC_VER) || defined(__MINGW32__)
+#ifdef _WIN32
# include <direct.h> // for getcwd()
# define getcwd _getcwd
# include <io.h> // isatty()
# define isatty _isatty
-# include "Winsock2.h" // for gethostname()
+# include "winsock2.h" // for gethostname()
#endif
// work around a stdc++ lib bug in some versions of linux, but doesn't
// find fg-root any other way.
if ( root.empty() ) {
#if defined( __CYGWIN__ )
- root = "/FlightGear";
-#elif defined( WIN32 )
- root = "\\FlightGear";
+ root = "../data";
+#elif defined( _WIN32 )
+ root = "..\\data";
#elif defined(__APPLE__)
/*
The following code looks for the base package inside the application
}
SGPropertyNode autosave;
-#if defined( _MSC_VER ) || defined( __MINGW32__ )
+#ifdef _WIN32
char *envp = ::getenv( "APPDATA" );
if (envp != NULL ) {
SGPath config( envp );
#include "WindowBuilder.hxx"
#include "WindowSystemAdapter.hxx"
+// Static linking of OSG needs special macros
+#ifdef OSG_LIBRARY_STATIC
+#include <osgDB/Registry>
+USE_GRAPHICSWINDOW();
+// Image formats
+USE_OSGPLUGIN(bmp);
+USE_OSGPLUGIN(dds);
+USE_OSGPLUGIN(hdr);
+USE_OSGPLUGIN(pic);
+USE_OSGPLUGIN(pnm);
+USE_OSGPLUGIN(rgb);
+USE_OSGPLUGIN(tga);
+#ifdef OSG_JPEG_ENABLED
+ USE_OSGPLUGIN(jpeg);
+#endif
+#ifdef OSG_PNG_ENABLED
+ USE_OSGPLUGIN(png);
+#endif
+#ifdef OSG_TIFF_ENABLED
+ USE_OSGPLUGIN(tiff);
+#endif
+// Model formats
+USE_OSGPLUGIN(3ds);
+USE_OSGPLUGIN(ac);
+USE_OSGPLUGIN(ive);
+USE_OSGPLUGIN(osg);
+USE_OSGPLUGIN(txf);
+#endif
+
// fg_os implementation using OpenSceneGraph's osgViewer::Viewer class
// to create the graphics window and run the event/update/render loop.
# if defined( __CYGWIN__ )
string command = "start /m `cygpath -w " + mp3file.str() + "`";
-# elif defined( WIN32 )
+# elif defined( _WIN32 )
string command = "start /m " + mp3file.str();
# else
string command = "mpg123 " + mp3file.str() + "> /dev/null 2>&1";
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h> //snprintf
-#if defined( _MSC_VER ) || defined(__MINGW32__)
+#ifdef _WIN32
# include <io.h> //lseek, read, write
#endif
ATCRelease( lock_fd );
-#if defined( _MSC_VER )
- ulMilliSecondSleep(33);
-#elif defined (WIN32) && !defined(__CYGWIN__)
+#ifdef _WIN32
Sleep (33);
#else
usleep(33);
#if defined( _MSC_VER )
# include <windows.h>
#elif defined( __MINGW32__ )
-# include <Winsock2.h>
+# include <winsock2.h>
#else
# include <netinet/in.h> // htonl() ntohl()
#endif
#if defined( _MSC_VER )
# include <windows.h>
#elif defined( __MINGW32__ )
-# include <Winsock2.h>
+# include <winsock2.h>
#else
# include <netinet/in.h> // htonl() ntohl()
#endif
#include "native_gui.hxx"
// FreeBSD works better with this included last ... (?)
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined( _MSC_VER )
# include <windows.h>
+#elif defined( __MINGW32__ )
+# include <winsock2.h>
#else
# include <netinet/in.h> // htonl() ntohl()
#endif
// Return UNIX epoch time in seconds.
static naRef f_systime(naContext c, naRef me, int argc, naRef* args)
{
-#ifdef WIN32
+#ifdef _WIN32
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
double t = (4294967296.0 * ft.dwHighDateTime + ft.dwLowDateTime);
# include <config.h>
#endif
-#if !defined( _MSC_VER ) && !defined( __MINGW32__ )
+#ifndef _WIN32
# include <strings.h> // for bzero()
#else
# define bzero(a,b) memset(a,0,b)
#include <windows.h>
#endif
+#ifdef __MINGW32__
+#include <time.h>
+#include <unistd.h>
+#endif
#include <stdlib.h> // atoi() atof() abs() system()
main.cxx \
untarka.c untarka.h
-fgadmin_LDADD = -lsgmisc -lplibul -lz
+fgadmin_LDADD = -lsgmisc -lsgdebug -lplibul -lz
fgadmin.cxx fgadmin.h: fgadmin.fl
fluid -c fgadmin.fl
#include <set>
#include <sys/stat.h>
-#ifdef _MSC_VER
+#ifdef _WIN32
# include <direct.h>
#endif
*/
#undef DOSISH
-#if defined(WIN32) || defined(__MINGW32__) || defined(__CYGWIN__) || MSC_VER > 1000
+#ifdef WIN32
# include <windows.h>
# define DOSISH 1
# undef __STRICT_ANSI__
fgviewer_LDADD = \
-lsgtgdb -lsgmaterial -lsgmodel -lsgbvh -lsgutil -lsgio -lsgbucket \
-lsgmath -lsgprops -lsgdebug -lsgmisc -lsgxml -lsgstructure \
- $(fgviewer_PLIB_LIBS) $(OSG_LIBS) $(opengl_LIBS) $(THREAD_LIBS) -lz
+ $(fgviewer_PLIB_LIBS) $(OSG_LIBS) $(opengl_LIBS) $(thread_LIBS) -lz
/* give other processes a chance */
-#ifdef WIN32
+#ifdef _WIN32
Sleep ( 1 ) ;
#elif defined(sgi)
sginap ( 1 ) ;