On Wed Sep 10 09:30:37 2008, doughera wrote:
> 
> That's another easy one.  The test assumes that all platforms have -lrt 
> and that all platforms have to link with it for this test.  Your system 
> clearly doesn't have -lrt, so the link fails.  If you just delete the
line 
> that adds in -lrt, I'll bet the test succeeds.
> 
> Generally, Configure shouldn't be unconditionally adding libraries.  A 
> better idiom is probably to try without, and then try with only if 
> necessary.  Something like this:
> 

The principle sounds good.  I applied the patch and, as predicted, it
DTRT on Linux, as this verbose output for auto::aio on Linux demonstrates.

Unfortunately, it didn't cause AIO to be located on Darwin -- even
though it changed the error message.  The handles to the error files
were opened, but the .out, .cco and .ldo files were all empty.

$ ls -ltr test_*
-rw-r--r--   1 jimk  jimk   3424 Sep 10 19:58 test_26632.o
-rw-r--r--   1 jimk  jimk      0 Sep 10 19:58 test_26632.ldo
-rw-r--r--   1 jimk  jimk      0 Sep 10 19:58 test_26632.cco
-rw-r--r--   1 jimk  jimk   1330 Sep 10 19:58 test_26632.c
-rw-r--r--   1 jimk  jimk      0 Sep 10 19:58 test_26632.out
-rwxr-xr-x   1 jimk  jimk  18148 Sep 10 19:58 test_26632


Thank you very much.
kid51
auto::aio -           Does your platform support AIO...
/usr/bin/gcc -fno-common -no-cpp-precomp  -pipe -I/opt/local/include -pipe 
-fno-common -Wno-long-double  -DHASATTRIBUTE_CONST  -DHASATTRIBUTE_DEPRECATED  
-DHASATTRIBUTE_MALLOC  -DHASATTRIBUTE_NONNULL  -DHASATTRIBUTE_NORETURN  
-DHASATTRIBUTE_PURE  -DHASATTRIBUTE_UNUSED  -DHASATTRIBUTE_WARN_UNUSED_RESULT  
-falign-functions=16 -fvisibility=hidden -W -Wall -Waggregate-return 
-Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization 
-Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral 
-Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline 
-Winvalid-pch -Wmissing-braces -Wmissing-field-initializers 
-Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses 
-Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare 
-Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs 
-Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings 
-Wbad-function-cast -Wdeclaration-after-statement 
-Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations 
-Wmissing-prototypes -Wnested-externs -Wnonnull  -I./include -c test_26632.c
/usr/bin/g++ -undefined dynamic_lookup test_26632.o  -o test_26632  -lm
./test_26632
 (no) 
Setting Configuration Data:
(
        verbose => undef,
);

                      Does your platform support AIO.......................no.
auto::aio -           Does your platform support AIO...
cc  -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 
-D_GNU_SOURCE -DHASATTRIBUTE_CONST  -DHASATTRIBUTE_DEPRECATED  
-DHASATTRIBUTE_MALLOC  -DHASATTRIBUTE_NONNULL  -DHASATTRIBUTE_NORETURN  
-DHASATTRIBUTE_PURE  -DHASATTRIBUTE_UNUSED  -DHASATTRIBUTE_WARN_UNUSED_RESULT  
-falign-functions=16 -fvisibility=hidden -maccumulate-outgoing-args -W -Wall 
-Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment 
-Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args 
-Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport 
-Winit-self -Winline -Winvalid-pch -Wmissing-braces 
-Wmissing-field-initializers -Wno-missing-format-attribute 
-Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type 
-Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing 
-Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef 
-Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings 
-Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement 
-Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations 
-Wmissing-prototypes -Wnested-externs -Wnonnull  -I./include -c test_15075.c
cc  -L/usr/local/lib -Wl,-E test_15075.o  -o test_15075  -lnsl -ldl -lm -lcrypt 
-lutil -lpthread
test_15075.o: In function `main':
test_15075.c:(.text+0x172): undefined reference to `aio_read64'
collect2: ld returned 1 exit status
 (Trying again with -lrt) cc  -pipe -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DHASATTRIBUTE_CONST  
-DHASATTRIBUTE_DEPRECATED  -DHASATTRIBUTE_MALLOC  -DHASATTRIBUTE_NONNULL  
-DHASATTRIBUTE_NORETURN  -DHASATTRIBUTE_PURE  -DHASATTRIBUTE_UNUSED  
-DHASATTRIBUTE_WARN_UNUSED_RESULT  -falign-functions=16 -fvisibility=hidden 
-maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual 
-Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra 
-Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k 
-Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces 
-Wmissing-field-initializers -Wno-missing-format-attribute 
-Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type 
-Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing 
-Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef 
-Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings 
-Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement 
-Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations 
-Wmissing-prototypes -Wnested-externs -Wnonnull  -I./include -c test_15075.c
cc  -L/usr/local/lib -Wl,-E test_15075.o  -o test_15075  -lnsl -ldl -lm -lcrypt 
-lutil -lpthread -lrt
./test_15075
INFO=42
ok
 (yes) 
Setting Configuration Data:
(
        verbose => undef,
);

                      Does your platform support AIO......................yes.

Reply via email to