Re: Win32 Make

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4dfJUey-GgCH_CHgq6nTrf5W0MrZxW39bhYau7wKUA-yg@mail.gmail.com>
2015-07-30 15:26 GMT+01:00 Michael Becker <[email protected]>:
> these functions must be checked using check_symbol_exists
>
> I have changed CMakeLists.txt as follows:
>
> ==============================================
> # find functions
> set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
> set(FUNCS _atoi64 strtok_r readpassphrase
>         strlcpy strlcat basename getopt strsep gettimeofday
>         nl_langinfo locale_charset setenv putenv
>         getuid getpwuid getpwuid_r fstat alarm fork
>         gethrtime localtime_r setitimer
>         _fseeki64 _ftelli64 setrlimit
>         inet_ntoa_r getipnodebyaddr getipnodebyname
>         getaddrinfo inet_ntop gethostname poll socketpair
>         clock_gettime fseeko pthread_cond_timedwait
>         pthread_condattr_setclock _lock_file _unlock_file usleep nanosleep
>         readdir_r)
>
> foreach(func ${FUNCS})
>         string(TOUPPER "HAVE_${func}" var)
>         check_function_exists(${func} ${var})
>         set(HAVE_GETADDRINFO 1 CACHE INTERNAL "")
>         config_write("/* Define to 1 if you have function <${func}>. */\n")
>         config_write("#cmakedefine ${var} 1\n\n")
> endforeach(func)
>
> set(VSPRINTF asprintf vasprintf vsnprintf _vsnprintf snprintf _snprintf
> _vscprintf)
>
> foreach(func ${VSPRINTF})
>         string(TOUPPER "HAVE_${func}" var)
>         check_symbol_exists(${func} stdio.h ${var})
>         config_write("/* Define to 1 if you have function <${func}>. */\n")
>         config_write("#cmakedefine ${var} 1\n\n")
> endforeach(func)
>
> set(CMAKE_REQUIRED_LIBRARIES)
> ==============================================
>

Change a bit to do both the tests, it continues to build on old Visual
Studio versions.

> This works for the replacement functions but runs into an error when linking
> tdsodbc.dll because some stdio functions seem to have moved to
> legacy_stdio_definitions.lib
>

Which functions?

> How can this lib be included optional into cmake?
>

I think just include in lib_BASE define but perhaps would be better to
avoid to use them. Depends on the functions.

Frediano

>
>
>
>
>
> On 30/07/15 13:04, Michael Becker wrote:
>>
>> have created an entry in cmake bugtracker
>>
>> On 30/07/15 12:41, Michael Becker wrote:
>>>>
>>>>
>>>> There are different possibilities. Function is inline (I suspect it is).
>>>> Function is non __cdecl. Function is declared as C++ (I don't think so).
>>>> Can you find function declaration into the headers?
>>>>
>>>
>>> both (vsnprintf and _vsnprintf) are in stdio.h and both are inlines ...
>>>
>>>
>>> _______________________________________________
>>> FreeTDS mailing list
>>> [email protected]
>>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>>
>>
>>
>> _______________________________________________
>> FreeTDS mailing list
>> [email protected]
>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>
>
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.