icudefs.mk.in trailing spaces, OUTOPT and Mac OS X

View: New views
7 Messages — Rating Filter:   Alert me  

icudefs.mk.in trailing spaces, OUTOPT and Mac OS X

by Vladimir Weinstein :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I stumbled upon something interesting and I'm wondering what is the  
best long term solution:
Some of the editors we were using stripped trailing spaces from  
source/icudefs.mk.in
Most notably, the trailing space was stripped from definition of  
OUTOPT variable:
# OUTOPT is for creating a specific output name
OUTOPT = -o<<<<< here

Unfortunately, that made Intel Mac OS X build break:

dhcp-172-19-12-37:build_icu$ cd stubdata/; make; cd ..
/Users/weiv/0_src/build_icu/stubdata
generating dependency information for ../../0_icu/source/stubdata/
stubdata.c
gcc  -DU_USING_ICU_NAMESPACE=1  -I../common -I../../0_icu/source/
common  -g  -fno-common -c  -dynamic -o stubdata.o ../../0_icu/source/
stubdata/stubdata.c
gcc -dynamiclib -dynamic -g    -Wl,-compatibility_version -Wl,36 -Wl,-
current_version -Wl,36.0 -install_name libicudata.dylib.36 -
olibicudata.dylib.36.0 stubdata.o
/usr/bin/libtool: unknown option character `o' in: -olibicudata.dylib.
36.0
Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile
[,dirname]] [-arch_only arch] [-sacLT]
Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile
[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-
compatibility_version #] [-current_version #] [-seg1addr 0x#] [-
segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table  
<filename>] [-seg_addr_table_filename <file_system_path>] [-all_load]  
[-noall_load]
make: *** [libicudata.dylib.36.0] Error 1

The fix was to reintroduce the space to OUTOPT variable:
OUTOPT = -o <<<<< here

Linux is happy either way.

The reason for confusion is that in all the Makefile.in files, $
(OUTOPT) is clumped together with the file name:
./stubdata/Makefile.in: $(SHLIB.c) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)

Looking at ICU revision 11008, it looks like -o was factored out to  
OUTOPT and that construct -o $@ was replaced with $(OUTOPT)$@.

In order to prevent this from happening again, we could:
1. Add a comment above OUTOPT definition stating that the trailing  
space behind it is important
2. Modify Makefile.in files so that there is a space between $
(OUTOPT) and $@
(I tried quoting '-o ', but that doesn't work).

It would appear that 2. would be the proper thing to do, unless it  
breaks other platforms, but 1. would be sufficient, although it would  
appear quite icky that a configuration file depends on editor's  
trailing spaces policy.

Let me know what you think.

Thanks!

Regards,
v.





-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
icu-support mailing list - icu-support@...
To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support

Re: icudefs.mk.in trailing spaces, OUTOPT and Mac OS X

by Steven R. Loomis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think #2 may be problematic because :

mh-cygwin-msvc:OUTOPT = /out:

->  /out:foobar

Why doesn't quoting work?

------
OUTOPT="-o "

all:
         echo BAZ$(OUTOPT)BAT
-----
# make

->   BAZ-o BAT

-s

On 07 Mej 2007, at 10:26, weiv wrote:

> Hello,
>
> I stumbled upon something interesting and I'm wondering what is the
> best long term solution:
> Some of the editors we were using stripped trailing spaces from
> source/icudefs.mk.in
> Most notably, the trailing space was stripped from definition of
> OUTOPT variable:
> # OUTOPT is for creating a specific output name
> OUTOPT = -o<<<<< here
>
> Unfortunately, that made Intel Mac OS X build break:
>
> dhcp-172-19-12-37:build_icu$ cd stubdata/; make; cd ..
> /Users/weiv/0_src/build_icu/stubdata
> generating dependency information for ../../0_icu/source/stubdata/
> stubdata.c
> gcc  -DU_USING_ICU_NAMESPACE=1  -I../common -I../../0_icu/source/
> common  -g  -fno-common -c  -dynamic -o stubdata.o ../../0_icu/source/
> stubdata/stubdata.c
> gcc -dynamiclib -dynamic -g    -Wl,-compatibility_version -Wl,36 -Wl,-
> current_version -Wl,36.0 -install_name libicudata.dylib.36 -
> olibicudata.dylib.36.0 stubdata.o
> /usr/bin/libtool: unknown option character `o' in: -olibicudata.dylib.
> 36.0
> Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile
> [,dirname]] [-arch_only arch] [-sacLT]
> Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile
> [,dirname]] [-arch_only arch] [-o output] [-install_name name] [-
> compatibility_version #] [-current_version #] [-seg1addr 0x#] [-
> segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table
> <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load]
> [-noall_load]
> make: *** [libicudata.dylib.36.0] Error 1
>
> The fix was to reintroduce the space to OUTOPT variable:
> OUTOPT = -o <<<<< here
>
> Linux is happy either way.
>
> The reason for confusion is that in all the Makefile.in files, $
> (OUTOPT) is clumped together with the file name:
> ./stubdata/Makefile.in: $(SHLIB.c) $(LD_SONAME) $(OUTOPT)$@ $^ $(LIBS)
>
> Looking at ICU revision 11008, it looks like -o was factored out to
> OUTOPT and that construct -o $@ was replaced with $(OUTOPT)$@.
>
> In order to prevent this from happening again, we could:
> 1. Add a comment above OUTOPT definition stating that the trailing
> space behind it is important
> 2. Modify Makefile.in files so that there is a space between $
> (OUTOPT) and $@
> (I tried quoting '-o ', but that doesn't work).
>
> It would appear that 2. would be the proper thing to do, unless it
> breaks other platforms, but 1. would be sufficient, although it would
> appear quite icky that a configuration file depends on editor's
> trailing spaces policy.
>
> Let me know what you think.
>
> Thanks!
>
> Regards,
> v.
>
>
>
>
>
> ----------------------------------------------------------------------
> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> icu-support mailing list - icu-support@...
> To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu- 
> support


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
icu-support mailing list - icu-support@...
To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support

smime.p7s (3K) Download Attachment

Re: icudefs.mk.in trailing spaces, OUTOPT and Mac OS X

by George Rhoten :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> In order to prevent this from happening again, we could:
> 1. Add a comment above OUTOPT definition stating that the trailing
> space behind it is important
> 2. Modify Makefile.in files so that there is a space between $
> (OUTOPT) and $@
> (I tried quoting '-o ', but that doesn't work).

The space is important. MSVC wants the space to be absent. All others
usually want it to be there. Linux doesn't mind it either way. The OUTOPT
variable is overridden in the mh files. So option #2 is out of the
question.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
icu-support mailing list - icu-support@...
To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support

Re: icudefs.mk.in trailing spaces, OUTOPT and Mac OS X

by Mark Davis-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It is really fragile for a make file (or any programming source) to depend on trailing spaces. Surely there must be some way to fix it...

Mark

On 5/7/07, George Rhoten <grhoten@...> wrote:
> In order to prevent this from happening again, we could:
> 1. Add a comment above OUTOPT definition stating that the trailing
> space behind it is important
> 2. Modify Makefile.in files so that there is a space between $
> (OUTOPT) and $@
> (I tried quoting '-o ', but that doesn't work).

The space is important. MSVC wants the space to be absent. All others
usually want it to be there. Linux doesn't mind it either way. The OUTOPT
variable is overridden in the mh files. So option #2 is out of the
question.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
icu-support mailing list - icu-support@...
To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support



--
Mark
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
icu-support mailing list - icu-support@...
To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support

Re: icudefs.mk.in trailing spaces, OUTOPT and Mac OS X

by Vladimir Weinstein :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm not sure why quoting doesn't work:
OUTOPT ="-o "

Yields:
make[0]: Making `all' in `stubdata'
generating dependency information for ../../../0_icu/source/stubdata/
stubdata.c
gcc  -DU_USING_ICU_NAMESPACE=1  -I../common -I../../../0_icu/source/
common  -g  -fno-common -c  -dynamic -o stubdata.o ../../../0_icu/
source/stubdata/stubdata.c
gcc -dynamiclib -dynamic -g    -Wl,-compatibility_version -Wl,36 -Wl,-
current_version -Wl,36.0 -install_name libicudata.dylib.36 "-o  
"libicudata.dylib.36.0 stubdata.o
/usr/bin/libtool: unknown option character `o' in: -o  
libicudata.dylib.36.0
Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile
[,dirname]] [-arch_only arch] [-sacLT]
Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile
[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-
compatibility_version #] [-current_version #] [-seg1addr 0x#] [-
segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table  
<filename>] [-seg_addr_table_filename <file_system_path>] [-all_load]  
[-noall_load]
make[1]: *** [libicudata.dylib.36.0] Error 1
make: *** [all-recursive] Error 2

Yuck.

Regards,
v.

On May 7, 2007, at 10:43 AM, Steven R. Loomis wrote:

> I think #2 may be problematic because :
>
> mh-cygwin-msvc:OUTOPT = /out:
>
> ->  /out:foobar
>
> Why doesn't quoting work?
>
> ------
> OUTOPT="-o "
>
> all:
>         echo BAZ$(OUTOPT)BAT
> -----
> # make
>
> ->   BAZ-o BAT
>
> -s
>
> On 07 Mej 2007, at 10:26, weiv wrote:
>
>> Hello,
>>
>> I stumbled upon something interesting and I'm wondering what is the
>> best long term solution:
>> Some of the editors we were using stripped trailing spaces from
>> source/icudefs.mk.in
>> Most notably, the trailing space was stripped from definition of
>> OUTOPT variable:
>> # OUTOPT is for creating a specific output name
>> OUTOPT = -o<<<<< here
>>
>> Unfortunately, that made Intel Mac OS X build break:
>>
>> dhcp-172-19-12-37:build_icu$ cd stubdata/; make; cd ..
>> /Users/weiv/0_src/build_icu/stubdata
>> generating dependency information for ../../0_icu/source/stubdata/
>> stubdata.c
>> gcc  -DU_USING_ICU_NAMESPACE=1  -I../common -I../../0_icu/source/
>> common  -g  -fno-common -c  -dynamic -o stubdata.o ../../0_icu/
>> source/
>> stubdata/stubdata.c
>> gcc -dynamiclib -dynamic -g    -Wl,-compatibility_version -Wl,36 -
>> Wl,-
>> current_version -Wl,36.0 -install_name libicudata.dylib.36 -
>> olibicudata.dylib.36.0 stubdata.o
>> /usr/bin/libtool: unknown option character `o' in: -
>> olibicudata.dylib.
>> 36.0
>> Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile
>> [,dirname]] [-arch_only arch] [-sacLT]
>> Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile
>> [,dirname]] [-arch_only arch] [-o output] [-install_name name] [-
>> compatibility_version #] [-current_version #] [-seg1addr 0x#] [-
>> segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table
>> <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load]
>> [-noall_load]
>> make: *** [libicudata.dylib.36.0] Error 1
>>
>> The fix was to reintroduce the space to OUTOPT variable:
>> OUTOPT = -o <<<<< here
>>
>> Linux is happy either way.
>>
>> The reason for confusion is that in all the Makefile.in files, $
>> (OUTOPT) is clumped together with the file name:
>> ./stubdata/Makefile.in: $(SHLIB.c) $(LD_SONAME) $(OUTOPT)$@ $^ $
>> (LIBS)
>>
>> Looking at ICU revision 11008, it looks like -o was factored out to
>> OUTOPT and that construct -o $@ was replaced with $(OUTOPT)$@.
>>
>> In order to prevent this from happening again, we could:
>> 1. Add a comment above OUTOPT definition stating that the trailing
>> space behind it is important
>> 2. Modify Makefile.in files so that there is a space between $
>> (OUTOPT) and $@
>> (I tried quoting '-o ', but that doesn't work).
>>
>> It would appear that 2. would be the proper thing to do, unless it
>> breaks other platforms, but 1. would be sufficient, although it would
>> appear quite icky that a configuration file depends on editor's
>> trailing spaces policy.
>>
>> Let me know what you think.
>>
>> Thanks!
>>
>> Regards,
>> v.
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> ----
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> icu-support mailing list - icu-support@...
>> To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu- 
>> support
>
> ----------------------------------------------------------------------
> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/ 
> _______________________________________________
> icu-support mailing list - icu-support@...
> To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu- 
> support


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
icu-support mailing list - icu-support@...
To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support

Re: icudefs.mk.in trailing spaces, OUTOPT and Mac OS X

by Steven R. Loomis :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try this:

----
OUTOPT=-o #

all:
         echo BAZ$(OUTOPT)BAT
---


On 07 Mej 2007, at 15:51, weiv wrote:

>
> I'm not sure why quoting doesn't work:
> OUTOPT ="-o "
>
> Yields:
> make[0]: Making `all' in `stubdata'
> generating dependency information for ../../../0_icu/source/stubdata/
> stubdata.c
> gcc  -DU_USING_ICU_NAMESPACE=1  -I../common -I../../../0_icu/source/
> common  -g  -fno-common -c  -dynamic -o stubdata.o ../../../0_icu/
> source/stubdata/stubdata.c
> gcc -dynamiclib -dynamic -g    -Wl,-compatibility_version -Wl,36 -Wl,-
> current_version -Wl,36.0 -install_name libicudata.dylib.36 "-o
> "libicudata.dylib.36.0 stubdata.o
> /usr/bin/libtool: unknown option character `o' in: -o
> libicudata.dylib.36.0
> Usage: /usr/bin/libtool -static [-] file [...] [-filelist listfile
> [,dirname]] [-arch_only arch] [-sacLT]
> Usage: /usr/bin/libtool -dynamic [-] file [...] [-filelist listfile
> [,dirname]] [-arch_only arch] [-o output] [-install_name name] [-
> compatibility_version #] [-current_version #] [-seg1addr 0x#] [-
> segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table
> <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load]
> [-noall_load]
> make[1]: *** [libicudata.dylib.36.0] Error 1
> make: *** [all-recursive] Error 2
>
> Yuck.
>
>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
icu-support mailing list - icu-support@...
To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support

smime.p7s (3K) Download Attachment

Re: icudefs.mk.in trailing spaces, OUTOPT and Mac OS X

by Vladimir Weinstein :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yup, trailing with a # works.

Thanks Steven!

Regards,
v.

On May 7, 2007, at 3:56 PM, Steven R. Loomis wrote:

OUTOPT=-o #


all:

        echo BAZ$(OUTOPT)BAT



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
icu-support mailing list - icu-support@...
To Un/Subscribe: https://lists.sourceforge.net/lists/listinfo/icu-support