summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2005-02-13 21:48:37 (UTC)
committer Michael Krelin <hacker@klever.net>2005-02-13 21:48:37 (UTC)
commitace26447603d3f7ecd82fd3910174f603c2c7464 (patch) (unidiff)
tree3a82346bd7fff177f74424ed61a6a2c6aa7a308e
parent4fa4a0071ef9a04c02f8934b2e1d3b7628a65c80 (diff)
downloadkingate-ace26447603d3f7ecd82fd3910174f603c2c7464.zip
kingate-ace26447603d3f7ecd82fd3910174f603c2c7464.tar.gz
kingate-ace26447603d3f7ecd82fd3910174f603c2c7464.tar.bz2
portabiity improvements
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--configure.ac3
-rw-r--r--src/Makefile.am2
-rw-r--r--src/plaincgi.cc5
3 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 5ae7b27..b3141f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,67 +1,70 @@
1AC_INIT([kingate], [0.0.1], [kingate-bugs@klever.net]) 1AC_INIT([kingate], [0.0.1], [kingate-bugs@klever.net])
2AC_CONFIG_SRCDIR([include/kingate/cgi_gateway.h]) 2AC_CONFIG_SRCDIR([include/kingate/cgi_gateway.h])
3AC_CONFIG_HEADER([config.h]) 3AC_CONFIG_HEADER([config.h])
4AM_INIT_AUTOMAKE([dist-bzip2]) 4AM_INIT_AUTOMAKE([dist-bzip2])
5 5
6AC_PROG_INSTALL 6AC_PROG_INSTALL
7AC_PROG_AWK 7AC_PROG_AWK
8AC_PROG_CXX 8AC_PROG_CXX
9AC_PROG_CC 9AC_PROG_CC
10AC_PROG_LIBTOOL 10AC_PROG_LIBTOOL
11 11
12AC_HEADER_STDC 12AC_HEADER_STDC
13AC_CHECK_HEADERS([sys/types.h sys/stat.h]) 13AC_CHECK_HEADERS([sys/types.h sys/stat.h])
14AC_CHECK_DECLS([environ],,,[
15 #include <unistd.h>
16])
14 17
15HAVE_FCGI=false 18HAVE_FCGI=false
16AC_LANG_PUSH(C++) 19AC_LANG_PUSH(C++)
17AC_CHECK_HEADERS([fcgio.h],[ 20AC_CHECK_HEADERS([fcgio.h],[
18 AC_CHECK_LIB(fcgi,FCGX_Init,[ 21 AC_CHECK_LIB(fcgi,FCGX_Init,[
19 LIBS="-lfcgi ${LIBS}" 22 LIBS="-lfcgi ${LIBS}"
20 AC_CHECK_LIB([fcgi++],[main],[ 23 AC_CHECK_LIB([fcgi++],[main],[
21 LIBS="-lfcgi++ ${LIBS}" 24 LIBS="-lfcgi++ ${LIBS}"
22 HAVE_FCGI=true 25 HAVE_FCGI=true
23 ]) 26 ])
24 ]) 27 ])
25]) 28])
26AC_LANG_POP(C++) 29AC_LANG_POP(C++)
27if ! ${HAVE_FCGI} ; then 30if ! ${HAVE_FCGI} ; then
28 AC_MSG_NOTICE([no FastCGI development kit found. It is highly recommnded that you get one. Meanwhile we will proceed without FastCGI support]) 31 AC_MSG_NOTICE([no FastCGI development kit found. It is highly recommnded that you get one. Meanwhile we will proceed without FastCGI support])
29fi 32fi
30AM_CONDITIONAL([HAVE_FCGI],[${HAVE_FCGI}]) 33AM_CONDITIONAL([HAVE_FCGI],[${HAVE_FCGI}])
31 34
32AC_C_CONST 35AC_C_CONST
33 36
34AC_FUNC_MALLOC 37AC_FUNC_MALLOC
35AC_FUNC_REALLOC 38AC_FUNC_REALLOC
36 39
37AC_PATH_PROG([XSLTPROC],[xsltproc],[true]) 40AC_PATH_PROG([XSLTPROC],[xsltproc],[true])
38 41
39AC_WITH_PKGCONFIG 42AC_WITH_PKGCONFIG
40 43
41PKG_CHECK_MODULES([KONFORKA],[konforka],,[ 44PKG_CHECK_MODULES([KONFORKA],[konforka],,[
42 AC_MSG_ERROR([no konforka library found. get one from http://kin.klever.net/konforka/]) 45 AC_MSG_ERROR([no konforka library found. get one from http://kin.klever.net/konforka/])
43]) 46])
44 47
45WANT_DOXYGEN="yes" 48WANT_DOXYGEN="yes"
46AC_ARG_ENABLE([doxygen], 49AC_ARG_ENABLE([doxygen],
47 AC_HELP_STRING([--disable-doxygen],[do not generate documentation]), 50 AC_HELP_STRING([--disable-doxygen],[do not generate documentation]),
48 [ 51 [
49 test "${enableval}" = "no" && WANT_DOXYGEN="no" 52 test "${enableval}" = "no" && WANT_DOXYGEN="no"
50 ] 53 ]
51) 54)
52if test "${WANT_DOXYGEN}" = "yes" ; then 55if test "${WANT_DOXYGEN}" = "yes" ; then
53 AC_WITH_DOXYGEN 56 AC_WITH_DOXYGEN
54 AC_WITH_DOT 57 AC_WITH_DOT
55else 58else
56 AM_CONDITIONAL([HAVE_DOXYGEN],[false]) 59 AM_CONDITIONAL([HAVE_DOXYGEN],[false])
57 AM_CONDITIONAL([HAVE_DOT],[false]) 60 AM_CONDITIONAL([HAVE_DOT],[false])
58fi 61fi
59 62
60AC_CONFIG_FILES([ 63AC_CONFIG_FILES([
61 Makefile 64 Makefile
62 kingate.pc kingate-fcgi.pc kingate-plaincgi.pc 65 kingate.pc kingate-fcgi.pc kingate-plaincgi.pc
63 Doxyfile 66 Doxyfile
64 include/Makefile 67 include/Makefile
65 src/Makefile 68 src/Makefile
66]) 69])
67AC_OUTPUT 70AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index e5c6778..d516d37 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,25 +1,25 @@
1lib_LTLIBRARIES = libkingate.la libkingate-plaincgi.la 1lib_LTLIBRARIES = libkingate.la libkingate-plaincgi.la
2 2
3if HAVE_FCGI 3if HAVE_FCGI
4lib_LTLIBRARIES += libkingate-fcgi.la 4lib_LTLIBRARIES += libkingate-fcgi.la
5endif 5endif
6 6
7INCLUDES = -I${top_srcdir}/include 7INCLUDES = -I${top_srcdir}/include -I${top_srcdir}
8AM_CXXFLAGS = ${KONFORKA_CFLAGS} 8AM_CXXFLAGS = ${KONFORKA_CFLAGS}
9LDADD = ${KONFORKA_LIBS} 9LDADD = ${KONFORKA_LIBS}
10 10
11libkingate_la_SOURCES = \ 11libkingate_la_SOURCES = \
12 cgi_gateway.cc \ 12 cgi_gateway.cc \
13 cgi_interface.cc \ 13 cgi_interface.cc \
14 util.cc 14 util.cc
15libkingate_la_LDFLAGS = -version-info 1:0:0 15libkingate_la_LDFLAGS = -version-info 1:0:0
16 16
17libkingate_fcgi_la_SOURCES = \ 17libkingate_fcgi_la_SOURCES = \
18 fastcgi.cc 18 fastcgi.cc
19libkingate_fcgi_la_LDFLAGS = -version-info 1:0:0 19libkingate_fcgi_la_LDFLAGS = -version-info 1:0:0
20 20
21libkingate_plaincgi_la_SOURCES = \ 21libkingate_plaincgi_la_SOURCES = \
22 plaincgi.cc 22 plaincgi.cc
23libkingate_plaincgi_la_LDFLAGS = -version-info 1:0:0 23libkingate_plaincgi_la_LDFLAGS = -version-info 1:0:0
24 24
25EXTRA_DIST = ${libkingate_fcgi_la_SOURCES} 25EXTRA_DIST = ${libkingate_fcgi_la_SOURCES}
diff --git a/src/plaincgi.cc b/src/plaincgi.cc
index 6934748..1cb7dc6 100644
--- a/src/plaincgi.cc
+++ b/src/plaincgi.cc
@@ -1,27 +1,32 @@
1#include <unistd.h> 1#include <unistd.h>
2#include <sys/types.h> 2#include <sys/types.h>
3#include <sys/stat.h> 3#include <sys/stat.h>
4#include "kingate/plaincgi.h" 4#include "kingate/plaincgi.h"
5#include "kingate/exception.h" 5#include "kingate/exception.h"
6#include "config.h"
7
8#if !HAVE_DECL_ENVIRON
9extern char **environ;
10#endif /* HAVE_DECL_ENVIRON */
6 11
7namespace kingate { 12namespace kingate {
8 13
9 plaincgi_interface::plaincgi_interface() { 14 plaincgi_interface::plaincgi_interface() {
10 for(char **p = environ; *p; p++) { 15 for(char **p = environ; *p; p++) {
11 const char *e = strchr(*p,'='); 16 const char *e = strchr(*p,'=');
12 if(!e){ 17 if(!e){
13 // XXX: check if we have it already? 18 // XXX: check if we have it already?
14 metavars[*p] = string(0); 19 metavars[*p] = string(0);
15 }else{ 20 }else{
16 int l = e-*p; e++; 21 int l = e-*p; e++;
17 // XXX: check if we have it already? 22 // XXX: check if we have it already?
18 metavars[string(*p,l)]=e; 23 metavars[string(*p,l)]=e;
19 } 24 }
20 } 25 }
21 } 26 }
22 plaincgi_interface::~plaincgi_interface() { 27 plaincgi_interface::~plaincgi_interface() {
23 cout.flush(); 28 cout.flush();
24 cerr.flush(); 29 cerr.flush();
25 } 30 }
26 31
27} 32}