summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2010-10-05 08:36:38 +0200
committerLinus Nordberg <linus@nordu.net>2010-10-05 08:36:38 +0200
commit3587b10283526f70b3215292573519e19b012130 (patch)
treea29dbb62847f84765da5e3eeb6195c92d46c7663
parentf429a882c9bc72a597e6bcbecf5842e37af754e0 (diff)
Autotoolize.
-rw-r--r--lib/Makefile23
-rw-r--r--lib/Makefile.am18
-rw-r--r--lib/README23
-rw-r--r--lib/configure.ac35
-rw-r--r--lib/examples/Makefile15
-rw-r--r--lib/examples/Makefile.am8
-rw-r--r--lib/include/Makefile.am7
7 files changed, 87 insertions, 42 deletions
diff --git a/lib/Makefile b/lib/Makefile
deleted file mode 100644
index 774a0d2..0000000
--- a/lib/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-CFLAGS = -Wall -g -I include -DDEBUG
-
-OFILES = attr.o \
- conf.o \
- debug.o \
- err.o \
- packet.o \
- request.o \
- radsec.o
-
-all: libradsec.a
-
-libradsec.a: $(OFILES)
- ar rc $@ $^
-
-$(OFILES): include/radsec/radsec.h include/radsec/radsec-impl.h
-
-doc:
- doxygen
-
-clean:
- -rm *.o *.a *.gch
-
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 0000000..9acc2cb
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,18 @@
+AUTOMAKE_OPTIONS = foreign
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = . examples include
+
+INCLUDES = -I$(srcdir)/include
+
+lib_LTLIBRARIES = libradsec.la
+libradsec_la_SOURCES = \
+ attr.c \
+ conf.c \
+ debug.c \
+ err.c \
+ packet.c \
+ request.c \
+ radsec.c
+libradsec_la_LDFLAGS = -version-info 0:0:0
+libradsec_la_CFLAGS = $(CFLAGS) -DDEBUG -DDEBUG_LEVENT
diff --git a/lib/README b/lib/README
index 1a47134..e6b9956 100644
--- a/lib/README
+++ b/lib/README
@@ -1,9 +1,24 @@
-This is a non-working RADIUS library doing UDP, TCP, TLS and DTLS.
+libradsec is a non-working RADIUS library doing UDP, TCP, TLS and
+DTLS.
-It depends on libradius from FreeRADIUS freeradius-server and
-libevent2.
+libradsec depends on
+- libradius from the FreeRADIUS freeradius-server
+- libevent2
+- libconfuse
+- openssl (if configured with tls or dtls support)
-Those parts of the library which has been tested has been so on Linux
+
+To compile the library and the examples, do something like
+
+ sh autogen.sh && ./configure && make
+
+If any of the libraries are not found, try setting environment
+variable LDFLAGS at configure time
+
+ LDFLAGS="-L/usr/lib/freeradius -L/usr/local/lib" ./configure
+
+
+The parts of the library which has been tested has been so on Linux
(Ubuntu 10.04) with libfreeradius2 (2.1.8+dfsg-1ubuntu1), libconfuse0
(2.6-2) and libevent-2.0.7-rc-dev (http://monkey.org/~provos/).
diff --git a/lib/configure.ac b/lib/configure.ac
new file mode 100644
index 0000000..9f1972b
--- /dev/null
+++ b/lib/configure.ac
@@ -0,0 +1,35 @@
+# -*- Autoconf -*- script for libradsec.
+
+AC_PREREQ([2.65])
+AC_INIT([libradsec], [0.0.1], [linus+libradsec@nordu.net])
+AC_CONFIG_MACRO_DIR([m4])
+AM_INIT_AUTOMAKE
+AC_CONFIG_SRCDIR([radsec.c])
+AC_CONFIG_HEADERS([config.h])
+AC_PROG_LIBTOOL
+
+# Checks for programs.
+AC_PROG_CC
+
+# Checks for libraries.
+AC_CHECK_LIB([confuse], [cfg_init])
+AC_CHECK_LIB([event_core], [event_get_version])
+AC_CHECK_LIB([freeradius-radius], [rad_alloc])
+
+# Checks for header files.
+AC_CHECK_HEADERS([netdb.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+AC_TYPE_UINT8_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([memset socket strdup strerror strrchr])
+
+AC_CONFIG_FILES([Makefile
+ include/Makefile
+ examples/Makefile])
+AC_OUTPUT
diff --git a/lib/examples/Makefile b/lib/examples/Makefile
deleted file mode 100644
index cf3441b..0000000
--- a/lib/examples/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-SPECIAL =
-#SPECIAL += -DUSE_REQUEST_OBJECT
-SPECIAL += -DUSE_CONFIG_FILE
-
-CFLAGS = -Wall -g -I ../include $(SPECIAL)
-
-HFILES = ../include/radsec/radsec.h ../include/radsec/radsec-impl.h
-
-all: client-blocking
-
-client-blocking: client-blocking.c ../libradsec.a $(HFILES)
- $(CC) $(CFLAGS) -o $@ $< -lconfuse -L /usr/lib/freeradius -lfreeradius-radius -L .. -lradsec -L /usr/local/lib -levent_core
-
-clean:
- -rm *.o *.gch client-blocking
diff --git a/lib/examples/Makefile.am b/lib/examples/Makefile.am
new file mode 100644
index 0000000..c869070
--- /dev/null
+++ b/lib/examples/Makefile.am
@@ -0,0 +1,8 @@
+AUTOMAKE_OPTIONS = foreign
+
+INCLUDES = -I$(top_srcdir)/include
+
+bin_PROGRAMS = client
+client_SOURCES = client-blocking.c
+client_LDADD = ../libradsec.la
+client_CFLAGS = $(CFLAGS) -DUSE_CONFIG_FILE
diff --git a/lib/include/Makefile.am b/lib/include/Makefile.am
new file mode 100644
index 0000000..5b02eb2
--- /dev/null
+++ b/lib/include/Makefile.am
@@ -0,0 +1,7 @@
+RADSEC_EXPORT = \
+ radsec/radsec.h \
+ radsec/radsec-impl.h \
+ radsec/request.h \
+ radsec/request-impl.h
+EXTRA_SRC = $(RADSEC_EXPORT)
+nobase_include_HEADERS = $(RADSEC_EXPORT)