Thread: Building the psqlODBC enhanced branch (Linux)

Building the psqlODBC enhanced branch (Linux)

From
"Dave Page"
Date:
Hi Hiroshi,

Continuing my earlier testing, I've moved onto Linux. My test machine
has UnixODBC 2.2.11 rather than iODBC installed - unfortunately I get a
compile failure:

if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
-I/usr/local/pgsql/include  -g -O2 -MT convert.lo -MD -MP -MF
".deps/convert.Tpo" -c -o convert.lo convert.c; \
then mv -f ".deps/convert.Tpo" ".deps/convert.Plo"; else rm -f
".deps/convert.Tpo"; exit 1; fi
gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/pgsql/include -g -O2 -MT
convert.lo -MD -MP -MF .deps/convert.Tpo -c convert.c  -fPIC -DPIC -o
convert.lo
convert.c: In function `copy_and_convert_field':
convert.c:1239: error: incompatible types in assignment
convert.c:1241: error: incompatible types in assignment
convert.c:1247: error: incompatible types in assignment
convert.c:1249: error: incompatible types in assignment
make[1]: *** [convert.lo] Error 1
make[1]: Leaving directory `/home/dpage/psqlodbc'
make: *** [all] Error 2

That's with gcc 3.4.5.

:-(

That is actually on developer.pgadmin.org, so you can login and take a
look yourself if you like.

Regards, Dave.

Re: Building the psqlODBC enhanced branch (Linux)

From
Hiroshi Inoue
Date:
Dave Page wrote:

>Hi Hiroshi,
>
>Continuing my earlier testing, I've moved onto Linux. My test machine
>has UnixODBC 2.2.11 rather than iODBC installed - unfortunately I get a
>compile failure:
>
>if /bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I.
>-I/usr/local/pgsql/include  -g -O2 -MT convert.lo -MD -MP -MF
>".deps/convert.Tpo" -c -o convert.lo convert.c; \
>then mv -f ".deps/convert.Tpo" ".deps/convert.Plo"; else rm -f
>".deps/convert.Tpo"; exit 1; fi
>gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/pgsql/include -g -O2 -MT
>convert.lo -MD -MP -MF .deps/convert.Tpo -c convert.c  -fPIC -DPIC -o
>convert.lo
>convert.c: In function `copy_and_convert_field':
>convert.c:1239: error: incompatible types in assignment
>convert.c:1241: error: incompatible types in assignment
>convert.c:1247: error: incompatible types in assignment
>convert.c:1249: error: incompatible types in assignment
>make[1]: *** [convert.lo] Error 1
>make[1]: Leaving directory `/home/dpage/psqlodbc'
>make: *** [all] Error 2
>
>

How is it defined in config.h, SIZEOF_LONG or HAVE_STRTOLL ?

regards,
Hiroshi Inoue


Re: Building the psqlODBC enhanced branch (Linux)

From
"Dave Page"
Date:

> -----Original Message-----
> From: Hiroshi Inoue [mailto:inoue@tpf.co.jp]
> Sent: 20 February 2006 17:10
> To: Dave Page
> Cc: Hiroshi Saito; pgsql-odbc@postgresql.org
> Subject: Re: Building the psqlODBC enhanced branch (Linux)
>
>
> How is it defined in config.h, SIZEOF_LONG or HAVE_STRTOLL ?

dpage@developer:~/psqlodbc$ grep HAVE_STRTOLL config.h
#define HAVE_STRTOLL 1
dpage@developer:~/psqlodbc$ grep SIZEOF_LONG config.h
dpage@developer:~/psqlodbc$

Regards, Dave.

Re: Building the psqlODBC enhanced branch (Linux)

From
"Hiroshi Saito"
Date:
> How is it defined in config.h, SIZEOF_LONG or HAVE_STRTOLL ?

Ummm, I am just going to look now.
it will be slightly strange....

configure --enable-unicode --with-unixodbc --with-odbcver=0x0300 --enable-pthreads

checking for a BSD-compatible install... /usr/bin/ginstall -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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 ANSI C... none needed
checking dependency style of gcc... gcc3
checking for SQLGetPrivateProfileString in -lodbcinst... yes
checking for ODBC version number... 0x0300
checking for iswascii... no
checking for strtoul... yes
checking for strtoll... yes
checking for gethostbyname in -lc_r... no
checking for pthread_create in -lpthreads... no
checking for pthread_create in -lpthread... yes
checking for gethostbyname_r in -lnsl... yes
checking for localtime_r... yes
checking for strtok_r... yes
checking for pthread_mutexattr_settype... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for ld used by GCC... /usr/i486-slackware-linux/bin/ld
checking if the linker (/usr/i486-slackware-linux/bin/ld) is GNU ld... yes
checking for /usr/i486-slackware-linux/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking for a sed that does not truncate output... /usr/bin/sed
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking command to parse /usr/bin/nm -B output... ok
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for ranlib... ranlib
checking for strip... strip
checking for objdir... .libs
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.lo... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking whether the linker (/usr/i486-slackware-linux/bin/ld) supports shared libraries... yes
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether -lc should be explicitly linked in... no
creating libtool
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking for uint8... no
checking for int timezone... yes
checking for long... yes
checking size of long... 4
checking for long long... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for pg_config... /usr/local/pgsql/bin/pg_config
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands




Re: Building the psqlODBC enhanced branch (Linux)

From
"Hiroshi Saito"
Date:
> Ummm, I am just going to look now.
> it will be slightly strange....
>
> configure --enable-unicode --with-unixodbc --with-odbcver=0x0300 --enable-pthreads

I added config.h
#define SIZEOF_LONG 4
#define HAVE_LONG_LONG 1

problem will solve this.

Ummm,
hiroshi@developer:~/psqlodbc07-03-0260$ which odbc-config
which: no odbc-config in
(/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:.:/usr/local/pgsql/bin:.:)

I will want this to answer.
odbc_config --cflags
-DHAVE_UNISTD_H -DHAVE_PWD_H -DHAVE_SYS_TYPES_H -DHAVE_LONG_LONG -DSIZEOF_LONG=4

Reconsideration ...

Regards,
Hiroshi Saito



Re: Building the psqlODBC enhanced branch (Linux)

From
"Hiroshi Saito"
Date:
> -DHAVE_UNISTD_H -DHAVE_PWD_H -DHAVE_SYS_TYPES_H -DHAVE_LONG_LONG -DSIZEOF_LONG=4
>
> Reconsideration ...

HAVE_LONG_LONG and SIZEOF_LONG adds to config.h.in
I checked on developer.pgadmin.org. It was a very good condition.:-)

