diff --git a/Makefile.am b/Makefile.am index 79dee6c..c355c75 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,10 @@ ## Makefile.am for xsystem35 -#SUBDIRS = m4 po libltdl macros modules src -SUBDIRS = po libltdl macros modules src +SUBDIRS = po macros src + +if ENABLE_LTDL +SUBDIRS += libltdl modules +endif ACLOCAL_AMFLAGS = -I macros diff --git a/Makefile.in b/Makefile.in index 8d91388..bd1eaac 100644 --- a/Makefile.in +++ b/Makefile.in @@ -78,6 +78,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@ENABLE_LTDL_TRUE@am__append_1 = libltdl modules subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ @@ -167,7 +168,7 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = po macros src libltdl modules DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -404,9 +405,7 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ - -#SUBDIRS = m4 po libltdl macros modules src -SUBDIRS = po libltdl macros modules src +SUBDIRS = po macros src $(am__append_1) ACLOCAL_AMFLAGS = -I macros EXTRA_DIST = xsystem35.spec all: config.h diff --git a/config.h.in b/config.h.in index c17ea42..db868b1 100644 --- a/config.h.in +++ b/config.h.in @@ -42,6 +42,9 @@ /* Define this if you have gtk+ >= 2.0.0 */ #undef ENABLE_GTK +/* define this if you use ltdl */ +#undef ENABLE_LTDL + /* define this if you use external midi player */ #undef ENABLE_MIDI_EXTPLAYER diff --git a/configure b/configure index 869e30a..893e576 100755 --- a/configure +++ b/configure @@ -639,7 +639,6 @@ ltdl_LIBOBJS am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS -LIBOBJS EXTRALDFLAGS EXTRALIBS EXTRACFLAGS @@ -702,6 +701,7 @@ XGETTEXT GMSGFMT MSGFMT MKINSTALLDIRS +LIBOBJS LTDLOPEN LT_CONFIG_H subdirs @@ -721,6 +721,8 @@ INCLTDL LTDLINCL LTDLDEPS LIBLTDL +ENABLE_LTDL_FALSE +ENABLE_LTDL_TRUE CPP OTOOL64 OTOOL @@ -3328,7 +3330,6 @@ fi for k in macros ; do ACLOCAL="$ACLOCAL -I $k" ; done - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -11894,6 +11895,15 @@ CC="$lt_save_CC" # Only expand once: + if test "x$enable_shared" = xyes; then + ENABLE_LTDL_TRUE= + ENABLE_LTDL_FALSE='#' +else + ENABLE_LTDL_TRUE='#' + ENABLE_LTDL_FALSE= +fi + +if test "x$enable_shared" = xyes; then @@ -11901,24 +11911,7 @@ CC="$lt_save_CC" -case $enable_ltdl_convenience in - no) as_fn_error $? "this package needs a convenience libltdl" "$LINENO" 5 ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; -esac -LIBLTDL='${top_build_prefix}'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la" -LTDLDEPS=$LIBLTDL -LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" - - - - - -# For backwards non-gettext consistent compatibility... -INCLTDL="$LTDLINCL" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which extension is used for runtime loadable modules" >&5 $as_echo_n "checking which extension is used for runtime loadable modules... " >&6; } if ${libltdl_cv_shlibext+:} false; then : $as_echo_n "(cached) " >&6 @@ -12994,90 +12987,124 @@ eval "LTDLOPEN=\"$libname_spec\"" +$as_echo "#define ENABLE_LTDL 1" >>confdefs.h - -if test -f $prefix/lib/libltdl.la; then - lt_save_LDFLAGS="$LDFLAGS" - LDFLAGS="-L$prefix/lib $LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dlinit in -lltdl" >&5 -$as_echo_n "checking for lt_dlinit in -lltdl... " >&6; } -if ${ac_cv_lib_ltdl_lt_dlinit+:} false; then : - $as_echo_n "(cached) " >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lltdl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char lt_dlinit (); -int -main () -{ -return lt_dlinit (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_ltdl_lt_dlinit=yes -else - ac_cv_lib_ltdl_lt_dlinit=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_ltdl_lt_dlinit" >&5 -$as_echo "$ac_cv_lib_ltdl_lt_dlinit" >&6; } -if test "x$ac_cv_lib_ltdl_lt_dlinit" = xyes; then : - lt_lib_ltdl=yes + +# Check whether --enable-ltdl-install was given. +if test "${enable_ltdl_install+set}" = set; then : + enableval=$enable_ltdl_install; fi - LDFLAGS="$lt_save_LDFLAGS" - if test x"${lt_lib_ltdl-no}" = xyes; then - if test x"$enable_ltdl_install" != xyes; then - # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: not overwriting libltdl at $prefix, force with \`--enable-ltdl-install'" >&5 -$as_echo "$as_me: WARNING: not overwriting libltdl at $prefix, force with \`--enable-ltdl-install'" >&2;} - enable_ltdl_install=no - fi - elif test x"$enable_ltdl_install" = xno; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libltdl not installed, but installation disabled" >&5 -$as_echo "$as_me: WARNING: libltdl not installed, but installation disabled" >&2;} - fi -fi -# If configure.ac declared an installable ltdl, and the user didn't override -# with --disable-ltdl-install, we will install the shipped libltdl. -case $enable_ltdl_install in - no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLDEPS= - LTDLINCL= - ;; - *) enable_ltdl_install=yes - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_build_prefix}'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la" - LTDLDEPS=$LIBLTDL - LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}" - ;; +case ,${enable_ltdl_install},${enable_ltdl_convenience} in + *yes*) ;; + *) enable_ltdl_convenience=yes ;; esac + if test x"${enable_ltdl_install-no}" != xno; then + INSTALL_LTDL_TRUE= + INSTALL_LTDL_FALSE='#' +else + INSTALL_LTDL_TRUE='#' + INSTALL_LTDL_FALSE= +fi + + if test x"${enable_ltdl_convenience-no}" != xno; then + CONVENIENCE_LTDL_TRUE= + CONVENIENCE_LTDL_FALSE='#' +else + CONVENIENCE_LTDL_TRUE='#' + CONVENIENCE_LTDL_FALSE= +fi -# For backwards non-gettext consistent compatibility... -INCLTDL="$LTDLINCL" + +# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS +# the user used. This is so that ltdl.h can pick up the parent projects +# config.h file, The first file in AC_CONFIG_HEADERS must contain the +# definitions required by ltdl.c. +# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility). +for ac_header in unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in closedir opendir readdir +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + case " $LIBOBJS " in + *" lt__dirent.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lt__dirent.$ac_objext" + ;; +esac + +fi +done + +for ac_func in strlcat strlcpy +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + case " $LIBOBJS " in + *" lt__strl.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS lt__strl.$ac_objext" + ;; +esac + +fi +done + + + +cat >>confdefs.h <<_ACEOF +#define LT_LIBEXT "$libext" +_ACEOF + + +name= +eval "lt_libprefix=\"$libname_spec\"" + +cat >>confdefs.h <<_ACEOF +#define LT_LIBPREFIX "$lt_libprefix" +_ACEOF + + +name=ltdl +eval "LTDLOPEN=\"$libname_spec\"" + + +fi + MKINSTALLDIRS= if test -n "$ac_aux_dir"; then @@ -18384,7 +18411,7 @@ LIBS="$ac_save_LIBS" if test "x$available_jpeg" = xyes; then $as_echo "#define HAVE_JPEG 1" >>confdefs.h -, + fi if test "x$available_jpeg" = xyes; then @@ -18622,6 +18649,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_LTDL_TRUE}" && test -z "${ENABLE_LTDL_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_LTDL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -18647,6 +18678,15 @@ LT_CONFIG_H=config.h ltdl_LTLIBOBJS=$_ltdl_ltlibobjs +if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then + as_fn_error $? "conditional \"INSTALL_LTDL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then + as_fn_error $? "conditional \"CONVENIENCE_LTDL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +LT_CONFIG_H=config.h if test -z "${HAVE_GTK_TRUE}" && test -z "${HAVE_GTK_FALSE}"; then as_fn_error $? "conditional \"HAVE_GTK\" was never defined. diff --git a/configure.ac b/configure.ac index 29473c0..2ff4489 100644 --- a/configure.ac +++ b/configure.ac @@ -50,11 +50,6 @@ dnl dnl AM_ACLOCAL_INCLUDE(m4) AM_ACLOCAL_INCLUDE(macros) -dnl -dnl add subdirectory for libltdl -dnl -dnl AC_CONFIG_SUBDIRS(libltdl) - dnl dnl Checks for programs. dnl @@ -67,21 +62,15 @@ dnl AC_C_VAR_FUNC dnl dnl Check for libltdl dnl -dnl AC_CONFIG_SUBDIRS(libltdl) LT_INIT([dlopen]) -LT_CONFIG_LTDL_DIR([libltdl]) -_LTDL_CONVENIENCE -LTDL_INIT([]) -AC_SUBST([LTDLINCL]) -AC_SUBST([LIBLTDL]) - -dnl LT_INIT -dnl AC_SUBST(INCLTDL) -dnl AC_SUBST(LIBLTDL) -dnl AC_SUBST(LIBADD_DL) -dnl _LT_CONFIG_LTDL_DIR([m4_default([], [libltdl])]) -_LTDL_INSTALLABLE -dnl LTDL_INIT([]) +AM_CONDITIONAL(ENABLE_LTDL, test "x$enable_shared" = xyes) +if test "x$enable_shared" = xyes; then + LT_CONFIG_LTDL_DIR([libltdl]) + LTDL_INIT + AC_DEFINE(ENABLE_LTDL,1,[define this if you use ltdl]) +else + _LTDL_SETUP +fi dnl dnl Check for gettext @@ -730,7 +719,7 @@ CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" if test "x$available_jpeg" = xyes; then - AC_DEFINE(HAVE_JPEG,1,[Define this if you have libjpeg installed]), + AC_DEFINE(HAVE_JPEG,1,[Define this if you have libjpeg installed]) fi AM_CONDITIONAL(ENABLE_JPEG, test "x$available_jpeg" = xyes) diff --git a/src/cmd2F60.c b/src/cmd2F60.c index 5114ca3..7d0b8e4 100644 --- a/src/cmd2F60.c +++ b/src/cmd2F60.c @@ -22,7 +22,9 @@ /* $Id: cmd2F60.c,v 1.11 2003/01/12 10:48:50 chikama Exp $ */ #include +#ifdef ENABLE_LTDL #include +#endif #include "portab.h" #include "system.h" @@ -40,6 +42,7 @@ void commands2F60() { int fnum = sys_getdw(); /* function number */ entrypoint *function = NULL; +#ifdef ENABLE_LTDL if (dll == NULL) { SYSERROR("No DLL initilized\n"); } @@ -58,6 +61,7 @@ void commands2F60() { (*function)(); return; } +#endif eexit: SYSERROR("Can't continue further scenario.(%d,%d)(%s,%s)\n", type, fnum, dll[type].name, dll[type].function[fnum].name); diff --git a/src/s39ain.c b/src/s39ain.c index 56ca04e..8f4eae0 100644 --- a/src/s39ain.c +++ b/src/s39ain.c @@ -25,7 +25,6 @@ #include #include #include -#include #include "portab.h" #include "system.h" @@ -49,6 +48,7 @@ system39.ain の読み込み */ int s39ain_init(void) { +#ifdef ENABLE_LTDL FILE *fp; long len; char *buf; @@ -211,4 +211,7 @@ int s39ain_init(void) { free(buf); return OK; +#else + return NG; +#endif // ENABLE_LTDL } diff --git a/src/s39ain.h b/src/s39ain.h index 361658a..4445716 100644 --- a/src/s39ain.h +++ b/src/s39ain.h @@ -24,7 +24,12 @@ #ifndef __S39AIN_H__ #define __S39AIN_H__ +#ifdef ENABLE_LTDL #include +#else +typedef void lt_dlhandle; +#endif + #include "portab.h" /* DLL 内関数情報 */