added the dyncall library detection into configure.ac

This commit is contained in:
hyunghwan.chung
2017-01-10 14:27:31 +00:00
parent 1612143499
commit 808586ca00
42 changed files with 134 additions and 49 deletions

View File

@ -46,7 +46,7 @@ libmoo_console_la_LIBADD = $(LIBADD_COMMON) -ltermcap
libmoo_ffi_la_SOURCES = ffi.c _ffi.h
libmoo_ffi_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libmoo_ffi_la_LDFLAGS = $(LDFLAGS_COMMON)
libmoo_ffi_la_LIBADD = $(LIBADD_COMMON) -ldyncall_s
libmoo_ffi_la_LIBADD = $(LIBADD_COMMON) $(DYNCALL_LIBS)
libmoo_stdio_la_SOURCES = stdio.c _stdio.h
libmoo_stdio_la_CPPFLAGS = $(CPPFLAGS_COMMON)

View File

@ -143,7 +143,8 @@ libmoo_console_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@ENABLE_STATIC_MODULE_FALSE@am_libmoo_console_la_rpath = -rpath \
@ENABLE_STATIC_MODULE_FALSE@ $(pkgmodexecdir)
@ENABLE_STATIC_MODULE_TRUE@am_libmoo_console_la_rpath =
libmoo_ffi_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
libmoo_ffi_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
am_libmoo_ffi_la_OBJECTS = libmoo_ffi_la-ffi.lo
libmoo_ffi_la_OBJECTS = $(am_libmoo_ffi_la_OBJECTS)
libmoo_ffi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@ -250,6 +251,7 @@ DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
DYNCALL_LIBS = @DYNCALL_LIBS@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@ -410,7 +412,7 @@ libmoo_console_la_LIBADD = $(LIBADD_COMMON) -ltermcap
libmoo_ffi_la_SOURCES = ffi.c _ffi.h
libmoo_ffi_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libmoo_ffi_la_LDFLAGS = $(LDFLAGS_COMMON)
libmoo_ffi_la_LIBADD = $(LIBADD_COMMON) -ldyncall_s
libmoo_ffi_la_LIBADD = $(LIBADD_COMMON) $(DYNCALL_LIBS)
libmoo_stdio_la_SOURCES = stdio.c _stdio.h
libmoo_stdio_la_CPPFLAGS = $(CPPFLAGS_COMMON)
libmoo_stdio_la_LDFLAGS = $(LDFLAGS_COMMON)

View File

@ -1,7 +1,7 @@
/*
* $Id$
*
Copyright (c) 2006-2016 Chung, Hyung-Hwan. All rights reserved.
Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions

View File

@ -1,7 +1,7 @@
/*
* $Id$
*
Copyright (c) 2006-2016 Chung, Hyung-Hwan. All rights reserved.
Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions

View File

@ -1,7 +1,7 @@
/*
* $Id$
*
Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved.
Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions

View File

@ -1,7 +1,7 @@
/*
* $Id$
*
Copyright (c) 2006-2016 Chung, Hyung-Hwan. All rights reserved.
Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions

View File

@ -1,7 +1,7 @@
/*
* $Id$
*
Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved.
Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
@ -30,9 +30,11 @@
#include <errno.h>
#include <string.h>
#define HAVE_DYNCALL
#if defined(HAVE_DYNCALL_LIB) && defined(HAVE_DYNCALL_H)
# define USE_DYNCALL
#endif
#if defined(HAVE_DYNCALL)
#if defined(USE_DYNCALL)
# include <dyncall.h>
#endif
@ -54,7 +56,7 @@ static moo_pfrc_t pf_newinstsize (moo_t* moo, moo_ooi_t nargs)
static moo_pfrc_t pf_open (moo_t* moo, moo_ooi_t nargs)
{
#if defined(HAVE_DYNCALL)
#if defined(USE_DYNCALL)
ffi_t* rcv;
moo_oop_t name;
@ -91,13 +93,14 @@ reterr:
return MOO_PF_SUCCESS;
#else
moo_seterrnum (moo, MOO_ENOIMPL);
return MOO_PF_FAILURE;
MOO_STACK_SETRETTOERROR (moo, nargs);
return MOO_PF_SUCCESS;
#endif
}
static moo_pfrc_t pf_close (moo_t* moo, moo_ooi_t nargs)
{
#if defined(HAVE_DYNCALL)
#if defined(USE_DYNCALL)
ffi_t* rcv;
if (nargs != 0)
@ -128,13 +131,14 @@ reterr:
#else
moo_seterrnum (moo, MOO_ENOIMPL);
return MOO_PF_FAILURE;
MOO_STACK_SETRETTOERROR (moo, nargs);
return MOO_PF_SUCCESS;
#endif
}
static moo_pfrc_t pf_call (moo_t* moo, moo_ooi_t nargs)
{
#if defined(HAVE_DYNCALL)
#if defined(USE_DYNCALL)
ffi_t* rcv;
moo_oop_t fun, sig, args;
@ -343,13 +347,14 @@ reterr:
#else
moo_seterrnum (moo, MOO_ENOIMPL);
return MOO_PF_FAILURE;
MOO_STACK_SETRETTOERROR (moo, nargs);
return MOO_PF_SUCCESS;
#endif
}
static moo_pfrc_t pf_getsym (moo_t* moo, moo_ooi_t nargs)
{
#if defined(HAVE_DYNCALL)
#if defined(USE_DYNCALL)
ffi_t* rcv;
moo_oop_t name;
void* sym;
@ -390,7 +395,8 @@ reterr:
#else
moo_seterrnum (moo, MOO_ENOIMPL);
return MOO_PF_FAILURE;
MOO_STACK_SETRETTOERROR (moo, nargs);
return MOO_PF_SUCCESS;
#endif
}

View File

@ -4,10 +4,9 @@
CFLAGS := /D__DOS__ /DMOO_ENABLE_STATIC_MODULE /DNDEBUG /I..\lib
# ffi.c \
SRCS := \
console.c \
ffi.c \
stdio.c
OBJS := $(SRCS:.c=.obj)

View File

@ -1,7 +1,7 @@
/*
* $Id$
*
Copyright (c) 2014-2016 Chung, Hyung-Hwan. All rights reserved.
Copyright (c) 2014-2017 Chung, Hyung-Hwan. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions