FirebirdSQL / php-firebird

Firebird PHP driver
Other
66 stars 15 forks source link

FreeBSD + PHP 8 + Firebird #18

Closed alfiqmiq closed 2 years ago

alfiqmiq commented 3 years ago

I'm trying to compile php8 + Firebird extension with no success

Steps to reproduce:

# php -v
PHP 8.0.3 (cli) (built: Mar 13 2021 01:55:02) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.3, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies
    with Xdebug v3.0.3, Copyright (c) 2002-2021, by Derick Rethans
$ git clone https://github.com/FirebirdSQL/php-firebird.git
$ cd php-firebird
$ phpize
$ CPPFLAGS=-I/usr/include/firebird ./configure

fail occurred

configure: error: libfbclient, libgds or libib_util not found! Check config.log for more information.

so ...

# find /usr/ -iname "libfbclient*" -o -iname "libgds*" -o -iname "libib_util*"
/usr/local/lib/libgds.so.2.5
/usr/local/lib/libfbclient.so.2
/usr/local/lib/libib_util.so
/usr/local/lib/libgds.so
/usr/local/lib/libfbclient.so.2.5
/usr/local/lib/libfbclient.so
/usr/local/lib/libfbclient.so.2.5.8
/usr/local/lib/libgds.so.2

and than i use

CPPFLAGS=-I/usr/local/lib/ ./configure

still no success

# CPPFLAGS=-I/usr/local/lib/ ./configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
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 cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... amd64-unknown-freebsd13.0
checking host system type... amd64-unknown-freebsd13.0
checking target system type... amd64-unknown-freebsd13.0
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/20200930
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for Firebird support... yes, shared
checking for fb_config... no
checking for isc_detach_database in -lfbclient... no
checking for isc_detach_database in -lgds... no
checking for isc_detach_database in -lib_util... no
configure: error: libfbclient, libgds or libib_util not found! Check config.log for more information.
# cat config.log 
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = dev.fb
uname -m = amd64
uname -r = 13.0-RC4
uname -s = FreeBSD
uname -v = FreeBSD 13.0-RC4 #0 releng/13.0-n244719-2e70fcbb154: Mon Mar 29 04:19:01 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC 

/usr/bin/uname -p = amd64
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /root/.yarn/bin
PATH: /root/.config/yarn/global/node_modules/.bin
PATH: /sbin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /root/bin
PATH: /usr/local/bin/sg

## ----------- ##
## Core tests. ##
## ----------- ##

configure:2336: checking for grep that handles long lines and -e
configure:2394: result: /usr/bin/grep
configure:2399: checking for egrep
configure:2461: result: /usr/bin/grep -E
configure:2466: checking for a sed that does not truncate output
configure:2530: result: /usr/bin/sed
configure:2669: checking for pkg-config
configure:2687: found /usr/local/bin/pkg-config
configure:2699: result: /usr/local/bin/pkg-config
configure:2724: checking pkg-config is at least version 0.9.0
configure:2727: result: yes
configure:2789: checking for cc
configure:2805: found /usr/bin/cc
configure:2816: result: cc
configure:2847: checking for C compiler version
configure:2856: cc --version >&5
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
configure:2867: $? = 0
configure:2856: cc -v >&5
FreeBSD clang version 11.0.1 (git@github.com:llvm/llvm-project.git llvmorg-11.0.1-0-g43ff75f2c3fe)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
configure:2867: $? = 0
configure:2856: cc -V >&5
cc: error: argument to '-V' is missing (expected 1 value)
cc: error: no input files
configure:2867: $? = 1
configure:2856: cc -qversion >&5
cc: error: unknown argument '-qversion'; did you mean '--version'?
cc: error: no input files
configure:2867: $? = 1
configure:2887: checking whether the C compiler works
configure:2909: cc  -I/usr/local/lib/  conftest.c  >&5
configure:2913: $? = 0
configure:2961: result: yes
configure:2964: checking for C compiler default output file name
configure:2966: result: a.out
configure:2972: checking for suffix of executables
configure:2979: cc -o conftest  -I/usr/local/lib/  conftest.c  >&5
configure:2983: $? = 0
configure:3005: result: 
configure:3027: checking whether we are cross compiling
configure:3035: cc -o conftest  -I/usr/local/lib/  conftest.c  >&5
configure:3039: $? = 0
configure:3046: ./conftest
configure:3050: $? = 0
configure:3065: result: no
configure:3070: checking for suffix of object files
configure:3092: cc -c  -I/usr/local/lib/ conftest.c >&5
configure:3096: $? = 0
configure:3117: result: o
configure:3121: checking whether we are using the GNU C compiler
configure:3140: cc -c  -I/usr/local/lib/ conftest.c >&5
configure:3140: $? = 0
configure:3149: result: yes
configure:3158: checking whether cc accepts -g
configure:3178: cc -c -g -I/usr/local/lib/ conftest.c >&5
configure:3178: $? = 0
configure:3219: result: yes
configure:3236: checking for cc option to accept ISO C89
configure:3299: cc  -c -g -O2 -I/usr/local/lib/ conftest.c >&5
configure:3299: $? = 0
configure:3312: result: none needed
configure:3338: checking how to run the C preprocessor
configure:3369: cc -E -I/usr/local/lib/ conftest.c
configure:3369: $? = 0
configure:3383: cc -E -I/usr/local/lib/ conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
configure:3383: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3408: result: cc -E
configure:3428: cc -E -I/usr/local/lib/ conftest.c
configure:3428: $? = 0
configure:3442: cc -E -I/usr/local/lib/ conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.
configure:3442: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| #include <ac_nonexistent.h>
configure:3473: checking for icc
configure:3482: result: no
configure:3496: checking for suncc
configure:3505: result: no
configure:3523: checking for system library directory
configure:3538: result: lib
configure:3545: checking if compiler supports -R
configure:3564: cc -o conftest -g -O2 -I/usr/local/lib/  conftest.c -R /usr/lib  >&5
warning: unknown remark option '-R' [-Wunknown-warning-option]
1 warning generated.
ld: error: cannot open /usr/lib: Is a directory
cc: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3564: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3574: result: no
configure:3579: checking if compiler supports -Wl,-rpath,
configure:3598: cc -o conftest -g -O2 -I/usr/local/lib/  conftest.c -Wl,-rpath,/usr/lib  >&5
configure:3598: $? = 0
configure:3608: result: yes
configure:3624: checking build system type
configure:3638: result: amd64-unknown-freebsd13.0
configure:3658: checking host system type
configure:3671: result: amd64-unknown-freebsd13.0
configure:3691: checking target system type
configure:3704: result: amd64-unknown-freebsd13.0
configure:3807: checking for PHP prefix
configure:3809: result: /usr/local
configure:3811: checking for PHP includes
configure:3813: result: -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
configure:3815: checking for PHP extension directory
configure:3817: result: /usr/local/lib/php/20200930
configure:3819: checking for PHP installed headers prefix
configure:3821: result: /usr/local/include/php
configure:3824: checking if debug is enabled
configure:3850: result: no
configure:3853: checking if zts is enabled
configure:3879: result: no
configure:3947: checking for gawk
configure:3978: result: no
configure:3947: checking for nawk
configure:3964: found /usr/bin/nawk
configure:3975: result: nawk
configure:3998: checking if nawk is broken
configure:4005: result: no
configure:4018: checking for Firebird support
configure:4058: result: yes, shared
configure:4068: checking for fb_config
configure:4099: result: no
configure:4372: checking for isc_detach_database in -lfbclient
configure:4397: cc -o conftest -g -O2 -I/usr/local/lib/ -Wl,-rpath,/opt/firebird/lib -L/opt/firebird/lib  conftest.c -lfbclient   >&5
ld: error: unable to find library -lfbclient
cc: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4397: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char isc_detach_database ();
| int
| main ()
| {
| return isc_detach_database ();
|   ;
|   return 0;
| }
configure:4406: result: no
configure:4529: checking for isc_detach_database in -lgds
configure:4554: cc -o conftest -g -O2 -I/usr/local/lib/ -Wl,-rpath,/opt/firebird/lib -L/opt/firebird/lib  conftest.c -lgds   >&5
ld: error: unable to find library -lgds
cc: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4554: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char isc_detach_database ();
| int
| main ()
| {
| return isc_detach_database ();
|   ;
|   return 0;
| }
configure:4563: result: no
configure:4686: checking for isc_detach_database in -lib_util
configure:4711: cc -o conftest -g -O2 -I/usr/local/lib/ -Wl,-rpath,/opt/firebird/lib -L/opt/firebird/lib  conftest.c -lib_util   >&5
ld: error: unable to find library -lib_util
cc: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4711: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char isc_detach_database ();
| int
| main ()
| {
| return isc_detach_database ();
|   ;
|   return 0;
| }
configure:4720: result: no
configure:4736: error: libfbclient, libgds or libib_util not found! Check config.log for more information.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=amd64-unknown-freebsd13.0
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=''
ac_cv_env_CC_value=''
ac_cv_env_CFLAGS_set=''
ac_cv_env_CFLAGS_value=''
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=-I/usr/local/lib/
ac_cv_env_CPP_set=''
ac_cv_env_CPP_value=''
ac_cv_env_LDFLAGS_set=''
ac_cv_env_LDFLAGS_value=''
ac_cv_env_LIBS_set=''
ac_cv_env_LIBS_value=''
ac_cv_env_PKG_CONFIG_LIBDIR_set=''
ac_cv_env_PKG_CONFIG_LIBDIR_value=''
ac_cv_env_PKG_CONFIG_PATH_set=''
ac_cv_env_PKG_CONFIG_PATH_value=''
ac_cv_env_PKG_CONFIG_set=''
ac_cv_env_PKG_CONFIG_value=''
ac_cv_env_build_alias_set=''
ac_cv_env_build_alias_value=''
ac_cv_env_host_alias_set=''
ac_cv_env_host_alias_value=''
ac_cv_env_target_alias_set=''
ac_cv_env_target_alias_value=''
ac_cv_host=amd64-unknown-freebsd13.0
ac_cv_objext=o
ac_cv_path_EGREP='/usr/bin/grep -E'
ac_cv_path_FB_CONFIG=no
ac_cv_path_GREP=/usr/bin/grep
ac_cv_path_SED=/usr/bin/sed
ac_cv_path_ac_pt_PKG_CONFIG=/usr/local/bin/pkg-config
ac_cv_prog_AWK=nawk
ac_cv_prog_CPP='cc -E'
ac_cv_prog_ac_ct_CC=cc
ac_cv_prog_cc_c89=''
ac_cv_prog_cc_g=yes
ac_cv_target=amd64-unknown-freebsd13.0
php_cv_cc_dashr=no
php_cv_cc_rpath=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR=''
AWK='nawk'
CC='cc'
CFLAGS='-g -O2'
CONFIGURE_COMMAND=' '\''./configure'\'' '
CONFIGURE_OPTIONS=''
CPP='cc -E'
CPPFLAGS='-I/usr/local/lib/'
DEFS=''
DSYMUTIL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/usr/bin/grep -E'
EXEEXT=''
FB_CONFIG='no'
GREP='/usr/bin/grep'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
NMEDIT=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PKG_CONFIG='/usr/local/bin/pkg-config'
PKG_CONFIG_LIBDIR=''
PKG_CONFIG_PATH=''
RANLIB=''
SED='/usr/bin/sed'
SHELL='/bin/sh'
SHLIB_DL_SUFFIX_NAME='so'
SHLIB_SUFFIX_NAME='so'
STRIP=''
ac_ct_CC='cc'
bindir='${exec_prefix}/bin'
build='amd64-unknown-freebsd13.0'
build_alias=''
build_cpu='amd64'
build_os='freebsd13.0'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host='amd64-unknown-freebsd13.0'
host_alias='amd64-unknown-freebsd13.0'
host_cpu='amd64'
host_os='freebsd13.0'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target='amd64-unknown-freebsd13.0'
target_alias=''
target_cpu='amd64'
target_os='freebsd13.0'
target_vendor='unknown'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 1
alfiqmiq commented 3 years ago
# pkg info | grep firebird
firebird25-client-2.5.8_7      Firebird-2 database client
firebird25-server-2.5.8_7      Firebird-2 relational database (server)
# find /usr/ -iname "libfbclient*" -o -iname "libgds*" -o -iname "libib_util*" 
/usr/local/lib/libgds.so.2.5
/usr/local/lib/libfbclient.so.2
/usr/local/lib/libib_util.so
/usr/local/lib/libgds.so
/usr/local/lib/libfbclient.so.2.5
/usr/local/lib/libfbclient.so
/usr/local/lib/libfbclient.so.2.5.8
/usr/local/lib/libgds.so.2
mrotteveel commented 3 years ago

