Compiling netclass version 0.3.0 or later
netclass-0.3.0 or later adds much heavier use of the autoconf/automake
tools for library emission, proper installation support, and proper
distribution generation.
Compiling and installing netclass:
----------------------------------
./configure && make && make install
Standard compilation and installation options are now properly
supported.
Including netclass into your projects:
--------------------------------------
To add the netclass libraries and header files to your existing
autoconf/automake based project, add the following lines to your main
configure.in file:
dnl ----------------------------------
dnl start netclass related checks here
dnl ----------------------------------
NETCLASS_PATH=""
AC_ARG_WITH(netclass,
[ --with-netclass=DIR path to installed netclass package],
NETCLASS_PATH=$withval,
NETCLASS_PATH="/usr/local")
AC_CHECK_FILE("$NETCLASS_PATH/include/netclass.h", ,
AC_MSG_ERROR("cannot find netclass.h header file."))
AC_CHECK_FILE("$NETCLASS_PATH/lib/libnetclass.la", ,
AC_MSG_ERROR("cannot find netclass library."))
AC_SUBST(NETCLASS_PATH)
dnl this is required if NetClass threads are desired
AC_DEFINE(HAVE_THREADS)
AC_CHECK_FUNCS(gethostbyname socket inet_aton inet_addr \
inet_pton poll select strerror)
dnl ----------------------------------
dnl end netclass related checks here
dnl ----------------------------------
Now that the NETCLASS_PATH variable has been defined, output it in
each Makefile.am which needs to use either the netclass includes or
library files. An example includes the following:
INCLUDES = -I@NETCLASS_PATH@/include
main_LDADD = -L@NETCLASS_PATH@/lib -lnetclass
Having all of this in your project, allows flexibility. The user can
install netclass at any location and simply tell your application
where netclass is installed for linking and including purposes.
A note on licensing:
--------------------
The netclass project is Free Software released under the terms of the
GNU General Public License (GPL). What this mean for you is that any
code that you write using the library must also be released under the
GPL in order to avoid breaching the netclass license. The netclass
project is NOT under a BSD-styled license allowing you to use it without
releasing your code, nor under an LGPL license allowing closed use of
netclass in your code with only public releases of modified parts of
the netclass code base. As a developer, I value the Freedom the GPL
provides. Don't take it away from me and others that enjoy it. If
you can't live with this kind of Freedom, please consider using an
alternative library. Contact me at neillm@thecodefactory.org if
you're unsure of how you can or can't use netclass in your projects.