[PATCH] Updated Linux build

Archwyrm

08-12-2008 00:10:34

Hi, recently I have compiled this plugin and started using it in my project (great plugin, btw). There were a number of things that had to be fixed to get it up and running with Ogre 1.4.9, here are two Linux build fixes.


Index: PlugIns/PagingLandScape2/src/OgrePagingLandScapeTexture.cpp
===================================================================
--- PlugIns/PagingLandScape2/src/OgrePagingLandScapeTexture.cpp (revision 2504)
+++ PlugIns/PagingLandScape2/src/OgrePagingLandScapeTexture.cpp (working copy)
@@ -35,6 +35,7 @@
#include "OgrePagingLandScapeData2D.h"

#include "fileutils.h"
+#include "OgreLogManager.h"

namespace Ogre
{
Index: bootstrap
===================================================================
--- bootstrap (revision 2504)
+++ bootstrap (working copy)
@@ -22,7 +22,7 @@
exit 1;
fi

-if test -z "`libtool --version 2>&1|head -n 1|egrep '1.[4-5]'`"; then
+if test -z "`libtool --version 2>&1|head -n 1|egrep ' (1.[4-5]|2.2)'`"; then
echo "Libtool 1.4 or above is required. Aborting build...";
exit 1;
fi


The first part fixes

OgrePagingLandScapeTexture.cpp:564: error: incomplete type ‘Ogre::LogManager’ used in nested name specifier
OgrePagingLandScapeTexture.cpp:564: error: ‘LML_CRITICAL’ was not declared in this scope


The second part allows more recent libtool versions to be used, such as any version from the 2.x series, while still enforcing libtool 1.4+.

Hannofcart

08-04-2009 17:02:48

The update on bootstrap script helped. However, now I get the following make error also to do with libtool. Clearly I haven't setup something correctly with the libtool script (I have ver.2.2.4), but if someone could please help:


:~/ogre/ogreaddons/paginglandscape$ make
make all-recursive
make[1]: Entering directory `/home/balajee/ogre/ogreaddons/paginglandscape'
Making all in PlugIns
make[2]: Entering directory `/home/balajee/ogre/ogreaddons/paginglandscape/PlugIns'
Making all in PagingLandScape2
make[3]: Entering directory `/home/balajee/ogre/ogreaddons/paginglandscape/PlugIns/PagingLandScape2'
Making all in src
make[4]: Entering directory `/home/balajee/ogre/ogreaddons/paginglandscape/PlugIns/PagingLandScape2/src'
/bin/bash ../../../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../.. -DOGRE_GUI_GLX -DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/local/include -I/usr/local/include/OGRE -I../../../PlugIns/PagingLandScape2/include -g -O2 -MT Plugin_PagingLandScape2_la-DRGNURBSSurface.lo -MD -MP -MF .deps/Plugin_PagingLandScape2_la-DRGNURBSSurface.Tpo -c -o Plugin_PagingLandScape2_la-DRGNURBSSurface.lo `test -f 'DRGNURBSSurface.cpp' || echo './'`DRGNURBSSurface.cpp
../../../libtool: line 653: X--tag=CXX: command not found
../../../libtool: line 686: libtool: ignoring unknown tag : command not found
../../../libtool: line 653: X--mode=compile: command not found
../../../libtool: line 803: *** Warning: inferring the mode of operation is deprecated.: command not found
../../../libtool: line 804: *** Future versions of Libtool will require -mode=MODE be specified.: command not found
../../../libtool: line 947: Xg++: command not found
../../../libtool: line 947: X-DHAVE_CONFIG_H: command not found
../../../libtool: line 947: X-I.: command not found
../../../libtool: line 947: X-I../../..: No such file or directory
../../../libtool: line 947: X-DOGRE_GUI_GLX: command not found
../../../libtool: line 947: X-DOGRE_CONFIG_LITTLE_ENDIAN: command not found
../../../libtool: line 947: X-I/usr/local/include: No such file or directory
../../../libtool: line 947: X-I/usr/local/include/OGRE: No such file or directory
../../../libtool: line 947: X-I../../../PlugIns/PagingLandScape2/include: No such file or directory
../../../libtool: line 947: X-g: command not found
../../../libtool: line 947: X-O2: command not found
../../../libtool: line 947: X-MT: command not found
../../../libtool: line 947: XPlugin_PagingLandScape2_la-DRGNURBSSurface.lo: command not found
../../../libtool: line 947: X-MD: command not found
../../../libtool: line 947: X-MP: command not found
../../../libtool: line 947: X-MF: command not found
../../../libtool: line 947: X.deps/Plugin_PagingLandScape2_la-DRGNURBSSurface.Tpo: No such file or directory
../../../libtool: line 947: X-c: command not found
../../../libtool: line 995: XPlugin_PagingLandScape2_la-DRGNURBSSurface.lo: command not found
../../../libtool: line 1000: libtool: compile: cannot determine name of library object from `': command not found
make[4]: *** [Plugin_PagingLandScape2_la-DRGNURBSSurface.lo] Error 1
make[4]: Leaving directory `/home/balajee/ogre/ogreaddons/paginglandscape/PlugIns/PagingLandScape2/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/balajee/ogre/ogreaddons/paginglandscape/PlugIns/PagingLandScape2'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/balajee/ogre/ogreaddons/paginglandscape/PlugIns'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/balajee/ogre/ogreaddons/paginglandscape'
make: *** [all] Error 2



The (hopefully) relevant part of the libtool script [lines 640 - 1003]


# End of Shell function definitions
#####################################

# Darwin sucks
eval std_shrext=\"$shrext_cmds\"

# Parse our command line options once, thoroughly.
while test "$#" -gt 0
do
arg="$1"
shift

case $arg in
-*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac

# If the previous option needs an argument, assign it.
if test -n "$prev"; then
case $prev in
execute_dlfiles)
execute_dlfiles="$execute_dlfiles $arg"
;;
tag)
tagname="$arg"
preserve_args="${preserve_args}=$arg"

