Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Commit

Permalink
Check if mmap is available
Browse files Browse the repository at this point in the history
Based on patch by Antony Dovgal.
  • Loading branch information
cfeck committed Feb 16, 2012
1 parent 2b76098 commit 812de34
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Christoph Feck <[email protected]>
Antony Dovgal (autotools buildsystem)
9 changes: 9 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ AC_PROG_LD
AM_PROG_LIBTOOL
AC_PROG_INSTALL

AC_CHECK_FUNCS([mmap])

DEFAULT_INSTALL_PREFIX="/usr/local"

AC_ARG_ENABLE(debug,
Expand Down Expand Up @@ -54,6 +56,13 @@ else
INSTALL_STRIP_FLAG="-s"
fi

dnl Disable MinGW32 build for now
case $host_alias in
*mingw*)
AC_MSG_ERROR([mmap needs to be ported to MinGW32.])
;;
esac

AC_SUBST(INSTALL_STRIP_FLAG)

AC_CONFIG_FILES([Makefile])
Expand Down
11 changes: 5 additions & 6 deletions portableimage.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#ifdef HAVE_CONFIG_H
#include "iz_config.h"
#endif

#include "portableimage.h"

#if defined(__MINGW32__)
#error mmap needs to be ported to Windows
// assume we have no mmap
#undef HAVE_MMAP
#else
#if defined(HAVE_MMAP)
#include <sys/mman.h>
#define HAVE_MMAP
#endif

#include <sys/stat.h>
Expand Down

0 comments on commit 812de34

Please sign in to comment.