summaryrefslogtreecommitdiff
path: root/doc/PORTED
blob: a6198597025c10a343c577725ce9516731cdf208 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
==============================================================================
                        P O R T I N G   S T A T U S
==============================================================================

libnet is reasonably portable.

If you verify libnet building and running successfully (sample code works)
on platforms currently labeled UNKNOWN or not listed here at all, please
send email to autostart.ini@gmail.com.

libnet has been run successfully on at least the following operating systems:

SYSTEM                       STATUS                NOTES
==============================================================================

LINUX
------------------------------------------------------------------------------
   Linux 3.x                 FULL           (primary development platform)

SOLARIS
------------------------------------------------------------------------------
   Solaris                   UNKNOWN        not confirmed working in ages

*BSD
------------------------------------------------------------------------------
   FreeBSD                   UNKNOWN        not confirmed working in ages

   OpenBSD                   UNKNOWN        not confirmed working in ages

   NetBSD                    UNKNOWN        not confirmed working in ages

HP-UX
------------------------------------------------------------------------------
   HP-UX                     UNKNOWN        not confirmed working in ages

Apple (Darwin)
------------------------------------------------------------------------------
   macOS                     FULL           not tested by me

WINDOWS (Native/MinGW/Cygwin/Cross)
------------------------------------------------------------------------------
   MSVC 14.0                 FULL           Working. See README.win32 for instructions

   MinGW (GCC 6.2)           FULL           Working. See README.win32 for instructions

   Cygwin                    UNKNOWN        not confirmed working in ages

ANDROID (Native/Cross)
------------------------------------------------------------------------------
   Termux (clang 3.9.1)      FULL           Working. See detailed instructions below

   ARM Toolchain (gnueabi)   FULL           not tested by me


Platform Specific Details/Instructions
======================================

ANDROID
-------
libnet can be build natively on Android devices running 5.0 Lollipop (SDK 21)
or higher using Termux (https://termux.com/).
See the help pages of Termux for install and setup instructions.

At the time of this writing, doxygen has not been ported to Android yet.
So for this guide, we will build libnet without any docs. If you want docs
you can do one the following:

- build from a release (https://github.com/sgeto/libnet/releases)
- compile docs on one of the supported platforms
- port doxygen to Android
    Update: check out my port: https://github.com/sgeto/doxygen
    Update 2: my port has been merged into doxygen/master.
    Don't use my port. Get the real deal from their repo:
    https://github.com/doxygen/doxygen

The minimum packages to install are:

coreutils (important! Busybox alone is not enough!)
autoconf
automake
m4
make
libtool
clang
git (optional)

After that:

1. $ git clone https://github.com/sgeto/libnet.git

This is optional. As explained earlier, you can also build from a release.

2. $ cd libnet && autoreconf -i

Attention! You can not use the autogen.sh bootstrapping script for this step.
The Android file system only loosely resembles what many of us are used to
from their *nix boxes. This means that in Android, many files and folders aren't
located where you would expect them. As a result, many shell scripts, including
this one, will not be able run because their shebangs are pointing to a
none-existing location. (/bin/sh instead of /system/bin/sh or in Termux's
case: /data/data/com.termux/files/usr/bin/sh)

3. $ ./configure TMPDIR=$PREFIX/tmp --prefix=$PREFIX

TMPDIR=$PREFIX/tmp        Tell configure to use $PREFIX/tmp instead of /tmp
                          This is the only MANDATORY configure option.
                          This is due to the fact that config.guess is
                          (without root privileges) unable to write to /tmp

--prefix=$PREFIX          where to (possibly) install libnet
                          Use "$PREFIX" or make sure to add a valid path

4. $ make

5. $ make install

This step is optional and really only works if the proper prefix has been set
in step 3

Final Thoughts:

- You don't need a rooted device to build libnet, but you need need root
privileges in order to try the samples and to make use of libnet in general.

- You can not execute anything libnet from the Termux shell, because it does not
have root privileges.

- Even when you elevate you prompt and become root (by typing 'su'), you will
most likely still be unable to to use libnet right away. The reason for that is
that root prompts in Android come with their own shell (which is separate from
the one you use to elevate). So you need to either set or migrate the necessary
environment variables you had in your previous (Termux) shell over to your newly
spawn root shell. Specifically LD_LIBRARY_PATH
If you don't know what that means just run this every time you're root and want
to use libnet (adjust path accordingly): 
LD_LIBRARY_PATH=/data/data/com.termux/files/usr/lib