Please check it Dave.

Regards,
Hiroshi Saito


Re: Building the psqlODBC enhanced branch (Linux)

From
Dave Page
Date:


On 20/2/06 17:48, "Hiroshi Saito" <saito@inetrt.skcapi.co.jp> wrote:

>> -DHAVE_UNISTD_H -DHAVE_PWD_H -DHAVE_SYS_TYPES_H -DHAVE_LONG_LONG
>> -DSIZEOF_LONG=4
>>
>> Reconsideration ...
>
> HAVE_LONG_LONG and SIZEOF_LONG adds to config.h.in
> I checked on developer.pgadmin.org. It was a very good condition.:-)
>
> Please check it Dave.

Yup - looks good, thanks.

But, the non-pthreads build fails :-(

gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/pgsql/include -g -O2 -MT
psqlodbc.lo -MD -MP -MF .deps/psqlodbc.Tpo -c psqlodbc.c  -fPIC -DPIC -o
psqlodbc.lo
psqlodbc.c: In function `initialize_global_cs':
psqlodbc.c:73: error: `INIT_COMMON_CS' undeclared (first use in this
function)
psqlodbc.c:73: error: (Each undeclared identifier is reported only once
psqlodbc.c:73: error: for each function it appears in.)
psqlodbc.c: In function `finalize_global_cs':
psqlodbc.c:80: error: `DELETE_COMMON_CS' undeclared (first use in this
function)
make[1]: *** [psqlodbc.lo] Error 1
make[1]: Leaving directory `/home/dpage/psqlodbc'
make: *** [all] Error 2


Regards, Dave.


Re: Building the psqlODBC enhanced branch (Linux)

From
Hiroshi Inoue
Date:
Dave Page wrote:

>
>On 20/2/06 17:48, "Hiroshi Saito" <saito@inetrt.skcapi.co.jp> wrote:
>
>
>
>>>-DHAVE_UNISTD_H -DHAVE_PWD_H -DHAVE_SYS_TYPES_H -DHAVE_LONG_LONG
>>>-DSIZEOF_LONG=4
>>>
>>>Reconsideration ...
>>>
>>>
>>HAVE_LONG_LONG and SIZEOF_LONG adds to config.h.in
>>I checked on developer.pgadmin.org. It was a very good condition.:-)
>>
>>Please check it Dave.
>>
>>
>
>Yup - looks good, thanks.
>
>But, the non-pthreads build fails :-(
>
>gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/pgsql/include -g -O2 -MT
>psqlodbc.lo -MD -MP -MF .deps/psqlodbc.Tpo -c psqlodbc.c  -fPIC -DPIC -o
>psqlodbc.lo
>psqlodbc.c: In function `initialize_global_cs':
>psqlodbc.c:73: error: `INIT_COMMON_CS' undeclared (first use in this
>function)
>psqlodbc.c:73: error: (Each undeclared identifier is reported only once
>psqlodbc.c:73: error: for each function it appears in.)
>psqlodbc.c: In function `finalize_global_cs':
>psqlodbc.c:80: error: `DELETE_COMMON_CS' undeclared (first use in this
>function)
>make[1]: *** [psqlodbc.lo] Error 1
>make[1]: Leaving directory `/home/dpage/psqlodbc'
>make: *** [all] Error 2
>
>

Fixed at least the above problem.

regards,
Hiroshi Inoue

Re: Building the psqlODBC enhanced branch (Linux)

From
Dave Page
Date:


On 20/2/06 21:39, "Hiroshi Inoue" <inoue@tpf.co.jp> wrote:

>> But, the non-pthreads build fails :-(
>>
>> gcc -DHAVE_CONFIG_H -I. -I. -I. -I/usr/local/pgsql/include -g -O2 -MT
>> psqlodbc.lo -MD -MP -MF .deps/psqlodbc.Tpo -c psqlodbc.c  -fPIC -DPIC -o
>> psqlodbc.lo
>> psqlodbc.c: In function `initialize_global_cs':
>> psqlodbc.c:73: error: `INIT_COMMON_CS' undeclared (first use in this
>> function)
>> psqlodbc.c:73: error: (Each undeclared identifier is reported only once
>> psqlodbc.c:73: error: for each function it appears in.)
>> psqlodbc.c: In function `finalize_global_cs':
>> psqlodbc.c:80: error: `DELETE_COMMON_CS' undeclared (first use in this
>> function)
>> make[1]: *** [psqlodbc.lo] Error 1
>> make[1]: Leaving directory `/home/dpage/psqlodbc'
>> make: *** [all] Error 2
>>
>>
>
> Fixed at least the above problem.

Yep, it's good here, thanks.

Regards, Dave.