Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build on OpenBSD #199

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

ChihHao-Su
Copy link

Tested on OpenBSD 7.3 and Fedora 41

This pull request has a series of modifications, let me explain:

Change the system-detecting logic (configure.ac)

The original configure.ac rejects configuration if the target system is not one of: windows (cygwin/msys), linux, macos. But, actually, this project has basically nothing platform-dependent. Therefore I modified this area of logic: the script will assume the project is able to build on every systems, it just needs to have some special handling for certain platforms.

Get fmt and spdlog via pkg-config instead of specifing -lfmt and -lspdlog flags directly

The libraries might have different filename than we thought, or inside some other directories. For example, on OpenBSD, some libraries are located in /usr/local/lib, for them, additional linker flags or compiler flags are needed.

Give another option for enabling mariadb

So that users can specify clearly whether he wants libmysqlclient or libmariadb.

Remove linker flags link to libstdc++

Target platform may not use libstdc++.

Prevent the including of build-tools/grammar-tools/FlexLexer.h on non-windows platform

build-tools/grammar-tools/FlexLexer.h, this file only works with GNU systems's flex. So just use FlexLexer.h of the system's flex.

Refactor yyin.getline into two overloaded yyinGetline function (libgixpp/GixEsqlLexer.cpp)

In OpenBSD's flex, yyin is a std::istream* instead of a std::istream.

Remove all #include <malloc.h>

This is useless, because there's already #include <stdlib.h>. And this file is not standard C header, doesn't exist on OpenBSD and some systems.

Provide a unified and cross-platform bitswap implementation (runtime/libgixsql/SqlVar.cpp)

To find the bitswap function of every system is troublesome, and you cannot find that on some systems, for example, OpenBSD. Let use a self-implemented one.

…dlog flags directly; Give another option for enabling mariadb; Remove linker flags link to libstdc++; Prevent the including of build-tools/grammar-tools/FlexLexer.h on non-windows platform; Remove all '#include <malloc.h>' (this problem also exist in OCESQL); Provide a unified and cross-platform bitswap implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant