Skip to content

Commit 1908f50

Browse files
author
Sebastiano Merlino
committed
Adjusted in order to avoid errors in building swig
Added partial GUILE language support Modified doxygen documentation layout
1 parent 8da8fc3 commit 1908f50

File tree

7 files changed

+105
-30
lines changed

7 files changed

+105
-30
lines changed

Diff for: Makefile.am

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# have all needed files, that a GNU package needs
2121
AUTOMAKE_OPTIONS = foreign 1.4
2222

23-
SUBDIRS = src $(PYTHON_DIR) $(JAVA_DIR) $(PHP_DIR) $(LUA_DIR) $(PERL_DIR) $(RUBY_DIR)
24-
DIST_SUBDIRS = src $(PYTHON_DIR) $(JAVA_DIR) $(PHP_DIR) $(LUA_DIR) $(PERL_DIR) $(RUBY_DIR)
23+
SUBDIRS = src $(PYTHON_DIR) $(JAVA_DIR) $(PHP_DIR) $(LUA_DIR) $(PERL_DIR) $(RUBY_DIR) $(GUILE_DIR)
24+
DIST_SUBDIRS = src $(PYTHON_DIR) $(JAVA_DIR) $(PHP_DIR) $(LUA_DIR) $(PERL_DIR) $(RUBY_DIR) $(GUILE_DIR)
2525
EXTRA_DIST = libhttpserver.pc.in
2626

2727
pkgconfigdir = $(libdir)/pkgconfig
@@ -50,3 +50,7 @@ endif
5050
if RUBY
5151
RUBY_DIR = src/ruby
5252
endif
53+
54+
if GUILE
55+
GUILE_DIR = src/guile
56+
endif

Diff for: configure.ac

+41-17
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,23 @@ LHT_LIBDEPS="-lmicrohttpd"
5151

5252
AC_ARG_WITH([python],
5353
[ --with-python Compile PYTHON libraries],
54-
[python=true])
54+
[python=true; swig=true])
5555

5656
AC_ARG_WITH([php],
5757
[ --with-php Compile PHP libraries],
58-
[php=true])
58+
[php=true; swig=true])
5959

6060
AC_ARG_WITH([ruby],
6161
[ --with-ruby Compile RUBY libraries],
62-
[ruby=true])
62+
[ruby=true; swig=true])
6363

6464
AC_ARG_WITH([perl],
6565
[ --with-perl Compile PERL libraries],
66-
[perl=true])
66+
[perl=true; swig=true])
6767

6868
AC_ARG_WITH([lua],
6969
[ --with-lua Compile LUA libraries],
70-
[lua=true])
70+
[lua=true; swig=true])
7171

