Skip to content

Commit d64c819

Browse files
committed
Removed unused linux-libs
1 parent 15cb3a2 commit d64c819

File tree

11 files changed

+0
-140
lines changed

11 files changed

+0
-140
lines changed

Server/launcher/Main.cpp

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,6 @@ FILE* SharedUtil::File::Fopen(const char* szFilename, const char* szMode)
3232
{
3333
return fopen(szFilename, szMode);
3434
}
35-
bool SString::Contains(const SString& strOther) const
36-
{
37-
return find(strOther) != std::string::npos;
38-
}
39-
SString SharedUtil::GetSystemCurrentDirectory(void)
40-
{
41-
char szBuffer[MAX_PATH];
42-
getcwd(szBuffer, MAX_PATH - 1);
43-
return szBuffer;
44-
}
45-
void HandleLinuxLibs(const SString& strLaunchDirectory, int argc, char* argv[]);
4635
#endif
4736

4837
using namespace std;
@@ -53,14 +42,6 @@ using namespace std;
5342
#define LIB_CORE "./" SERVER_BIN_PATH "core" MTA_LIB_SUFFIX MTA_LIB_EXTENSION
5443
#endif
5544

56-
#ifndef WIN32
57-
#ifdef ANY_x86
58-
#define LINUX_LIBS_PATH "x86/linux-libs"
59-
#else
60-
#define LINUX_LIBS_PATH "x64/linux-libs"
61-
#endif
62-
#endif
63-
6445
int main(int argc, char* argv[])
6546
{
6647
// Work out the launched directory and filename
@@ -102,7 +83,6 @@ int main(int argc, char* argv[])
10283
printf(" -u Disable output buffering and flush instantly (useful for screenlog)\n");
10384
#ifndef WIN32
10485
printf(" -x Disable simplified crash reports (To allow core dumps)\n");
105-
printf(" -q Do not add " LINUX_LIBS_PATH " directory to library search path and relaunch\n");
10686
#endif
10787
printf(" -D [PATH] Use as base directory\n");
10888
printf(" --config [FILE] Alternate mtaserver.conf file\n");
@@ -125,8 +105,6 @@ int main(int argc, char* argv[])
125105
cin.get();
126106
return 1;
127107
}
128-
#else
129-
HandleLinuxLibs(strLaunchDirectory, argc, argv);
130108
#endif
131109

132110
// If we are unable to access the core module, try changing to the directory of the launched file
@@ -176,53 +154,3 @@ int main(int argc, char* argv[])
176154
cin.get();
177155
return 1;
178156
}
179-
180-
#ifndef WIN32
181-
//
182-
// Add linux-libs to library search path if:
183-
// 1. Options don't forbid it (-q)
184-
// 2. linux-libs is not already in the library search path
185-
//
186-
void HandleLinuxLibs(const SString& strLaunchDirectory, int argc, char* argv[])
187-
{
188-
// Check for linux-libs forbidden option
189-
for (int i = 1; i < argc; i++)
190-
{
191-
if (strcmp(argv[i], "-q") == 0)
192-
return;
193-
}
194-
195-
// Calculate absolute path to MTA directory
196-
SString strSavedDir = GetSystemCurrentDirectory();
197-
chdir(strLaunchDirectory);
198-
SString strAbsLaunchDirectory = GetSystemCurrentDirectory();
199-
chdir(strSavedDir);
200-
201-
SString strLdLibraryPath = getenv("LD_LIBRARY_PATH");
202-
SString strLinuxLibsPath = strAbsLaunchDirectory + "/" LINUX_LIBS_PATH;
203-
204-
// Check that linux-libs is not already in library path
205-
if (!strLdLibraryPath.Contains(strLinuxLibsPath))
206-
{
207-
// Add linux-libs to search path
208-
if (!strLdLibraryPath.empty())
209-
strLdLibraryPath += ";";
210-
strLdLibraryPath += strLinuxLibsPath;
211-
SString strEnvString = SStringX("LD_LIBRARY_PATH=") + strLdLibraryPath;
212-
putenv((char*)*strEnvString);
213-
214-
// Add -q to ensure linux-libs don't get added again
215-
char** pArgArray = new char*[argc + 2];
216-
for (int i = 0; i <= argc; i++)
217-
{
218-
pArgArray[i] = argv[i];
219-
}
220-
char newArg[] = "-q";
221-
pArgArray[argc] = newArg;
222-
pArgArray[argc + 1] = nullptr;
223-
224-
// Go for launch #2
225-
execv(argv[0], pArgArray);
226-
}
227-
}
228-
#endif

Shared/data/linux-libs/mta-server-with-linux-libs.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

Shared/data/linux-libs/mta-server64-with-linux-libs.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.
-1.96 MB
Binary file not shown.
-2.11 MB
Binary file not shown.
-382 KB
Binary file not shown.
-968 KB
Binary file not shown.
-1.74 MB
Binary file not shown.
-1.96 MB
Binary file not shown.
-354 KB
Binary file not shown.

0 commit comments

Comments
 (0)