Skip to content

Commit

Permalink
Prepare for building tests.
Browse files Browse the repository at this point in the history
Move main() out of radsecproxy.c.
Build a static library and link a main.c with it.
  • Loading branch information
Linus Nordberg committed Sep 27, 2011
1 parent 021300f commit bab2a00
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@ AUTOMAKE_OPTIONS = foreign

sbin_PROGRAMS = radsecproxy
bin_PROGRAMS = catgconf
noinst_LIBRARIES = librsp.a

radsecproxy_SOURCES = radsecproxy.c \
radsecproxy_SOURCES = main.c

nodist_librsp_a_SOURCES = $(radsecproxy_SOURCES)

librsp_a_SOURCES = radsecproxy.c \
tlscommon.c \
gconfig.c \
util.c \
Expand Down Expand Up @@ -42,7 +47,7 @@ catgconf_SOURCES = debug.c \
radsecproxy_CFLAGS = -g -Wall -Werror -fno-strict-aliasing \
@SSL_CFLAGS@ @TARGET_CFLAGS@
radsecproxy_LDFLAGS = @SSL_LDFLAGS@ @TARGET_LDFLAGS@
radsecproxy_LDADD = @SSL_LIBS@
radsecproxy_LDADD = librsp.a @SSL_LIBS@

catgconf_CFLAGS = -g -Wall -fno-strict-aliasing @TARGET_CFLAGS@
catgconf_LDFLAGS = @TARGET_LDFLAGS@
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_RANLIB
udp=yes
AC_ARG_ENABLE(udp,
[ --enable-udp whether to enable UDP transport: yes/no; default yes ],
Expand Down
7 changes: 7 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
int radsecproxy_main(int argc, char **argv);

int main(int argc, char **argv)
{
return radsecproxy_main(argc, argv);
}

2 changes: 1 addition & 1 deletion radsecproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3195,7 +3195,7 @@ int createpidfile(const char *pidfile) {
return f && !fclose(f) && r >= 0;
}

int main(int argc, char **argv) {
int radsecproxy_main(int argc, char **argv) {
pthread_t sigth;
sigset_t sigset;
struct list_node *entry;
Expand Down

0 comments on commit bab2a00

Please sign in to comment.