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

Support PostgreSQL #112

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
update configure by autoconf
  • Loading branch information
SunBeau committed Apr 30, 2024
commit cdd0c094fb0fc7b7abb17ab49c69b0bfaad0e415
2 changes: 1 addition & 1 deletion .github/workflows/ci-run-test-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Configure And make
working-directory: ${{ github.workspace }}
run: |
autoconf
# autoconf
./configure --with-pgsql \
--with-pgsql-incdir=/usr/include/postgresql \
--with-pgsql-libdir=/usr/lib/x86_64-linux-gnu
Expand Down
103 changes: 103 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,9 @@ enable_ext_qhttpclient
enable_ext_qdatabase
with_openssl
with_mysql
with_pgsql
with_pgsql_incdir
with_pgsql_libdir
'
ac_precious_vars='build_alias
host_alias
Expand Down Expand Up @@ -1372,6 +1375,11 @@ Optional Packages:
extension API. When it's enabled, user applications
need to link mysql client library. (ex:
-lmysqlclient)
--with-pgsql This will enable PostgreSQL database support in
qdatabase extension API. When it's enabled, user
applications need to link libpq library. (ex: -lpq)
--with-pgsql-incdir=DIR site header files for PostgreSQL in DIR.
--with-pgsql-libdir=DIR site library files for PostgreSQL in DIR

Some influential environment variables:
CC C compiler command
Expand Down Expand Up @@ -4843,6 +4851,101 @@ See \`config.log' for more details" "$LINENO" 5; }
fi
fi


# Check whether --with-pgsql was given.
if test "${with_pgsql+set}" = set; then :
withval=$with_pgsql;
else
withval=no
fi

if test "$withval" = yes; then
# check libpq-fe.h
as_ac_File=`$as_echo "ac_cv_file_$with_pgsql_incdir/libpq-fe.h" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_pgsql_incdir/libpq-fe.h" >&5
$as_echo_n "checking for $with_pgsql_incdir/libpq-fe.h... " >&6; }
if eval \${$as_ac_File+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "$with_pgsql_incdir/libpq-fe.h"; then
eval "$as_ac_File=yes"
else
eval "$as_ac_File=no"
fi
fi
eval ac_res=\$$as_ac_File
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
withval=yes
else
withval=no
fi

if test "$withval" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: find '$with_pgsql_incdir/libpq-fe.h'" >&5
$as_echo "$as_me: find '$with_pgsql_incdir/libpq-fe.h'" >&6;}
CPPFLAGS="$CPPFLAGS -DENABLE_PGSQL -I$with_pgsql_incdir"
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Cannot find 'libpq-fe.h' header. Use --with-pgsql-incdir=DIR to specify the directory where 'libpq-fe.h' is located.
See \`config.log' for more details" "$LINENO" 5; }
fi
# check libpq.so
as_ac_File=`$as_echo "ac_cv_file_$with_pgsql_libdir/libpq.so" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $with_pgsql_libdir/libpq.so" >&5
$as_echo_n "checking for $with_pgsql_libdir/libpq.so... " >&6; }
if eval \${$as_ac_File+:} false; then :
$as_echo_n "(cached) " >&6
else
test "$cross_compiling" = yes &&
as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
if test -r "$with_pgsql_libdir/libpq.so"; then
eval "$as_ac_File=yes"
else
eval "$as_ac_File=no"
fi
fi
eval ac_res=\$$as_ac_File
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
withval=yes
else
withval=no
fi

if test "$withval" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: find '$with_pgsql_libdir/libpq.so'" >&5
$as_echo "$as_me: find '$with_pgsql_libdir/libpq.so'" >&6;}
CPPFLAGS="$CPPFLAGS -Wl,-rpath,$with_pgsql_libdir -L$with_pgsql_libdir -lpq"
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Cannot find 'libpq.so' library. Use --with-pgsql-libdir=DIR to specify the directory where 'libpq.so' is located.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi

# Check whether --with-pgsql_incdir was given.
if test "${with_pgsql_incdir+set}" = set; then :
withval=$with_pgsql_incdir;
else
withval=no
fi


# Check whether --with-pgsql_libdir was given.
if test "${with_pgsql_libdir+set}" = set; then :
withval=$with_pgsql_libdir;
else
withval=no
fi


{ $as_echo "$as_me:${as_lineno-$LINENO}: CFLAGS $CFLAGS" >&5
$as_echo "$as_me: CFLAGS $CFLAGS" >&6;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS $CPPFLAGS" >&5
Expand Down
Loading