bugGNU libunistring - Bugs: bug #36057, Unable to compile...


bug #36057: Unable to compile libunistring-0.9.3 on Mac OS X 10.6.8

Submitted by:  Shane Celis <shizzy0>
Submitted on:  Sat Mar 31 19:57:48 2012  
Category: BuildSeverity: 3 - Normal
Item Group: NoneStatus: Need Info
Privacy: PublicAssigned to: Bruno Haible <haible>
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sun Apr 1 09:58:40 2012, comment #3:

> Here's the error I was dealing with.


> Inside the u16-casemap.lo file (attached), here is the interesting bit:

Thanks, this reveals the first layer of the problem:


In a correct build, these should be several lines, like this:

#define _UC_CATEGORY_NONE libunistring__UC_CATEGORY_NONE
#define C_isalnum libunistring_C_isalnum
#define C_isalpha libunistring_C_isalpha

This section ought to be constructed based on a file

Can you please attach
1) the file config.status
2) the file lib/libunistring.sym
3) the output of the commands
type sed; sed --version
type sort; sort --version
type uniq; uniq --version
type grep; grep --version
type join; join --version


Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sat Mar 31 22:09:22 2012, comment #2:

Right. Sorry. Here's the error I was dealing with.

$ ./configure && make
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c -o unicase/u16-casefold.lo unicase/u16-casefold.c
libtool: compile: gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c unicase/u16-casefold.c -fno-common -DPIC -o unicase/.libs/u16-casefold.o
libtool: compile: gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c unicase/u16-casefold.c -o unicase/u16-casefold.o >/dev/null 2>&1
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c -o unicase/u16-casemap.lo unicase/u16-casemap.c
libtool: compile: gcc -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c unicase/u16-casemap.c -fno-common -DPIC -o unicase/.libs/u16-casemap.o
In file included from unicase/u16-casemap.c:28:
./unictype.h:137: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'UC_CATEGORY_Cf'
make[3]: *** [unicase/u16-casemap.lo] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I'm running the command you suggested.

$ cd lib; gcc -E -dD -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I.. -I. -I. -I.. -I.. -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -g -O2 -c -o unicase/u16-casemap.lo unicase/u16-casemap.c

Inside the u16-casemap.lo file (attached), here is the interesting bit:

# 6 "./config.h" 2


I hope that helps.

(file #25535)

Shane Celis <shizzy0>
Sat Mar 31 21:56:15 2012, comment #1:

As usual, for a bug report, please state the problem before you
jump to your proposed solution.

> ran into a small issue

What were the error messages from the compiler?

> The issue is there is a struct UC_CATEGORY_C and a macro by the same name.

Can you use "gcc -E -dD" of the source file to be compiled to find
out where this macro is defined?

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sat Mar 31 19:57:48 2012, original submission:


I was trying to get libunistring-0.9.3 to compile and ran into a small issue. My machine is running Mac OS X 10.6.8.

$ uname -a
Darwin mbp13.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386

The issue is there is a struct UC_CATEGORY_C and a macro by the same name. They're used for categorically different things. I've attached a hack of a patch that I used to get around this issue. It seems to me that the real fix should be that the macro should have a distinct name, or perhaps there is a compiler flag that might resolve struct vs macro names differently on Mac OS X.

Shane Celis <shizzy0>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #25535:  u16-casemap.lo added by shizzy0 (196kB - application/octet-stream)
file #25534:  libunistring-0.9.3-macosx.patch added by shizzy0 (1kB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by haible (Posted a comment)
  • -unavailable- added by shizzy0 (Submitted the item)
  • -unavailable- added by shizzy0

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu Nov 24 00:28:34 2016haibleCategoryNone=>Build
    Sat Mar 31 22:09:22 2012shizzy0Attached File-=>Added u16-casemap.lo, #25535
    Sat Mar 31 21:56:15 2012haibleStatusNone=>Need Info
      Assigned toNone=>haible
    Sat Mar 31 19:57:48 2012shizzy0Attached File-=>Added libunistring-0.9.3-macosx.patch, #25534
      Carbon-Copy-=>Added shizzy0

    Back to the top

    Powered by Savane 3.1-cleanup