Skip to content
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

support build on freebsd #2

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
include src/*.h
include src/*.cpp
include tests/*
include README.rst

# Include this file, needed for bdist_rpm
include MANIFEST.in
include src/*.h
include src/*.cpp
include tests/*
include README.rst
recursive-include utils *.cpp

# Include this file, needed for bdist_rpm
include MANIFEST.in
18 changes: 15 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ def get_compiler_settings(version_str):
# OS/X now ships with iODBC.
settings['libraries'].append('iodbc')

elif sys.platform.startswith('freebsd'):
try:
include = '-I'+os.environ['PREFIX']+'/include'
lib = '-L'+os.environ['PREFIX']+'/lib'
except:
include = '-I/usr/local/include'
lib = '-L/usr/local/lib'

settings['extra_compile_args'] = ['-Wno-write-strings', include, lib]
settings['extra_link_args'] = [ lib ]
settings['libraries'].append('odbc')

else:
# Other posix-like: Linux, Solaris, etc.

Expand Down Expand Up @@ -263,13 +275,13 @@ def get_version():
def _get_version_pkginfo():
filename = join(dirname(abspath(__file__)), 'PKG-INFO')
if exists(filename):
re_ver = re.compile(r'^Version: \s+ (\d+)\.(\d+)\.(\d+) (?: -beta(\d+))?', re.VERBOSE)
re_ver = re.compile(r'^Version: \s+ (?: (.+)-) (\d+)\.(\d+)\.(\d+) (?: -beta(\d+))?', re.VERBOSE)
for line in open(filename):
match = re_ver.search(line)
if match:
name = line.split(':', 1)[1].strip()
numbers = [int(n or 0) for n in match.groups()[:3]]
numbers.append(int(match.group(4) or OFFICIAL_BUILD)) # don't use 0 as a default for build
numbers = [int(n or 0) for n in match.groups()[1:4]]
numbers.append(int(match.group(5) or OFFICIAL_BUILD)) # don't use 0 as a default for build
return name, numbers

return None, None
Expand Down