-
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?
Conversation
# so that the code can include "minizip/zip.h" explicitly. | ||
target_include_directories(appleii PUBLIC | ||
${CMAKE_CURRENT_BINARY_DIR} # for config.h | ||
${MINIZIP_INCLUDE_DIRS}/.. |
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
- if I want
minizip
, then I add-I/usr/include/minizip
and althoughzip.h
is ambiguous, this explicit-I
wins over the default one (used bylibzip
) - If I want
zip
, no problem as I do not add theminizip
-I
- I can't use them both.
So, the issue is probably related to a user who have both libzip
and minizip
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 for minizip
. 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 put minizip
headers in its own subdirectory, the hack here could work universally and so in AppleWin code we could simply #include <minizip/zip.h>
.
@@ -25,6 +25,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
#ifndef _MSC_VER | |||
#include <arpa/inet.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 comment
The reason will be displayed to describe this comment to others. Learn more.
no need to add ifdef
, I will commit this.
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.
Agree with that. This is just to explain the PR.
Should I update my PR? Or would you just fix your code in your way and drop the PR?
That's totally fine to me.
@@ -7,6 +7,9 @@ | |||
#include <sys/types.h> | |||
#include <sys/socket.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 comment
The reason will be displayed to describe this comment to others. Learn more.
will commit
@@ -75,6 +75,9 @@ typedef int socklen_t; | |||
#include <fcntl.h> | |||
#include <sys/types.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 comment
The reason will be displayed to describe this comment to others. Learn more.
no need of the ifdef
, but this has to go to AppleWin
FYI: APPLEN does run on FreeBSD, at least can boot DOS 3.3. |
Hi the https://github.com/audetto/AppleWin/tree/freebsd2 I will try to upstream it to AppleWin, they should not care. I have opened an issue madler/zlib#977, feel free to chip in. Then, as you say it works, but the ncurse F scan codes must be all over the place. |
Actually it is Shift-F behaving oddly, so I added |
An alternative solution is to drop minizip detection at all on FreeBSD. Very likely |
I could only |
c3bd178
to
8b4b10d
Compare
The most elegant solution would be to move I see you have updated it recently, do you fancy proposing a new PR upstream? |
8b4b10d
to
5ef6082
Compare
5ef6082
to
24ad7c4
Compare
24ad7c4
to
9a0b9ca
Compare
9a0b9ca
to
f7b281c
Compare
f7b281c
to
f61ba5d
Compare
f61ba5d
to
9881b18
Compare
dc7c570
to
240ec92
Compare
240ec92
to
658f41f
Compare
minizip has removed the source of ambiguity. so, I will try to change AppleWin upstream for the new layout of minizip, otherwise I will just incorporate these changes. directly. |
Some tweaks to get APPLEN target to build on FreeBSD.
Not yet verify if the build actually works on FreeBSD.