diff --git a/INSTALL b/INSTALL index 9e0126221..563847f1e 100644 --- a/INSTALL +++ b/INSTALL @@ -38,6 +38,15 @@ eventually need them. If you haven't already checked it out, for a list of distribution contents, contacts and links to documentation check out index.html. +Compiling under all (UNIX - including CYGWIN) Platforms +------------------------------------------------------- + +Building the OSG requires 'gmake', due to the extensive use of gmake +directives in the Makefiles. You can get gmake from here if you don't +already have it installed: + + http://www.gnu.org/software/make/ + Compiling under Linux --------------------- @@ -46,23 +55,22 @@ Compiling under Linux make - Note, make should automatically detect linux and copy the - Make/makerules.linux and Make/makedefs.linux over the - default Make/makerules and Make/makedefs. If autodetection - does not work type 'make linux'. + Note, make should automatically detect linux and build + optimized targets for your system. - And if you wish to install the OSG to /usr/include/ & - /usr/lib then su root, and type: + And if you wish to install the OSG type: make install or make instlinks - + To get full details of make options, type: make help + + (highly recommended) The osgText library now depends upon GLU1.3 functionality, and only @@ -76,12 +84,14 @@ Compiling under Linux Compiling under FreeBSD ----------------------- - To compile, from the OSG root directory, type : + To compile, from the OSG root directory, type: - make freebsd + make + + Note, make should automatically detect your system and build + optimized targets for your system. - And if you wish to install the OSG to /usr/include/ & - /usr/lib then su root, and type: + And if you wish to install the OSG type: make install @@ -93,6 +103,9 @@ Compiling under FreeBSD make help + (highly recommended) + + Compiling under IRIX -------------------- @@ -103,17 +116,14 @@ Compiling under IRIX unwildy to support and is very rarely used in the OSG commiunity. It is recommended to use MIPSPro7.3.1.1m. - To compile, from the OSG root directory, type : + To compile, from the OSG root directory, type: make + + Note, make should automatically detect your system and build + optimized targets for your system. - Note, make should automatically detect IRIX and copy the - Make/makerules.irix.std and Make/makedefs.irix.std over the - default Make/makerules and Make/makedefs. If autodetection - does not work type 'make irix'. - - And if you wish to install the OSG to /usr/include/ & - /usr/lib then su root, and type: + And if you wish to install the OSG type: make install @@ -125,6 +135,32 @@ Compiling under IRIX make help + (highly recommended) + +Compiling under Solaris +----------------------- + + To compile, from the OSG root directory, type: + + make + + Note, make should automatically detect your system and build + optimized targets for your system. + + And if you wish to install the OSG type: + + make install + + or + + make instlinks + + To get full details of make options, type: + + make help + + (highly recommended) + Compiling under Windows ----------------------- @@ -246,6 +282,30 @@ Compiling under MacOS X (instructions written by Phil Atkin) forewarned is forearmed. +Compiling under Cygwin +---------------------- + + To compile, from the OSG root directory, type: + + make + + Note, make should automatically detect your system and build + optimized targets for your system. + + And if you wish to install the OSG type: + + make install + + Note that make symbolic links don't seem to work under + cygwin, so a make instlinks will simply copy files just like + make install. 'make install' places all files in + /usr/local/OpenSceneGraph under appropriate subdirectories. + + To get full details of make options, type: + + make help + + (highly recommended) OSGFILEPATH environmental variable ---------------------------------- diff --git a/Make/help.sh b/Make/help.sh new file mode 100644 index 000000000..a2fce4483 --- /dev/null +++ b/Make/help.sh @@ -0,0 +1,151 @@ +#!/bin/sh + +OS=$1 +TOPDIR=$2 +INST_LIBS=$3 +INST_PLUGINS=$4 +INST_INCLUDE=$5 +INST_DEMOS=$6 +INST_DEMO_SRC=$7 +INST_DOC=$8 +INST_DATA=$9 + + +cat <<- EOF + +The following targets can be used with any subsystem as well as the top +level build (build in the OSG Root directory). Note that debug versions +and optimized version of targets reside in parallel. + + make - Same as 'make opt' + make opt - Makes optimized versions of all targets + make debug - Makes debug versions of all targets. + make clean - Removes all object files (both optimized and debug + versions) + make cleanopt - Removes optimized version of object files + make cleandbg - Removes debug version of object files + make cleanlite - Removes only targets but leaves object files (both + optimized and debug versions) + make cleanliteopt - Removes only optimized targets but leaves optimized + objects files. + make cleanlitedbg - Removes only debug targets but leaves debug object + files + make clobber - Removes object files and targets (both optimized and + debug versions) + make clobberopt - Removes optimized object files and targets + make clobberdbg - Removes debug object files and targets + make beautify - Pretty print C++ files + make docs - Builds documentation database for current target + make depend - Force a rebuild of the dependency file. Note that + dependency files are generated automatically during + builds. + + +Solars and IRIX can build 64 bit targets. These require the ARCH=64 argument. +For example: + + make ARCH=64 - Same as 'make ARCH=64 opt' + make ARCH=64 opt - Builds 64 bit optimized targets + make ARCH=64 debug - Builds 64 bit debug versions of targets + make ARCH=64 clean - Removes all 64 bit object files (both optimized and + debug versions). + + etc. + +The following targets may only be issued from the top-level OSG build: + + make install - Install both execution environment and development + targets + make instbin - Install execution environment targets only. These + consist of libraries, plugins and demo programs. + Libraries are installed in + o $INST_LIBS, + plugins are installed in + o $INST_PLUGINS, + and demos are installed in + o $INST_DEMOS + on $OS + + make instdev - Install development targets only. These consist of + header files, source code to the demo programs, and + documentation. + Header files are install in + o $INST_INCLUDE, + demo source code is installed in + o $INST_DEMO_SRC, + and documentation is installed in + o $INST_DOC + on $OS + + make instlinks - Installs symbolic links at install locations for both + execution environment and development targets rather + than copyied files. Installing links is ideal for a + development environment for avoiding confusion about + which binaries are being run or linked to. + + make instlinksbin - Installs symbolic links at install locations for + execution environment targets only. + make instlinksdev - Installs symbolic links at install locations for + development targets only + make instclean - Removes installed targets (files or links) from + installation locations for both execution environment + and development targets + make instcleanbin - Removes installed targets from installation locations + for execution environment targets only + make instcleandev - Removes installed targets from installation locations + for defelopment targets only + +Note that the following variables can be used to directly override the default +installation locations for $OS. + + make INST_LIBS= \\ + INST_PLUGINS=\\ + INST_INCLUDE=\\ + INST_DEMOS=\\ + INST_DEMO_SRC=\\ + INST_DOC=\\ + install + + - Installs libraries in , plugins in + , header files in + , demos in , + demo source code in and + documentation in + +Note also that INST_LIBS, INST_PLUGINS, and INST_INCLUDE share a common +prefix by default: INST_SYS_PREFIX. Further INST_DEMOS, INST_DEMOS_SRC, +INST_DOC, and INST_DATA share a common prefix by default : INST_SHARE_PREFIX. +This provides a short cut for the above 'make' usage. For example, + + make INST_SYS_PREFIX=/usr/local/OpenSceneGraph \\ + INST_SHARE_PREFIX=/usr/share/OpenSceneGraph \\ + install + + +These values can be tested by reissuing 'make help' with these arguments. + +After doing a 'make install' or 'make instlinks', and if not already added, +add + + $INST_DEMOS + +to your PATH environmental variable to run the demos. If it is not already +present, add + + $INST_LIBS + +and + + $INST_PLUGINS + +to your LD_LIBRARY_PATH environmental variable. When compiling programs +using OSG headers add to your -I compile flags: + + $INST_INCLUDE + + + + +EOF + +exit 0 diff --git a/Make/helprules b/Make/helprules new file mode 100644 index 000000000..c38529d81 --- /dev/null +++ b/Make/helprules @@ -0,0 +1,11 @@ +help: + $(TOPDIR)/Make/help.sh\ + $(OS)\ + $(TOPDIR)\ + $(INST_LIBS)\ + $(INST_PLUGINS)\ + $(INST_INCLUDE)\ + $(INST_DEMOS)\ + $(INST_DEMO_SRC)\ + $(INST_DOC)\ + $(INST_DATA) | more diff --git a/Make/instrules b/Make/instrules index 834b6b440..5051420a8 100644 --- a/Make/instrules +++ b/Make/instrules @@ -7,6 +7,13 @@ instbin : INSTALL?="$(INSTBINCMD)" __install @$(MAKE) INSTSRC=$(TOPDIR)/lib/osgPlugins INSTDEST=$(INST_PLUGINS)\ INSTALL?="$(INSTBINCMD)" __install + @echo + @echo " Execution environment installation successful. Add" + @echo " $(INST_DEMOS)" + @echo " to your PATH environmental variable, and " + @echo " $(INST_LIBS) and $(INST_PLUGINS)" + @echo " to your LD_LIBRARY_PATH if not already present." + @echo instdev : @@ -26,6 +33,12 @@ instdev : INSTALL?="$(INSTDEVCMD)" __install;\ fi\ done + @echo + @echo " Development environment installation successful. Add" + @echo " -I/$(INST_INCLUDE)" + @echo " compile flag when compiling with OSG header files." + @echo " Example programs can be found at $(INST_DEMOS_SRC)." + @echo instlinks : instlinksbin instlinksdev diff --git a/Make/makedefs b/Make/makedefs index 0b6bc750f..3459d8957 100644 --- a/Make/makedefs +++ b/Make/makedefs @@ -41,7 +41,7 @@ INST_INCLUDE = $(INST_SYS_PREFIX)/include INST_SHARE_PREFIX = /usr/share INST_DEMOS = $(INST_SHARE_PREFIX)/OpenSceneGraph/bin INST_DEMO_SRC = $(INST_SHARE_PREFIX)/OpenSceneGraph/src/demos -INST_DOC = $(INST_SHARE_REFIX)/OpenSceneGraph/doc +INST_DOC = $(INST_SHARE_PREFIX)/OpenSceneGraph/doc INST_DATA = $(INST_SHARE_PREFIX)/OpenSceneGraph/data LINK = ln -sf @@ -57,7 +57,7 @@ PLUGIN_EXT = so MAKEDIST = echo " === Distribution build is not implemented yet for $(OS)"; printf "\n" -ALL_TARGETS = \ +RECURSIVE_TARGETS = \ opt\ debug\ clean\ @@ -67,6 +67,8 @@ ALL_TARGETS = \ cleanliteopt\ cleanlitedbg\ clobber\ + clobberdbg\ + clobberopt\ beautify\ docs\ depend\ @@ -185,7 +187,7 @@ ifeq ($(OS),FreeBSD) endif -#### Mac OSX specific definitions +#### MacOS X specific definitions ifeq ($(OS),Darwin) C++ = cc INC += -I/usr/include -I/sw/include @@ -258,12 +260,22 @@ ifeq ($(OS),CYGWIN) FREETYPE_LIB = -lfreetype2 - LIB_PREFIX = cyg - LIB_EXT = dll - PLUGIN_PREFIX = cygosgdb_ - PLUGIN_EXT = dll + LIB_PREFIX = cyg + LIB_EXT = dll + PLUGIN_PREFIX = cygosgdb_ + PLUGIN_EXT = dll - LINK = cp -f + LINK = cp -f + + INST_SYS_PREFIX = /usr/local/OpenSceneGraph + INST_LIBS = $(INST_SYS_PREFIX)/bin + INST_PLUGINS = $(INST_SYS_PREFIX)/bin + INST_INCLUDE = $(INST_SYS_PREFIX)/include + INST_SHARE_PREFIX = /usr/local/OpenSceneGraph + INST_DEMOS = $(INST_SHARE_PREFIX)/bin + INST_DEMO_SRC = $(INST_SHARE_PREFIX)/src/demos + INST_DOC = $(INST_SHARE_PREFIX)/doc + INST_DATA = $(INST_SHARE_PREFIX)/data endif diff --git a/Make/makedirrules b/Make/makedirrules index 4f04f0210..8add1ff83 100644 --- a/Make/makedirrules +++ b/Make/makedirrules @@ -2,5 +2,5 @@ default : $(DIRS) @for f in $(DIRS); do cd $$f; $(MAKE) $@ || exit 1; cd ..; done -$(ALL_TARGETS) : $(DIRS) +$(RECURSIVE_TARGETS) : $(DIRS) @for f in $(DIRS); do cd $$f; $(MAKE) $@ || exit 1; cd ..; done diff --git a/Make/makerules b/Make/makerules index 6f7f67930..cc4d908a8 100644 --- a/Make/makerules +++ b/Make/makerules @@ -46,6 +46,7 @@ docs: echo "$(TARGET_BASENAME) HTML documentation created in "\ "$(TOPDIR)/doc/doc++/$(TARGET_BASENAME)" + $(EXEC) : $(OBJS) $(C++) $(LDFLAGS) $(OBJS) $(LIBS) -o $@ diff --git a/Makefile b/Makefile index ce5ed3872..181631cf7 100644 --- a/Makefile +++ b/Makefile @@ -6,3 +6,4 @@ DIRS = src include $(TOPDIR)/Make/makedirrules include $(TOPDIR)/Make/instrules include $(TOPDIR)/Make/distrules +include $(TOPDIR)/Make/helprules diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 855a277e8..0606fa182 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -225,18 +225,26 @@ std::string Registry::createLibraryNameForExt(const std::string& ext) ExtensionAliasMap::iterator itr=_extAliasMap.find(ext); if (itr!=_extAliasMap.end()) return createLibraryNameForExt(itr->second); -#if defined(WIN32) +#if defined(WIN32) // [ // !! recheck evolving Cygwin DLL extension naming protocols !! NHV -# ifdef _DEBUG + #ifdef __CYGWIN__ // [ +# ifdef _DEBUG // [ + return "cygosgdb_"+ext+"d.dll"; +# else // ][ + return "cygosgdb_"+ext+".dll"; +# endif // ] + #else // ][ +# ifdef _DEBUG // [ return "osgdb_"+ext+"d.dll"; -# else +# else // ][ return "osgdb_"+ext+".dll"; -# endif -#elif macintosh +# endif // ] + #endif // ] +#elif macintosh // ][ return "osgdb_"+ext; -#else +#else // ][ return "osgdb_"+ext+".so"; -#endif +#endif // ] }