Opened 13 years ago
Closed 13 years ago
#1966 closed defect (invalid)
Flag --enable-fribidi does not add "-lfribidi" to compiler flags
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Component: | build system |
Version: | HEAD | Severity: | minor |
Keywords: | Cc: | cehoyos | |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
I tried configuring and compiling with the "--enable-fribidi" flag, which resulted in a build error due to undefined fribidi symbols:
Undefined symbols for architecture i386:
"_fribidi_charset_to_unicode", referenced from:
_do_fribid_log2vis in subreader.o
_sub_fribidi in subreader.o
"_fribidi_log2vis", referenced from:
_do_fribid_log2vis in subreader.o
_sub_fribidi in subreader.o
"_fribidi_remove_bidi_marks", referenced from:
_do_fribid_log2vis in subreader.o
_sub_fribidi in subreader.o
"_fribidi_set_mirroring", referenced from:
_sub_fribidi in subreader.o
"_fribidi_set_reorder_nsm", referenced from:
_sub_fribidi in subreader.o
"_fribidi_parse_charset", referenced from:
_sub_fribidi in subreader.o
"_fribidi_unicode_to_charset", referenced from:
_sub_fribidi in subreader.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
make: * [mencoder] Error 1
The huge line above (won't paste it here) explains why: the flag "-lfribidi" is missing in the compile command.
The cause appears to be the "configure" script (line 6066) where the variable "ld_tmp" is still empty from its initialization on line 6041.
I changed the following lines:
if test "$_fribidi" = yes ; then
def_fribidi='#define CONFIG_FRIBIDI 1'
extra_cflags="$extra_cflags $inc_tmp"
extra_ldflags="$extra_ldflags $ld_tmp"
else
to these and compilation works:
if test "$_fribidi" = yes ; then
def_fribidi='#define CONFIG_FRIBIDI 1'
ld_tmp='-lfribidi'
extra_cflags="$extra_cflags $inc_tmp"
extra_ldflags="$extra_ldflags $ld_tmp"
else
Change History (6)
comment:1 by , 13 years ago
Cc: | added |
---|
comment:2 by , 13 years ago
Fribidi is not autodetected without --enable-fribidi.
Here is the relevant output:
Checking for fribidi with charsets ... Package fribidi was not found in the pkg-config search path.
Perhaps you should add the directory containing `fribidi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fribidi' found
Package fribidi was not found in the pkg-config search path.
Perhaps you should add the directory containing `fribidi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fribidi' found
I tried supplying the --extra-cflags and --extra-ldflags, but that results in a configure error:
./configure --cc=$GCC2 --disable-x11 --disable-gl --disable-qtx --disable-theora --disable-libvorbis --with-freetype-config=$TARGET/bin/freetype-config --prefix=$TARGET --enable-fribidi --extra-cflags=-lfribidi --extra-ldflags=-lfribidi
Checking for /usr/bin/gcc-4.2 version ... 4.2.1
Checking for working compiler ...
Error: Compiler is not functioning correctly. Check your installation and custom CFLAGS -O4 -fomit-frame-pointer -pipe -mmacosx-version-min=10.6 -isystem /Developer/SDKs/MacOSX10.6.sdk -arch i386 -I/tmp/i386/target/include .
To work around that error I can of course add "-lfribidi" to the CFLAGS and LDFLAGS.
It merely occurred to me as strange that the configure code seems to set ld_tmp and inc_tmp in the bit above, but it skips such initialization when --enable-fribidi is defined.
If this is normal behavior and not a bug, I'll just use the workaround and close this issue.
comment:3 by , 13 years ago
Please post the part of config.log (after running without --enable-fribidi) beginning with "Checking for fribidi" and ending with "Result is..."
(The expected behaviour is of course that auto-detection works.)
comment:4 by , 13 years ago
Sure, here you go:
============ Checking for fribidi with charsets ============
#include <stdlib.h>
/* workaround for fribidi 0.10.4 and below */
#define FRIBIDI_CHARSET_UTF8 FRIBIDI_CHAR_SET_UTF8
#include <fribidi/fribidi.h>
int main(void) {
if (fribidi_parse_charset("UTF-8") != FRIBIDI_CHAR_SET_UTF8)
exit(1);
return 0;
}
/usr/bin/gcc-4.2 -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99 -O4 -fomit-frame-pointer -pipe -mmacosx-version-min=10.6 -isystem /Developer/SDKs/MacOSX10.6.sdk -arch i386 -I/tmp/i386/target/include -fno-tree-vectorize /var/folders/22/mk15r87109qf3h56sxm74ptr0000gn/Tmplayer-configure-3698-559/tmp.c -Ilibdvdread4 -falign-loops=16 -shared-libgcc -mdynamic-no-pic -I. -Iffmpeg -I/usr/X11/include -I/tmp/i386/target/include/freetype2 -I/tmp/i386/target/include -lm -mmacosx-version-min=10.6 -isysroot /Developer/SDKs/MacOSX10.6.sdk -Wl,-syslibroot,/Developer/SDKs/MacOSX10.6.sdk -arch i386 -L/tmp/i386/target/lib -Wl,-search_paths_first -liconv -lncurses -framework QuickTime -lpng -lz -ljpeg -lgif -framework IOKit -framework Carbon -L/tmp/i386/target/lib -lfreetype -lz -framework IOKit -framework Cocoa -framework Carbon -framework Carbon -framework Cocoa -framework QuartzCore -framework OpenGL -framework OpenAL -framework CoreAudio -framework AudioUnit -framework AudioToolbox -o /var/folders/22/mk15r87109qf3h56sxm74ptr0000gn/Tmplayer-configure-3698-559/tmp -lfribidi
In file included from /tmp/i386/target/include/fribidi/fribidi.h:35,
from /var/folders/22/mk15r87109qf3h56sxm74ptr0000gn/Tmplayer-configure-3698-559/tmp.c:4:
/tmp/i386/target/include/fribidi/fribidi-common.h:35:5: warning: "DONT_HAVE_FRIBIDI_CONFIG_H" is not defined
/tmp/i386/target/include/fribidi/fribidi-common.h:45:5: warning: "HAVE_FRIBIDI_CUSTOM_H" is not defined
In file included from /tmp/i386/target/include/fribidi/fribidi-unicode.h:38,
from /tmp/i386/target/include/fribidi/fribidi.h:37,
from /var/folders/22/mk15r87109qf3h56sxm74ptr0000gn/Tmplayer-configure-3698-559/tmp.c:4:
/tmp/i386/target/include/fribidi/fribidi-types.h:85:6: warning: "SIZEOF_WCHAR_T" is not defined
/tmp/i386/target/include/fribidi/fribidi-types.h:102:5: warning: "FRIBIDI_INT_TYPES" is not defined
In file included from /tmp/i386/target/include/fribidi/fribidi.h:37,
from /var/folders/22/mk15r87109qf3h56sxm74ptr0000gn/Tmplayer-configure-3698-559/tmp.c:4:
/tmp/i386/target/include/fribidi/fribidi-unicode.h:46:5: warning: "DONT_HAVE_FRIBIDI_UNICODE_VERSION_H" is not defined
In file included from /var/folders/22/mk15r87109qf3h56sxm74ptr0000gn/Tmplayer-configure-3698-559/tmp.c:4:
/tmp/i386/target/include/fribidi/fribidi.h:54:5: warning: "FRIBIDI_NO_DEPRECATED" is not defined
Result is: yes
##########################################
comment:5 by , 13 years ago
Your last post indicates that fribidi does get auto-detected if --enable-fribidi is not passed to configure ("Result is: yes", this is the intended behaviour), but in the post before you wrote that "Fribidi is not auto-detected".
Could you elaborate?
comment:6 by , 13 years ago
op_sys: | Mac OS X → All |
---|---|
Resolution: | → invalid |
Status: | new → closed |
The described behavior is not a bug and autodetection is working fine.
This sounds like expected behaviour (if you specify --enable-fribidi, you also have to set --extra-cflags and --extra-ldflags).
What happens if you do not specify --enable-fribidi? It should be auto-detected.