diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 7 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/Makefile.in | 2 | ||||
-rw-r--r-- | src/gui/gui.pro.in | 14 | ||||
-rw-r--r-- | src/lib/cfuns-c.c | 10 |
5 files changed, 30 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e69de29b..6faf0d71 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -0,0 +1,7 @@ +2014-02-02 Gabriel Dos Reis <gdr@integrable-solutions.net> + + * Makefile.am (all-gui): Depend on all-syntax. + * gui/gui.pro.in: Fix qmake idiocy on mac os. + * lib/cfuns-c.c (make_c_str): New helper. + (oa_acquire_temporary_pathname): Use it. Prefer mktemp. + diff --git a/src/Makefile.am b/src/Makefile.am index fe1f8387..41bae540 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -119,7 +119,7 @@ all-clef: all-lib all-sman: all-lib all-driver cd sman && $(MAKE) $(AM_MAKEFLAGS) $@ -all-gui: all-driver all-io all-rt +all-gui: all-driver all-io all-rt all-syntax cd gui && $(MAKE) $(AM_MAKEFLAGS) all-hyper: all-lib all-io diff --git a/src/Makefile.in b/src/Makefile.in index 72b95864..7890895f 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -770,7 +770,7 @@ all-clef: all-lib all-sman: all-lib all-driver cd sman && $(MAKE) $(AM_MAKEFLAGS) $@ -all-gui: all-driver all-io all-rt +all-gui: all-driver all-io all-rt all-syntax cd gui && $(MAKE) $(AM_MAKEFLAGS) all-hyper: all-lib all-io diff --git a/src/gui/gui.pro.in b/src/gui/gui.pro.in index c67666d6..a34f55cc 100644 --- a/src/gui/gui.pro.in +++ b/src/gui/gui.pro.in @@ -18,6 +18,17 @@ macx { CONFIG -= app_bundle } +macx-g++ { + QMAKE_CFLAGS -= -Xarch_x86_64 + QMAKE_CFLAGS_X86_64 -= -Xarch_x86_64 + + QMAKE_CXXFLAGS -= -Xarch_x86_64 + QMAKE_CXXFLAGS_X86_64 -= -Xarch_x86_64 + + QMAKE_LFLAGS -= -Xarch_x86_64 + QMAKE_LFLAGS_X86_64 -= -Xarch_x86_64 +} + ## We are building a GUI application. TEMPLATE = app @@ -43,5 +54,6 @@ SOURCES += server.cc conversation.cc main-window.cc debate.cc main.cc LIBS += $$OA_RT_LIB $$OA_SYNTAX_LIB $$OA_LIB $$OA_IOLIB ## C++ compiler -#QMAKE_CXX = @CXX@ +QMAKE_CXX = @CXX@ QMAKE_CXXFLAGS += -std=c++11 +QMAKE_LINK = @CXX@ diff --git a/src/lib/cfuns-c.c b/src/lib/cfuns-c.c index ec9a139d..856e4bcc 100644 --- a/src/lib/cfuns-c.c +++ b/src/lib/cfuns-c.c @@ -79,6 +79,11 @@ #endif namespace OpenAxiom { + // Make a copy of string data on free store. + static char* + copy_c_str(const std::string& s) { + return strdup(s.c_str()); + } OPENAXIOM_C_EXPORT int addtopath(char *dir) @@ -500,11 +505,12 @@ oa_acquire_temporary_pathname() { exit(1); } return strdup(buf); +#elif HAVE_DECL_MKTEMP + return mktemp(copy_c_str(std::string{ oa_get_tmpdir() } + "/oa-XXXXXX")); #elif HAVE_DECL_TEMPNAM return tempnam(oa_get_tmpdir(), "oa-"); #else - std::string s = "oa-" + std::to_string(random()); - return strdup(s.c_str()); + return copy_c_str("oa-" + std::to_string(random())); #endif } |