I'm very interested in building NSIS installers on a Mac, so all platforms
(win32, linux and mac os x) can be built on one machine. So I was very
pleased to see that the latest NSIS release (2.16) includes big endian
support. makensis builds on my intel based machine, but there are still
some problems on my Mac:
Machine details:
Mac OS X 10.4.6
G4 iBook
Latest XCode 2.2 installed
Scons 0.96.92
With the default compiler, gcc 4.0.1, the build fails on Source/util.cpp
with:
g++ -o build/release/makensis/util.o -c -O2 -Wall -
D_WIN32_IE=0x0500 Source/util.cpp
Source/util.cpp: In function 'std::string get_executable_path(const
char*)':
Source/util.cpp:648: error: 'MAXPATHLEN' was not declared in this
scope
Source/util.cpp:650: error: 'temp_buf' was not declared in this scope
Source/util.cpp:650: error: '_NSGetExecutablePath' was not declared in
this scope
scons: *** [build/release/makensis/util.o] Error 1
The code in question is this:
#elif __APPLE__
char temp_buf[MAXPATHLEN+1];
unsigned long buf_len = MAXPATHLEN;
int rc = _NSGetExecutablePath(temp_buf, &buf_len);
assert(rc == 0);
return string(temp_buf);
and it seems that commenting out this block makes the build succeed.
However, running the resulting executable results in this:
dyld: lazy symbol binding failed: lazy pointer not found
dyld: lazy pointer not found
Trace/BPT trap
Selecting the obsolete but still available gcc 3.3 compiler with
'gcc_select 3.3' results in a binary that seems to work. However, the
compile failure on Source/util.cpp is still there.
Finally, gcc reports quite a few warnings while building, especially with
gcc 4.0. Here's some of them:
g++ -o build/release/makensis/7zip/7zGuids.o -c -O2 -Wall -
D_WIN32_IE=0x0500 -DCOMPRESS_MF_BT Source/7zip/7zGuids.cpp
Source/7zip/7zip/../Common/MyWindows.h:96: warning: 'struct
IUnknown' has virtual functions but non-virtual destructor
Source/7zip/7zip/IStream.h:14: warning: 'struct ISequentialInStream'
has virtual functions but non-virtual destructor
Source/7zip/7zip/IStream.h:32: warning: 'struct ISequentialOutStream'
has virtual functions but non-virtual destructor
Source/7zip/7zip/IStream.h:43: warning: 'struct IInStream' has virtual
functions but non-virtual destructor
(there's a lot of those)
g++ -o build/release/makensis/ResourceVersionInfo.o -c -O2 -Wall -
D_WIN32_IE=0x0500 Source/ResourceVersionInfo.cpp
Source/strlist.h: In member function 'int SortedStringListND<T>::add
(const char*, int, int) [with T = version_string_list]':
Source/strlist.h:134: warning: 'where' may be used uninitialized in this
function
g++ -o build/release/makensis/ShConstants.o -c -O2 -Wall -
D_WIN32_IE=0x0500 Source/ShConstants.cpp
Source/strlist.h: In member function 'int SortedStringListND<T>::add
(const char*, int, int) [with T = constantstring]':
Source/strlist.h:134: warning: 'where' may be used uninitialized in this
function
Source/strlist.h: In member function 'int SortedStringListND<T>::add
(const char*, int, int) [with T = uservarstring]':
Source/strlist.h:134: warning: 'where' may be used uninitialized in this
function
Source/clzma.cpp: In destructor 'virtual CLZMA::~CLZMA()':
Source/clzma.cpp:146: warning: converting to non-pointer type
'HANDLE' from NULL
Source/clzma.cpp:151: warning: converting to non-pointer type
'HANDLE' from NULL
Source/makenssi.cpp: In function 'void print_stub_info(CEXEBuild&)':
Source/makenssi.cpp:167: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
Source/makenssi.cpp:168: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
Source/makenssi.cpp:169: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
Source/makenssi.cpp:170: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
Source/makenssi.cpp:171: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
g++ -o build/release/makensis/strlist.o -c -O2 -Wall -
D_WIN32_IE=0x0500 Source/strlist.cpp
Source/strlist.cpp: In member function 'int DefineList::add(const char*,
const char*)':
Source/strlist.cpp:116: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
Source/strlist.h: In member function 'int SortedStringList<T>::add
(const char*, int) [with T = define]':
Source/strlist.cpp:101: instantiated from here
Source/strlist.h:59: warning: format '%d' expects type 'int', but
argument 3 has type 'long unsigned int'
g++ -o build/release/makensis/makensis -s -pthread build/release/
makensis/build.o build/release/makensis/clzma.o build/release/
makensis/crc32.o build/release/makensis/DialogTemplate.o build/
release/makensis/dirreader.o build/release/makensis/fileform.o build/
release/makensis/growbuf.o build/release/makensis/lang.o build/
release/makensis/lineparse.o build/release/makensis/makenssi.o
build/release/makensis/mmap.o build/release/makensis/Plugins.o
build/release/makensis/ResourceEditor.o build/release/makensis/
ResourceVersionInfo.o build/release/makensis/script.o build/release/
makensis/ShConstants.o build/release/makensis/strlist.o build/
release/makensis/tokens.o build/release/makensis/util.o build/
release/makensis/writer.o build/release/makensis/bzip2/blocksort.o
build/release/makensis/bzip2/bzlib.o build/release/makensis/bzip2/
compress.o build/release/makensis/bzip2/huffman.o build/release/
makensis/7zip/7zGuids.o build/release/makensis/7zip/Common/
CRC.o build/release/makensis/7zip/7zip/Compress/LZ/LZInWindow.o
build/release/makensis/7zip/7zip/Compress/LZMA/LZMAEncoder.o
build/release/makensis/7zip/7zip/Common/OutBuffer.o build/
release/makensis/7zip/7zip/Compress/RangeCoder/RangeCoderBit.o
build/release/makensis/7zip/Common/Alloc.o build/release/
makensis/zlib/deflate.o build/release/makensis/zlib/trees.o -lpthread
-lstdc++ -liconv
powerpc-apple-darwin8-g++-4.0.1: unrecognized option '-pthread'
Logged In: YES
user_id=648271
By "makensis builds on my intel based machine" I mean on my intel based
_linux_ machine (that is, non-windows but not Mac OS X).
Logged In: YES
user_id=584402
Thanks, fixed. Some warnings still remain as they require
upgrading the 7-zip source. Anonymous CVS is still down, so
I've attached a patch to this ticket.