NichDieMama
1st October 2004 09:18 UTC
Compiling NSIS 2.01 on Solaris
Hi!
Has anyone successfully compiled NSIS 2.01 on Solaris? I did compile it on Linux, but on Solaris I got lots of errors:
ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.375
gmake -C exehead
ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.375
gmake[1]: Entering directory `/hox/user/dspilker/src/NSIS/NSIS/Source/exehead'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `/hox/user/dspilker/src/NSIS/NSIS/Source/exehead'
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o 7zGuids.o 7zip/7zGuids.cpp
gcc -Wall -O3 -DCOMPRESS_MF_BT -c -o bzlib.o bzip2/bzlib.c
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o CRC.o 7zip/Common/CRC.cpp
gcc -Wall -O3 -DCOMPRESS_MF_BT -c -o crc32.o crc32.c
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o DialogTemplate.o DialogTemplate.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o Alloc.o 7zip/Common/Alloc.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o makenssi.o makenssi.cpp
In file included from build.h:8,
from makenssi.cpp:43:
strlist.h: In method `void MMapFile::release()':
strlist.h:767: ANSI C++ forbids implicit conversion from `void *' in argument passing
strlist.h: In method `void MMapFile::release(void *, int)':
strlist.h:780: ANSI C++ forbids implicit conversion from `void *' in argument passing
strlist.h: In method `void MMapFile::flush(int)':
strlist.h:790: ANSI C++ forbids implicit conversion from `void *' in argument passing
In file included from build.h:30,
from makenssi.cpp:43:
clzma.h: In method `HANDLE CLZMA::CreateEvent(void *, int, int, char *)':
clzma.h:64: implicit declaration of function `int pthread_cond_init(...)'
clzma.h:69: implicit declaration of function `int pthread_mutex_init(...)'
clzma.h: In method `BOOL CLZMA::SetEvent(long unsigned int)':
clzma.h:81: implicit declaration of function `int pthread_mutex_lock(...)'
clzma.h:84: implicit declaration of function `int pthread_cond_signal(...)'
clzma.h:85: implicit declaration of function `int pthread_mutex_unlock(...)'
clzma.h: In method `BOOL CLZMA::CloseHandle(long unsigned int)':
clzma.h:103: implicit declaration of function `int pthread_cond_destroy(...)'
clzma.h:105: implicit declaration of function `int pthread_mutex_destroy(...)'
clzma.h: In method `DWORD CLZMA::WaitForSingleObject(long unsigned int, long unsigned int)':
clzma.h:118: `PTHREAD_MUTEX_INITIALIZER' undeclared (first use this function)
clzma.h:118: (Each undeclared identifier is reported only once
clzma.h:118: for each function it appears in.)
clzma.h:119: implicit declaration of function `int pthread_cond_wait(...)'
clzma.h: In method `int CLZMA::End()':
clzma.h:245: implicit declaration of function `int pthread_join(...)'
clzma.h: In method `int CLZMA::Compress(int)':
clzma.h:319: implicit declaration of function `int pthread_create(...)'
gmake: *** [makenssi.o] Error 1
kichik
1st October 2004 12:19 UTC
For the pthread errors, add #include <pthread.h> on the top of clzma.h.
I have tried to reproduce the other error on three different solaris computers, but none showed that error. Can you attach (don't copy and paste, it might be very large) the output of `man munmap`?
NichDieMama
1st October 2004 13:06 UTC
Hi!
Thanks for your quick reply. I did that include and came to the munmap problem. I had a look at mmap.h and casted the first argument to caddr_t which seems to work fine. I attached my 'man munmap' nevertheless plus mmap.h. Now I am running into a problem in script.cpp:
ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.375
gmake -C exehead
ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.375
gmake[1]: Entering directory `/hox/user/dspilker/src/NSIS/NSIS/Source/exehead'
gmake[1]: Nothing to be done for `all'.
gmake[1]: Leaving directory `/hox/user/dspilker/src/NSIS/NSIS/Source/exehead'
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o 7zGuids.o 7zip/7zGuids.cpp
gcc -Wall -O3 -DCOMPRESS_MF_BT -c -o blocksort.o bzip2/blocksort.c
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o build.o build.cpp
gcc -Wall -O3 -DCOMPRESS_MF_BT -c -o bzlib.o bzip2/bzlib.c
gcc -Wall -O3 -DCOMPRESS_MF_BT -c -o compress.o bzip2/compress.c
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o CRC.o 7zip/Common/CRC.cpp
gcc -Wall -O3 -DCOMPRESS_MF_BT -c -o crc32.o crc32.c
gcc -Wall -O3 -DCOMPRESS_MF_BT -c -o deflate.o zlib/deflate.c
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o DialogTemplate.o DialogTemplate.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o exedata.o exedata.cpp
gcc -Wall -O3 -DCOMPRESS_MF_BT -c -o huffman.o bzip2/huffman.c
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o lang.o lang.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o LZInWindow.o 7zip/7zip/Compress/LZ/LZInWindow.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o LZMAEncoder.o 7zip/7zip/Compress/LZMA/LZMAEncoder.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o Alloc.o 7zip/Common/Alloc.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o makenssi.o makenssi.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o OutBuffer.o 7zip/7zip/Common/OutBuffer.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o Plugins.o Plugins.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o RangeCoderBit.o 7zip/7zip/Compress/RangeCoder/RangeCoderBit.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o ResourceEditor.o ResourceEditor.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o ResourceVersionInfo.o ResourceVersionInfo.cpp
g++ -Wall -O3 -DCOMPRESS_MF_BT -c -o script.o script.cpp
script.cpp: In method `char * CEXEBuild::set_timestamp_predefine(char *)':
script.cpp:87: implicit declaration of function `int ctime_r(...)'
gmake: *** [script.o] Error 1
kichik
1st October 2004 13:21 UTC
ctime_r is defined in time.h which is already included. ctime_r conforms with POSIX.1 (1996), so it's a pretty basic function that should be in any POSIX compliant platform. But I guess I could convert it to ctime which is defined in ANSI-C. Try replacing that block of code with:
definedlist.add("__TIMESTAMP__",ctime(&st.st_mtime));
As for munmap, is there any define that can be checked so caddr_t can be used?
NichDieMama
1st October 2004 17:19 UTC
Hi!
Thanks! Your code did it. Since I am a Java programmer I do not have that much clue about C or C++ programming. The functions with the caddr_t argument are defined in the else part of an #if (_POSIX_C_SOURCE > 2) || defined(_XPG4_2). I am not sure which values are hold by those variables.
I had to remove the -Wl option in LDFLAGS to make the linker happy. But when running makensis, it core dumped. Any ideas? Could you compile and link it successfully? Which gcc version are you using?
MakeNSIS v2.01 - Copyright 1999-2004 Nullsoft, Inc.
Portions Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler (zlib).
Portions Copyright (C) 1996-2002 Julian R Seward (bzip2).
Portions Copyright (C) 1999-2003 Igor Pavlov (lzma).
Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, Peter Windridge, Dave Laundon, Robert Rainwater, Yaroslav Faybishenko, Jeff Doozan, Amir Szekely, Ximon Eighteen, et al.
Processing config:
Processing plugin dlls: "/hox/user/appbuild/opt/thirdparty/nullsoft/nsis/Plugins/*.dll"
Segmentation Fault (core dumped)
kichik
1st October 2004 17:30 UTC
Looks like the big endian problem... Are you using Sparc? According to this page, Sparc has a little endian mode. Try looking for little endian switch for gcc.
NichDieMama
2nd October 2004 14:57 UTC
Hi!
My gcc does not support -mlittle-endian for Sparc CPUs. I tried -D__LITTLE_ENDIAN__ and/or -D__LITTLE_ENDIAN_DATA__ which showed not effect. I also tried -m32 and -m64 which also didn't help. Further ideas?
kichik
2nd October 2004 15:01 UTC
Are you running on 32 or 64 bit Sparc?