fixed some build files

This commit is contained in:
hyunghwan.chung 2018-10-14 10:14:48 +00:00
parent 325297d46a
commit d44b400c4a
5 changed files with 62 additions and 76 deletions

View File

@ -34,13 +34,13 @@ endif
if WIN32 if WIN32
# you must adjust the value of DEFAULT_MODPOSTFIX according # you must adjust the value of DEFAULT_MODPOSTFIX according
# to the first number in -version-info above # to the first number in -version-info above
CPPFLAGS_LIB_COMMON += -DMOO_DEFAULT_PFMODPREFIX=\"libmoo-\" -DMOO_DEFAULT_PFMODPOSTFIX=\"-1.dll\" CPPFLAGS_PFMOD = -DMOO_DEFAULT_PFMODPREFIX=\"libmoo-\" -DMOO_DEFAULT_PFMODPOSTFIX=\"-1.dll\"
else else
CPPFLAGS_LIB_COMMON += -DMOO_DEFAULT_PFMODPREFIX=\"$(libdir)/libmoo-\" CPPFLAGS_PFMOD = -DMOO_DEFAULT_PFMODPREFIX=\"$(libdir)/libmoo-\"
if MACOSX if MACOSX
CPPFLAGS_LIB_COMMON += -DMOO_DEFAULT_PFMODPOSTFIX=\".dylib\" CPPFLAGS_PFMOD += -DMOO_DEFAULT_PFMODPOSTFIX=\".dylib\"
else else
CPPFLAGS_LIB_COMMON += -DMOO_DEFAULT_PFMODPOSTFIX=\".so\" CPPFLAGS_PFMOD += -DMOO_DEFAULT_PFMODPOSTFIX=\".so\"
endif endif
endif endif
@ -116,8 +116,8 @@ endif
bin_PROGRAMS = moo bin_PROGRAMS = moo
moo_SOURCES = main.c moo_SOURCES = main.c
moo_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) moo_CPPFLAGS = $(CPPFLAGS_ALL_COMMON) $(CPPFLAGS_PFMOD)
moo_LDFLAGS = $(LDFLAGS_LIB_COMMON) moo_LDFLAGS = $(LDFLAGS_ALL_COMMON)
moo_LDADD = $(LIBADD_LIB_COMMON) -lmoo $(PTHREAD_LIBS) moo_LDADD = $(LIBADD_LIB_COMMON) -lmoo $(PTHREAD_LIBS)
if ENABLE_STATIC_MODULE if ENABLE_STATIC_MODULE
moo_DEPENDENCIES = libmoo.la moo_DEPENDENCIES = libmoo.la

View File