# Check whether tagname contains only valid characters
case $tagname in
*[!-_A-Za-z0-9,/]*)
$echo "$progname: invalid tag name: $tagname" 1>&2
exit $EXIT_FAILURE
;;
esac

case $tagname in
CC)
# Don't test for the "default" C tag, as we know, it's there, but
# not specially marked.
;;
*)
if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
taglist="$taglist $tagname"
# Evaluate the configuration.
eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
else
$echo "$progname: ignoring unknown tag $tagname" 1>&2
fi
;;
esac
;;
*)
eval "$prev=\$arg"
;;
esac

prev=
prevopt=
continue
fi

# Have we seen a non-optional argument yet?
case $arg in
--help)
show_help=yes
;;

--version)
$echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
$echo
$echo "Copyright (C) 2003 Free Software Foundation, Inc."
$echo "This is free software; see the source for copying conditions. There is NO"
$echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit $EXIT_SUCCESS
;;

--config)
${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
# Now print the configurations for the tags.
for tagname in $taglist; do
${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
done
exit $EXIT_SUCCESS
;;

--debug)
$echo "$progname: enabling shell trace mode"
set -x
preserve_args="$preserve_args $arg"
;;

--dry-run | -n)
run=:
;;

--features)
$echo "host: $host"
if test "$build_libtool_libs" = yes; then
$echo "enable shared libraries"
else
$echo "disable shared libraries"
fi
if test "$build_old_libs" = yes; then
$echo "enable static libraries"
else
$echo "disable static libraries"
fi
exit $EXIT_SUCCESS
;;

--finish) mode="finish" ;;

--mode) prevopt="--mode" prev=mode ;;
--mode=*) mode="$optarg" ;;

--preserve-dup-deps) duplicate_deps="yes" ;;

--quiet | --silent)
show=:
preserve_args="$preserve_args $arg"
;;

--tag) prevopt="--tag" prev=tag ;;
--tag=*)
set tag "$optarg" ${1+"$@"}
shift
prev=tag
preserve_args="$preserve_args --tag"
;;

-dlopen)
prevopt="-dlopen"
prev=execute_dlfiles
;;

-*)
$echo "$modename: unrecognized option \`$arg'" 1>&2
$echo "$help" 1>&2
exit $EXIT_FAILURE
;;

*)
nonopt="$arg"
break
;;
esac
done

