-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FreeBSD: Fix to build APPLEN #170
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
#include <arpa/inet.h> | ||
#include <sys/socket.h> | ||
#include <netdb.h> | ||
#ifdef __FreeBSD__ | ||
#include <sys/socket.h> // AF_INET. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree with that. This is just to explain the PR. |
||
#endif | ||
#endif | ||
|
||
uint32_t getHostByName(const std::string & name) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,9 @@ typedef int socklen_t; | |
#include <unistd.h> | ||
#include <fcntl.h> | ||
#include <errno.h> | ||
#ifdef __FreeBSD__ | ||
#include <netinet/in.h> // sockaddr_in. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need of the |
||
#endif | ||
|
||
#endif | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
#include <sys/socket.h> | ||
#include <netinet/in.h> | ||
#include <netdb.h> | ||
#ifdef __FreeBSD__ | ||
#include <netinet/in.h> // sockaddr_in. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will commit |
||
#endif | ||
|
||
namespace | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see the issue, but it is not limited to FreeBSD. What happens if I install https://packages.ubuntu.com/noble/libzip-dev ?
There must be a more general solution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried and there are no issues. The reason must be
minizip
, then I add-I/usr/include/minizip
and althoughzip.h
is ambiguous, this explicit-I
wins over the default one (used bylibzip
)zip
, no problem as I do not add theminizip
-I
So, the issue is probably related to a user who have both
libzip
andminizip
in/usr/local
which breaks the (weak) order of includes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, now I see better. In FreeBSD they are all installed in
/usr/local
so they cannot coexist.Which is really odd, maybe nobody is using it, someone should file a bug.
The fact is that the command
pkg-config minizip -cflags
in FreeBSD returns-I/usr/local/include/minizip
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is exactly the order of
-I
problem.pkg-config
is returning the right path forminizip
. But some other libs is likely returning the common/usr/local/include
and happens to be earlier in the include path. The kind of problem does happen to FreeBSD ports occasionally too. Ideally for FreeBSD/usr/local/include
should always be the last path. But that's very difficult to control. Neither is to have/usr/local/include/minizip
always in front, just not obvious to me how within CMake that can be done reliably. If all Linux distros always putminizip
headers in its own subdirectory, the hack here could work universally and so in AppleWin code we could simply#include <minizip/zip.h>
.