vermaneerajin / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
0 stars 0 forks source link

Does not build on OpenBSD #186

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... i386-unknown-openbsd4.9
checking host system type... i386-unknown-openbsd4.9
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... match_pattern 
/lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... openbsd4.9 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for an ANSI C-conforming const... yes
checking whether gcc needs -traditional... no
checking libutil.h usability... no
checking libutil.h presence... no
checking for libutil.h... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking pty.h usability... no
checking pty.h presence... no
checking for pty.h... no
checking for strings.h... (cached) yes
checking sys/prctl.h usability... no
checking sys/prctl.h presence... no
checking for sys/prctl.h... no
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking util.h usability... yes
checking util.h presence... yes
checking for util.h... yes
checking utmp.h usability... yes
checking utmp.h presence... yes
checking for utmp.h... yes
checking utmpx.h usability... no
checking utmpx.h presence... no
checking for utmpx.h... no
checking for login_tty... no
checking for login_tty in -lutil... yes
checking for strlcat... yes
checking for getgrgid_r... yes
checking for getgrnam_r... yes
checking for gethostbyname_r... no
checking for getpwnam_r... yes
checking for getpwuid_r... yes
checking for openpty... yes
checking for strcasestr... yes
checking for getresuid... yes
checking for getresgid... yes
checking for setresuid... yes
checking for setresgid... yes
checking openssl/bio.h usability... yes
checking openssl/bio.h presence... yes
checking for openssl/bio.h... yes
checking openssl/err.h usability... yes
checking openssl/err.h presence... yes
checking for openssl/err.h... yes
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking security/pam_appl.h usability... no
checking security/pam_appl.h presence... no
checking for security/pam_appl.h... no
checking security/pam_client.h usability... no
checking security/pam_client.h presence... no
checking for security/pam_client.h... no
checking security/pam_misc.h usability... no
checking security/pam_misc.h presence... no
checking for security/pam_misc.h... no
checking for dlopen... yes
checking for deflate in -lz... yes
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
# make
od shellinabox/beep.wav >shellinabox/beep.h
od shellinabox/cgi_root.html >shellinabox/cgi_root.h
od shellinabox/enabled.gif >shellinabox/enabled.h
od shellinabox/favicon.ico >shellinabox/favicon.h
od shellinabox/keyboard.png >shellinabox/keyboard.h
od shellinabox/keyboard-layout.html >shellinabox/keyboard-layout.h
od shellinabox/print-styles.css >shellinabox/print-styles.h
od shellinabox/root_page.html >shellinabox/root_page.h
od shellinabox/shell_in_a_box.js >shellinabox/shell_in_a_box.h
od shellinabox/styles.css >shellinabox/styles.h
od shellinabox/vt100.js >shellinabox/vt100.h
make  all-am
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -g 
-std=gnu99 -Wall -Os -MT hashmap.lo -MD -MP -MF .deps/hashmap.Tpo -c -o 
hashmap.lo `test -f 'libhttp/hashmap.c' || echo './'`libhttp/hashmap.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -std=gnu99 -Wall -Os -MT 
hashmap.lo -MD -MP -MF .deps/hashmap.Tpo -c libhttp/hashmap.c  -fPIC -DPIC -o 
.libs/hashmap.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -std=gnu99 -Wall -Os -MT 
hashmap.lo -MD -MP -MF .deps/hashmap.Tpo -c libhttp/hashmap.c -o hashmap.o 
>/dev/null 2>&1
mv -f .deps/hashmap.Tpo .deps/hashmap.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -g 
-std=gnu99 -Wall -Os -MT trie.lo -MD -MP -MF .deps/trie.Tpo -c -o trie.lo `test 
-f 'libhttp/trie.c' || echo './'`libhttp/trie.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -std=gnu99 -Wall -Os -MT trie.lo 
-MD -MP -MF .deps/trie.Tpo -c libhttp/trie.c  -fPIC -DPIC -o .libs/trie.o
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -std=gnu99 -Wall -Os -MT trie.lo 
-MD -MP -MF .deps/trie.Tpo -c libhttp/trie.c -o trie.o >/dev/null 2>&1
mv -f .deps/trie.Tpo .deps/trie.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -g 
-std=gnu99 -Wall -Os -MT httpconnection.lo -MD -MP -MF .deps/httpconnection.Tpo 
-c -o httpconnection.lo `test -f 'libhttp/httpconnection.c' || echo 
'./'`libhttp/httpconnection.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -std=gnu99 -Wall -Os -MT 
httpconnection.lo -MD -MP -MF .deps/httpconnection.Tpo -c 
libhttp/httpconnection.c  -fPIC -DPIC -o .libs/httpconnection.o
In file included from libhttp/httpconnection.c:50:
/usr//include/arpa/inet.h:74: warning: 'struct in_addr' declared inside 
parameter list
/usr//include/arpa/inet.h:74: warning: its scope is only this definition or 
declaration, which is probably not what you want
/usr//include/arpa/inet.h:75: warning: 'struct in_addr' declared inside 
parameter list
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -std=gnu99 -Wall -Os -MT 
httpconnection.lo -MD -MP -MF .deps/httpconnection.Tpo -c 
libhttp/httpconnection.c -o httpconnection.o >/dev/null 2>&1
mv -f .deps/httpconnection.Tpo .deps/httpconnection.Plo
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.    -g 
-std=gnu99 -Wall -Os -MT server.lo -MD -MP -MF .deps/server.Tpo -c -o server.lo 
`test -f 'libhttp/server.c' || echo './'`libhttp/server.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -g -std=gnu99 -Wall -Os -MT 
server.lo -MD -MP -MF .deps/server.Tpo -c libhttp/server.c  -fPIC -DPIC -o 
.libs/server.o
In file included from libhttp/server.c:48:
/usr//include/arpa/inet.h:74: warning: 'struct in_addr' declared inside 
parameter list
/usr//include/arpa/inet.h:74: warning: its scope is only this definition or 
declaration, which is probably not what you want
/usr//include/arpa/inet.h:75: warning: 'struct in_addr' declared inside 
parameter list
libhttp/server.c: In function 'serverGetConnection':
libhttp/server.c:437: error: 'uintptr_t' undeclared (first use in this function)
libhttp/server.c:437: error: (Each undeclared identifier is reported only once
libhttp/server.c:437: error: for each function it appears in.)
libhttp/server.c:437: error: expected ';' before 'ptr1'
libhttp/server.c:438: error: 'ptr1' undeclared (first use in this function)
libhttp/server.c:439: error: 'ptr2' undeclared (first use in this function)
*** Error code 1

Stop in /tmp/shellinabox-2.14 (line 578 of Makefile).
*** Error code 1

Stop in /tmp/shellinabox-2.14 (line 399 of Makefile).

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by j...@rby.se on 6 May 2012 at 2:19

GoogleCodeExporter commented 8 years ago
# uname -a
OpenBSD whiterussian.c 4.9 GENERIC#671 i386

Original comment by j...@rby.se on 6 May 2012 at 2:19

GoogleCodeExporter commented 8 years ago
Easy to fix, this uintptr_t (a type big enough to hold difference between two 
pointers) is defined in the gcc standard header file stdint.h, so you can just 
edit the file libhttp/server.c and add a line 

#include <stdint.h>

right under the line #include "config.h"

Compiles and works just fine on openbsd 4.9 up to 5.4

Original comment by adm...@rsiegler.org on 6 Nov 2013 at 11:38