Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Omake for Linux running #1060

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/omake/MakeMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,18 @@ bool MakeMain::LoadJobArgs()
}
void MakeMain::LoadEnvironment()
{
#ifdef TARGET_OS_WINDOWS
char** env = environ;
#else
char** env = 0;
// https://www.man7.org/linux/man-pages/man7/environ.7.html
/*
*Historically and by standard, environ must be declared in the
*user program. However, as a (nonstandard) programmer
*convenience, environ is declared in the header file <unistd.h> if
*the _GNU_SOURCE feature test macro is defined (see
*feature_test_macros(7)).
*/
#ifndef TARGET_OS_WINDOWS
extern char** environ;
#endif
char** env = environ;
Variable::Origin origin;
if (environOverride.GetValue())
origin = Variable::o_environ_override;
Expand Down
2 changes: 1 addition & 1 deletion src/omake/Maker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Maker::Maker(bool Silent, bool DisplayOnly, bool IgnoreResults, bool Touch, Outp
Variable* v = VariableContainer::Instance()->Lookup("SHELL");
std::string shtest = v->GetValue();
std::transform(shtest.begin(), shtest.end(), shtest.begin(), ::toupper);
OS::SetSHEXE(shtest.find("SH.EXE") != std::string::npos || shtest.find("BASH.EXE") != std::string::npos);
OS::SetSHEXE(shtest.find("sh") != std::string::npos);
}
Maker::~Maker() {}
void Maker::SetFirstGoal(const std::string& name)
Expand Down
18 changes: 10 additions & 8 deletions src/omake/Variable.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
/* Software License Agreement
*
*
* Copyright(C) 1994-2024 David Lindauer, (LADSoft)
*
*
* This file is part of the Orange C Compiler package.
*
*
* The Orange C Compiler package is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*
* The Orange C Compiler package 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 General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with Orange C. If not, see <http://www.gnu.org/licenses/>.
*
*
* contact information:
* email: [email protected] <David Lindauer>
*
*
*
*
*/

#include "Variable.h"
Expand Down Expand Up @@ -85,6 +85,8 @@ Variable* VariableContainer::Lookup(const std::string& name)
}
void VariableContainer::operator+(Variable* variable)
{
if (!variable)
return;
std::unique_ptr<Variable> temp(variable);
if (variable->GetName().find_first_of('%') != std::string::npos)
{
Expand Down
Loading
Loading