nijel / enca

Extremely Naive Charset Analyser
https://cihar.com/software/enca/
GNU General Public License v2.0
285 stars 51 forks source link

Automagic iconv dependency #21

Open Coacher opened 8 years ago

Coacher commented 8 years ago

Hello.

Regardless of --without-libiconv-prefix configure flag iconv is still detected and enabled:

$ ./configure --without-libiconv-prefix
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gawk... (cached) gawk
checking for gcc... gcc
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 gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/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 minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for library containing strerror... none required
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-linux-gnu/bin/ld
checking if the linker (/usr/x86_64-pc-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-pc-linux-gnu/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... 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 ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether ln -s works... yes
checking for mktemp... /usr/bin/mktemp
checking for cstocs... no
checking for recode... no
checking for umap... no
checking for piconv... /usr/bin/piconv
checking for map... no
checking for gcov... /usr/bin/gcov
checking for gtkdoc-mkdb... true
checking gtk-doc version (1.25) >= 1.0... yes
checking for sqrt in -lm... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether stat file-mode macros are broken... no
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for memory.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/wait.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking wordexp.h usability... yes
checking wordexp.h presence... yes
checking for wordexp.h... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for mode_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for uid_t in sys/types.h... yes
checking for ssize_t... yes
checking whether LC_MESSAGES is declared... yes
checking for program_invocation_short_name... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for ftruncate... yes
checking for gettimeofday... yes
checking for isatty... yes
checking for nl_langinfo... yes
checking for random... yes
checking for realpath... yes
checking for strstr... yes
checking for stpcpy... yes
checking for setlocale... yes
checking for ttyname... yes
checking for wordexp... yes
checking for getopt_long... yes
checking for ld used by gcc... /usr/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64
checking if the linker (/usr/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking for iconv... yes
checking for working iconv... yes
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking whether iconv implementation is usable... yes
checking whether iconv is transitive... yes
checking for recode_new_outer in librecode... no
checking for locale.alias... /usr/share/locale/locale.alias
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating enca.spec
config.status: creating enca.pc
config.status: creating devel-docs/Makefile
config.status: creating data/Makefile
config.status: creating lib/Makefile
config.status: creating script/Makefile
config.status: creating script/b-cstocs
config.status: creating script/b-map
config.status: creating script/b-piconv
config.status: creating script/b-umap
config.status: creating src/Makefile
config.status: creating src/HELP
config.status: creating test/Makefile
config.status: creating tools/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
=================================================================
  Features:
    libenca will be built as:            static, shared
    GNU recode library interface:        no
    UNIX98 iconv interface:              yes
    External converters:                 yes (piconv)
    Language preferences from locale:    yes
    Language aliases decryption:         /usr/share/locale/locale.alias
    Target charset from locale:          yes
    ENCAOPT environment variable:        yes
=================================================================

Configure complete, now type `make' to compile enca.
If it compiles, don't forget to run `make check'.

This isn't right: https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies

Please allow to disable iconv support at configure time.

nijel commented 8 years ago

Quoting documentation

--without-libiconv-prefix don't search for libiconv in includedir and libdir

So it works as expected, it just removes search in some directories. As you probably have iconv embedded in libc, it makes no difference.

What you probably want is to disable iconv feature?

Coacher commented 8 years ago

@nijel, I expected --without-libiconv-prefix disable iconv interface at all.

So it works as expected, it just removes search in some directories. As you probably have iconv embedded in libc, it makes no difference.

--with-librecode flag has a similar description and --without-librecode disables recode interface. So I expected the similar behaviour from --without-libiconv-prefix.

What you probably want is to disable iconv feature?

Yes. IMHO there should be a proper way to disable iconv interface. Whether it would be a separate configure flag or --without-libiconv-prefix isn't important. Currently one has to do

export am_cv_func_iconv=no

but this is very far from perfect or convenient.