if test -n "$prevopt"; then
$echo "$modename: option \`$prevopt' requires an argument" 1>&2
$echo "$help" 1>&2
exit $EXIT_FAILURE
fi

# If this variable is set in any of the actions, the command in it
# will be execed at the end. This prevents here-documents from being
# left over by shells.
exec_cmd=

if test -z "$show_help"; then

# Infer the operation mode.
if test -z "$mode"; then
$echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
$echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
case $nonopt in
*cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
mode=link
for arg
do
case $arg in
-c)
mode=compile
break
;;
esac
done
;;
*db | *dbx | *strace | *truss)
mode=execute
;;
*install*|cp|mv)
mode=install
;;
*rm)
mode=uninstall
;;
*)
# If we have no mode, but dlfiles were specified, then do execute mode.
test -n "$execute_dlfiles" && mode=execute

# Just use the default operation mode.
if test -z "$mode"; then
if test -n "$nonopt"; then
$echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
else
$echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
fi
fi
;;
esac
fi

# Only execute mode is allowed to have -dlopen flags.
if test -n "$execute_dlfiles" && test "$mode" != execute; then
$echo "$modename: unrecognized option \`-dlopen'" 1>&2
$echo "$help" 1>&2
exit $EXIT_FAILURE
fi

# Change the help message to a mode-specific one.
generic_help="$help"
help="Try \`$modename --help --mode=$mode' for more information."

# These modes are in order of execution frequency so that they run quickly.
case $mode in
# libtool compile mode
compile)
modename="$modename: compile"
# Get the compilation command and the source file.
base_compile=
srcfile="$nonopt" # always keep a non-empty value in "srcfile"
suppress_opt=yes
suppress_output=
arg_mode=normal
libobj=
later=

for arg
do
case "$arg_mode" in
arg )
# do not "continue". Instead, add this to base_compile
lastarg="$arg"
arg_mode=normal
;;

target )
libobj="$arg"
arg_mode=normal
continue
;;

normal )
# Accept any command-line options.
case $arg in
-o)
if test -n "$libobj" ; then
$echo "$modename: you cannot specify \`-o' more than once" 1>&2
exit $EXIT_FAILURE
fi
arg_mode=target
continue
;;

-static | -prefer-pic | -prefer-non-pic)
later="$later $arg"
continue
;;

-no-suppress)
suppress_opt=no
continue
;;

-Xcompiler)
arg_mode=arg # the next one goes into the "base_compile" arg list
continue # The current "srcfile" will either be retained or
;; # replaced later. I would guess that would be a bug.

-Wc,*)
args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
lastarg=
save_ifs="$IFS"; IFS=','
for arg in $args; do
IFS="$save_ifs"

# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
arg="\"$arg\""
;;
esac
lastarg="$lastarg $arg"
done
IFS="$save_ifs"
lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`

# Add the arguments to base_compile.
base_compile="$base_compile $lastarg"
continue
;;

* )
# Accept the current argument as the source file.
# The previous "srcfile" becomes the current argument.
#
lastarg="$srcfile"
srcfile="$arg"
;;
esac # case $arg
;;
esac # case $arg_mode

# Aesthetically quote the previous argument.
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`

case $lastarg in
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
lastarg="\"$lastarg\""
;;
esac

base_compile="$base_compile $lastarg"
done # for arg

case $arg_mode in
arg)
$echo "$modename: you must specify an argument for -Xcompile"
exit $EXIT_FAILURE
;;
target)
$echo "$modename: you must specify a target with \`-o'" 1>&2
exit $EXIT_FAILURE
;;
*)
# Get the name of the library object.
[ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
;;
esac

# Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo
xform='[cCFSifmso]'
case $libobj in
*.ada) xform=ada ;;
*.adb) xform=adb ;;
*.ads) xform=ads ;;
*.asm) xform=asm ;;
*.c++) xform=c++ ;;
*.cc) xform=cc ;;
*.ii) xform=ii ;;
*.class) xform=class ;;
*.cpp) xform=cpp ;;
*.cxx) xform=cxx ;;
*.f90) xform=f90 ;;
*.for) xform=for ;;
*.java) xform=java ;;
esac

libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`

case $libobj in
*.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
*)
$echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
exit $EXIT_FAILURE
;;
esac