Skip to content

Commit 8a4b3c8

Browse files
committed
moved to scons
1 parent 5f60cad commit 8a4b3c8

File tree

7 files changed

+50
-70
lines changed

7 files changed

+50
-70
lines changed

CMakeLists.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,16 @@ A SYSU H3C Client in \*NIX
44

55
## Usage
66

7-
We use CMake Build System.
7+
`sysuh3c` uses `SCons` build system.
88

99
```bash
10-
$ mkdir build
11-
$ cd build
12-
$ cmake ..
13-
$ make
14-
$ make install
10+
$ cd src
11+
$ scons -Q
12+
$ scons install
1513
```
1614

1715
Then you get `sysuh3c` executable file in `/usr/local/bin`.
1816

19-
If you get errors about missing `iconv.h` while compiling, you should install iconv library or remove `--enable-showmessage`.
20-
2117
```bash
2218
-h --help print help screen
2319
-u --user user account (must!)

cmake/modules/Findlibiconv.cmake

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/CMakeLists.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/SConstruct

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
env = DefaultEnvironment()
2+
env.Append(CCFLAGS=['-O2', '-std=c++11', '-I./eapauth'])
3+
4+
LIBS = [
5+
'eapauth'
6+
]
7+
8+
conf = Configure(env)
9+
if conf.CheckLibWithHeader('iconv', 'iconv.h', 'cxx'):
10+
conf.env.AppendUnique(CPPDEFINES=['WITH_SHOWMESSAGE'])
11+
LIBS.append('iconv')
12+
env = conf.Finish()
13+
14+
SConscript([
15+
'eapauth/SConscript',
16+
])
17+
18+
sysuh3c = env.Program('sysuh3c', ['main.cpp'],
19+
LIBS=LIBS, LIBPATH='./eapauth')
20+
21+
AddOption(
22+
'--prefix',
23+
dest='prefix',
24+
type='string',
25+
nargs=1,
26+
action='store',
27+
metavar='DIR',
28+
help='Installation prefix'
29+
)
30+
31+
prefix = GetOption('prefix')
32+
if prefix is None:
33+
prefix = '/usr/local/bin'
34+
env.Install(prefix, sysuh3c)
35+
36+
env.Alias('install', prefix)

src/eapauth/CMakeLists.txt

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/eapauth/SConscript

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
env = DefaultEnvironment()
2+
env.AppendUnique(CCFLAGS=['-O2', '-std=c++11'])
3+
4+
env.StaticLibrary('eapauth',
5+
[
6+
'eapauth.cpp',
7+
'eapdef.cpp',
8+
'eaputils.cpp'
9+
]
10+
)

0 commit comments

Comments
 (0)