From: <mk...@us...> - 2002-12-15 00:48:48
|
Update of /cvsroot/csp/APPLICATIONS/CSPFlightSim In directory sc8-pr-cvs1:/tmp/cvs-serv1608 Added Files: Makefile.am README.linux acinclude.m4 config.h.in configure.in Log Message: very minor fixes initial autoconf/automake support for linux --- NEW FILE: Makefile.am --- # WARNING: # I have almost no prior experience with GNU autoconf/automake and this # is very much a work in progress. The original Makefile for Linux can # be found in Source/Makefile.orig. If you have trouble with building # CSPFlightSim with this configure script or autmake files, and know # how to fix them, please do so and commit the changes to CVS. Thanks! # # -OS # Edit these lines to match your system configuration export OSG_PREFIX=/usr/local export DEMETER_PREFIX=@abs_srcdir@/../../THIRDPARTYLIBS/demeter AUTOMAKE_OPTIONS = foreign XTRA_DIST = SUBDIRS = Source --- NEW FILE: README.linux --- CSPFlightSim, Linux README December-2002 ======================================================================= To bulid on Linux, you currently need (at least) the following: gcc 2.95 or newer autoconf / automake And these (or newer) third partly libraries: OSG 0.9.2 (including GLUT, Text, Util, and Particle) SDL 1.2.5 SDL_Console SDL_Image GDAL 1.1.7 ======================================================================= To actually run CSPFlightSim, you'll also need terrain and data files. These can be found at http://sourceforge.net/projects/csp The exact installation path of the data files is still in some flux. This file will be updates as soon as the paths are standardized. ======================================================================= To build, do the following: $ aclocal; autoconf; automake $ ./configure $ make $ ln -s Source/CSPFlightSim . The build system is undergoing considerable changes right now (automake/autoconf support is brand-new), so expect some problems. If you overcome any problems related to the build scripts, please post the changes to the CSP developers forum or just commit the revisions to CVS. Thanks! ======================================================================= If you need help, check the CSP wiki or post a message to the develepers forum: http://csp.sourceforge.net/wiki/CurrentBuildDependencies http://csp.sourceforge.net/forum Good luck! --- NEW FILE: acinclude.m4 --- dnl WARNING: dnl I have almost no prior experience with GNU autoconf/automake and this dnl is very much a work in progress. The original Makefile for Linux can dnl be found in Source/Makefile.orig. If you have trouble with building dnl CSPFlightSim with this configure script or autmake files, and know dnl how to fix them, please do so and commit the changes to CVS. Thanks! dnl dnl -OS m4_pushdef([UP], m4_translit([$1], [a-z], [A-Z]))dnl m4_pushdef([DOWN], m4_translit([$1], [A-Z], [a-z]))dnl m4_pushdef([LDOWN], ac_path_lib_[]DOWN)dnl m4_pushdef([CACHE], ac_cv_path_lib_[]DOWN)dnl m4_pushdef([ERRORLOG], error.[]DOWN[]test)dnl AC_DEFUN(CSP_SDL_ERROR, [ AC_MSG_ERROR([ Simple DirectMedia Layer version >= $lib_min_version must be installed. SDL can be downloaded from http://www.libsdl.org/ If you already have a sufficiently new version of SDL installed, this error probably means that the wrong copy of the sdl-config shell script is being found. ]) ]) AC_DEFUN(CSP_LIB_ERROR, [ AC_MSG_ERROR([ $1 version >= $2 must be installed. This library can be downloaded from $3. If you already have a sufficiently new version of this library installed, this error probably means that the wrong copy of the $4 shell script is being found. ]) ]) dnl Generic version check for libraries using 'xxx-config' scripts AC_DEFUN(CSP_LIB_CONFIG, [ lib_min_version=$3 lib=yes AC_PATH_PROG($1[]_CONFIG, $2-config, no) AC_MSG_CHECKING(for $1 >= $lib_min_version) no_lib="" if test "$$1[]_CONFIG" = "no"; then no_lib=yes else lib_version=`$$1[]_CONFIG --version` lib_major=`echo $lib_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` lib_minor=`echo $lib_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` lib_micro=`echo $lib_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` lib_major_min=`echo $lib_min_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` lib_minor_min=`echo $lib_min_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` lib_micro_min=`echo $lib_min_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` lib_version_proper=`expr \ $lib_major \> $lib_major_min \| \ $lib_major \= $lib_major_min \& \ $lib_minor \> $lib_minor_min \| \ $lib_major \= $lib_major_min \& \ $lib_minor \= $lib_minor_min \& \ $lib_micro \>= $lib_micro_min ` if test "$lib_version_proper" = "1" ; then AC_MSG_RESULT(yes) $1[]_FLAGS=`$$1[]_CONFIG --cflags` $1[]_LIBS=`$$1[]_CONFIG --libs` else AC_MSG_RESULT(no) no_lib=yes fi fi if test "$no_lib" = "yes"; then CSP_LIB_ERROR($4,$3,$5,$1[]_CONFIG) fi AC_SUBST($1[]_FLAGS) AC_SUBST($1[]_LIBS) LIBS="$$1[]_LIBS $LIBS" ]) AC_DEFUN(CSP_OSG_CONFIG, [ AC_MSG_CHECKING(for $1 >= $2) LIBS="-l$1 $LIBS" AC_TRY_RUN([ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ const char *$1GetVersion (); int main() { const char *v = $1GetVersion(); const char *need = "$2"; int major, minor, micro; int need_major, need_minor, need_micro; int n; n = sscanf(need, "%d.%d.%d", &need_major, &need_minor, &need_micro); if (n<3) exit(1); n = sscanf(v, "%d.%d.%d", &major, &minor, µ); if (n<3) exit(1); if (major < need_major) exit(1); if (major > need_major) exit(0); if (minor < need_minor) exit(1); if (minor > need_minor) exit(0); if (micro < need_micro) exit(1); exit(0); return 0; } ], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) AC_MSG_ERROR([ $3 version >= $1 needs to be installed. OSG can be downloaded from http://www.openscenegraph.org/ ]) ], []) ]) --- NEW FILE: config.h.in --- /* config.h.in. Generated from configure.in by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the <fcntl.h> header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `SDL_console' library (-lSDL_console). */ #undef HAVE_LIBSDL_CONSOLE /* Define to 1 if you have the `SDL_image' library (-lSDL_image). */ #undef HAVE_LIBSDL_IMAGE /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the <stdint.h> header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the <stdlib.h> header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the <strings.h> header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H /* Define to 1 if `st_blksize' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BLKSIZE /* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */ #undef HAVE_ST_BLKSIZE /* Define to 1 if you have the <sys/file.h> header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the <sys/param.h> header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the <sys/stat.h> header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the <sys/types.h> header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the <unistd.h> header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION --- NEW FILE: configure.in --- dnl WARNING: dnl I have almost no prior experience with GNU autoconf/automake and this dnl is very much a work in progress. The original Makefile for Linux can dnl be found in Source/Makefile.orig. If you have trouble with building dnl CSPFlightSim with this configure script or autmake files, and know dnl how to fix them, please do so and commit the changes to CVS. Thanks! dnl dnl -OS dnl Process this file with autoconf to produce a configure script. AC_INIT(Source/CSPFlightSim.cpp) AM_INIT_AUTOMAKE(CSPFlightSim, 0.1.0) AM_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CC AC_PROG_CXX AC_PROG_RANLIB dnl Checks for libraries. dnl Checks for header files. AC_STDC_HEADERS AC_HAVE_HEADERS(string.h fcntl.h sys/file.h sys/param.h) dnl Checks for library functions. AC_FUNC_ALLOCA dnl Check for st_blksize in struct stat AC_ST_BLKSIZE dnl check for Simple Direct Media Library CSP_LIB_CONFIG([SDL], [sdl], [1.2.5], [Simple Direct Media Library], [http://www.libsdl.org/]) dnl check for SDL Image Library AC_CHECK_LIB(SDL_image, IMG_Load, [], [AC_MSG_ERROR([ SDL_image does not appear to be installed. You can download this library from http://www.libsdl.org/projects/SDL_image If SDL_image is already installed, please specify a library path when running configure: --sdl_image_path=xxx])], []) dnl check for SDL Console Library AC_CHECK_LIB(SDL_console, CON_DrawConsole, [], [AC_MSG_ERROR([ SDL_console does not appear to be installed. You can download this library from http://sdlconsole.tuxfamily.org If SDL_console is already installed, please specify a library path when running configure: --sdl_image_path=xxx])], []) dnl check for Geospatial Data Abstraction Library CSP_LIB_CONFIG([GDAL], [gdal], [1.1.7], [Geospatial Data Abstraction Library], [http://remotesensing.org/gdal/]) dnl check for OpenSceneGraph CSP_OSG_CONFIG(osg, 0.9.2, [OpenSceneGraph]) CSP_OSG_CONFIG(osgGLUT, 0.9.2, [OpenSceneGraph GLUT library]) CSP_OSG_CONFIG(osgUtil, 0.9.2, [OpenSceneGraph Util library]) CSP_OSG_CONFIG(osgText, 0.9.2, [OpenSceneGraph Util library]) CSP_OSG_CONFIG(osgParticle, 0.9.2, [OpenSceneGraph Particle library]) #AC_CHECK_LIB(osgGLUT, osgGLUTGetVersion, , # [AC_MSG_ERROR(OpenSceneGraph GLUT library not found. See http://www.openscenegraph.org)],) #AC_CHECK_LIB(osgUtil, osgUtilGetVersion, , # [AC_MSG_ERROR(OpenSceneGraph Util library not found. See http://www.openscenegraph.org)],) #AC_CHECK_LIB(osgText, osgTextGetVersion, , # [AC_MSG_ERROR(OpenSceneGraph Text library not found. See http://www.openscenegraph.org)],) #AC_CHECK_LIB(osgParticle, osgParticleGetVersion, , # [AC_MSG_ERROR(OpenSceneGraph Particle library not found. See http://www.openscenegraph.org)],) AC_OUTPUT([Makefile Source/Makefile], []) |