@ -91,14 +91,9 @@ host_triplet = @host@
@ENABLE_LIBLTDL_TRUE@am__append_1 = $(LTDL_LIBS) @ENABLE_LIBLTDL_TRUE@am__append_1 = $(LTDL_LIBS)
@ENABLE_LIBLTDL_FALSE@am__append_2 = $(DL_LIBS) @ENABLE_LIBLTDL_FALSE@am__append_2 = $(DL_LIBS)
@ENABLE_LIBUNWIND_TRUE@am__append_3 = $(UNWIND_LIBS) @ENABLE_LIBUNWIND_TRUE@am__append_3 = $(UNWIND_LIBS)
@MACOSX_TRUE@@WIN32_FALSE@am__append_4 = -DMOO_DEFAULT_PFMODPOSTFIX=\".dylib\"
# you must adjust the value of DEFAULT_MODPOSTFIX according @MACOSX_FALSE@@WIN32_FALSE@am__append_5 = -DMOO_DEFAULT_PFMODPOSTFIX=\".so\"
# to the first number in -version-info above @ENABLE_STATIC_MODULE_TRUE@am__append_6 = -lmoo-stdio
@WIN32_TRUE@am__append_4 = -DMOO_DEFAULT_PFMODPREFIX=\"libmoo-\" -DMOO_DEFAULT_PFMODPOSTFIX=\"-1.dll\"
@WIN32_FALSE@am__append_5 = -DMOO_DEFAULT_PFMODPREFIX=\"$(libdir)/libmoo-\"
@MACOSX_TRUE@@WIN32_FALSE@am__append_6 = -DMOO_DEFAULT_PFMODPOSTFIX=\".dylib\"
@MACOSX_FALSE@@WIN32_FALSE@am__append_7 = -DMOO_DEFAULT_PFMODPOSTFIX=\".so\"
@ENABLE_STATIC_MODULE_TRUE@am__append_8 = -lmoo-stdio
@ENABLE_STATIC_MODULE_FALSE@libmoo_la_DEPENDENCIES = \ @ENABLE_STATIC_MODULE_FALSE@libmoo_la_DEPENDENCIES = \
@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_5) \ @ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_5) \
@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) \ @ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) \
@ -106,14 +101,14 @@ host_triplet = @host@
@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) \ @ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) \
@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) \ @ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) \
@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) @ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1)
@ENABLE_MOD_CON_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_9 = -lmoo-con @ENABLE_MOD_CON_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_7 = -lmoo-con
@ENABLE_MOD_CON_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_10 = $(abs_builddir)/../mod/libmoo-con.la @ENABLE_MOD_CON_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_8 = $(abs_builddir)/../mod/libmoo-con.la
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_11 = -lmoo-ffi @ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_9 = -lmoo-ffi
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_12 = $(abs_builddir)/../mod/libmoo-ffi.la @ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_10 = $(abs_builddir)/../mod/libmoo-ffi.la
@ENABLE_MOD_SCK_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_13 = -lmoo-sck @ENABLE_MOD_SCK_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_11 = -lmoo-sck
@ENABLE_MOD_SCK_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_14 = $(abs_builddir)/../mod/libmoo-sck.la @ENABLE_MOD_SCK_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_12 = $(abs_builddir)/../mod/libmoo-sck.la
@ENABLE_MOD_X11_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_15 = -lmoo-x11 @ENABLE_MOD_X11_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_13 = -lmoo-x11
@ENABLE_MOD_X11_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_16 = $(abs_builddir)/../mod/libmoo-x11.la @ENABLE_MOD_X11_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_14 = $(abs_builddir)/../mod/libmoo-x11.la
bin_PROGRAMS = moo$(EXEEXT) bin_PROGRAMS = moo$(EXEEXT)
@ENABLE_STATIC_MODULE_FALSE@moo_DEPENDENCIES = $(am__DEPENDENCIES_5) \ @ENABLE_STATIC_MODULE_FALSE@moo_DEPENDENCIES = $(am__DEPENDENCIES_5) \
@ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1) @ENABLE_STATIC_MODULE_FALSE@ $(am__DEPENDENCIES_1)
@ -423,11 +418,19 @@ CPPFLAGS_ALL_COMMON = \
################################################## ##################################################
# MAIN LIBRARY # MAIN LIBRARY
################################################## ##################################################
CPPFLAGS_LIB_COMMON = $(CPPFLAGS_ALL_COMMON) $(am__append_4) \ CPPFLAGS_LIB_COMMON = $(CPPFLAGS_ALL_COMMON)
$(am__append_5) $(am__append_6) $(am__append_7)
LDFLAGS_LIB_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined LDFLAGS_LIB_COMMON = $(LDFLAGS_ALL_COMMON) -version-info 1:0:0 -no-undefined
LIBADD_LIB_COMMON = $(LIBM) $(am__append_1) $(am__append_2) \ LIBADD_LIB_COMMON = $(LIBM) $(am__append_1) $(am__append_2) \
$(am__append_3) $(am__append_3)
@WIN32_FALSE@CPPFLAGS_PFMOD = \
@WIN32_FALSE@ -DMOO_DEFAULT_PFMODPREFIX=\"$(libdir)/libmoo-\" \
@WIN32_FALSE@ $(am__append_4) $(am__append_5)
# you must adjust the value of DEFAULT_MODPOSTFIX according
# to the first number in -version-info above
@WIN32_TRUE@CPPFLAGS_PFMOD = -DMOO_DEFAULT_PFMODPREFIX=\"libmoo-\" \
@WIN32_TRUE@ -DMOO_DEFAULT_PFMODPOSTFIX=\"-1.dll\" \
@WIN32_TRUE@ $(am__append_4) $(am__append_5)
pkginclude_HEADERS = \ pkginclude_HEADERS = \
moo.h \ moo.h \
moo-bct.h \ moo-bct.h \
@ -472,15 +475,15 @@ libmoo_la_SOURCES = \
libmoo_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) libmoo_la_CPPFLAGS = $(CPPFLAGS_LIB_COMMON)
libmoo_la_LDFLAGS = $(LDFLAGS_LIB_COMMON) libmoo_la_LDFLAGS = $(LDFLAGS_LIB_COMMON)
libmoo_la_LIBADD = $(LIBADD_LIB_COMMON) $(am__append_8) \ libmoo_la_LIBADD = $(LIBADD_LIB_COMMON) $(am__append_6) \
$(am__append_9) $(am__append_11) $(am__append_13) \ $(am__append_7) $(am__append_9) $(am__append_11) \
$(am__append_15) $(am__append_13)
@ENABLE_STATIC_MODULE_TRUE@libmoo_la_DEPENDENCIES = $(abs_builddir)/../mod/libmoo-stdio.la \ @ENABLE_STATIC_MODULE_TRUE@libmoo_la_DEPENDENCIES = $(abs_builddir)/../mod/libmoo-stdio.la \
@ENABLE_STATIC_MODULE_TRUE@ $(am__append_10) $(am__append_12) \ @ENABLE_STATIC_MODULE_TRUE@ $(am__append_8) $(am__append_10) \
@ENABLE_STATIC_MODULE_TRUE@ $(am__append_14) $(am__append_16) @ENABLE_STATIC_MODULE_TRUE@ $(am__append_12) $(am__append_14)
moo_SOURCES = main.c moo_SOURCES = main.c
moo_CPPFLAGS = $(CPPFLAGS_LIB_COMMON) moo_CPPFLAGS = $(CPPFLAGS_ALL_COMMON) $(CPPFLAGS_PFMOD)
moo_LDFLAGS = $(LDFLAGS_LIB_COMMON) moo_LDFLAGS = $(LDFLAGS_ALL_COMMON)
moo_LDADD = $(LIBADD_LIB_COMMON) -lmoo $(PTHREAD_LIBS) moo_LDADD = $(LIBADD_LIB_COMMON) -lmoo $(PTHREAD_LIBS)
@ENABLE_STATIC_MODULE_TRUE@moo_DEPENDENCIES = libmoo.la @ENABLE_STATIC_MODULE_TRUE@moo_DEPENDENCIES = libmoo.la
all: moo-cfg.h all: moo-cfg.h

