fix libopenjpip link on Windows

This commit is contained in:
Vincent Torri 2012-01-25 20:56:07 +00:00
parent f3f86e1eb7
commit aab317eb8c
3 changed files with 37 additions and 29 deletions

View File

@ -6,6 +6,7 @@ What's New for OpenJPEG
+ : added + : added
January 25, 2012 January 25, 2012
* [vincent] fix libopenjpip link on Windows
* [vincent] follow latest JPIP changes in the autotools side (pthread dependency, conditional compilation of JPIP server and client) * [vincent] follow latest JPIP changes in the autotools side (pthread dependency, conditional compilation of JPIP server and client)
December 8, 2011 December 8, 2011

View File

@ -84,8 +84,8 @@ libopenjpip_server_la_CPPFLAGS = \
@FCGI_CFLAGS@ \ @FCGI_CFLAGS@ \
@LIBCURL_CFLAGS@ \ @LIBCURL_CFLAGS@ \
-DSERVER -DSERVER
libopenjpip_server_la_CFLAGS = @PTHREAD_CFLAGS@ libopenjpip_server_la_CFLAGS = @THREAD_CFLAGS@
libopenjpip_server_la_LIBADD = @FCGI_LIBS@ @LIBCURL_LIBS@ @PTHREAD_LIBS@ -lm libopenjpip_server_la_LIBADD = @FCGI_LIBS@ @LIBCURL_LIBS@ @THREAD_LIBS@ -lm
libopenjpip_server_la_LDFLAGS = -no-undefined -version-info @lt_version@ libopenjpip_server_la_LDFLAGS = -no-undefined -version-info @lt_version@
libopenjpip_server_la_SOURCES = $(JPIP_SRC) libopenjpip_server_la_SOURCES = $(JPIP_SRC)
@ -96,8 +96,8 @@ libopenjpip_local_la_CPPFLAGS = \
-I$(top_srcdir)/applications/jpip/libopenjpip \ -I$(top_srcdir)/applications/jpip/libopenjpip \
-I$(top_builddir)/applications/jpip/libopenjpip \ -I$(top_builddir)/applications/jpip/libopenjpip \
@LIBCURL_CFLAGS@ @LIBCURL_CFLAGS@
libopenjpip_local_la_CFLAGS = @PTHREAD_CFLAGS@ libopenjpip_local_la_CFLAGS = @THREAD_CFLAGS@
libopenjpip_local_la_LIBADD = @PTHREAD_LIBS@ $(top_builddir)/libopenjpeg/libopenjpeg.la -lm libopenjpip_local_la_LIBADD = @THREAD_LIBS@ $(top_builddir)/libopenjpeg/libopenjpeg.la -lm
libopenjpip_local_la_LDFLAGS = -no-undefined -version-info @lt_version@ libopenjpip_local_la_LDFLAGS = -no-undefined -version-info @lt_version@
libopenjpip_local_la_SOURCES = $(JPIP_SRC) $(LOCAL_SRC) libopenjpip_local_la_SOURCES = $(JPIP_SRC) $(LOCAL_SRC)

View File

@ -348,42 +348,49 @@ fi
# pthread # pthread
if test "x${want_jpip}" = "xyes" && test "x${have_win32}" = "xno" ; then if test "x${want_jpip}" = "xyes" ; then
SAVE_CFLAGS=${CFLAGS} if test "x${have_win32}" = "xno" ; then
CFLAGS="${CFLAGS} -pthread"
SAVE_LIBS=${LIBS} SAVE_CFLAGS=${CFLAGS}
LIBS="${LIBS} -pthread" CFLAGS="${CFLAGS} -pthread"
AC_LINK_IFELSE( SAVE_LIBS=${LIBS}
[AC_LANG_PROGRAM([[ LIBS="${LIBS} -pthread"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[
#include <pthread.h> #include <pthread.h>
]], ]],
[[ [[
pthread_t id; pthread_t id;
id = pthread_self(); id = pthread_self();
]])], ]])],
[have_pthread="yes"], [have_pthread="yes"],
[have_pthread="no"]) [have_pthread="no"])
CFLAGS=${SAVE_CFLAGS} CFLAGS=${SAVE_CFLAGS}
LIBS=${SAVE_LIBS} LIBS=${SAVE_LIBS}
AC_MSG_CHECKING([whether Pthread library is available]) AC_MSG_CHECKING([whether Pthread library is available])
AC_MSG_RESULT([${have_pthread}]) AC_MSG_RESULT([${have_pthread}])
if ! test "x${have_pthread}" = "xyes" ; then
AC_MSG_WARN([Pthread library not found. OpenJPIP library will not be compiled.])
want_jpip="no"
else
THREAD_CFLAGS="-pthread"
THREAD_LIBS="-pthread"
fi
if ! test "x${have_pthread}" = "xyes" ; then
AC_MSG_WARN([Pthread library not found. OpenJPIP library will not be compiled.])
want_jpip="no"
else else
PTHREAD_CFLAGS="-pthread" THREAD_LIBS="-lws2_32"
AC_ARG_VAR([PTHREAD_CFLAGS], [compiler flag for Pthread])
AC_SUBST([PTHREAD_CFLAGS])
PTHREAD_LIBS="-pthread"
AC_ARG_VAR([PTHREAD_LIBS], [linker flags for Pthread])
AC_SUBST([PTHREAD_LIBS])
fi fi
fi fi
AC_ARG_VAR([THREAD_CFLAGS], [compiler flag for the thread library])
AC_SUBST([THREAD_CFLAGS])
AC_ARG_VAR([THREAD_LIBS], [linker flags for thread library])
AC_SUBST([THREAD_LIBS])
# libfcgi # libfcgi
if test "x${want_jpip_server}" = "xyes" ; then if test "x${want_jpip_server}" = "xyes" ; then