<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div>I've an autotools script to convert to cmake. It has a lot of long case statement. Any tips to easily convert this statement?</div><div><br></div><div>Here an example:</div><div><br></div><div><div>case "$THREADS" in</div><div>&nbsp;no | none | single)</div><div>&nbsp;&nbsp; &nbsp;THREADS=none</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>&nbsp;posix | pthreads)</div><div>&nbsp;&nbsp; &nbsp;THREADS=posix</div><div>&nbsp;&nbsp; &nbsp;THREADDLLIBS=-lpthread</div><div>&nbsp;&nbsp; &nbsp;case "$host" in</div><div>&nbsp;&nbsp; &nbsp; x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux* | sparc*-*-linux*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_LINUX_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(_REENTRANT)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if test "${enable_parallel_mark}" = yes; then</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;AC_DEFINE(PARALLEL_MARK)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_MSG_WARN("Explicit GC_INIT() calls may be required.");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-linux*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_LINUX_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(_REENTRANT)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-aix*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_AIX_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(_REENTRANT)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-hpux11*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_HPUX_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(_POSIX_C_SOURCE,199506L)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if test "${enable_parallel_mark}" = yes; then</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;AC_DEFINE(PARALLEL_MARK)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_MSG_WARN("Explicit GC_INIT() calls may be required.");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>THREADDLLIBS="-lpthread -lrt"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span># HPUX needs REENTRANT for the _r calls.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads.])</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-hpux10*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-openbsd*)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;AC_DEFINE(GC_OPENBSD_THREADS)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;THREADDLLIBS=-pthread</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;INCLUDES="$INCLUDES -pthread"</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;openbsd_threads=true</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;;;</div><div>&nbsp;&nbsp; &nbsp; *-*-freebsd*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_FREEBSD_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>INCLUDES="$INCLUDES -pthread"</div><div>&nbsp;&nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-kfreebsd*-gnu)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_FREEBSD_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>INCLUDES="$INCLUDES -pthread"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>THREADDLLIBS=-pthread</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(_REENTRANT)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if test "${enable_parallel_mark}" = yes; then</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;AC_DEFINE(PARALLEL_MARK)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(USE_COMPILER_TLS)</div><div>&nbsp;&nbsp; &nbsp; &nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-gnu*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_GNU_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(_REENTRANT)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-netbsd*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_MSG_WARN("Only on NetBSD 2.0 or later.")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_NETBSD_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(_REENTRANT)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(_PTHREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>THREADDLLIBS="-lpthread -lrt"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-solaris*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_SOLARIS_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>THREADDLLIBS="-lpthread -lrt"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if test "$GCC" != yes; then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CFLAGS="$CFLAGS -O"</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;need_atomic_ops_asm=true</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;fi</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-irix*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_IRIX_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-cygwin*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_THREADS)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if test "${enable_parallel_mark}" = yes; then</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;AC_DEFINE(PARALLEL_MARK)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span># Cygwin doesn't have a real libpthread, so Libtool can't link</div><div><span class="Apple-tab-span" style="white-space:pre">        </span># against it.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>THREADDLLIBS=""</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>win32_threads=true</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-darwin*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_DARWIN_THREADS)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_MSG_WARN("Explicit GC_INIT() calls may be required.");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span># Parallel-mark is currently unreliable on Darwin; ignore request</div><div><span class="Apple-tab-span" style="white-space:pre">        </span># if test "${enable_parallel_mark}" = yes; then</div><div><span class="Apple-tab-span" style="white-space:pre">        </span># &nbsp; AC_DEFINE(PARALLEL_MARK)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span># fi</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>darwin_threads=true</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; *-*-osf*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_DEFINE(GC_OSF1_THREADS)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if test "${enable_parallel_mark}" = yes; then</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;AC_DEFINE(PARALLEL_MARK)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;AC_MSG_WARN("Explicit GC_INIT() calls may be required.");</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;# May want to enable it in other cases, too.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp;# Measurements havent yet been done.</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>INCLUDES="$INCLUDES -pthread"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>THREADDLLIBS="-lpthread -lrt"</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;*)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>AC_MSG_ERROR("Pthreads not supported by the GC on this platform.")</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>;;</div><div>&nbsp;&nbsp; &nbsp;esac</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>&nbsp;win32)</div><div>&nbsp;&nbsp; &nbsp;AC_DEFINE(GC_THREADS)</div><div>&nbsp;&nbsp; &nbsp;if test "${enable_parallel_mark}" = yes; then</div><div>&nbsp;&nbsp; &nbsp; &nbsp;AC_DEFINE(PARALLEL_MARK)</div><div>&nbsp;&nbsp; &nbsp; &nbsp;AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div>&nbsp;&nbsp; &nbsp;fi</div><div>&nbsp;&nbsp; &nbsp;win32_threads=true</div><div>&nbsp;&nbsp; &nbsp;AC_DEFINE([EMPTY_GETENV_RESULTS], [1],</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp; &nbsp; &nbsp;[Wine getenv may not return NULL for missing entry.])</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>&nbsp;dgux386)</div><div>&nbsp;&nbsp; &nbsp;THREADS=dgux386</div><div>&nbsp;&nbsp; &nbsp;AC_MSG_RESULT($THREADDLLIBS)</div><div>&nbsp;&nbsp; &nbsp;# Use pthread GCC &nbsp;switch</div><div>&nbsp;&nbsp; &nbsp;THREADDLLIBS=-pthread</div><div>&nbsp;&nbsp; &nbsp;if test "${enable_parallel_mark}" = yes; then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;AC_DEFINE(PARALLEL_MARK)</div><div>&nbsp;&nbsp; &nbsp;fi</div><div>&nbsp;&nbsp; &nbsp;AC_DEFINE(THREAD_LOCAL_ALLOC)</div><div>&nbsp;&nbsp; &nbsp;AC_MSG_WARN("Explicit GC_INIT() calls may be required.");</div><div>&nbsp;&nbsp; &nbsp;AC_DEFINE([GC_DGUX386_THREADS], 1,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp; &nbsp; &nbsp;[Define to enable support for DB/UX threads on i386.])</div><div>&nbsp;&nbsp; &nbsp;AC_DEFINE([DGUX_THREADS], 1,</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> &nbsp; &nbsp; &nbsp;[Define to enable support for DB/UX threads.])</div><div>&nbsp;&nbsp; &nbsp;# Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread</div><div>&nbsp;&nbsp; &nbsp;INCLUDES="-pthread $INCLUDES"</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>&nbsp;aix)</div><div>&nbsp;&nbsp; &nbsp;THREADS=posix</div><div>&nbsp;&nbsp; &nbsp;THREADDLLIBS=-lpthread</div><div>&nbsp;&nbsp; &nbsp;AC_DEFINE(GC_AIX_THREADS)</div><div>&nbsp;&nbsp; &nbsp;AC_DEFINE(_REENTRANT)</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>&nbsp;decosf1 | irix | mach | os2 | solaris | dce | vxworks)</div><div>&nbsp;&nbsp; &nbsp;AC_MSG_ERROR(thread package $THREADS not yet supported)</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>&nbsp;*)</div><div>&nbsp;&nbsp; &nbsp;AC_MSG_ERROR($THREADS is an unknown thread package)</div><div>&nbsp;&nbsp; &nbsp;;;</div><div>esac</div><div><br></div></div><div><br><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Nicola Brisotto</div><div><a href="http://www.breezit.net/vcards/NicolaBrisotto.vcf">vcard</a></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div><br class="Apple-interchange-newline"><br class="Apple-interchange-newline">
</div>
<br></div></body></html>