summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgignore4
-rw-r--r--autobuild.xml4
-rw-r--r--indra/cmake/DirectX.cmake2
-rw-r--r--indra/cmake/LLRender.cmake6
-rw-r--r--indra/cmake/LLWindow.cmake14
-rw-r--r--indra/llmessage/tests/llhttpclient_test.cpp84
-rw-r--r--indra/llmessage/tests/test_llsdmessage_peer.py326
-rw-r--r--indra/llrender/CMakeLists.txt30
-rw-r--r--indra/llrender/llfontregistry.cpp2
-rw-r--r--indra/llrender/llrender.cpp2
-rw-r--r--indra/llrender/llrendertarget.cpp2
-rw-r--r--indra/llrender/llrendertarget.h3
-rw-r--r--indra/llrender/llvertexbuffer.cpp8
-rw-r--r--indra/llwindow/CMakeLists.txt9
-rw-r--r--indra/llwindow/llwindow.cpp2
-rw-r--r--indra/llwindow/llwindowmesaheadless.h1
-rw-r--r--indra/lscript/lscript_compile/CMakeLists.txt6
-rw-r--r--indra/lscript/lscript_compile/bison.bat9
-rw-r--r--indra/lscript/lscript_compile/indra.l23
-rw-r--r--indra/newview/lldirpicker.cpp4
-rw-r--r--indra/newview/llfilepicker.cpp8
21 files changed, 285 insertions, 264 deletions
diff --git a/.hgignore b/.hgignore
index 06d31e2f88..c845758e7c 100644
--- a/.hgignore
+++ b/.hgignore
@@ -10,7 +10,7 @@ syntax: glob
.*.swp
#OSX image cache file
*.DS_Store
-*.orig
+#*.orig
LICENSES
indra/.distcc
build-linux-*
@@ -74,4 +74,4 @@ glob:indra/newview/filters.xml
glob:indra/newview/avatar_icons_cache.txt
glob:indra/newview/avatar_lad.log
glob:*.diff
-*.rej
+#*.rej
diff --git a/autobuild.xml b/autobuild.xml
index 1c1b2be527..19dd39c19b 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -1432,9 +1432,9 @@
<key>archive</key>
<map>
<key>hash</key>
- <string>1f600840463c7327ea17486821425750</string>
+ <string>bdfb275b9bfa071397fb5633a0f5d360</string>
<key>url</key>
- <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/mesa-7.0-linux-20100930.tar.bz2</string>
+ <string>http://s3-proxy.lindenlab.com/private-builds-secondlife-com/hg/repo/3p-mesa/rev/265010/arch/Linux/installer/mesa-7.11.1-linux-20120920.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
diff --git a/indra/cmake/DirectX.cmake b/indra/cmake/DirectX.cmake
index b2a18805d4..8cae606848 100644
--- a/indra/cmake/DirectX.cmake
+++ b/indra/cmake/DirectX.cmake
@@ -3,6 +3,7 @@
if (VIEWER AND WINDOWS)
find_path(DIRECTX_INCLUDE_DIR dxdiag.h
"$ENV{DXSDK_DIR}/Include"
+ "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2009)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include"
@@ -25,6 +26,7 @@ if (VIEWER AND WINDOWS)
find_path(DIRECTX_LIBRARY_DIR dxguid.lib
"$ENV{DXSDK_DIR}/Lib/x86"
+ "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2009)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86"
diff --git a/indra/cmake/LLRender.cmake b/indra/cmake/LLRender.cmake
index 8427928151..6695ed6bd9 100644
--- a/indra/cmake/LLRender.cmake
+++ b/indra/cmake/LLRender.cmake
@@ -8,15 +8,15 @@ set(LLRENDER_INCLUDE_DIRS
${GLH_INCLUDE_DIR}
)
-if (SERVER AND LINUX)
+if ((SERVER OR BAKING) AND LINUX)
set(LLRENDER_LIBRARIES
llrenderheadless
)
-else (SERVER AND LINUX)
+else ((SERVER OR BAKING) AND LINUX)
set(LLRENDER_LIBRARIES
llrender
)
-endif (SERVER AND LINUX)
+endif ((SERVER OR BAKING) AND LINUX)
# mapserver requires certain files to be copied so LL_MESA_HEADLESS can be set
# differently for different object files.
diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake
index b4bb9a078a..1ee4ca0aac 100644
--- a/indra/cmake/LLWindow.cmake
+++ b/indra/cmake/LLWindow.cmake
@@ -22,22 +22,28 @@ else (STANDALONE)
endif (LINUX AND VIEWER)
endif (STANDALONE)
-if (SDL_FOUND)
+if (SDL_FOUND AND NOT BAKING)
add_definitions(-DLL_SDL=1)
include_directories(${SDL_INCLUDE_DIR})
-endif (SDL_FOUND)
+endif (SDL_FOUND AND NOT BAKING)
+
+if (BAKING)
+ use_prebuilt_binary(mesa)
+ add_definitions(-DLL_MESA_HEADLESS=1)
+endif (BAKING)
set(LLWINDOW_INCLUDE_DIRS
${GLEXT_INCLUDE_DIR}
${LIBS_OPEN_DIR}/llwindow
)
-if (SERVER AND LINUX)
+if ((SERVER AND LINUX) OR (BAKING AND LINUX))
set(LLWINDOW_LIBRARIES
llwindowheadless
)
+ MESSAGE( STATUS "using headless libraries")
else (SERVER AND LINUX)
set(LLWINDOW_LIBRARIES
llwindow
)
-endif (SERVER AND LINUX)
+endif ((SERVER AND LINUX) OR (BAKING AND LINUX))
diff --git a/indra/llmessage/tests/llhttpclient_test.cpp b/indra/llmessage/tests/llhttpclient_test.cpp
index e338d4ec71..4a9db7cd98 100644
--- a/indra/llmessage/tests/llhttpclient_test.cpp
+++ b/indra/llmessage/tests/llhttpclient_test.cpp
@@ -47,37 +47,6 @@
namespace tut
{
- LLSD storage;
-
- class LLSDStorageNode : public LLHTTPNode
- {
- public:
- LLSD simpleGet() const { return storage; }
- LLSD simplePut(const LLSD& value) const { storage = value; return LLSD(); }
- };
-
- class ErrorNode : public LLHTTPNode
- {
- public:
- void get(ResponsePtr r, const LLSD& context) const
- { r->status(599, "Intentional error"); }
- void post(ResponsePtr r, const LLSD& context, const LLSD& input) const
- { r->status(input["status"], input["reason"]); }
- };
-
- class TimeOutNode : public LLHTTPNode
- {
- public:
- void get(ResponsePtr r, const LLSD& context) const
- {
- /* do nothing, the request will eventually time out */
- }
- };
-
- LLHTTPRegistration<LLSDStorageNode> gStorageNode("/test/storage");
- LLHTTPRegistration<ErrorNode> gErrorNode("/test/error");
- LLHTTPRegistration<TimeOutNode> gTimeOutNode("/test/timeout");
-
struct HTTPClientTestData
{
public:
@@ -86,7 +55,6 @@ namespace tut
{
apr_pool_create(&mPool, NULL);
LLCurl::initClass(false);
- mServerPump = new LLPumpIO(mPool);
mClientPump = new LLPumpIO(mPool);
LLHTTPClient::setPump(*mClientPump);
@@ -94,20 +62,11 @@ namespace tut
~HTTPClientTestData()
{
- delete mServerPump;
delete mClientPump;
LLProxy::cleanupClass();
apr_pool_destroy(mPool);
}
- void setupTheServer()
- {
- LLHTTPNode& root = LLIOHTTPServer::create(mPool, *mServerPump, 8888);
-
- LLHTTPStandardServices::useServices();
- LLHTTPRegistrar::buildAllServices(root);
- }
-
void runThePump(float timeout = 100.0f)
{
LLTimer timer;
@@ -115,11 +74,7 @@ namespace tut
while(!mSawCompleted && !mSawCompletedHeader && !timer.hasExpired())
{
- if (mServerPump)
- {
- mServerPump->pump();
- mServerPump->callback();
- }
+ LLFrameTimer::updateFrameTime();
if (mClientPump)
{
mClientPump->pump();
@@ -128,17 +83,10 @@ namespace tut
}
}
- void killServer()
- {
- delete mServerPump;
- mServerPump = NULL;
- }
-
const std::string local_server;
private:
apr_pool_t* mPool;
- LLPumpIO* mServerPump;
LLPumpIO* mClientPump;
protected:
@@ -283,14 +231,12 @@ namespace tut
sd["list"][1]["three"] = 3;
sd["list"][1]["four"] = 4;
- setupTheServer();
-
- LLHTTPClient::post("http://localhost:8888/web/echo", sd, newResult());
+ LLHTTPClient::post(local_server + "web/echo", sd, newResult());
runThePump();
ensureStatusOK();
ensure_equals("echoed result matches", getResult(), sd);
}
-
+
template<> template<>
void HTTPClientTestObject::test<4>()
{
@@ -298,12 +244,11 @@ namespace tut
sd["message"] = "This is my test message.";
- setupTheServer();
- LLHTTPClient::put("http://localhost:8888/test/storage", sd, newResult());
+ LLHTTPClient::put(local_server + "test/storage", sd, newResult());
runThePump();
ensureStatusOK();
- LLHTTPClient::get("http://localhost:8888/test/storage", newResult());
+ LLHTTPClient::get(local_server + "test/storage", newResult());
runThePump();
ensureStatusOK();
ensure_equals("echoed result matches", getResult(), sd);
@@ -317,9 +262,7 @@ namespace tut
sd["status"] = 543;
sd["reason"] = "error for testing";
- setupTheServer();
-
- LLHTTPClient::post("http://localhost:8888/test/error", sd, newResult());
+ LLHTTPClient::post(local_server + "test/error", sd, newResult());
runThePump();
ensureStatusError();
ensure_contains("reason", mReason, sd["reason"]);
@@ -328,23 +271,16 @@ namespace tut
template<> template<>
void HTTPClientTestObject::test<6>()
{
- setupTheServer();
-
- LLHTTPClient::get("http://localhost:8888/test/timeout", newResult());
- runThePump(1.0f);
- killServer();
- runThePump();
+ const F32 timeout = 1.0f;
+ LLHTTPClient::get(local_server + "test/timeout", newResult(), LLSD(), timeout);
+ runThePump(timeout * 5.0f);
ensureStatusError();
- ensure_equals("reason", mReason, "STATUS_ERROR");
+ ensure_equals("reason", mReason, "STATUS_EXPIRED");
}
template<> template<>
void HTTPClientTestObject::test<7>()
{
- // Can not use the little mini server. The blocking request
- // won't ever let it run. Instead get from a known LLSD
- // source and compare results with the non-blocking get which
- // is tested against the mini server earlier.
LLHTTPClient::get(local_server, newResult());
runThePump();
ensureStatusOK();
diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py
index fe4f3a8c01..b59c5a06cd 100644
--- a/indra/llmessage/tests/test_llsdmessage_peer.py
+++ b/indra/llmessage/tests/test_llsdmessage_peer.py
@@ -1,153 +1,173 @@
-#!/usr/bin/env python
-"""\
-@file test_llsdmessage_peer.py
-@author Nat Goodspeed
-@date 2008-10-09
-@brief This script asynchronously runs the executable (with args) specified on
- the command line, returning its result code. While that executable is
- running, we provide dummy local services for use by C++ tests.
-
-$LicenseInfo:firstyear=2008&license=viewerlgpl$
-Second Life Viewer Source Code
-Copyright (C) 2010, Linden Research, Inc.
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation;
-version 2.1 of the License only.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-
-Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
-$/LicenseInfo$
-"""
-
-import os
-import sys
-from threading import Thread
-from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
-
-mydir = os.path.dirname(__file__) # expected to be .../indra/llmessage/tests/
-sys.path.insert(0, os.path.join(mydir, os.pardir, os.pardir, "lib", "python"))
-from indra.util.fastest_elementtree import parse as xml_parse
-from indra.base import llsd
-from testrunner import freeport, run, debug, VERBOSE
-
-class TestHTTPRequestHandler(BaseHTTPRequestHandler):
- """This subclass of BaseHTTPRequestHandler is to receive and echo
- LLSD-flavored messages sent by the C++ LLHTTPClient.
- """
- def read(self):
- # The following logic is adapted from the library module
- # SimpleXMLRPCServer.py.
- # Get arguments by reading body of request.
- # We read this in chunks to avoid straining
- # socket.read(); around the 10 or 15Mb mark, some platforms
- # begin to have problems (bug #792570).
- try:
- size_remaining = int(self.headers["content-length"])
- except (KeyError, ValueError):
- return ""
- max_chunk_size = 10*1024*1024
- L = []
- while size_remaining:
- chunk_size = min(size_remaining, max_chunk_size)
- chunk = self.rfile.read(chunk_size)
- L.append(chunk)
- size_remaining -= len(chunk)
- return ''.join(L)
- # end of swiped read() logic
-
- def read_xml(self):
- # This approach reads the entire POST data into memory first
- return llsd.parse(self.read())
-## # This approach attempts to stream in the LLSD XML from self.rfile,
-## # assuming that the underlying XML parser reads its input file
-## # incrementally. Unfortunately I haven't been able to make it work.
-## tree = xml_parse(self.rfile)
-## debug("Finished raw parse")
-## debug("parsed XML tree %s", tree)
-## debug("parsed root node %s", tree.getroot())
-## debug("root node tag %s", tree.getroot().tag)
-## return llsd.to_python(tree.getroot())
-
- def do_HEAD(self):
- self.do_GET(withdata=False)
-
- def do_GET(self, withdata=True):
- # Of course, don't attempt to read data.
- data = dict(reply="success", body="avatar", random=17)
- self.answer(data, withdata=withdata)
-
- def do_POST(self):
- # Read the provided POST data.
- self.answer(self.read_xml())
-
- def answer(self, data, withdata=True):
- debug("%s.answer(%s): self.path = %r", self.__class__.__name__, data, self.path)
- if "fail" not in self.path:
- data = data.copy() # we're going to modify
- # Ensure there's a "reply" key in data, even if there wasn't before
- data["reply"] = data.get("reply", llsd.LLSD("success"))
- response = llsd.format_xml(data)
- debug("success: %s", response)
- self.send_response(200)
- self.send_header("Content-type", "application/llsd+xml")
- self.send_header("Content-Length", str(len(response)))
- self.end_headers()
- if withdata:
- self.wfile.write(response)
- else: # fail requested
- status = data.get("status", 500)
- # self.responses maps an int status to a (short, long) pair of
- # strings. We want the longer string. That's why we pass a string
- # pair to get(): the [1] will select the second string, whether it
- # came from self.responses or from our default pair.
- reason = data.get("reason",
- self.responses.get(status,
- ("fail requested",
- "Your request specified failure status %s "
- "without providing a reason" % status))[1])
- debug("fail requested: %s: %r", status, reason)
- self.send_error(status, reason)
-
- if not VERBOSE:
- # When VERBOSE is set, skip both these overrides because they exist to
- # suppress output.
-
- def log_request(self, code, size=None):
- # For present purposes, we don't want the request splattered onto
- # stderr, as it would upset devs watching the test run
- pass
-
- def log_error(self, format, *args):
- # Suppress error output as well
- pass
-
-class Server(HTTPServer):
- # This pernicious flag is on by default in HTTPServer. But proper
- # operation of freeport() absolutely depends on it being off.
- allow_reuse_address = False
-
-if __name__ == "__main__":
- # Instantiate a Server(TestHTTPRequestHandler) on the first free port
- # in the specified port range. Doing this inline is better than in a
- # daemon thread: if it blows up here, we'll get a traceback. If it blew up
- # in some other thread, the traceback would get eaten and we'd run the
- # subject test program anyway.
- httpd, port = freeport(xrange(8000, 8020),
- lambda port: Server(('127.0.0.1', port), TestHTTPRequestHandler))
- # Pass the selected port number to the subject test program via the
- # environment. We don't want to impose requirements on the test program's
- # command-line parsing -- and anyway, for C++ integration tests, that's
- # performed in TUT code rather than our own.
- os.environ["PORT"] = str(port)
- debug("$PORT = %s", port)
- sys.exit(run(server=Thread(name="httpd", target=httpd.serve_forever), *sys.argv[1:]))
+#!/usr/bin/env python
+"""\
+@file test_llsdmessage_peer.py
+@author Nat Goodspeed
+@date 2008-10-09
+@brief This script asynchronously runs the executable (with args) specified on
+ the command line, returning its result code. While that executable is
+ running, we provide dummy local services for use by C++ tests.
+
+$LicenseInfo:firstyear=2008&license=viewerlgpl$
+Second Life Viewer Source Code
+Copyright (C) 2010, Linden Research, Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation;
+version 2.1 of the License only.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+$/LicenseInfo$
+"""
+
+import os
+import sys
+from threading import Thread
+from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
+
+mydir = os.path.dirname(__file__) # expected to be .../indra/llmessage/tests/
+sys.path.insert(0, os.path.join(mydir, os.pardir, os.pardir, "lib", "python"))
+from indra.util.fastest_elementtree import parse as xml_parse
+from indra.base import llsd
+from testrunner import freeport, run, debug, VERBOSE
+import time
+
+_storage=None
+
+class TestHTTPRequestHandler(BaseHTTPRequestHandler):
+ """This subclass of BaseHTTPRequestHandler is to receive and echo
+ LLSD-flavored messages sent by the C++ LLHTTPClient.
+ """
+ def read(self):
+ # The following logic is adapted from the library module
+ # SimpleXMLRPCServer.py.
+ # Get arguments by reading body of request.
+ # We read this in chunks to avoid straining
+ # socket.read(); around the 10 or 15Mb mark, some platforms
+ # begin to have problems (bug #792570).
+ try:
+ size_remaining = int(self.headers["content-length"])
+ except (KeyError, ValueError):
+ return ""
+ max_chunk_size = 10*1024*1024
+ L = []
+ while size_remaining:
+ chunk_size = min(size_remaining, max_chunk_size)
+ chunk = self.rfile.read(chunk_size)
+ L.append(chunk)
+ size_remaining -= len(chunk)
+ return ''.join(L)
+ # end of swiped read() logic
+
+ def read_xml(self):
+ # This approach reads the entire POST data into memory first
+ return llsd.parse(self.read())
+## # This approach attempts to stream in the LLSD XML from self.rfile,
+## # assuming that the underlying XML parser reads its input file
+## # incrementally. Unfortunately I haven't been able to make it work.
+## tree = xml_parse(self.rfile)
+## debug("Finished raw parse")
+## debug("parsed XML tree %s", tree)
+## debug("parsed root node %s", tree.getroot())
+## debug("root node tag %s", tree.getroot().tag)
+## return llsd.to_python(tree.getroot())
+
+ def do_HEAD(self):
+ self.do_GET(withdata=False)
+
+ def do_GET(self, withdata=True):
+ # Of course, don't attempt to read data.
+ data = dict(reply="success", body="avatar", random=17)
+ self.answer(data, withdata=withdata)
+
+ def do_POST(self):
+ # Read the provided POST data.
+ self.answer(self.read_xml())
+
+ def do_PUT(self):
+ # Read the provided PUT data.
+ self.answer(self.read_xml())
+
+ def answer(self, data, withdata=True):
+ global _storage
+ debug("%s.answer(%s): self.path = %r", self.__class__.__name__, data, self.path)
+ if "fail" in self.path or "test/error" in self.path: # fail requested
+ status = data.get("status", 500)
+ # self.responses maps an int status to a (short, long) pair of
+ # strings. We want the longer string. That's why we pass a string
+ # pair to get(): the [1] will select the second string, whether it
+ # came from self.responses or from our default pair.
+ reason = data.get("reason",
+ self.responses.get(status,
+ ("fail requested",
+ "Your request specified failure status %s "
+ "without providing a reason" % status))[1])
+ debug("fail requested: %s: %r", status, reason)
+ self.send_error(status, reason)
+ else:
+ if "web/echo" in self.path:
+ pass
+ elif "test/timeout" in self.path:
+ time.sleep(5.0)
+ return
+ elif "test/storage" in self.path:
+ if "GET" == self.command:
+ data = _storage
+ else:
+ _storage = data
+ data = "ok"
+ else:
+ data = data.copy() # we're going to modify
+ # Ensure there's a "reply" key in data, even if there wasn't before
+ data["reply"] = data.get("reply", llsd.LLSD("success"))
+ response = llsd.format_xml(data)
+ debug("success: %s", response)
+ self.send_response(200)
+ self.send_header("Content-type", "application/llsd+xml")
+ self.send_header("Content-Length", str(len(response)))
+ self.end_headers()
+ if withdata:
+ self.wfile.write(response)
+
+ if not VERBOSE:
+ # When VERBOSE is set, skip both these overrides because they exist to
+ # suppress output.
+
+ def log_request(self, code, size=None):
+ # For present purposes, we don't want the request splattered onto
+ # stderr, as it would upset devs watching the test run
+ pass
+
+ def log_error(self, format, *args):
+ # Suppress error output as well
+ pass
+
+class Server(HTTPServer):
+ # This pernicious flag is on by default in HTTPServer. But proper
+ # operation of freeport() absolutely depends on it being off.
+ allow_reuse_address = False
+
+if __name__ == "__main__":
+ # Instantiate a Server(TestHTTPRequestHandler) on the first free port
+ # in the specified port range. Doing this inline is better than in a
+ # daemon thread: if it blows up here, we'll get a traceback. If it blew up
+ # in some other thread, the traceback would get eaten and we'd run the
+ # subject test program anyway.
+ httpd, port = freeport(xrange(8000, 8020),
+ lambda port: Server(('127.0.0.1', port), TestHTTPRequestHandler))
+ # Pass the selected port number to the subject test program via the
+ # environment. We don't want to impose requirements on the test program's
+ # command-line parsing -- and anyway, for C++ integration tests, that's
+ # performed in TUT code rather than our own.
+ os.environ["PORT"] = str(port)
+ debug("$PORT = %s", port)
+ sys.exit(run(server=Thread(name="httpd", target=httpd.serve_forever), *sys.argv[1:]))
diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt
index fc38f56957..f31446924f 100644
--- a/indra/llrender/CMakeLists.txt
+++ b/indra/llrender/CMakeLists.txt
@@ -78,13 +78,17 @@ set_source_files_properties(${llrender_HEADER_FILES}
list(APPEND llrender_SOURCE_FILES ${llrender_HEADER_FILES})
-if (SERVER AND NOT WINDOWS AND NOT DARWIN)
+list(APPEND llrender_SOURCE_FILES
+ llgl.cpp
+ llrender.cpp
+ llrendertarget.cpp
+ )
+if ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN)
copy_server_sources(
llgl
llrender
)
-
set_source_files_properties(
${server_SOURCE_FILES}
PROPERTIES
@@ -94,13 +98,20 @@ if (SERVER AND NOT WINDOWS AND NOT DARWIN)
${llrender_SOURCE_FILES}
${server_SOURCE_FILES}
)
-else (SERVER AND NOT WINDOWS AND NOT DARWIN)
- list(APPEND llrender_SOURCE_FILES
- llgl.cpp
- llrender.cpp
- llrendertarget.cpp
- )
-endif (SERVER AND NOT WINDOWS AND NOT DARWIN)
+
+target_link_libraries(llrenderheadless
+ ${LLCOMMON_LIBRARIES}
+ ${LLIMAGE_LIBRARIES}
+ ${LLMATH_LIBRARIES}
+ ${LLRENDER_LIBRARIES}
+ ${LLVFS_LIBRARIES}
+ ${LLXML_LIBRARIES}
+ ${LLVFS_LIBRARIES}
+ ${LLWINDOW_LIBRARIES}
+ ${OPENGL_LIBRARIES})
+
+endif ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN)
+
add_library (llrender ${llrender_SOURCE_FILES})
# Libraries on which this library depends, needed for Linux builds
# Sort by high-level to low-level
@@ -115,3 +126,4 @@ target_link_libraries(llrender
${LLWINDOW_LIBRARIES}
${FREETYPE_LIBRARIES}
${OPENGL_LIBRARIES})
+
diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp
index 4d22eba3d9..d0637f2546 100644
--- a/indra/llrender/llfontregistry.cpp
+++ b/indra/llrender/llfontregistry.cpp
@@ -225,7 +225,7 @@ std::string currentOsName()
return "Windows";
#elif LL_DARWIN
return "Mac";
-#elif LL_SDL
+#elif LL_SDL || LL_MESA_HEADLESS
return "Linux";
#else
return "";
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 4597d06260..c60eb8d9d9 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -357,7 +357,6 @@ bool LLTexUnit::bind(LLCubeMap* cubeMap)
}
// LLRenderTarget is unavailible on the mapserver since it uses FBOs.
-#if !LL_MESA_HEADLESS
bool LLTexUnit::bind(LLRenderTarget* renderTarget, bool bindDepth)
{
if (mIndex < 0) return false;
@@ -380,7 +379,6 @@ bool LLTexUnit::bind(LLRenderTarget* renderTarget, bool bindDepth)
return true;
}
-#endif // LL_MESA_HEADLESS
bool LLTexUnit::bindManual(eTextureType type, U32 texture, bool hasMips)
{
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index cc5c232380..d87255f6ce 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -570,3 +570,5 @@ void LLRenderTarget::getViewport(S32* viewport)
viewport[3] = mResY;
}
+
+
diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h
index e1a51304f1..b9ef666206 100644
--- a/indra/llrender/llrendertarget.h
+++ b/indra/llrender/llrendertarget.h
@@ -28,7 +28,6 @@
#define LL_LLRENDERTARGET_H
// LLRenderTarget is unavailible on the mapserver since it uses FBOs.
-#if !LL_MESA_HEADLESS
#include "llgl.h"
#include "llrender.h"
@@ -157,7 +156,5 @@ protected:
static LLRenderTarget* sBoundTarget;
};
-#endif //!LL_MESA_HEADLESS
-
#endif
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 28a14b23b9..37a4649cb6 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -1574,8 +1574,10 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
{
if (map_range)
{
+#ifndef LL_MESA_HEADLESS
glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE);
glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE);
+#endif
src = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
}
else
@@ -1752,8 +1754,10 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
{
if (map_range)
{
+#ifndef LL_MESA_HEADLESS
glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE);
glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE);
+#endif
src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
}
else
@@ -1881,7 +1885,9 @@ void LLVertexBuffer::unmapBuffer()
}
else if (gGLManager.mHasFlushBufferRange)
{
+#ifndef LL_MESA_HEADLESS
glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER_ARB, offset, length);
+#endif
}
stop_glerror();
}
@@ -1947,8 +1953,10 @@ void LLVertexBuffer::unmapBuffer()
else if (gGLManager.mHasFlushBufferRange)
{
#ifdef GL_APPLE_flush_buffer_range
+#ifndef LL_MESA_HEADLESS
glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length);
#endif
+#endif
}
stop_glerror();
}
diff --git a/indra/llwindow/CMakeLists.txt b/indra/llwindow/CMakeLists.txt
index 652d5cae5a..4db58be776 100644
--- a/indra/llwindow/CMakeLists.txt
+++ b/indra/llwindow/CMakeLists.txt
@@ -140,18 +140,19 @@ endif (SOLARIS)
set_source_files_properties(${llwindow_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
-if (SERVER AND NOT WINDOWS AND NOT DARWIN)
+if ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN)
set(server_SOURCE_FILES
llwindowmesaheadless.cpp
+ llmousehandler.cpp
)
set(server_HEADER_FILES
llwindowmesaheadless.h
+ llmousehandler.h
)
copy_server_sources(
llwindow
)
-
set_source_files_properties(
${server_SOURCE_FILES}
PROPERTIES
@@ -161,8 +162,8 @@ if (SERVER AND NOT WINDOWS AND NOT DARWIN)
${llwindow_SOURCE_FILES}
${server_SOURCE_FILES}
)
- target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES})
-endif (SERVER AND NOT WINDOWS AND NOT DARWIN)
+ target_link_libraries (llwindowheadless ${llwindow_LINK_LIBRARIES} OSMesa16 dl)
+endif ((SERVER OR BAKING) AND NOT WINDOWS AND NOT DARWIN)
if (llwindow_HEADER_FILES)
list(APPEND llwindow_SOURCE_FILES ${llwindow_HEADER_FILES})
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 5b7424acbb..d83278d875 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -256,6 +256,8 @@ std::vector<std::string> LLWindow::getDynamicFallbackFontList()
return LLWindowWin32::getDynamicFallbackFontList();
#elif LL_DARWIN
return LLWindowMacOSX::getDynamicFallbackFontList();
+#elif LL_MESA_HEADLESS
+ return std::vector<std::string>();
#elif LL_SDL
return LLWindowSDL::getDynamicFallbackFontList();
#else
diff --git a/indra/llwindow/llwindowmesaheadless.h b/indra/llwindow/llwindowmesaheadless.h
index 8f70aee4f6..bc8e25ec44 100644
--- a/indra/llwindow/llwindowmesaheadless.h
+++ b/indra/llwindow/llwindowmesaheadless.h
@@ -51,6 +51,7 @@ public:
/*virtual*/ BOOL getSize(LLCoordWindow *size) {return FALSE;};
/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
+ /*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;};
/*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
diff --git a/indra/lscript/lscript_compile/CMakeLists.txt b/indra/lscript/lscript_compile/CMakeLists.txt
index 3ed2892e0e..2cfd389893 100644
--- a/indra/lscript/lscript_compile/CMakeLists.txt
+++ b/indra/lscript/lscript_compile/CMakeLists.txt
@@ -95,6 +95,7 @@ add_custom_command(
${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp
COMMAND ${FLEX}
ARGS
+ -P indra_
-o${CMAKE_CURRENT_BINARY_DIR}/indra.l.cpp
${CMAKE_CURRENT_SOURCE_DIR}/indra.l
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/indra.l
@@ -112,8 +113,10 @@ if (WINDOWS)
${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
${CMAKE_CURRENT_BINARY_DIR}/indra.y.hpp
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bison.bat
+ ARGS
${BISON} ${M4_PATH}
- ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
+ -p indra_
+ -d -o ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
${CMAKE_CURRENT_SOURCE_DIR}/indra.y
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/bison.bat
@@ -128,6 +131,7 @@ else (WINDOWS)
COMMAND
${BISON}
ARGS
+ -p indra_
-d -o ${CMAKE_CURRENT_BINARY_DIR}/indra.y.cpp
${CMAKE_CURRENT_SOURCE_DIR}/indra.y
DEPENDS
diff --git a/indra/lscript/lscript_compile/bison.bat b/indra/lscript/lscript_compile/bison.bat
index 0baff4e5ef..d40997225e 100644
--- a/indra/lscript/lscript_compile/bison.bat
+++ b/indra/lscript/lscript_compile/bison.bat
@@ -2,10 +2,11 @@
@REM find m4, even if neither program is present in PATH.
@set bison=%1
-set M4PATH=%2
+shift
+set M4PATH=%1
+shift
set M4=
-@set output=%3
-@set input=%4
set PATH=%M4PATH%;%PATH%
-%bison% -d -o %output% %input%
+@REM %* does not work with shift...
+%bison% %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/indra/lscript/lscript_compile/indra.l b/indra/lscript/lscript_compile/indra.l
index 96b7e57e97..b2c49083cb 100644
--- a/indra/lscript/lscript_compile/indra.l
+++ b/indra/lscript/lscript_compile/indra.l
@@ -56,6 +56,29 @@ void parse_string();
#define ECHO do { } while (0)
+#define yyparse indra_parse
+#define yyerror indra_error
+#define yylval indra_lval
+#define yy_create_buffer indra__create_buffer
+#define yy_delete_buffer indra__delete_buffer
+#define yy_flex_debug indra__flex_debug
+#define yy_init_buffer indra__init_buffer
+#define yy_flush_buffer indra__flush_buffer
+#define yy_load_buffer_state indra__load_buffer_state
+#define yy_switch_to_buffer indra__switch_to_buffer
+#define yyin indra_in
+#define yyleng indra_leng
+#define yylex indra_lex
+#define yylineno indra_lineno
+#define yyout indra_out
+#define yyrestart indra_restart
+#define yytext indra_text
+#define yywrap indra_wrap
+#define yyalloc indra_alloc
+#define yyrealloc indra_realloc
+#define yyfree indra_free
+
+
#if defined(__cplusplus)
extern "C" { int yylex( void ); }
extern "C" { int yyparse( void ); }
diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp
index 1e03582a29..d7d9f82910 100644
--- a/indra/newview/lldirpicker.cpp
+++ b/indra/newview/lldirpicker.cpp
@@ -327,6 +327,8 @@ BOOL LLDirPicker::getDir(std::string* filename)
return FALSE;
}
+#if !LL_MESA_HEADLESS
+
if (mFilePicker)
{
GtkWindow* picker = mFilePicker->buildFilePicker(false, true,
@@ -340,6 +342,8 @@ BOOL LLDirPicker::getDir(std::string* filename)
return (!mFilePicker->getFirstFile().empty());
}
}
+#endif // !LL_MESA_HEADLESS
+
return FALSE;
}
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 4bf5b26b3b..d13f85baa2 100644
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -1103,6 +1103,7 @@ void LLFilePicker::chooser_responder(GtkWidget *widget, gint response, gpointer
GtkWindow* LLFilePicker::buildFilePicker(bool is_save, bool is_folder, std::string context)
{
+#ifndef LL_MESA_HEADLESS
if (LLWindowSDL::ll_try_gtk_init())
{
GtkWidget *win = NULL;
@@ -1174,6 +1175,9 @@ GtkWindow* LLFilePicker::buildFilePicker(bool is_save, bool is_folder, std::stri
{
return NULL;
}
+#else
+ return NULL;
+#endif //LL_MESA_HEADLESS
}
static void add_common_filters_to_gtkchooser(GtkFileFilter *gfilter,
@@ -1473,7 +1477,7 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename
return FALSE;
}
-BOOL LLFilePicker::getOpenFile( ELoadFilter filter )
+BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking )
{
// if local file browsing is turned off, return without opening dialog
// (Even though this is a stub, I think we still should not return anything at all)
@@ -1494,7 +1498,7 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter )
default: break;
}
mFiles.push_back(filename);
- llinfos << "getOpenFile: Will try to open file: " << hackyfilename << llendl;
+ llinfos << "getOpenFile: Will try to open file: " << filename << llendl;
return TRUE;
}