Yes, sorry I missed that at first. I'll leave this to Martin then; sorry for my intrusion.

alfiqmiq commented 3 years ago

I always try to give as many information as i can ;-)

MartinKoeditz commented 3 years ago

Well, I don't have any experiences with Free BSD. But we'll find out what the problem is.

As I can see you're trying to compile the PHP 64 bit version. What version is Firebird? 64 bit too? Or 32 bit?

alfiqmiq commented 3 years ago
pkg info firebird25-server
firebird25-server-2.5.8_7
Name           : firebird25-server
Version        : 2.5.8_7
Installed on   : Sun Mar 21 05:19:00 2021 CET
Origin         : databases/firebird25-server
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : databases
Licenses       : IPL, IDPL
Maintainer     : acm@FreeBSD.org
WWW            : https://sourceforge.net/projects/firebird/
Comment        : Firebird-2 relational database (server)
Shared Libs required:
        libfbclient.so.2
        libicuuc.so.68
        libicui18n.so.68
        libfbembed.so.2.5
        libicudata.so.68
        libib_util.so
Shared Libs provided:
        libfbtrace.so.0
        libfbintl.so.1
Annotations    :
        FreeBSD_version: 1300139
        cpe            : cpe:2.3:a:firebird:firebird:2.5.8:::::freebsd13:x64:7
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 12.0MiB
Description    :
Firebird is a relational database offering many ANSI SQL-99 features
that runs on Linux, Windows, and a variety of Unix platforms.  Firebird
offers excellent concurrency, high performance, and powerful language
support for stored procedures and triggers.  It has been used in
production systems, under a variety of names since 1981.

