Skip to content

Commit

Permalink
FreeBSD: Fix to build APPLEN
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyolee committed Oct 17, 2024
1 parent bf0582c commit 240ec92
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,22 @@ target_include_directories(appleii PRIVATE
)

# this one appears in header files
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
# FreeBSD could already have "zip.h" (from libzip) in /usr/local/include
# which takes precedence than the one in /usr/local/include/minizip.
# "zip.h" from libzip is not what we want here.
# The following changes to use include path /usr/local/include for minizip
# 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}/..
)
else()
target_include_directories(appleii PUBLIC
${CMAKE_CURRENT_BINARY_DIR} # for config.h
${MINIZIP_INCLUDE_DIRS}
)
endif()

target_link_libraries(appleii PRIVATE
${YAML_LIBRARIES}
Expand Down
4 changes: 4 additions & 0 deletions source/DiskImageHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Common.h"

#include "zlib.h"
#ifdef __FreeBSD__
#include "minizip/unzip.h"
#else
#include "unzip.h"
#endif

#include "CPU.h"
#include "DiskImage.h"
Expand Down
4 changes: 4 additions & 0 deletions source/DiskImageHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

#include "DiskDefs.h"
#include "DiskImage.h"
#ifdef __FreeBSD__
#include "minizip/zip.h"
#else
#include "zip.h"
#endif

#define GZ_SUFFIX ".gz"
#define GZ_SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)
Expand Down
3 changes: 3 additions & 0 deletions source/Tfe/DNS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#endif
#endif

uint32_t getHostByName(const std::string & name)
Expand Down
3 changes: 3 additions & 0 deletions source/Uthernet2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#endif

#endif

Expand Down
3 changes: 3 additions & 0 deletions source/linux/network/portfwds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#ifdef __FreeBSD__
#include <netinet/in.h> // sockaddr_in.
#endif

namespace
{
Expand Down

0 comments on commit 240ec92

Please sign in to comment.