--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ SWIGSOURCE = $(FILE).i
 DOCMODSDIRS := $(shell find pyme -type d | grep -v CVS | sed 'sx/x.xg')
 DOCMODSFILES := $(shell find pyme -name "*.py" | egrep -v __init__ | grep -v gpgme.py | sed 'sx/x.xg')
 DOCMODS := $(DOCMODSDIRS) $(DOCMODSFILES:.py=)
-SWIGOPT := $(shell gpgme-config --cflags) -I/usr/include 
+SWIGOPT := $(shell gpgme-config --cflags) -I/usr/include -D_FILE_OFFSET_BITS=64 -DLARGEFILE_SOURCE
 PYMEVERS := $(shell python -c "from pyme.version import *;print versionstr")
 SYSTEM = $(shell uname -s | sed 's/_.*//')
 ifeq ($(SYSTEM),MINGW32)
--- a/setup.py
+++ b/setup.py
@@ -39,7 +39,7 @@ def getconfig(what):
     return [x for x in confdata.split(' ') if x != '']
 
 include_dirs = [os.getcwd()]
-define_macros = []
+define_macros = [("_FILE_OFFSET_BITS", "64"), ("LARGEFILE_SOURCE", None)]
 library_dirs = []
 libs = getconfig('libs')
 for item in getconfig('cflags'):