Firebird is completely free of any registration, licensing or deployment
fees.  It may be deployed freely for use with any third-party software,
whether commercial or not.

WWW: https://sourceforge.net/projects/firebird/
WWW: http://www.firebirdsql.org/
alfiqmiq commented 3 years ago

any progress / solution ?

AlexPeshkoff commented 3 years ago

Using -I switch for lib directory makes no sense (it works with include files, not libraries), if you wish - try with -L CPPFLAGS=-L/usr/local/lib/ ./configure but I doubt it can help, by default libraries in /usr/local/lib are present in lib search path.

MartinKoeditz commented 2 years ago

Well, I never used BSD. If someone is able to compile the driver on BSD, please let me know. Then we can add a section at the wiki.

alfiqmiq commented 2 years ago

Well, I never used BSD. If someone is able to compile the driver on BSD, please let me know. Then we can add a section at the wiki.

If U can help me with compilation then we can try do it together

alfiqmiq commented 2 years ago
git clone https://github.com/FirebirdSQL/php-firebird.git

cd php-firebird/

phpize

CPPFLAGS=-L/usr/local/lib ./configure

make

/bin/sh /root/php-firebird/libtool --mode=compile cc -I. -I/root/php-firebird -I/root/php-firebird/include -I/root/php-firebird/main -I/root/php-firebird -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/firebird/include  -L/usr/local/lib -DHAVE_CONFIG_H  -g -O2   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /root/php-firebird/interbase.c -o interbase.lo
mkdir .libs
 cc -I. -I/root/php-firebird -I/root/php-firebird/include -I/root/php-firebird/main -I/root/php-firebird -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/firebird/include -L/usr/local/lib -DHAVE_CONFIG_H -g -O2 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /root/php-firebird/interbase.c  -fPIC -DPIC -o .libs/interbase.o
cc: warning: argument unused during compilation: '-L/usr/local/lib' [-Wunused-command-line-argument]
In file included from /root/php-firebird/interbase.c:35:
./php_ibase_includes.h:24:10: fatal error: 'ibase.h' file not found
#include <ibase.h>
         ^~~~~~~~~
1 error generated.
*** Error code 1

Stop.
alfiqmiq commented 2 years ago
find /usr/ -iname "libfbclient*" -o -iname "libgds*" -o -iname "libib_util*" -o -iname "ibase.h*"
/usr/local/lib/libfbclient.so.2.5.8
/usr/local/lib/libfbclient.so.2.5
/usr/local/lib/libib_util.so
/usr/local/lib/libfbclient.so.2
/usr/local/lib/libfbclient.so
/usr/local/lib/libgds.so.2.5
/usr/local/lib/libgds.so.2
/usr/local/lib/libgds.so
/usr/local/include/ibase.h
alfiqmiq commented 2 years ago

