delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/12/07/01:53:06

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Sun, 7 Dec 2003 01:52:50 -0500 (EST)
From: Daniel Reed <n AT ml DOT org>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: Some questions about ImageMagick and cygwin
In-Reply-To: <3FD16F82.3010802@cwilson.fastmail.fm>
Message-ID: <Pine.LNX.4.55.0312070125580.18741@narnia.n.ml.org>
MIME-Version: 1.0
X-Virus-Scanned: Symantec AntiVirus Scan Engine
Note-from-DJ: This may be spam

On 2003-12-06T00:56-0500, Charles Wilson wrote:
) -release?  If not for every platform, what is the advisability of our
) cygwin maintainer making that change for his cygwin releases?  Is there
) a way to do "#if CYGWIN then libMagick_LDFLAGS = -release ..... else
) libMagick_LDFLAGS = -version-info ...." ?

While it seems to be obviated in this case, just for future reference I
thought I'd mention how I do something similar to this in the naim package.

In configure.in I use:

AC_CANONICAL_HOST
AC_MSG_CHECKING([for Cygwin])
case $host_os in
	*cygwin*)
		AC_MSG_RESULT(yes)
		AC_SUBST([cygwindocdir], ['${datadir}/doc/Cygwin'])
		AC_DEFINE(FAKE_MAIN_STUB, 1, [Define to enable a workaround on Windows for module loading])
		AC_DEFINE(DLOPEN_SELF_LIBNAIM_CORE, 1, [Define to dlopen libnaim_core rather than NULL])
		AM_CONDITIONAL(CYGWIN, true)
		;;
	*)
		AC_MSG_RESULT(no)
		AC_SUBST([cygwindocdir], [''])
		AM_CONDITIONAL(CYGWIN, false)
		;;
esac

The magic part is AM_CONDITIONAL(CYGWIN, ...).


This can be used in Makefile.am as:
if CYGWIN
libMagick_LDFLAGS = -release ...
else
libMagick_LDFLAGS = -version-info ...
endif


I use it to do some hideous things with .dll files; as best as I can tell,
dlopen()ed .dll's can't directly access symbols in the .exe that opened
them, but they can access symbols in other .dll files. So, on Cygwin I
compile what is normally "naim" into libnaim_core.dll and create a stub
naim.exe that just loads libnaim_core and executes libnaim_core's main().

-- 
Daniel Reed <n AT ml DOT org>	http://naim-users.org/nmlorg/	http://naim.n.ml.org/
"I don't believe in making something user friendly just for the sake of
being user friendly, though; if you're decreasing the users' available
power, you're not really being all that friendly to them."

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019