View File

@ -358,6 +358,8 @@ static moo_mmgr_t sys_mmgr =
# define IS_PATH_SEP(c) ((c) == '/') # define IS_PATH_SEP(c) ((c) == '/')
#endif #endif
/* TODO: handle path with a drive letter or in the UNC notation */
#define IS_PATH_ABSOLUTE(x) IS_PATH_SEP(x[0])
static const moo_bch_t* get_base_name (const moo_bch_t* path) static const moo_bch_t* get_base_name (const moo_bch_t* path)
{ {
@ -909,8 +911,10 @@ static void* dl_open (moo_t* moo, const moo_ooch_t* name, int flags)
{ {
moo_oow_t len, i, xlen, dlen; moo_oow_t len, i, xlen, dlen;
/* opening a primitive function module - mostly libmoo-xxxx */ /* opening a primitive function module - mostly libmoo-xxxx.
dlen = moo_copy_bcstr(bufptr, bufcapa, MOO_DEFAULT_PFMODDIR); * if PFMODPREFIX is absolute, never use PFMODDIR */
dlen = IS_PATH_ABSOLUTE(MOO_DEFAULT_PFMODPREFIX)?
0: moo_copy_bcstr(bufptr, bufcapa, MOO_DEFAULT_PFMODDIR);
len = moo_copy_bcstr(&bufptr[dlen], bufcapa - dlen, MOO_DEFAULT_PFMODPREFIX); len = moo_copy_bcstr(&bufptr[dlen], bufcapa - dlen, MOO_DEFAULT_PFMODPREFIX);
len += dlen; len += dlen;
@ -939,11 +943,7 @@ static void* dl_open (moo_t* moo, const moo_ooch_t* name, int flags)
{ {
MOO_DEBUG3 (moo, "Unable to open(ext) PFMOD %hs[%js] - %hs\n", &bufptr[dlen], name, sys_dl_error()); MOO_DEBUG3 (moo, "Unable to open(ext) PFMOD %hs[%js] - %hs\n", &bufptr[dlen], name, sys_dl_error());
#if defined(_WIN32) || defined(__DOS__) || defined(__OS2__) if (dlen > 0)
if (dlen > 0 && bufptr[len] != '/' && bufptr[len != '\\')
#else
if (dlen > 0 && bufptr[len] != '/')
#endif
{ {
handle = sys_dl_openext(&bufptr[0]); handle = sys_dl_openext(&bufptr[0]);
if (handle) goto pfmod_open_ok; if (handle) goto pfmod_open_ok;

View File

@ -9,19 +9,6 @@ CPPFLAGS_COMMON = \
-I$(abs_srcdir)/../lib \ -I$(abs_srcdir)/../lib \
-I$(includedir) -I$(includedir)
if WIN32
# you must adjust the value of DEFAULT_MODPOSTFIX according
# to the first number in -version-info above
CPPFLAGS_COMMON += -DMOO_DEFAULT_PFMODPREFIX=\"libmoo-\" -DMOO_DEFAULT_PFMODPOSTFIX=\"-1.dll\"
else
CPPFLAGS_COMMON += -DMOO_DEFAULT_PFMODPREFIX=\"$(libdir)/libmoo-\"
if MACOSX
CPPFLAGS_COMMON += -DMOO_DEFAULT_PFMODPOSTFIX=\".dylib\"
else
CPPFLAGS_COMMON += -DMOO_DEFAULT_PFMODPOSTFIX=\".so\"
endif
endif
if ENABLE_STATIC_MODULE if ENABLE_STATIC_MODULE
################################################## ##################################################

View File

@ -88,21 +88,14 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
build_triplet = @build@ build_triplet = @build@
host_triplet = @host@ host_triplet = @host@
@ENABLE_MOD_CON_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_1 = libmoo-con.la
# you must adjust the value of DEFAULT_MODPOSTFIX according @ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_2 = libmoo-ffi.la
# to the first number in -version-info above @ENABLE_MOD_SCK_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_3 = libmoo-sck.la
@WIN32_TRUE@am__append_1 = -DMOO_DEFAULT_PFMODPREFIX=\"libmoo-\" -DMOO_DEFAULT_PFMODPOSTFIX=\"-1.dll\" @ENABLE_MOD_X11_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_4 = libmoo-x11.la
@WIN32_FALSE@am__append_2 = -DMOO_DEFAULT_PFMODPREFIX=\"$(libdir)/libmoo-\" @ENABLE_MOD_CON_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_5 = libmoo-con.la
@MACOSX_TRUE@@WIN32_FALSE@am__append_3 = -DMOO_DEFAULT_PFMODPOSTFIX=\".dylib\" @ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_6 = libmoo-ffi.la
@MACOSX_FALSE@@WIN32_FALSE@am__append_4 = -DMOO_DEFAULT_PFMODPOSTFIX=\".so\" @ENABLE_MOD_SCK_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_7 = libmoo-sck.la
@ENABLE_MOD_CON_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_5 = libmoo-con.la @ENABLE_MOD_X11_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_8 = libmoo-x11.la
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_6 = libmoo-ffi.la
@ENABLE_MOD_SCK_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_7 = libmoo-sck.la
@ENABLE_MOD_X11_TRUE@@ENABLE_STATIC_MODULE_TRUE@am__append_8 = libmoo-x11.la
@ENABLE_MOD_CON_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_9 = libmoo-con.la
@ENABLE_MOD_FFI_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_10 = libmoo-ffi.la
@ENABLE_MOD_SCK_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_11 = libmoo-sck.la
@ENABLE_MOD_X11_TRUE@@ENABLE_STATIC_MODULE_FALSE@am__append_12 = libmoo-x11.la
subdir = mod subdir = mod
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_sign.m4 \
@ -435,10 +428,13 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = nostdinc AUTOMAKE_OPTIONS = nostdinc
CPPFLAGS_COMMON = -I$(abs_builddir) -I$(abs_builddir)/../lib \ CPPFLAGS_COMMON = \
-I$(abs_srcdir) -I$(abs_srcdir)/../lib -I$(includedir) \ -I$(abs_builddir) \
$(am__append_1) $(am__append_2) $(am__append_3) \ -I$(abs_builddir)/../lib \
$(am__append_4) -I$(abs_srcdir) \
-I$(abs_srcdir)/../lib \
-I$(includedir)
################################################## ##################################################
# DYNAMIC MODULES # DYNAMIC MODULES
@ -451,13 +447,13 @@ CPPFLAGS_COMMON = -I$(abs_builddir) -I$(abs_builddir)/../lib \
@ENABLE_STATIC_MODULE_TRUE@LDFLAGS_COMMON = -L$(libdir) -version-info 1:0:0 -no-undefined @ENABLE_STATIC_MODULE_TRUE@LDFLAGS_COMMON = -L$(libdir) -version-info 1:0:0 -no-undefined
@ENABLE_STATIC_MODULE_FALSE@LIBADD_COMMON = -lmoo @ENABLE_STATIC_MODULE_FALSE@LIBADD_COMMON = -lmoo
@ENABLE_STATIC_MODULE_TRUE@LIBADD_COMMON = @ENABLE_STATIC_MODULE_TRUE@LIBADD_COMMON =
@ENABLE_STATIC_MODULE_TRUE@noinst_LTLIBRARIES = $(am__append_5) \ @ENABLE_STATIC_MODULE_TRUE@noinst_LTLIBRARIES = $(am__append_1) \
@ENABLE_STATIC_MODULE_TRUE@ $(am__append_6) $(am__append_7) \ @ENABLE_STATIC_MODULE_TRUE@ $(am__append_2) $(am__append_3) \
@ENABLE_STATIC_MODULE_TRUE@ libmoo-stdio.la $(am__append_8) @ENABLE_STATIC_MODULE_TRUE@ libmoo-stdio.la $(am__append_4)
@ENABLE_STATIC_MODULE_FALSE@pkgmodexecdir = $(libdir) @ENABLE_STATIC_MODULE_FALSE@pkgmodexecdir = $(libdir)
@ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = $(am__append_9) \ @ENABLE_STATIC_MODULE_FALSE@pkgmodexec_LTLIBRARIES = $(am__append_5) \
@ENABLE_STATIC_MODULE_FALSE@ $(am__append_10) $(am__append_11) \ @ENABLE_STATIC_MODULE_FALSE@ $(am__append_6) $(am__append_7) \
@ENABLE_STATIC_MODULE_FALSE@ libmoo-stdio.la $(am__append_12) @ENABLE_STATIC_MODULE_FALSE@ libmoo-stdio.la $(am__append_8)
@ENABLE_MOD_CON_TRUE@libmoo_con_la_SOURCES = _con.c _con.h @ENABLE_MOD_CON_TRUE@libmoo_con_la_SOURCES = _con.c _con.h
@ENABLE_MOD_CON_TRUE@libmoo_con_la_CPPFLAGS = $(CPPFLAGS_COMMON) @ENABLE_MOD_CON_TRUE@libmoo_con_la_CPPFLAGS = $(CPPFLAGS_COMMON)
@ENABLE_MOD_CON_TRUE@libmoo_con_la_LDFLAGS = $(LDFLAGS_COMMON) @ENABLE_MOD_CON_TRUE@libmoo_con_la_LDFLAGS = $(LDFLAGS_COMMON)