check libpthread in win32

This commit is contained in:
Vítor Santos Costa 2014-02-22 22:48:29 +00:00
parent 87d6a6cc31
commit 3da5cc5977
6 changed files with 69 additions and 8 deletions

53
configure vendored
View File

@ -5229,10 +5229,51 @@ then
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
if test "$cygwin" = "no" -o "$target_os" = "mingw32"
then
if test "$threads" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5
$as_echo_n "checking for main in -lpthread... " >&6; }
if ${ac_cv_lib_pthread_main+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
return main ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_pthread_main=yes
else
ac_cv_lib_pthread_main=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5
$as_echo "$ac_cv_lib_pthread_main" >&6; }
if test "x$ac_cv_lib_pthread_main" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBPTHREAD 1
_ACEOF
LIBS="-lpthread $LIBS"
fi
fi
if test "$target_cpu" = x86_64; then
YAP_TARGET=amd64
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5
$as_echo_n "checking for main in -lws2_32... " >&6; }
if ${ac_cv_lib_ws2_32_main+:} false; then :
$as_echo_n "(cached) " >&6
@ -12016,7 +12057,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 12019 "configure" */
/* #line 12060 "configure" */
public class Test {
}
EOF
@ -12192,7 +12233,7 @@ EOF
if uudecode$EXEEXT Test.uue; then
ac_cv_prog_uudecode_base64=yes
else
echo "configure: 12195: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: 12236: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: failed file was:" >&5
cat Test.uue >&5
ac_cv_prog_uudecode_base64=no
@ -12323,7 +12364,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 12326 "configure" */
/* #line 12367 "configure" */
public class Test {
}
EOF
@ -12358,7 +12399,7 @@ JAVA_TEST=Test.java
CLASS_TEST=Test.class
TEST=Test
cat << \EOF > $JAVA_TEST
/* [#]line 12361 "configure" */
/* [#]line 12402 "configure" */
public class Test {
public static void main (String args[]) {
System.exit (0);

View File

@ -497,6 +497,9 @@ then
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
if test "$cygwin" = "no" -o "$target_os" = "mingw32"
then
if test "$threads" = yes; then
AC_CHECK_LIB(pthread, main)
fi
if test "$target_cpu" = x86_64; then
YAP_TARGET=amd64
AC_CHECK_LIB(ws2_32,main)

View File

@ -104,7 +104,7 @@ DIALECT_BP= \
all:
install: $(PROGRAMS) install-examples
install: $(PROGRAMS) $(DIALECT_PROGRAMS) $(DIALECT_SWI) $(DIALECT_BP) install-examples
mkdir -p $(DESTDIR)$(SHAREDIR)/Yap
mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/dialect
mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/dialect/swi
@ -121,3 +121,11 @@ clean:
distclean: clean
rm -f *def Makefile
##########
FULL_PATH_PL_SOURCES=$(PROGRAMS) $(DIALECT_PROGRAMS) $(DIALECT_SWI) $(DIALECT_BP)
TAGS: $(PROGRAMS) $(DIALECT_PROGRAMS) $(DIALECT_SWI) $(DIALECT_BP)
etags --append ../TAGS $(FULL_PATH_PL_SOURCES)

View File

@ -49,7 +49,7 @@ SOBJS=yap_mpi.@SO@
all: $(SOBJS)
yap_mpi.o: $(srcdir)/yap_mpi.c $(srcdir)/yap_mpi.c
yap_mpi.o: $(srcdir)/yap_mpi.c
$(MPI_CC) $(CFLAGS) $(MPICF) -c $(srcdir)/yap_mpi.c -o yap_mpi.o
prologterms2c.o: $(srcdir)/prologterms2c.c $(srcdir)/prologterms2c.h
@ -74,3 +74,10 @@ install-examples:
distclean: clean
rm -f Makefile
FULL_PATH_C_SOURCES= $(srcdir)/yap_mpi.c $(srcdir)/prologterms2c.c $(srcdir)/hash.c
FULL_PATH_PL_SOURCES=
FULL_PATH_HEADERS=$(srcdir)/hash.h $(srcdir)/prologterms2c.h
TAGS: $(C_SOURCES) $(PL_SOURCES) $(HEADERS)
etags --append ../../TAGS $(FULL_PATH_C_SOURCES) $(FULL_PATH_PL_SOURCES) $(FULL_PATH_HEADERS)

View File

@ -64,3 +64,4 @@ install-examples:
distclean: clean
rm -f Makefile

View File

@ -209,6 +209,7 @@ true :- true.
'$swi_current_prolog_flag'(break_level, BreakLevel),
( Breaklevel \= 0 -> true ; '$pred_exists'(halt(_), user) -> halt(0) ; '$halt'(0) ).
'$enter_top_level' :-
flush_output,
'$run_toplevel_hooks',
prompt1(' ?- '),
'$read_toplevel'(Command,Varnames),