openlitespeed
openlitespeed copied to clipboard
Build from source: lshttpdmain.cpp:87:19: error: expected ‘,’ or ‘;’ before ‘LS_MODULE_VERSION_INFO_ONELINE’
https://www.hetzner.com/de/dedicated-rootserver/rx220 Ampere® Altra® Q80-30 Debian 11 used guide: https://openlitespeed.org/kb/install-openlitespeed-from-source-with-build-script/
how to replicate:
- order the server
- install debian 11 with installimage script "https://docs.hetzner.com/de/robot/dedicated-server/operating-systems/installimage"
- follow the guide to ./build.sh
[ 86%] Building CXX object src/socket/CMakeFiles/socket.dir/gsockaddr.cpp.o /root/downloads/openlitespeed-1.7.16/src/main/lshttpdmain.cpp:87:19: error: expected ‘,’ or ‘;’ before ‘LS_MODULE_VERSION_INFO_ONELINE’ 87 | " Open (" LS_MODULE_VERSION_INFO_ONELINE ") BUILD (" BUILDTIME ")"; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/downloads/openlitespeed-1.7.16/src/main/lshttpdmain.cpp: In member function ‘int LshttpdMain::guardCrash()’: /root/downloads/openlitespeed-1.7.16/src/main/lshttpdmain.cpp:1706:36: warning: comparison is always false due to limited range of data type [-Wtype-limits] 1706 | stopAllChildren(s_iRunning < 0); | ~~~~~~~~~~~^~~ [ 86%] Building CXX object src/socket/CMakeFiles/socket.dir/hostinfo.cpp.o make[2]: *** [src/main/CMakeFiles/main.dir/build.make:95: src/main/CMakeFiles/main.dir/lshttpdmain.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1234: src/main/CMakeFiles/main.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 86%] Building CXX object src/socket/CMakeFiles/socket.dir/tcpsockopt.cpp.o [ 86%] Building CXX object src/socket/CMakeFiles/socket.dir/tcpserversocket.cpp.o [ 87%] Building CXX object src/socket/CMakeFiles/socket.dir/tcpconnection.cpp.o [ 87%] Building CXX object src/socket/CMakeFiles/socket.dir/streamsocket.cpp.o [ 87%] Building CXX object src/socket/CMakeFiles/socket.dir/serversocket.cpp.o [ 87%] Building CXX object src/socket/CMakeFiles/socket.dir/coresocket.cpp.o [ 87%] Linking CXX static library libsocket.a [ 87%] Built target socket make: *** [Makefile:149: all] Error 2 cp: cannot stat 'build/src/openlitespeed': No such file or directory cp: cannot stat 'build/src/modules/modreqparser/.so': No such file or directory cp: cannot stat 'build/src/modules/modinspector/.so': No such file or directory cp: cannot stat 'build/src/modules/uploadprogress/*.so': No such file or directory Start to pack files. mv: cannot stat 'dist/install.sh': No such file or directory
I have the same issue.
Solved it by defining LS_MODULE_VERSION_INFO_ONELINE within lshttpdmain.cpp
It is defined in src/config.h.cmake
, cmake should create <build_dir>/src/config.h
.
Yes, that's how I found what was neccessary. Well, apperently it didn't according to both of our issue.
what is the content of <build_dir>/src/config.h
? Is it created?
It is. Seems LS_MODULE_VERSION_INFO_ONELINE was not added in it.
marcell@raspberry:~$ cat /opt/openlitespeed_source/src/config.h
/* src/config.h. Generated from config.h.in by configure. */
/* src/config.h.in. Generated from configure.ac by autoheader. */
/* Defined the temprary directory */
#define DEFAULT_TMP_DIR "/tmp/lshttpd"
/* Defined to compile with iptogeo2 enabled */
/* #undef ENABLE_IPTOGEO2 */
/* Define to 1 if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to 1 if you have the `bzero' function. */
#define HAVE_BZERO 1
/* Define to 1 if your system has a working `chown' function. */
#define HAVE_CHOWN 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the `dup2' function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#define HAVE_FSEEKO 1
/* Define to 1 if you have the `ftruncate' function. */
#define HAVE_FTRUNCATE 1
/* Define to 1 if you have the `getcwd' function. */
#define HAVE_GETCWD 1
/* Define to 1 if you have the `gethostbyaddr' function. */
#define HAVE_GETHOSTBYADDR 1
/* Define to 1 if you have the `gethostbyname' function. */
#define HAVE_GETHOSTBYNAME 1
/* Define to 1 if you have the `getpagesize' function. */
#define HAVE_GETPAGESIZE 1
/* Define to 1 if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the `inet_ntoa' function. */
#define HAVE_INET_NTOA 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <lauxlib.h> header file. */
/* #undef HAVE_LAUXLIB_H */
/* Define to 1 if you have the `pcre' library (-lpcre). */
#define HAVE_LIBPCRE 1
/* Define if pthread (-lpthread) */
#define HAVE_LIBPTHREAD /**/
/* Define to 1 if you have the `z' library (-lz). */
#define HAVE_LIBZ 1
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define to 1 if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R 1
/* Define to 1 if you have the <lualib.h> header file. */
/* #undef HAVE_LUALIB_H */
/* Define to 1 if you have the <lua.h> header file. */
/* #undef HAVE_LUA_H */
/* Define to 1 if you have the `malloc' function. */
#define HAVE_MALLOC 1
/* Define to 1 if you have the `memchr' function. */
#define HAVE_MEMCHR 1
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
/* Define to 1 if you have the `mkdir' function. */
#define HAVE_MKDIR 1
/* Define to 1 if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define to 1 if you have the `munmap' function. */
#define HAVE_MUNMAP 1
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define if <pthread.h> */
#define HAVE_PTHREAD_H /**/
/* Define to 1 if the system has the type `ptrdiff_t'. */
#define HAVE_PTRDIFF_T 1
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#define HAVE_REALLOC 1
/* Define to 1 if you have the `select' function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the `socket' function. */
#define HAVE_SOCKET 1
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strcasecmp' function. */
#define HAVE_STRCASECMP 1
/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
/* Define to 1 if you have the `strcspn' function. */
#define HAVE_STRCSPN 1
/* Define to 1 if you have the `strdup' function. */
#define HAVE_STRDUP 1
/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strncasecmp' function. */
#define HAVE_STRNCASECMP 1
/* Define to 1 if you have the `strpbrk' function. */
#define HAVE_STRPBRK 1
/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1
/* Define to 1 if you have the `strspn' function. */
#define HAVE_STRSPN 1
/* Define to 1 if you have the `strstr' function. */
#define HAVE_STRSTR 1
/* Define to 1 if you have the `strtol' function. */
#define HAVE_STRTOL 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `vfork' function. */
#define HAVE_VFORK 1
/* Define to 1 if you have the <vfork.h> header file. */
/* #undef HAVE_VFORK_H */
/* Define to 1 if `fork' works. */
#define HAVE_WORKING_FORK 1
/* Define to 1 if `vfork' works. */
#define HAVE_WORKING_VFORK 1
/* Defined to build lscpd */
/* #undef IS_LSCPD */
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
/* Define if set to debug mode */
/* #undef LS_ENABLE_DEBUG */
/* Define if need spdy/http2 feature */
#define LS_ENABLE_SPDY 1
/* The pre-defined modules version info */
#define LS_MODULE_VERSION_INFO "\tmodgzip 1.1\n\tcache 1.64\n\tmodinspector 1.1\n\tuploadprogress 1.1\n\tmod_security 1.4\n"
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/"
/* Define to 1 if assertions should be disabled. */
/* #undef NDEBUG */
/* Defined the group of the user */
#define OPENLSWS_GROUP "nobody"
/* Defined the user name */
#define OPENLSWS_USER "nobody"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "[email protected]"
/* Define to the full name of this package. */
#define PACKAGE_NAME "openlitespeed"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "openlitespeed 1.7.16"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "openlitespeed"
/* Define to the home page for this package. */
#define PACKAGE_URL "http://www.litespeedtech.com/"
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.7.16"
/* Defined the pid file path */
#define PID_FILE "/tmp/lshttpd/lshttpd.pid"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Defined to use BoringSSL instead of OpenSSL */
#define USE_BORINGSSL 1
/* Defined to compile with Brotli compression included */
/* #undef USE_BROTLI */
/* Defined to use boringSSL */
#define USE_BSSL 1
/* Defined to use openssl */
#define USE_DYN_OSSL 0
/* Defined to compile with IP2Location included */
/* #undef USE_IP2LOCATION */
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
/* #undef _LARGEFILE_SOURCE */
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
/* #undef _UINT32_T */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
/* #undef inline */
#endif
/* Define to the type of a signed integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
/* #undef int16_t */
/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef int32_t */
/* Define to the type of a signed integer type of width exactly 8 bits if such
a type exists and the standard includes do not define it. */
/* #undef int8_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef pid_t */
/* Define to rpl_realloc if the replacement function should be used. */
/* #undef realloc */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef ssize_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint16_t */
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
/* #undef uint32_t */
/* Define as `fork' if `vfork' does not work. */
/* #undef vfork */
We no longer use configure
, only use cmake
. maybe you run it manually?
If you run build.sh
immediately after grab the source code, it should not create a file like that.
build.sh fails mostly, whenever I try to run it the first time on a clean OS. I usually go back in /scripts/ and build_ols.sh from there. It's likely because arm64 is not supported, I guess, so the script isn't work as it should, though the guy above runs 64bit, so no clue.
You mean the dependent libraries in /third-party/
directory? If you remember which lib failed and what you did to fix it, then we can improve the build script.
My first attempt of build.sh on arm64 build is successful.
I personally do not recall for 100%, but, I can install deboostrap and see what's happening for first. What I do remember.
-Yajl failed, so I had to manually edit the bash script in the /third-party/scripts directory to fix the URL and cd the right directory make it work.
The corrected part
wget https://github.com/lloyd/yajl/archive/refs/tags/2.1.0.tar.gz -O yajl-2.1.0.tar.gz
tar -xvzf yajl-2.1.0.tar.gz
cd yajl-2.1.0
The old version
wget http://github.com/lloyd/yajl/tarball/2.1.0 -O yajl-2.1.0.tar.gz
tar -xvzf yajl-2.1.0.tar.gz
cd lloyd-yajl-66cb08c