[Vm-dev] platforms/unix/plugins/UUIDPlugin/acinclude.m4 proposed change

gettimothy gettimothy at zoho.com
Sun Jun 15 21:52:53 UTC 2014


Hi Eliot.



I just realized that platforms/unix/plugins/UUIDPlugin/sqUnixUUID.c chechs in three places for uuid.h and the uuid generator executable (which has different names depending on system)




#include "config.h"

#if defined(HAVE_SYS_UUID_H)     
# include <sys/types.h>
# include <sys/uuid.h>
#elif defined(HAVE_UUID_UUID_H)
# include <uuid/uuid.h>
#elif defined(HAVE_UUID_H)
# include <uuid.h>
#else
# error cannot find a uuid.h to include
#endif


 
The .m4 file in my last email only checked two.


Here is a modified version that checks 3 to match the .c file. NOTE however that the executable name differs depending on where the uuid.h file is located. <uuid/uuid.h>->uuid_generator, <uuid.h>-->uuidgen
I do not know (and could not determine, but I suspect its BSD) what the name of that program is when uuid.h is under the <sys/uuid.h>->???????





 # -*- sh -*-

AC_MSG_CHECKING([for UUID support])
AC_TRY_COMPILE([#include <sys/uuid.h>],[uuid_generatorxyz;],[    <----THE uuid_generator_xyz needs to be the renamed for whatever system uses this.
       AC_MSG_RESULT(yes)
             AC_CHECK_LIB(uuid, uuid_generator_xyz,LIB_UUID="-luuid" )     <----THE uuid_generator_xyz needs to be the renamed for whatever system uses this.
            ],[
       AC_MSG_RESULT(no)
            AC_MSG_CHECKING([for UUID support uuid/uuid.h] and uuid_generate)
            AC_TRY_COMPILE([#include <uuid/uuid.h>],[uuid_generate;],[
                   AC_MSG_RESULT(yes)
                         AC_CHECK_LIB(uuid, uuid_generate, LIB_UUID="-luuid")
                        ],[
                   AC_MSG_RESULT(no)
                         AC_MSG_CHECKING([for UUID support uuid and uuidgen] )
                         AC_TRY_COMPILE([#include <uuid.h>],[uuidgen;],[
                               AC_MSG_RESULT(yes)
                                     AC_CHECK_LIB(uuid, uuidgen, LIB_UUID="-luuid" )],[
                               AC_MSG_RESULT(no)
                                      AC_PLUGIN_DISABLE
 ])
 ])
])

I used that .m4 in my oscogvm/platforms/unix/plugins/UUIDPlugin/   for the CMake build I am working on and it worked fine. as my system uses the <uuid.h>-->uuidgen pair.


So I assume the file is correct syntax wise.


cheers.


tty



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20140615/98dc01e5/attachment.htm


More information about the Vm-dev mailing list