Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 286736 - app-misc/getopt doesn't merge
Summary: app-misc/getopt doesn't merge
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Interix
: High normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-28 09:12 UTC by Sergey Kishchenko
Modified: 2009-09-28 12:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to switch off LIBCGETOPT define (getopt-1.1.4.ebuild.patch,646 bytes, patch)
2009-09-28 09:12 UTC, Sergey Kishchenko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Kishchenko 2009-09-28 09:12:04 UTC
By default it defines LIBCGETOPT and tries to find getopt.h header in system include dir:
gcc -c -DLIBCGETOPT=1 -DLOCALEDIR=\"/usr/local/share/locale\" -DNOT_UTIL_LINUX -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wmissing-declarations -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -O3 -fno-strength-reduce getopt.c -o getopt.o
getopt.c:49:20: error: getopt.h: No such file or directory

I was able to merge getopt with patch below.
Comment 1 Sergey Kishchenko 2009-09-28 09:12:38 UTC
Created attachment 205448 [details, diff]
Patch to switch off LIBCGETOPT define
Comment 2 Markus Duft (RETIRED) gentoo-dev 2009-09-28 12:13:54 UTC
the way you did it, libcgetopt variable will always be 0, so it possibly breaks on other systems (having getopt in libc). always pay attention to not break others.

i have now done it like this:
[[ ${CHOST} == *-interix* ]] && libcgetopt=0

which turns it off on interix, and remains the same on all others.
Comment 3 Sergey Kishchenko 2009-09-28 12:19:18 UTC
>the way you did it, libcgetopt variable will always be 0, so it possibly breaks
>on other systems (having getopt in libc). always pay attention to not break
>others.

Thanks, will pay more attention to it from now.