aboutsummaryrefslogtreecommitdiffstats
path: root/bba
diff options
context:
space:
mode:
Diffstat (limited to 'bba')
-rw-r--r--bba/bba.cmake8
-rw-r--r--bba/main.cc9
2 files changed, 16 insertions, 1 deletions
diff --git a/bba/bba.cmake b/bba/bba.cmake
index 3e094277..a6995ca3 100644
--- a/bba/bba.cmake
+++ b/bba/bba.cmake
@@ -11,3 +11,11 @@ ENDIF(NOT CMAKE_CROSSCOMPILING)
IF(NOT CMAKE_CROSSCOMPILING)
EXPORT(TARGETS bbasm FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake )
ENDIF(NOT CMAKE_CROSSCOMPILING)
+
+include(TestBigEndian)
+TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
+if(IS_BIG_ENDIAN)
+ set(BBASM_ENDIAN_FLAG "--be")
+else()
+ set(BBASM_ENDIAN_FLAG "--le")
+endif()
diff --git a/bba/main.cc b/bba/main.cc
index 32a68c63..d4d16e12 100644
--- a/bba/main.cc
+++ b/bba/main.cc
@@ -70,7 +70,7 @@ int main(int argc, char **argv)
{
bool debug = false;
bool verbose = false;
- bool bigEndian = false;
+ bool bigEndian;
bool writeC = false;
char buffer[512];
@@ -81,6 +81,7 @@ int main(int argc, char **argv)
options.add_options()("verbose,v", "verbose output");
options.add_options()("debug,d", "debug output");
options.add_options()("be,b", "big endian");
+ options.add_options()("le,l", "little endian");
options.add_options()("c,c", "write c strings");
options.add_options()("files", po::value<std::vector<std::string>>(), "file parameters");
pos.add("files", -1);
@@ -106,6 +107,12 @@ int main(int argc, char **argv)
debug = true;
if (vm.count("be"))
bigEndian = true;
+ else if (vm.count("le"))
+ bigEndian = false;
+ else {
+ printf("Endian parameter is mandatory\n");
+ exit(-1);
+ }
if (vm.count("c"))
writeC = true;