Hi,
Just started using cmake in the last couple of weeks on Windows and Linux, and now moving to Solaris 11.4 (x86). I have built and installed cmake a couple of times under Linux, but it fails to compile under Solaris. It gives a link error.
Undefined first referenced
symbol in file
makedev …/Utilities/cmlibarchive/libarchive/libcmlibarchive.a(archive_pack_dev.c.o)
Had a look at the source and I think I see what the problem is.
There is a section with a comment that starts ‘This is blatantly stolen from libarchive/archive_entry.c’. And the code that follows is identical to the other file. However the includes at the top of the file, that setup various defines used by the code, are different.
I believe that
#ifdef HAVE_SYS_SYSMACROS_H
#include <sys/sysmacros.h>
#endif
needs to become
#if MAJOR_IN_MKDEV
#include <sys/mkdev.h>
#define HAVE_MAJOR
#elif MAJOR_IN_SYSMACROS
#include <sys/sysmacros.h>
#define HAVE_MAJOR
#endif
So it matches the other file.
After making this change locally cmake builds successfully and works with my CMakeLists.txt files.