-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from yalla/master
Added OSX support
- Loading branch information
Showing
4 changed files
with
57 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
# Object files | ||
.sconsign.dblite | ||
pkt2flow | ||
*.o | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
#!/usr/bin/evn python | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
env = Environment(CCFLAGS='-Wall -g', CPPFLAGS='-D_GNU_SOURCE') | ||
|
||
AddOption('--prefix', | ||
dest='prefix', | ||
nargs=1, type='string', | ||
action='store', | ||
metavar='DIR', | ||
help='installation prefix') | ||
env = Environment(PREFIX = GetOption('prefix')) | ||
|
||
idir_prefix = '$PREFIX' | ||
idir_bin = '$PREFIX/bin' | ||
|
||
Export('env idir_prefix idir_bin') | ||
|
||
platform = sys.platform | ||
lib_path = ['/usr/local/lib', '/usr/lib'] | ||
libs = Glob('./*.a') + ['pcap'] | ||
cpp_path=['.'] | ||
|
||
if platform == 'darwin': | ||
env.Append(CPPFLAGS=['-Ddarwin']) | ||
|
||
# Compile the programs | ||
env.Program(target = './pkt2flow', | ||
pkt2flow = env.Program(target = './pkt2flow', | ||
source = Glob('./*.c'), | ||
LIBPATH = lib_path, | ||
LIBS = libs, | ||
CPPPATH = cpp_path) | ||
|
||
# install the program | ||
env.Install(dir = idir_bin, source = pkt2flow) | ||
|
||
# create an install alias | ||
env.Alias('install', idir_prefix) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters