[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-10 Thread ilovezfs
URL:
  

 Summary: Build fails unless -liconv set explicitly in LDFLAGS
 Project: GNU Wget
Submitted by: ilovezfs
Submitted on: Fri 10 Jun 2016 10:46:26 AM GMT
Category: Build/Install
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
 Originator Name: ilovezfs
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Release: None
Operating System: Mac OS
 Reproducibility: None
   Fixed Release: None
 Planned Release: None
  Regression: Yes
   Work Required: None
  Patch Included: None

___

Details:

This is a regression introduced by 59b920874daa565a1323ffa1e756e80493190686

The error is
```
Making all in src
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-am
clang  -DNDEBUG-o wget connect.o convert.o cookies.o ftp.o css_.o
css-url.o ftp-basic.o ftp-ls.o hash.o host.o hsts.o html-parse.o html-url.o
http.o init.o log.o main.o netrc.o progress.o ptimer.o recur.o res.o retr.o
spider.o url.o warc.o utils.o exits.o build_info.o   version.o ftp-opie.o
openssl.o http-ntlm.o ../lib/libgnu.a -L/usr/local/opt/openssl/lib -lssl
-lcrypto -ldl -lz  
Undefined symbols for architecture x86_64:
  "_iconv", referenced from:
  _url_file_name in url.o
  "_iconv_close", referenced from:
  _url_file_name in url.o
  "_iconv_open", referenced from:
  _url_file_name in url.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
```




___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-10 Thread Tim Ruehsen
Follow-up Comment #1, bug #48193 (project wget):

Could you add a line

iconv

to ./bootstrap.conf and execute

./bootstrap && ./configure && make again

And report back here if that solves the problem for you !?


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-10 Thread Tim Ruehsen
Follow-up Comment #2, bug #48193 (project wget):

Sorry, mistake by me - iconv is already included.

Please #include  unconditionally in src/url.c (remove the lines with
#ifdef HAVE_ICONV and the corresponding #endif) and try again 'make'.


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-10 Thread ilovezfs
Follow-up Comment #3, bug #48193 (project wget):

Nope, same issue. I still have to manually add -liconv to LDFLAGS in the
environment, otherwise make fails.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-10 Thread Tim Ruehsen
Follow-up Comment #4, bug #48193 (project wget):

Ah, looks like something is missing in src/Makefile.am.

Please send the output of
  grep -i iconv src/config.h src/Makefile



___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-10 Thread ilovezfs
Follow-up Comment #5, bug #48193 (project wget):

bash-3.2$ grep -i iconv src/config.h src/Makefile
src/config.h:/* Define if you have the iconv() function and it works. */
src/config.h:#define HAVE_ICONV 1
src/config.h:/* Define to 1 if you have the  header file. */
src/config.h:#define HAVE_ICONV_H 1
src/config.h:/* Define as const if the declaration of iconv() needs const. */
src/config.h:#define ICONV_CONST 
src/Makefile:   $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/iconv_h.m4 \
src/Makefile:GNULIB_ICONV = 1
src/Makefile:ICONV_CONST = 
src/Makefile:ICONV_H = 
src/Makefile:LIBICONV = 
src/Makefile:LTLIBICONV = -liconv
src/Makefile:NEXT_AS_FIRST_DIRECTIVE_ICONV_H = 
src/Makefile:NEXT_ICONV_H = 
src/Makefile:REPLACE_ICONV = 0
src/Makefile:REPLACE_ICONV_OPEN = 0
src/Makefile:REPLACE_ICONV_UTF = 0


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-11 Thread Tim Ruehsen
Follow-up Comment #6, bug #48193 (project wget):

As you can see, $(LTLIBICONV) should be added to the linking stage.
Maybe the whole src/Makefile.am should be rewritten... it looks quirked.

./boostrap says:

You may need to use the following Makefile variables when linking. Use them in
_LDADD when linking a program, or
in _a_LDFLAGS or _la_LDFLAGS when linking a library.
  $(GETADDRINFO_LIB)
  $(HOSTENT_LIB)
  $(INET_NTOP_LIB)
  $(LIBSOCKET)
  $(LIB_CLOCK_GETTIME)
  $(LIB_CRYPTO)
  $(LIB_SELECT)
  $(LTLIBICONV) when linking with libtool, $(LIBICONV) otherwise
  $(LTLIBINTL) when linking with libtool, $(LIBINTL) otherwise
  $(LTLIBTHREAD) when linking with libtool, $(LIBTHREAD) otherwise
  $(SERVENT_LIB)


Basically we should add all of them to wget_LDADD, to have gnulib working on
all supported platforms. I am not a real expert here, though.

For further testing, please change this in src/Makefile.am:
-LDADD = $(LIBOBJS) ../lib/libgnu.a
+LDADD = $(LIBOBJS) $(LTLIBICONV) ../lib/libgnu.a

Then execute 
  autoreconf && ./configure && make


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-11 Thread ilovezfs
Follow-up Comment #7, bug #48193 (project wget):

Yes, that worked.

For reference, the difference in the generated Makefile is
```
bash-3.2$ diff src/Makefile.orig src/Makefile
305c305,306
< wget_DEPENDENCIES = $(LIBOBJS) ../lib/libgnu.a
---
> am__DEPENDENCIES_1 =
> wget_DEPENDENCIES = $(LIBOBJS) $(am__DEPENDENCIES_1) ../lib/libgnu.a
721,723d721
< GPGME_CFLAGS = 
< GPGME_CONFIG = no
< GPGME_LIBS = 
1390c1388
< LDADD = $(LIBOBJS) ../lib/libgnu.a
---
> LDADD = $(LIBOBJS) $(LTLIBICONV) ../lib/libgnu.a

```

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-11 Thread Tim Ruehsen
Update of bug #48193 (project wget):

  Patch Included:None => Yes

___

Follow-up Comment #8:

Please everybody test the attached patch on different platforms and report
back. Thanks.

(file #37453)
___

Additional Item Attachment:

File name: 0001-Add-libraries-to-LDADD-for-wget.patch Size:1 KB


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-19 Thread Bruno Haible
Follow-up Comment #9, bug #48193 (project wget):

Rather than
LDADD = $(LIBOBJS) $(LTLIBICONV) ../lib/libgnu.a 
it would be better to write
LDADD = $(LIBOBJS) ../lib/libgnu.a $(LTLIBICONV)

The reason is that $(LTLIBICONV) refers to - more or less - a system library,
and it can be a shared library. If the object files in libgnu.a reference the
'iconv' symbol but $(LIBOBJS) don't, you may still get a link error. Moving
all the shared/system libraries to the end of the link command line fixes
this.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2016-06-21 Thread Tim Ruehsen
Update of bug #48193 (project wget):

  Status:None => Fixed  
 Planned Release:None => 1.18.1 

___

Follow-up Comment #10:

Thanks, Bruno.

I added all the libraries (that gnulib-tool mentions) to the end of the link
command.


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2017-02-11 Thread Charles
Follow-up Comment #11, bug #48193 (project wget):

This is not fixed as of 1.19.1.  I just tried building it on macOS 10.12.3 and
got the exact error that initiated this thread.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2017-02-12 Thread Charles
Follow-up Comment #12, bug #48193 (project wget):

More info: it seems to be something about this particular set of config flags:
--with-ssl=openssl --with-libssl-prefix=/usr/local/ssl --disable-pcre
--disable-iri

If I simply get rid of the --disable-iri flag, 1.19.1 will build find on macOS
10.12.3.  If I readd that flag, I get the exact error message that started
this thread.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2017-02-12 Thread Tim Ruehsen
Follow-up Comment #13, bug #48193 (project wget):

Please add your config.log and your src/config.h (after the ./configure that
results in failures)

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2017-02-12 Thread Charles
Additional Item Attachment, bug #48193 (project wget):

File name: config.h   Size:88 KB
File name: config.log Size:1765 KB


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2017-02-12 Thread Charles
Follow-up Comment #14, bug #48193 (project wget):

Ok, I uploaded those two things.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2017-02-13 Thread Tim Ruehsen
Follow-up Comment #15, bug #48193 (project wget):

Thanks, your config.log shows what is going wrong...

In configure.ac there is a line
LIBICONV=
which was ok before a certain commit - nowadays we always need libiconv, so
this line must be removed.

This line will only be executed with --disable-iri, as you found out.

Could you remove or comment that line, and execute autoreconf && ./configure
 && make. Just to make sure the problem
is solved.


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2017-02-15 Thread Charles
Follow-up Comment #16, bug #48193 (project wget):

I commented out that line.

Autoreconf emitted this warning: configure.ac:499: warning: macro
'AM_PATH_GPGME' not found in library

Then running ./configure ended with: ./configure: line 44129: syntax error
near unexpected token `fi'
./configure: line 44129: `fi'

Apparently the entire else-block needed removal.  I did that, and then started
over.  Autoreconf still emits the warning, but then ./configure succeeded and
so did the subsequent `make`.

___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/




[Bug-wget] [bug #48193] Build fails unless -liconv set explicitly in LDFLAGS

2017-02-15 Thread Tim Ruehsen
Update of bug #48193 (project wget):

 Assigned to:None => rockdaboot 
 Open/Closed:Open => Closed 
   Fixed Release:None => trunk  
 Planned Release:  1.18.1 => 2.0

___

Follow-up Comment #17:

My bad, just removing the single line indeed results in a broken configure
script (it is just a shell script with an empty else block).

The warning about 'AM_PATH_GPGME' is expected, when you don't have libgpgme
installed. But this is a different, unrelated issue.


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/