2 # Copyright 2003, Sony Online Entertainment.
5 # Based off a script originally written by Rick Delashmit.
7 # PURPOSE: Build the infrequently-changing Linux libraries that
8 # typically live in perforce as binaries. The gcc 2.95.3 C++ libraries are
9 # incompatible with the gcc 3.x C++ libraries. This script builds
10 # all the libraries that normally exist in perforce as binaries.
12 # NOTE: This script will fail if the user has not taken care to remove
13 # *.a and *.so from their client spec. Those files will be read-only and
14 # the new compiled versions will fail to replace them. As of this writing,
15 # the only .a file that should exist in perforce is the one for pcre in
16 # swg/$BRANCH/src/external/3rd/library/pcre/*.
18 # USAGE: run this script in the from the base directory of a branch.
20 # Here's some examples of branch directories:
27 # * This script does no error checking on the result of the builds. If
28 # the caller does not watch the output, it is possible this script will fail.
30 # * This script has failed to build in the live branch on Matt Bogue's machine.
31 # Rick and I could not resolve the apparent bash substitution issue that was
32 # occurring. Our workaround was to link the live branch's
33 # external/3rd/library/platform/libs directory to the corresponding directory
34 # in the current branch.
41 cd $BASEDIR/src
/external
/3rd
/library
/soePlatform
/ChatAPI
2/ChatAPI
/projects
/Chat
/ChatMono
43 mkdir
-p ..
/..
/..
/..
/..
/libs
/Linux-Debug
44 mkdir
-p ..
/..
/..
/..
/..
/libs
/Linux-Release
45 cp ..
/..
/..
/lib
/debug
/libChatAPI.a ..
/..
/..
/..
/..
/libs
/Linux-Debug
/
46 cp ..
/..
/..
/lib
/release
/libChatAPI.a ..
/..
/..
/..
/..
/libs
/Linux-Release
/
49 cd $BASEDIR/src
/external
/3rd
/library
/stlport453
/src
53 # Note: just link zlib to the zlib already installed under Linux.
54 mkdir
-p $BASEDIR/src
/external
/3rd
/library
/zlib
/lib
/linux
55 ln -s -f /usr
/lib
/libz.a
$BASEDIR/src
/external
/3rd
/library
/zlib
/lib
/linux
/libz.a
58 cd $BASEDIR/src
/external
/3rd
/library
/platform
/projects
/Session
/LoginAPI
62 cd $BASEDIR/src
/external
/3rd
/library
/platform
/projects
/Session
/CommonAPI
66 cd $BASEDIR/src
/external
/3rd
/library
/platform
/utils
/Base
/linux
67 make debug_st release_st
70 cd $BASEDIR/src
/external
/3rd
/library
/soePlatform
/CommodityAPI
/linux
72 cp $BASEDIR/src
/external
/3rd
/library
/soePlatform
/libs
/Linux-Debug
/libcommodityapi.so
$BASEDIR/exe
/linux
/
73 cp $BASEDIR/src
/external
/3rd
/library
/soePlatform
/libs
/Linux-Debug
/libcommodityapi.so
$BASEDIR/dev
/linux
/
76 cd $BASEDIR/src
/external
/3rd
/library
/soePlatform
/CSAssist
/projects
/CSAssist
/CSAssistgameapi
79 echo Copying csassistgameapi
80 mkdir
-p ..
/..
/..
/..
/libs
/Linux-Debug
81 mkdir
-p ..
/..
/..
/..
/libs
/Linux-Release
83 cp debug
/libCSAssistgameapi.a ..
/..
/..
/..
/libs
/Linux-Debug
/
84 cp release
/libCSAssistgameapi.a ..
/..
/..
/..
/libs
/Linux-Release
/
85 # note: this includes various other libs that CustomerServiceServer expects to link with, so is not compatible
89 cd $BASEDIR/src
/external
/3rd
/library
/platform
/MonAPI2
93 # libOracleDB (CommodityServer)
94 cd $BASEDIR/src
/external
/3rd
/library
/soePlatform
/CommodityServer
/platform
/utils
/OracleDB
96 ls *.cpp |
sed -e '/\.cpp/s///' -e '/^.*$/s//g++ -g -c -I..\/..\/..\/..\/..\/oracle\/include -I.. &.cpp -o &.o/' >comp.sh
99 ar rcs libOracleDB.a
*.o
100 mkdir
-p ..
/..
/..
/..
/libs
/Linux-Debug
101 mv -f libOracleDB.a ..
/..
/..
/..
/libs
/Linux-Debug
/libOracleDB.a
103 # libBase (CommodityServer)
104 cd $BASEDIR/src
/external
/3rd
/library
/soePlatform
/CommodityServer
/platform
/utils
/Base
106 ls *.cpp linux
/*.cpp |
sed -e '/\.cpp/s///' -e '/^.*$/s//g++ -g -c -Dlinux=1 -D_REENTRANT &.cpp -o &.o/' >comp.sh
109 ar rcs libBase.a
*.o linux
/*.o
110 mkdir
-p ..
/..
/..
/..
/libs
/Linux-Debug
111 mv -f libBase.a ..
/..
/..
/..
/libs
/Linux-Debug
/libBase.a
113 # Create an empty library.a to solve makefile dependencies on libCSAssistBase.a and libCSAssistUnicode.a
114 echo > /tmp
/empty.cpp
115 g
++ -c -o /tmp
/empty.o
/tmp
/empty.cpp
116 ar crs
/tmp
/empty.a
/tmp
/empty.o
118 mkdir
-p $BASEDIR/src
/external
/3rd
/library
/soePlatform
/libs
/Linux-Debug
119 cp /tmp
/empty.a
$BASEDIR/src
/external
/3rd
/library
/soePlatform
/libs
/Linux-Debug
/libCSAssistBase.a
120 cp /tmp
/empty.a
$BASEDIR/src
/external
/3rd
/library
/soePlatform
/libs
/Linux-Debug
/libCSAssistUnicode.a
122 mkdir
-p $BASEDIR/src
/external
/3rd
/library
/soePlatform
/libs
/Linux-Release
123 cp /tmp
/empty.a
$BASEDIR/src
/external
/3rd
/library
/soePlatform
/libs
/Linux-Release
/libCSAssistBase.a
124 cp /tmp
/empty.a
$BASEDIR/src
/external
/3rd
/library
/soePlatform
/libs
/Linux-Release
/libCSAssistUnicode.a
126 # Build CommoditiesServer_d and CommoditiesServer_r
127 # .. start with local OracleDB library
128 cd $BASEDIR/src
/external
/3rd
/library
/soePlatform
/CommodityServer
/platform
/utils
/OracleDB
131 # .. now do the server
135 # Copy CommoditiesServer_* to exe/linux. The normal
136 # make process copies those from exe/linux to dev/linux.
137 cp commoditysvr
$BASEDIR/exe
/linux
/CommoditiesServer_d
138 cp commoditysvr
$BASEDIR/exe
/linux
/CommoditiesServer_r
140 # Remove the debugging symbols from the release version.
142 strip
-g $BASEDIR/exe
/linux
/CommoditiesServer_r
144 # Copy Commodities server from exe/linux to dev/linux for the first time. Failure to do this
145 # will cause the build to break.
146 cp $BASEDIR/exe
/linux
/CommoditiesServer_
* $BASEDIR/dev
/linux
148 # Build the MonAPI2 library.
149 cd $BASEDIR/src
/external
/3rd
/library
/platform
/MonAPI2
151 .
/configure
--with-udplibrary=..
/..
/udplibrary
--prefix=`pwd`