Next i try:

./configure CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib

Result:

[root@php80.bsd|~/php-firebird]# make
/bin/sh /root/php-firebird/libtool --mode=compile cc -I. -I/root/php-firebird -I/root/php-firebird/include -I/root/php-firebird/main -I/root/php-firebird -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/firebird/include  -DHAVE_CONFIG_H  -I/usr/local/include   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /root/php-firebird/ibase_query.c -o ibase_query.lo
 cc -I. -I/root/php-firebird -I/root/php-firebird/include -I/root/php-firebird/main -I/root/php-firebird -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/opt/firebird/include -DHAVE_CONFIG_H -I/usr/local/include -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /root/php-firebird/ibase_query.c  -fPIC -DPIC -o .libs/ibase_query.o
/root/php-firebird/ibase_query.c:159:24: warning: equality comparison result unused [-Wunused-comparison]
                        ib_result->stmt_res == NULL;
                        ~~~~~~~~~~~~~~~~~~~~^~~~~~~
/root/php-firebird/ibase_query.c:159:24: note: use '=' to turn this equality comparison into an assignment
                        ib_result->stmt_res == NULL;
                                            ^~
                                            =
/root/php-firebird/ibase_query.c:178:22: warning: equality comparison result unused [-Wunused-comparison]
                ib_query->stmt_res == NULL;
                ~~~~~~~~~~~~~~~~~~~^~~~~~~
/root/php-firebird/ibase_query.c:178:22: note: use '=' to turn this equality comparison into an assignment
                ib_query->stmt_res == NULL;
                                   ^~
                                   =
/root/php-firebird/ibase_query.c:253:22: error: use of undeclared identifier 'blr_bool'
                case blr_bool:
                     ^
/root/php-firebird/ibase_query.c:254:34: error: use of undeclared identifier 'SQL_BOOLEAN'
                    a->el_type = SQL_BOOLEAN;
                                 ^
/root/php-firebird/ibase_query.c:598:22: error: use of undeclared identifier 'SQL_BOOLEAN'
                case SQL_BOOLEAN:
                     ^
/root/php-firebird/ibase_query.c:790:18: error: use of undeclared identifier 'SQL_BOOLEAN'
            case SQL_BOOLEAN:
                 ^
/root/php-firebird/ibase_query.c:795:32: error: use of undeclared identifier 'SQL_BOOLEAN'
                var->sqltype = SQL_BOOLEAN;
                               ^
/root/php-firebird/ibase_query.c:883:18: error: use of undeclared identifier 'SQL_BOOLEAN'
            case SQL_BOOLEAN:
                 ^
/root/php-firebird/ibase_query.c:1386:14: error: use of undeclared identifier 'SQL_BOOLEAN'
        case SQL_BOOLEAN:
             ^
/root/php-firebird/ibase_query.c:1985:18: error: use of undeclared identifier 'SQL_BOOLEAN'
            case SQL_BOOLEAN:
                 ^
/root/php-firebird/ibase_query.c:2012:18: error: use of undeclared identifier 'SQL_BOOLEAN'
            case SQL_BOOLEAN:
                 ^
2 warnings and 9 errors generated.
*** Error code 1

Stop.
make: stopped in /root/php-firebird
diegosardina commented 2 years ago

I was able to build it (both with gcc and clang) without problems with:

CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib

(FreeBSD keeps 3rd party software in /usr/local/ prefix)

The problem about SQL_BOOLEAN should be fixed in the last commit.

This can be closed I think.

@alfiqmiq If you still have problems, maybe it's your box. I built for you the module for PHP 8.0 and Firebird 2.5. My system is 13-STABLE but it is binary compatible with all 13.x-RELEASEs.

interbase.so.zip

alfiqmiq commented 2 years ago

@diegosardina thanks for reply,

I can confirm that on my homelab (13.0-RELEASE FreeBSD amd64), extension was compiled succesfully with php-firebird commit eb2f5df, and php 8.0, i will do some tests and will close this if everything will be ok :-)

Also i will try to compile module and check it with php 8.1.

diegosardina commented 2 years ago

It compiles well with PHP 8.1 and Firebird 4.0, this is what I use :-)