7272
AC_ARG_WITH(lua-include-dir,
7373
[ --with-lua-include-dir=DIR where to look for lua headers],
@@ -81,7 +81,7 @@ AC_ARG_WITH(lua-include-dir,
8181

8282
AC_ARG_WITH([java],
8383
[ --with-java Compile JAVA libraries],
84-
[java=true])
84+
[java=true; swig=true])
8585

8686
AC_ARG_WITH(java-dir,
8787
[ --with-java-dir=DIR where to look for jni headers and libs. We search for jni.h in 'java-dir/include/'],
@@ -93,6 +93,10 @@ AC_ARG_WITH(java-dir,
9393
fi
9494
])
9595

96+
AC_ARG_WITH([guile],
97+
[ --with-guile Compile GUILE libraries],
98+
[guile=true; swig=true])
99+
96100
AC_ARG_WITH(doc,
97101
[ --with-doc Compile DOC],
98102
[doc=true])
@@ -103,12 +107,21 @@ AM_CONDITIONAL([PHP], [test x$php = xtrue])
103107
AM_CONDITIONAL([PERL], [test x$perl = xtrue])
104108
AM_CONDITIONAL([LUA], [test x$lua = xtrue])
105109
AM_CONDITIONAL([RUBY], [test x$ruby = xtrue])
110+
AM_CONDITIONAL([GUILE], [test x$guile = xtrue])
106111
AM_CONDITIONAL([DOC], [test x$doc = xtrue])
107112

108113
LANGUAGES="C++"
109114

115+
if test x$swig = xtrue; then
116+
AC_CHECK_PROG([SWIG], [swig], ["yes"], ["no"])
117+
if test "SWIG" = "no"
118+
then
119+
AC_MSG_ERROR(swig not found)
120+
fi
121+
fi
122+
110123
if test x$python = xtrue; then
111-
AC_CHECK_PROG([PYTHONCONFIG],[python-config],["php-config"], ["no"])
124+
AC_CHECK_PROG([PYTHONCONFIG],[python-config],["yes"], ["no"])
112125
if test "$PYTHONCONFIG" = "no"
113126
then
114127
AC_MSG_ERROR(python-config not found)
@@ -122,7 +135,7 @@ if test x$python = xtrue; then
122135
AC_SUBST(PYLDFLAGS)
123136
AC_SUBST(PYLIBS)
124137
AC_SUBST_FILE([PYTHON_AUTOGENERATION])
125-
PYTHON_AUTOGENERATION=src/autogen_helpers/support_command
138+
PYTHON_AUTOGENERATION=$srcdir/src/autogen_helpers/support_command
126139
LANGUAGES="$LANGUAGES Python"
127140
fi
128141

@@ -152,12 +165,12 @@ if test x$java = xtrue; then
152165
AC_SUBST(JAVALDFLAGS)
153166
AC_SUBST(JABALIBS)
154167
AC_SUBST_FILE([JAVA_AUTOGENERATION])
155-
JAVA_AUTOGENERATION=src/autogen_helpers/support_command
168+
JAVA_AUTOGENERATION=$srcdir/src/autogen_helpers/support_command
156169
LANGUAGES="$LANGUAGES Java"
157170
fi
158171

159172
if test x$php = xtrue; then
160-
AC_CHECK_PROG([PHPCONFIG],[php-config],["php-config"], ["no"])
173+
AC_CHECK_PROG([PHPCONFIG],[php-config],["yes"], ["no"])
161174
if test "$PHPCONFIG" = "no"
162175
then
163176
AC_MSG_ERROR(php-config not found)
@@ -167,7 +180,7 @@ if test x$php = xtrue; then
167180
AC_SUBST(PHPINCLUDES)
168181
AC_SUBST(PHPLDFLAGS)
169182
AC_SUBST_FILE([PHP_AUTOGENERATION])
170-
PHP_AUTOGENERATION=src/autogen_helpers/support_command
183+
PHP_AUTOGENERATION=$srcdir/src/autogen_helpers/support_command
171184
LANGUAGES="$LANGUAGES PHP"
172185
fi
173186

@@ -193,12 +206,12 @@ if test x$lua = xtrue; then
193206
fi
194207
AC_SUBST(LUAINCLUDES)
195208
AC_SUBST_FILE([LUA_AUTOGENERATION])
196-
LUA_AUTOGENERATION=src/autogen_helpers/support_command
209+
LUA_AUTOGENERATION=$srcdir/src/autogen_helpers/support_command
197210
LANGUAGES="$LANGUAGES LUA"
198211
fi
199212

200213
if test x$perl = xtrue; then
201-
AC_CHECK_PROG([PERLINT],[perl],["perl"], ["no"])
214+
AC_CHECK_PROG([PERLINT],[perl],["yes"], ["no"])
202215
if test "$PERLINT" = "no"
203216
then
204217
AC_MSG_ERROR(perl interpreter not found)
@@ -208,12 +221,12 @@ if test x$perl = xtrue; then
208221
AC_SUBST(PERLINCLUDES)
209222
AC_SUBST(PERLDEFINES)
210223
AC_SUBST_FILE([PERL_AUTOGENERATION])
211-
PERL_AUTOGENERATION=src/autogen_helpers/support_command
224+
PERL_AUTOGENERATION=$srcdir/src/autogen_helpers/support_command
212225
LANGUAGES="$LANGUAGES Perl"
213226
fi
214227

215228
if test x$ruby = xtrue; then
216-
AC_CHECK_PROG([RUBYINT],[ruby],["ruby"], ["no"])
229+
AC_CHECK_PROG([RUBYINT],[ruby],["yes"], ["no"])
217230
RUBYINCLUDES=""
218231
if test "$RUBYINT" = "no"
219232
then
@@ -238,10 +251,21 @@ if test x$ruby = xtrue; then
238251
AC_SUBST(RUBYINCLUDES)
239252
AC_SUBST(RUBYDEFINES)
240253
AC_SUBST_FILE([RUBY_AUTOGENERATION])
241-
RUBY_AUTOGENERATION=src/autogen_helpers/support_command
254+
RUBY_AUTOGENERATION=$srcdir/src/autogen_helpers/support_command
242255
LANGUAGES="$LANGUAGES Ruby"
243256
fi
244257

258+
if test x$guile = xtrue; then
259+
AC_CHECK_PROG([GUILEINT],[guile],["yes"], ["no"])
260+
if test "$GUILEINT" = "no"
261+
then
262+
AC_MSG_ERROR(guile interpreter not found)
263+
fi
264+
AC_SUBST_FILE([GUILE_AUTOGENERATION])
265+
GUILE_AUTOGENERATION=$srcdir/src/autogen_helpers/support_command
266+
LANGUAGES="$LANGUAGES Guile"
267+
fi
268+
245269
AC_SUBST(LHT_LIBDEPS)
246270
AC_SUBST(CPPFLAGS)
247271
AC_SUBST(LIBS)
@@ -250,7 +274,7 @@ AC_SUBST(EXT_LIB_PATH)
250274
AC_SUBST(EXT_LIBS)
251275

252276
AC_OUTPUT(
253-
libhttpserver.pc Makefile src/Makefile src/python/Makefile src/java/Makefile src/php/Makefile src/lua/Makefile src/perl/Makefile src/ruby/Makefile
277+
libhttpserver.pc Makefile src/Makefile src/python/Makefile src/java/Makefile src/php/Makefile src/lua/Makefile src/perl/Makefile src/ruby/Makefile src/guile/Makefile
254278
)
255279

256280
AC_MSG_NOTICE([Configuration Summary:

Diff for: doxyconfig

+10-10
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ DOXYFILE_ENCODING = UTF-8
2525
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
2626
# by quotes) that should identify the project.
2727

28-
PROJECT_NAME = Distributed Systems Project
28+
PROJECT_NAME = libhttpserver
2929

3030
# The PROJECT_NUMBER tag can be used to enter a project or revision number.
3131
# This could be handy for archiving the generated documentation or
@@ -47,7 +47,7 @@ OUTPUT_DIRECTORY = doc
4747
# source files, where putting all generated files in the same directory would
4848
# otherwise cause performance problems for the file system.
4949

50-
CREATE_SUBDIRS = NO
50+
CREATE_SUBDIRS = YES
5151

5252
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
5353
# documentation generated by doxygen is written. Doxygen will use this
@@ -99,7 +99,7 @@ ALWAYS_DETAILED_SEC = NO
9999
# members were ordinary class members. Constructors, destructors and assignment
100100
# operators of the base classes will not be shown.
101101

102-
INLINE_INHERITED_MEMB = NO
102+
INLINE_INHERITED_MEMB = YES
103103

104104
# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
105105
# path before files name in the file list and in the header files. If set
@@ -581,7 +581,7 @@ WARN_LOGFILE =
581581
# directories like "/usr/src/myproject". Separate the files or directories
582582
# with spaces.
583583

584-
INPUT = src
584+
INPUT = src/httpserver
585585

586586
# This tag can be used to specify the character encoding of the source files
587587
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
@@ -598,7 +598,7 @@ INPUT_ENCODING = UTF-8
598598
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
599599
# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
600600

601-
FILE_PATTERNS = *.cpp *.hpp
601+
FILE_PATTERNS = *.hpp
602602

603603
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
604604
# should be searched for input files as well. Possible values are YES and NO.
@@ -697,12 +697,12 @@ FILTER_SOURCE_FILES = YES
697697
# Note: To get rid of all source code in the generated output, make sure also
698698
# VERBATIM_HEADERS is set to NO.
699699

700-
SOURCE_BROWSER = NO
700+
SOURCE_BROWSER = YES
701701

702702
# Setting the INLINE_SOURCES tag to YES will include the body
703703
# of functions and classes directly in the documentation.
704704

705-
INLINE_SOURCES = NO
705+
INLINE_SOURCES = YES
706706

707707
# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
708708
# doxygen to hide any special comment blocks from generated source code
@@ -1213,7 +1213,7 @@ RTF_EXTENSIONS_FILE =
12131213
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
12141214
# generate man pages
12151215

1216-
GENERATE_MAN = NO
1216+
GENERATE_MAN = YES
12171217

12181218
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
12191219
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
@@ -1232,7 +1232,7 @@ MAN_EXTENSION = .3
12321232
# only source the real man page, but without them the man command
12331233
# would be unable to find the correct page. The default is NO.
12341234

1235-
MAN_LINKS = NO
1235+
MAN_LINKS = YES
12361236

12371237
#---------------------------------------------------------------------------
12381238
# configuration options related to the XML output
@@ -1551,7 +1551,7 @@ CALL_GRAPH = YES
15511551
# the time of a run. So in most cases it will be better to enable caller
15521552
# graphs for selected functions only using the \callergraph command.
15531553

1554-
CALLER_GRAPH = NO
1554+
CALLER_GRAPH = YES
15551555

15561556
# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
15571557
# will graphical hierarchy of all classes instead of a textual one.

Diff for: src/autogen_helpers/support_command

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
# License along with this library; if not, write to the Free Software
1717
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
#
19-
$(srcdir)/WebserverWrap.cpp $(srcdir)/WebserverWrap.h: $(top_srcdir)/src/httpserver/Webserver.hpp $(top_srcdir)/src/httpserver/HttpResponse.hpp $(top_srcdir)/src/httpserver/HttpRequest.hpp $(top_srcdir)/src/httpserver/HttpResource.hpp $(top_srcdir)/src/httpserver/HttpEndpoint.hpp $(top_srcdir)/src/httpserver/HttpUtils.hpp
19+
$(srcdir)/WebserverWrap.cpp $(srcdir)/WebserverWrap.h: $(srcdir)/../httpserver/Webserver.hpp $(srcdir)/../httpserver/HttpResponse.hpp $(srcdir)/../httpserver/HttpRequest.hpp $(srcdir)/../httpserver/HttpResource.hpp $(srcdir)/../httpserver/HttpEndpoint.hpp $(srcdir)/../httpserver/HttpUtils.hpp
2020
swig -c++ -$(language) $(swigoptions) -o $(srcdir)/WebserverWrap.cpp -I$(srcdir)/.. $(srcdir)/../httpserver/Webserver.hpp

Diff for: src/guile/Makefile.am

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#
2+
# This file is part of libhttpserver
3+
# Copyright (C) 2011 Sebastiano Merlino
4+
#
5+
# This library is free software; you can redistribute it and/or
6+
# modify it under the terms of the GNU Lesser General Public
7+
# License as published by the Free Software Foundation; either
8+
# version 2.1 of the License, or (at your option) any later version.
9+
#
10+
# This library is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+
# Lesser General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU Lesser General Public
16+
# License along with this library; if not, write to the Free Software
17+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+
19+
INCLUDES = -I../ -I$(top_srcdir)/src -I$(top_srcdir)/src/httpserver
20+
METASOURCES = AUTO
21+
lib_LTLIBRARIES = libhttpserver_guile.la
22+
libhttpserver_guile_la_LIBADD = -lmicrohttpd
23+
libhttpserver_guile_la_SOURCES = WebserverWrap.cpp $(top_srcdir)/src/Webserver.cpp $(top_srcdir)/src/HttpUtils.cpp $(top_srcdir)/src/HttpEndpoint.cpp $(top_srcdir)/src/HttpResource.cpp $(top_srcdir)/src/HttpRequest.cpp $(top_srcdir)/src/HttpResponse.cpp $(top_srcdir)/src/string_utilities.cpp
24+
libhttpserver_guile_la_includedir =
25+
libhttpserver_guile_la_include_HEADERS =
26+
27+
language=guile
28+
swigoptions=-Wall
29+
@GUILE_AUTOGENERATION@

Diff for: src/httpserver/Webserver.hpp

+12
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ namespace std {
7777
%feature("director") HttpUtils;
7878
#endif
7979

80+
#ifdef SWIGGUILE
81+
%module(directors="1") libhttpserver_guile
82+
%include "typemaps.i"
83+
%include "cpointer.i"
84+
%feature("director") Webserver;
85+
%feature("director") HttpRequest;
86+
%feature("director") HttpResponse;
87+
%feature("director") HttpResource;
88+
%feature("director") HttpEndpoint;
89+
%feature("director") HttpUtils;
90+
#endif
91+
8092
#ifdef SWIGLUA
8193
%module(directors="1") libhttpserver_lua
8294
%include "typemaps.i"

Diff for: src/httpserver/string_utilities.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ namespace httpserver
2828
namespace string_utilities
2929
{
3030

31+
/**
32+
* Function used to convert a string to its uppercase version.
33+
* It generates a new string in output
34+
* @param str The string to turn uppercase
35+
* @return a string that is the uppercase version of the previous
36+
**/
3137
std::string to_upper_copy(std::string str);
3238
std::string to_lower_copy(std::string str);
3339
std::vector<std::string> string_split(std::string s, char sep);

0 commit comments

Comments
 (0)