lurcher / unixODBC

The unixODBC Project goals are to develop and promote unixODBC to be the definitive standard for ODBC on non MS Windows platforms.
GNU Lesser General Public License v2.1
100 stars 52 forks source link

Need advice to build master branch on Alpine Edge w/GCC 12.1 #118

Closed mcordova1967 closed 2 years ago

mcordova1967 commented 2 years ago

I am following the regular procedure: ./configure make make install

First problem with step 1:

config.status: error: Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the --disable-dependency-tracking option to at least be able to build the package (albeit without support for automatic dependency tracking). See `config.log' for more details

I can pass this one following the above advice using --disable-dependency-tracking

But make then fails:


Making all in exe
make[2]: Entering directory '/opt/unixODBC-2.3.11-alpine/exe'
/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -pthread   -o isql isql.o ../DriverManager/libodbc.la ../extras/libodbcextraslc.la  -lpthread
libtool: link: gcc -g -O2 -pthread -o .libs/isql isql.o  ../DriverManager/.libs/libodbc.so ../extras/.libs/libodbcextraslc.a -lpthread -pthread -Wl,-rpath -Wl,/opt/alpine/lib
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: isql.o: in function `main':
/opt/unixODBC-2.3.11/exe/isql.c:88: undefined reference to `read_history'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/unixODBC-2.3.11/exe/isql.c:271: undefined reference to `readline'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/unixODBC-2.3.11/exe/isql.c:533: undefined reference to `write_history'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: /opt/unixODBC-2.3.11/exe/isql.c:291: undefined reference to `add_history'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: ../DriverManager/.libs/libodbc.so: undefined reference to `argz_insert'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: ../DriverManager/.libs/libodbc.so: undefined reference to `lt_strlcpy'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: ../DriverManager/.libs/libodbc.so: undefined reference to `argz_stringify'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: ../DriverManager/.libs/libodbc.so: undefined reference to `argz_create_sep'
/usr/lib/gcc/x86_64-alpine-linux-musl/12.1.1/../../../../x86_64-alpine-linux-musl/bin/ld: ../DriverManager/.libs/libodbc.so: undefined reference to `argz_append'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:501: isql] Error 1

I know I must be missing something that needs to be installed before this building process because the unixodbc package exists for Alpine Edge, so it can be done. I want to build this master branch because it does contain an important fix for a memory leak when using connection pooling.

Any help will be much appreciated.

mcordova1967 commented 2 years ago

Never mind, I found the parameters for ./configure that make it work:


./configure --prefix=/usr --sysconfdir=/etc --disable-nls --enable-static --enable-gui=no

I suspect these ones are the key elements that made it work:


--disable-nls --enable-static --enable-gui=no

Alpine official build script of unixodbc: https://git.alpinelinux.org/aports/tree/main/unixodbc/APKBUILD

TallTed commented 2 years ago

@mcordova1967 -- For future reports, it is often helpful to put "code fences" (lines that are just three backticks) before and after big input/output blocks and/or commands, because otherwise characters that are part of those blocks get treated as Markdown instead of being shown as part of the text. Even now, it may be worth editing your comments on this issue to add such lines, for future folks who encounter similar issues.

mcordova1967 commented 2 years ago

Good advice, I will edit it, thank you

TallTed commented 2 years ago

Code fence lines are three backticks ("```") like --

``` code block ```

-- which I've escaped here (with a backslash before each backtick), so you can see them. The above would result in --

code block

You can also wrap smaller bits in single backticks, like `this`, which then get rendered like this.

mcordova1967 commented 2 years ago

Done, thank you.