rename some of the new Environment methods, make PocoDoc config changes backwards-compatible, revert PocoDoc config changes, make doc build scripts work on macos

This commit is contained in:
Guenter Obiltschnig 2017-11-08 14:37:53 +01:00
parent f0a79015f7
commit 079c9a6263
7 changed files with 100 additions and 145 deletions

View File

@ -105,19 +105,15 @@ public:
/// Return the operating system as defined
/// in the include Foundation/Platform.h (POCO_OS)
static Poco::Int32 cpu();
/// Return the underlying cpu that runs this operating system
static Poco::Int32 arch();
/// Return the underlying cpu architecture that runs this operating system
/// as defined in Foundation/Platform (POCO_ARCH)
static bool osFamilyUnix();
static bool isUnix();
/// Return true if the operating system belongs to the Linux family
static bool osFamilyWindows();
static bool isWindows();
/// Return true if the operating system belongs to the Windows family
static bool osFamilyVms();
/// Return true if the operating system belongs to the VMS family
};

View File

@ -126,17 +126,20 @@ Poco::UInt32 Environment::libraryVersion()
return POCO_VERSION;
}
Poco::Int32 Environment::os()
{
return POCO_OS;
}
Poco::Int32 Environment::cpu()
Poco::Int32 Environment::arch()
{
return POCO_ARCH;
}
bool Environment::osFamilyUnix()
bool Environment::isUnix()
{
#if defined(POCO_OS_FAMILY_UNIX)
return true;
@ -145,7 +148,8 @@ bool Environment::osFamilyUnix()
#endif
}
bool Environment::osFamilyWindows()
bool Environment::isWindows()
{
#if defined(POCO_OS_FAMILY_WINDOWS)
return true;
@ -154,13 +158,5 @@ bool Environment::osFamilyWindows()
#endif
}
bool Environment::osFamilyVms()
{
#if defined(POCO_OS_FAMILY_VMS)
return true;
#else
return false;
#endif
}
} // namespace Poco

View File

@ -13,13 +13,6 @@
expat*.h,
zconf.h,
zlib.h,
Alignment.h,
QName.h,
CppUnitException.h,
Constants.h,
inffast.h,
PDF/include/*.h,
CppParser/include/*.h
</exclude>
</files>
<pages>
@ -35,41 +28,21 @@
${PocoBuild}/*/doc/images
</resources>
<compiler>
<windows>
<exec>cl.exe</exec>
<options>
${Includes},
/I${PocoBase}/openssl/include
/I${VC}/include,
/I${WDK}/shared
/I${WDK}/um
/I${WDK}/ucrt
/nologo,
/D_DEBUG,
/E,
/C,
/DPOCO_NO_GCC_API_ATTRIBUTE
/DPOCO_NO_WINDOWS_H
</options>
<path>${VC}/bin</path>
<usePipe>true</usePipe>
</windows>
<unix>
<exec>${CXX} ${CXXFLAGS}</exec>
<exec>clang++</exec>
<options>
${Includes},
-I/usr/local/mysql/include,
-I/usr/include/mysql,
-I/usr/include/postgresql,
-D_DEBUG,
-E,
-C,
-DPOCO_NO_GCC_API_ATTRIBUTE
-DPOCO_NO_WINDOWS_H
-DPOCO_NO_GCC_API_ATTRIBUTE,
-xc++
-std=c++11,
-stdlib=libc++
</options>
<path></path>
<usePipe>true</usePipe>
</unix>
</compiler>
<language>EN</language>
<charset>utf-8</charset>

View File

@ -13,9 +13,7 @@
expat*.h,
zconf.h,
zlib.h,
XMLStreamParser.h,
CppUnitException.h,
RepeatedTest.h,
${PocoBuild}/Util/include/Poco/Util/Units.h
</exclude>
</files>
<pages>
@ -31,23 +29,15 @@
${PocoBuild}/*/doc/images
</resources>
<compiler>
<exec>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe</exec>
<exec>g++</exec>
<options>
${Includes},
-I/usr/local/mysql/include,
-I/usr/include/mysql,
-I/usr/include/postgresql,
/I${PocoBase}/openssl/include
/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include,
/IC:\Program Files (x86)\Windows Kits\8.1\Include\shared,
/IC:\Program Files (x86)\Windows Kits\8.1\Include\um,
/IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt,
/nologo,
-D_DEBUG,
-E,
-C,
-DPOCO_NO_GCC_API_ATTRIBUTE
-DPOCO_NO_WINDOWS_H
</options>
<path></path>
<usePipe>true</usePipe>
@ -104,7 +94,7 @@
<loggers>
<root>
<channel>c1</channel>
<level>information</level>
<level>warning</level>
</root>
</loggers>
<channels>

View File

@ -60,7 +60,6 @@ using Poco::Util::OptionCallback;
using Poco::Util::HelpFormatter;
using Poco::Util::AbstractConfiguration;
static std::string osName = Environment::osName();
class Preprocessor
{
@ -221,14 +220,17 @@ protected:
Path pp(file);
pp.setExtension("i");
std::string comp = "PocoDoc.compiler";
if (Environment::osFamilyWindows())
comp += ".windows";
std::string platformComp(comp);
if (Environment::isWindows())
platformComp += ".windows";
else
comp += ".unix";
std::string exec = config().getString(comp + ".exec");
std::string opts = config().getString(comp + ".options");
std::string path = config().getString(comp + ".path", "");
bool usePipe = config().getBool(comp + ".usePipe", false);
platformComp += ".unix";
std::string exec = config().getString(platformComp + ".exec", config().getString(comp + ".exec"));
std::string opts = config().getString(platformComp + ".options", config().getString(comp + ".options"));
std::string path = config().getString(platformComp + ".path", config().getString(comp + ".path", ""));
bool usePipe = config().getBool(platformComp + ".usePipe", config().getBool(comp + ".usePipe", false));
std::string popts;
for (std::string::const_iterator it = opts.begin(); it != opts.end(); ++it)

View File

@ -18,7 +18,7 @@ Please refer to the Android NDK Dev Guide document "Standalone Toolchain", secti
Typically, you'll run a command like:
$NDK/build/tools/make-standalone-toolchain.sh --platform=android-8 --install-dir=$HOME/my-android-toolchain
$NDK/build/tools/make-standalone-toolchain.sh --arch arm --install-dir=$HOME/my-android-toolchain/arm
----
Then, add the directory containing the toolchain executables to your <[$PATH]>:
@ -71,18 +71,16 @@ is used to cross-build for Android from a Linux or Mac OS X host.
To build the POCO C++ Libraries (static) on a Linux or Mac OS X host:
./configure --config=Android --no-samples --no-tests
./make -s -j4
make -s -j4
----
The default configuration builds for the <*armeabi*> platform ABI. To build for
<*armeabi-v7a*>, set the <[ANDROID_ABI]> make variable to <[armeabi-v7a]>:
./make -s -j4 ANDROID_ABI=armeabi-v7a
make -s -j4 ANDROID_ABI=armeabi-v7a
----
The build configuration also supports setting the <[ANDROID_ABI]> to <[x86]>,
but the NDK r6 standalone toolchain for x86 generated by <*make-standalone-toolchain.sh*>
lacks the C++ STL headers, so this does not work.
The build configuration also supports setting the <[ANDROID_ABI]> to <[x86]>.
Depending on your specific requirements (e.g., no ARM architecture, etc.), it may be necessary
to modify the Android build configuration, or create a new one based on it.

View File

@ -1,4 +1,4 @@
#! /bin/bash
#! /bin/sh
#
# mkdoc
#