-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/plaincgi.cc | 5 |
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 | |||
@@ -6,16 +6,19 @@ AM_INIT_AUTOMAKE([dist-bzip2]) | |||
6 | AC_PROG_INSTALL | 6 | AC_PROG_INSTALL |
7 | AC_PROG_AWK | 7 | AC_PROG_AWK |
8 | AC_PROG_CXX | 8 | AC_PROG_CXX |
9 | AC_PROG_CC | 9 | AC_PROG_CC |
10 | AC_PROG_LIBTOOL | 10 | AC_PROG_LIBTOOL |
11 | 11 | ||
12 | AC_HEADER_STDC | 12 | AC_HEADER_STDC |
13 | AC_CHECK_HEADERS([sys/types.h sys/stat.h]) | 13 | AC_CHECK_HEADERS([sys/types.h sys/stat.h]) |
14 | AC_CHECK_DECLS([environ],,,[ | ||
15 | #include <unistd.h> | ||
16 | ]) | ||
14 | 17 | ||
15 | HAVE_FCGI=false | 18 | HAVE_FCGI=false |
16 | AC_LANG_PUSH(C++) | 19 | AC_LANG_PUSH(C++) |
17 | AC_CHECK_HEADERS([fcgio.h],[ | 20 | AC_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}" |
diff --git a/src/Makefile.am b/src/Makefile.am index e5c6778..d516d37 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -1,15 +1,15 @@ | |||
1 | lib_LTLIBRARIES = libkingate.la libkingate-plaincgi.la | 1 | lib_LTLIBRARIES = libkingate.la libkingate-plaincgi.la |
2 | 2 | ||
3 | if HAVE_FCGI | 3 | if HAVE_FCGI |
4 | lib_LTLIBRARIES += libkingate-fcgi.la | 4 | lib_LTLIBRARIES += libkingate-fcgi.la |
5 | endif | 5 | endif |
6 | 6 | ||
7 | INCLUDES = -I${top_srcdir}/include | 7 | INCLUDES = -I${top_srcdir}/include -I${top_srcdir} |
8 | AM_CXXFLAGS = ${KONFORKA_CFLAGS} | 8 | AM_CXXFLAGS = ${KONFORKA_CFLAGS} |
9 | LDADD = ${KONFORKA_LIBS} | 9 | LDADD = ${KONFORKA_LIBS} |
10 | 10 | ||
11 | libkingate_la_SOURCES = \ | 11 | libkingate_la_SOURCES = \ |
12 | cgi_gateway.cc \ | 12 | cgi_gateway.cc \ |
13 | cgi_interface.cc \ | 13 | cgi_interface.cc \ |
14 | util.cc | 14 | util.cc |
15 | libkingate_la_LDFLAGS = -version-info 1:0:0 | 15 | libkingate_la_LDFLAGS = -version-info 1:0:0 |
diff --git a/src/plaincgi.cc b/src/plaincgi.cc index 6934748..1cb7dc6 100644 --- a/src/plaincgi.cc +++ b/src/plaincgi.cc | |||
@@ -1,13 +1,18 @@ | |||
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 | ||
9 | extern char **environ; | ||
10 | #endif /* HAVE_DECL_ENVIRON */ | ||
6 | 11 | ||
7 | namespace kingate { | 12 | namespace 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? |