Index: build-aux/m4/buildsys.m4 ================================================================== --- build-aux/m4/buildsys.m4 +++ build-aux/m4/buildsys.m4 @@ -40,10 +40,14 @@ AC_SUBST(CC_DEPENDS, $GCC) AC_SUBST(CXX_DEPENDS, $GXX) AC_SUBST(OBJC_DEPENDS, $GOBJC) AC_SUBST(OBJCXX_DEPENDS, $GOBJCXX) + AMIGA_LIB_LDFLAGS="-nostartfiles" + AC_SUBST(AMIGA_LIB_CFLAGS) + AC_SUBST(AMIGA_LIB_LDFLAGS) + AC_PATH_PROG(TPUT, tput) AS_IF([test x"$TPUT" != x""], [ if x=$($TPUT el 2>/dev/null); then AC_SUBST(TERM_EL, "$x") @@ -97,19 +101,10 @@ AC_SUBST(TERM_SETAF4, "$($TPUT AF 4 2>/dev/null)") AC_SUBST(TERM_SETAF6, "$($TPUT AF 6 2>/dev/null)") fi - ], [ - AC_SUBST(TERM_EL, '\033\133K') - AC_SUBST(TERM_SGR0, '\033\133m') - AC_SUBST(TERM_BOLD, '\033\1331m') - AC_SUBST(TERM_SETAF1, '\033\13331m') - AC_SUBST(TERM_SETAF2, '\033\13332m') - AC_SUBST(TERM_SETAF3, '\033\13333m') - AC_SUBST(TERM_SETAF4, '\033\13334m') - AC_SUBST(TERM_SETAF6, '\033\13336m') ]) ]) AC_CONFIG_COMMANDS_POST([ ${as_echo:="echo"} ${as_me:="configure"}": touching .deps files" @@ -118,10 +113,33 @@ test -f "$DEPSFILE" && rm "$DEPSFILE" touch -t 0001010000 "$DEPSFILE" done ]) ]) + +AC_DEFUN([BUILDSYS_CHECK_IOS], [ + case "$host_os" in + darwin*) + AC_MSG_CHECKING(whether host is iOS) + AC_EGREP_CPP(yes, [ + #include + + #if (defined(TARGET_OS_IPHONE) && \ + TARGET_OS_IPHONE) || \ + (defined(TARGET_OS_SIMULATOR) && \ + TARGET_OS_SIMULATOR) + yes + #endif + ], [ + host_is_ios="yes" + ], [ + host_is_ios="no" + ]) + AC_MSG_RESULT($host_is_ios) + ;; + esac +]) AC_DEFUN([BUILDSYS_PROG_IMPLIB], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_MSG_CHECKING(whether we need an implib) case "$host_os" in @@ -141,10 +159,11 @@ AC_SUBST(PROG_IMPLIB_LDFLAGS) ]) AC_DEFUN([BUILDSYS_SHARED_LIB], [ AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([BUILDSYS_CHECK_IOS]) AC_MSG_CHECKING(for shared library system) case "$host_os" in darwin*) AC_MSG_RESULT(Darwin) @@ -153,14 +172,21 @@ LIB_LDFLAGS_INSTALL_NAME='-Wl,-install_name,${libdir}/$${out%.dylib}.${LIB_MAJOR}.dylib' LIB_PREFIX='lib' LIB_SUFFIX='.dylib' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='-fPIC -DPIC' - PLUGIN_LDFLAGS='-bundle -undefined dynamic_lookup' + PLUGIN_LDFLAGS='-bundle ${PLUGIN_LDFLAGS_BUNDLE_LOADER}' PLUGIN_SUFFIX='.bundle' + AS_IF([test x"$host_is_ios" = x"yes"], [ + LINK_PLUGIN='rm -fr $$out && ${MKDIR_P} $$out && if test -f Info.plist; then ${INSTALL} -m 644 Info.plist $$out/Info.plist; fi && ${LD} -o $$out/$${out%${PLUGIN_SUFFIX}} ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS} && ${CODESIGN} -fs ${CODESIGN_IDENTITY} --timestamp=none $$out' + ], [ + LINK_PLUGIN='rm -fr $$out && ${MKDIR_P} $$out/Contents/MacOS && if test -f Info.plist; then ${INSTALL} -m 644 Info.plist $$out/Contents/Info.plist; fi && ${LD} -o $$out/Contents/MacOS/$${out%${PLUGIN_SUFFIX}} ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS} && ${CODESIGN} -fs ${CODESIGN_IDENTITY} --timestamp=none $$out' + ]) INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib && ${LN_S} -f $${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.dylib ${DESTDIR}${libdir}/$${i%.dylib}.${LIB_MAJOR}.${LIB_MINOR}.dylib' + INSTALL_PLUGIN='&& rm -fr ${DESTDIR}${plugindir}/$$i && cp -R $$i ${DESTDIR}${plugindir}/' + UNINSTALL_PLUGIN='&& rm -fr ${DESTDIR}${plugindir}/$$i' CLEAN_LIB='' ;; mingw* | cygwin*) AC_MSG_RESULT(MinGW / Cygwin) LIB_CFLAGS='' @@ -170,12 +196,15 @@ LIB_SUFFIX='.dll' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.dll' + LINK_PLUGIN='${LD} -o $$out ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}' INSTALL_LIB='&& ${MKDIR_P} ${DESTDIR}${bindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${bindir}/$$i && ${INSTALL} -m 755 $$i.a ${DESTDIR}${libdir}/$$i.a' UNINSTALL_LIB='&& rm -f ${DESTDIR}${bindir}/$$i ${DESTDIR}${libdir}/$$i.a' + INSTALL_PLUGIN='&& ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i' + UNINSTALL_PLUGIN='&& rm -f ${DESTDIR}${plugindir}/$$i' CLEAN_LIB='${SHARED_LIB}.a' ;; openbsd* | mirbsd*) AC_MSG_RESULT(OpenBSD) LIB_CFLAGS='-fPIC -DPIC' @@ -185,12 +214,15 @@ LIB_SUFFIX='.so.${LIB_MAJOR}.${LIB_MINOR}' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='-fPIC -DPIC' PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.so' + LINK_PLUGIN='${LD} -o $$out ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}' INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i' + INSTALL_PLUGIN='&& ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i' + UNINSTALL_PLUGIN='&& rm -f ${DESTDIR}${plugindir}/$$i' CLEAN_LIB='' ;; solaris*) AC_MSG_RESULT(Solaris) LIB_CFLAGS='-fPIC -DPIC' @@ -200,12 +232,15 @@ LIB_SUFFIX='.so' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='-fPIC -DPIC' PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.so' + LINK_PLUGIN='${LD} -o $$out ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}' INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR} && rm -f ${DESTDIR}${libdir}/$$i && ${LN_S} $$i.${LIB_MAJOR}.${LIB_MINOR} ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}' + INSTALL_PLUGIN='&& ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i' + UNINSTALL_PLUGIN='&& rm -f ${DESTDIR}${plugindir}/$$i' CLEAN_LIB='' ;; *-android*) AC_MSG_RESULT(Android) LIB_CFLAGS='-fPIC -DPIC' @@ -215,12 +250,15 @@ LIB_SUFFIX='.so' LDFLAGS_RPATH='' PLUGIN_CFLAGS='-fPIC -DPIC' PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.so' + LINK_PLUGIN='${LD} -o $$out ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}' INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0' + INSTALL_PLUGIN='&& ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i' + UNINSTALL_PLUGIN='&& rm -f ${DESTDIR}${plugindir}/$$i' CLEAN_LIB='' ;; *) AC_MSG_RESULT(ELF) LIB_CFLAGS='-fPIC -DPIC' @@ -230,12 +268,15 @@ LIB_SUFFIX='.so' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' PLUGIN_CFLAGS='-fPIC -DPIC' PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.so' + LINK_PLUGIN='${LD} -o $$out ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}' INSTALL_LIB='&& ${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0 && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} && ${LN_S} -f $$i.${LIB_MAJOR}.${LIB_MINOR}.0 ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='&& rm -f ${DESTDIR}${libdir}/$$i ${DESTDIR}${libdir}/$$i.${LIB_MAJOR} ${DESTDIR}${libdir}/$$i.${LIB_MAJOR}.${LIB_MINOR}.0' + INSTALL_PLUGIN='&& ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i' + UNINSTALL_PLUGIN='&& rm -f ${DESTDIR}${plugindir}/$$i' CLEAN_LIB='' ;; esac AC_SUBST(LIB_CFLAGS) @@ -245,39 +286,31 @@ AC_SUBST(LIB_SUFFIX) AC_SUBST(LDFLAGS_RPATH) AC_SUBST(PLUGIN_CFLAGS) AC_SUBST(PLUGIN_LDFLAGS) AC_SUBST(PLUGIN_SUFFIX) + AC_SUBST(LINK_PLUGIN) AC_SUBST(INSTALL_LIB) AC_SUBST(UNINSTALL_LIB) + AC_SUBST(INSTALL_PLUGIN) + AC_SUBST(UNINSTALL_PLUGIN) AC_SUBST(CLEAN_LIB) ]) AC_DEFUN([BUILDSYS_FRAMEWORK], [ AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([BUILDSYS_CHECK_IOS]) AC_REQUIRE([BUILDSYS_SHARED_LIB]) AC_CHECK_TOOL(CODESIGN, codesign) case "$host_os" in darwin*) - AC_MSG_CHECKING(whether host is iOS) - AC_EGREP_CPP(yes, [ - #include - - #if (defined(TARGET_OS_IPHONE) && \ - TARGET_OS_IPHONE) || \ - (defined(TARGET_OS_SIMULATOR) && \ - TARGET_OS_SIMULATOR) - yes - #endif - ], [ - AC_MSG_RESULT(yes) + AS_IF([test x"$host_is_ios" = x"yes"], [ FRAMEWORK_LDFLAGS='-dynamiclib -current_version ${LIB_MAJOR}.${LIB_MINOR} -compatibility_version ${LIB_MAJOR}' FRAMEWORK_LDFLAGS_INSTALL_NAME='-Wl,-install_name,@executable_path/Frameworks/$$out/$${out%.framework}' ], [ - AC_MSG_RESULT(no) FRAMEWORK_LDFLAGS='-dynamiclib -current_version ${LIB_MAJOR}.${LIB_MINOR} -compatibility_version ${LIB_MAJOR}' FRAMEWORK_LDFLAGS_INSTALL_NAME='-Wl,-install_name,@executable_path/../Frameworks/$$out/$${out%.framework}' ]) AC_SUBST(FRAMEWORK_LDFLAGS) Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -54,19 +54,19 @@ LIB_CFLAGS = @LIB_CFLAGS@ LIB_LDFLAGS = @LIB_LDFLAGS@ LIB_LDFLAGS_INSTALL_NAME = @LIB_LDFLAGS_INSTALL_NAME@ LIB_PREFIX = @LIB_PREFIX@ LIB_SUFFIX = @LIB_SUFFIX@ +AMIGA_LIB_CFLAGS = @AMIGA_LIB_CFLAGS@ +AMIGA_LIB_LDFLAGS = @AMIGA_LIB_LDFLAGS@ PLUGIN_CFLAGS = @PLUGIN_CFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PLUGIN_SUFFIX = @PLUGIN_SUFFIX@ FRAMEWORK_LDFLAGS = @FRAMEWORK_LDFLAGS@ FRAMEWORK_LDFLAGS_INSTALL_NAME = @FRAMEWORK_LDFLAGS_INSTALL_NAME@ CODESIGN = @CODESIGN@ CODESIGN_IDENTITY ?= - -INSTALL_LIB = @INSTALL_LIB@ -UNINSTALL_LIB = @UNINSTALL_LIB@ CLEAN_LIB = @CLEAN_LIB@ AS_DEPENDS = @AS_DEPENDS@ CC_DEPENDS = @CC_DEPENDS@ CXX_DEPENDS = @CXX_DEPENDS@ OBJC_DEPENDS = @OBJC_DEPENDS@ @@ -83,10 +83,11 @@ BUILD_AND_HOST_ARE_DARWIN = @BUILD_AND_HOST_ARE_DARWIN@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ +amigalibdir ?= ${prefix}/libs plugindir ?= ${libdir}/${PACKAGE_NAME} datarootdir = @datarootdir@ datadir = @datadir@ includedir = @includedir@ includesubdir ?= ${PACKAGE_NAME} @@ -108,25 +109,25 @@ OBJS10 = ${OBJS9:.rc=.o} OBJS11 = ${OBJS10:.S=.o} OBJS += ${OBJS11:.xpm=.o} LIB_OBJS = ${OBJS:.o=.lib.o} -MORPHOS_LIB_OBJS = ${OBJS:.o=.moslib.o} +AMIGA_LIB_OBJS = ${OBJS:.o=.amigalib.o} PLUGIN_OBJS = ${OBJS:.o=.plugin.o} MO_FILES = ${LOCALES:.po=.mo} .SILENT: .SUFFIXES: -.SUFFIXES: .beam .c .c.dep .cc .cc.dep .class .cxx .cxx.dep .d .erl .lib.o .java .mo .m .m.dep .mm .mm.dep .moslib.o .o .plugin.o .po .py .pyc .rc .S .S.dep .xpm -.PHONY: all subdirs subdirs-after pre-depend depend install install-includes install-extra uninstall uninstall-extra clean distclean locales ${SUBDIRS} ${SUBDIRS_AFTER} +.SUFFIXES: .amigalib.o .beam .c .c.dep .cc .cc.dep .class .cxx .cxx.dep .d .erl .lib.o .java .mo .m .m.dep .mm .mm.dep .o .plugin.o .po .py .pyc .rc .S .S.dep .xpm +.PHONY: all subdirs subdirs-after pre-depend depend install install-extra uninstall uninstall-extra clean distclean locales copy-headers-into-framework ${SUBDIRS} ${SUBDIRS_AFTER} all: ${MAKE} pre-all ${MAKE} subdirs ${MAKE} depend - ${MAKE} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${FRAMEWORK} ${FRAMEWORK_NOINST} ${MORPHOS_LIB} ${MORPHOS_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} ${JARFILE} locales + ${MAKE} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${FRAMEWORK} ${FRAMEWORK_NOINST} ${AMIGA_LIB} ${AMIGA_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} ${JARFILE} locales ${MAKE} subdirs-after ${MAKE} post-all pre-all post-all: @@ -192,31 +193,31 @@ fi; \ fi .c.c.dep: ${CPP} ${CPPFLAGS} ${CFLAGS} -M $< | \ - sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.moslib.o \1.plugin.o:/' >$@ || \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.amigalib.o \1.plugin.o:/' >$@ || \ { rm -f $@; false; } .cc.cc.dep .cxx.cxx.dep: ${CPP} ${CPPFLAGS} ${CXXFLAGS} -M $< | \ - sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.moslib.o \1.plugin.o:/' >$@ || \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.amigalib.o \1.plugin.o:/' >$@ || \ { rm -f $@; false; } .m.m.dep: ${CPP} ${CPPFLAGS} ${OBJCFLAGS} -M $< | \ - sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.moslib.o \1.plugin.o:/' >$@ || \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.amigalib.o \1.plugin.o:/' >$@ || \ { rm -f $@; false; } .mm.mm.dep: ${CPP} ${CPPFLAGS} ${OBJCPPFLAGS} -M $< | \ - sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.moslib.o \1.plugin.o:/' >$@ || \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.amigalib.o \1.plugin.o:/' >$@ || \ { rm -f $@; false; } .S.S.dep: ${CPP} ${CPPFLAGS} ${ASFLAGS} -M $< | \ - sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.moslib.o \1.plugin.o:/' >$@ || \ + sed 's/^\([^\.]*\)\.o:/\1.o \1.lib.o \1.amigalib.o \1.plugin.o:/' >$@ || \ { rm -f $@; false; } pre-depend: ${PROG} ${PROG_NOINST}: ${EXT_DEPS} ${OBJS} ${OBJS_EXTRA} @@ -252,54 +253,50 @@ else \ ${LINK_FAILED}; \ fi ${FRAMEWORK} ${FRAMEWORK_NOINST}: ${EXT_DEPS} ${LIB_OBJS} ${LIB_OBJS_EXTRA} - rm -fr $@ - ${MKDIR_P} $@ - ${MAKE} INSTALL_INCLUDES_IF_SUBDIR=${includesubdir} INSTALL_INCLUDES_DESTINATION=$$PWD/$@/Headers install-includes - if test -f Info.plist; then \ - i=Info.plist; \ - ${INSTALL_STATUS}; \ - if ${INSTALL} -m 644 $$i $@/$$i; then \ - ${INSTALL_OK}; \ - else \ - ${INSTALL_FAILED}; \ - fi \ - fi - if test -f module.modulemap; then \ - i=module.modulemap; \ - ${INSTALL_STATUS}; \ - if ${MKDIR_P} $@/Modules && ${INSTALL} -m 644 $$i $@/Modules/$$i; then \ - ${INSTALL_OK}; \ - else \ - ${INSTALL_FAILED}; \ - fi \ - fi ${LINK_STATUS} out="$@"; \ - if ${LD} -o $$out/$${out%.framework} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${FRAMEWORK_LDFLAGS} ${FRAMEWORK_LDFLAGS_INSTALL_NAME} ${LDFLAGS} ${FRAMEWORK_LIBS} && ${CODESIGN} -fs ${CODESIGN_IDENTITY} --timestamp=none $$out; then \ + if rm -fr $$out && ${MKDIR_P} $$out && ${MAKE} COPY_HEADERS_IF_SUBDIR=${includesubdir} COPY_HEADERS_DESTINATION=$$PWD/$@/Headers copy-headers-into-framework && if test -f Info.plist; then ${INSTALL} -m 644 Info.plist $$out/Info.plist; fi && if test -f module.modulemap; then ${MKDIR_P} $$out/Modules && ${INSTALL} -m 644 module.modulemap $$out/Modules/module.modulemap; fi && ${LD} -o $$out/$${out%.framework} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${FRAMEWORK_LDFLAGS} ${FRAMEWORK_LDFLAGS_INSTALL_NAME} ${LDFLAGS} ${FRAMEWORK_LIBS} && ${CODESIGN} -fs ${CODESIGN_IDENTITY} --timestamp=none $$out; then \ ${LINK_OK}; \ else \ rm -fr $$out; \ ${LINK_FAILED}; \ fi -${MORPHOS_LIB} ${MORPHOS_LIB_NOINST}: ${EXT_DEPS} ${MORPHOS_LIB_OBJS} ${MORPHOS_LIB_OBJS_EXTRA} +copy-headers-into-framework: + for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ + test x"$$i" = x"" && continue; \ + cd $$i || exit 1; \ + ${MAKE} copy-headers-into-framework || exit $$?; \ + cd .. || exit 1; \ + done + + if test x"${includesubdir}" = x"${COPY_HEADERS_IF_SUBDIR}"; then \ + for i in "" ${INCLUDES}; do \ + test x"$$i" = x"" && continue; \ + ${MKDIR_P} ${COPY_HEADERS_DESTINATION} || exit $$?; \ + ${INSTALL} -m 644 $$i ${COPY_HEADERS_DESTINATION}/$$i || exit $$?; \ + done \ + fi + +${AMIGA_LIB} ${AMIGA_LIB_NOINST}: ${EXT_DEPS} ${AMIGA_LIB_OBJS_START} ${AMIGA_LIB_OBJS} ${AMIGA_LIB_OBJS_EXTRA} ${LINK_STATUS} - if ${LD} -o $@ ${MORPHOS_LIB_OBJS} ${MORPHOS_LIB_OBJS_EXTRA} -nostartfiles ${LDFLAGS} ${LIBS}; then \ + if ${LD} -o $@ ${AMIGA_LIB_OBJS_START} ${AMIGA_LIB_OBJS} ${AMIGA_LIB_OBJS_EXTRA} ${AMIGA_LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi ${PLUGIN} ${PLUGIN_NOINST}: ${EXT_DEPS} ${PLUGIN_OBJS} ${LINK_STATUS} out="$@"; \ - if ${LD} -o $@ ${PLUGIN_OBJS} ${PLUGIN_OBJS_EXTRA} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ + if @LINK_PLUGIN@; then \ ${LINK_OK}; \ else \ + rm -fr $$out; \ ${LINK_FAILED}; \ fi ${STATIC_LIB} ${STATIC_LIB_NOINST}: ${EXT_DEPS} ${OBJS} ${OBJS_EXTRA} ${LINK_STATUS} @@ -413,18 +410,18 @@ if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$<} ${CFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi -.c.moslib.o: - ${COMPILE_MOSLIB_STATUS} +.c.amigalib.o: + ${COMPILE_AMIGA_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${CC} -mbaserel32 ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$<} ${CFLAGS_$@} -c -o $@ $<; then \ - ${COMPILE_MOSLIB_OK}; \ + if ${CC} ${AMIGA_LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$<} ${CFLAGS_$@} -c -o $@ $<; then \ + ${COMPILE_AMIGA_LIB_OK}; \ else \ - ${COMPILE_MOSLIB_FAILED}; \ + ${COMPILE_AMIGA_LIB_FAILED}; \ fi .c.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ @@ -450,18 +447,18 @@ if ${CXX} ${LIB_CFLAGS} ${CXXFLAGS} ${CPPFLAGS} ${CXXFLAGS_$<} ${CXXFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi -.cc.moslib.o .cxx.moslib.o: - ${COMPILE_MOSLIB_STATUS} +.cc.amigalib.o .cxx.amigalib.o: + ${COMPILE_AMIGA_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${CXX} -mbaserel32 ${CXXFLAGS} ${CPPFLAGS} ${CXXFLAGS_$<} ${CXXFLAGS_$@} -c -o $@ $<; then \ - ${COMPILE_MOSLIB_OK}; \ + if ${CXX} ${AMIGA_LIB_CFLAGS} ${CXXFLAGS} ${CPPFLAGS} ${CXXFLAGS_$<} ${CXXFLAGS_$@} -c -o $@ $<; then \ + ${COMPILE_AMIGA_LIB_OK}; \ else \ - ${COMPILE_MOSLIB_FAILED}; \ + ${COMPILE_AMIGA_LIB_FAILED}; \ fi .cc.plugin.o .cxx.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ @@ -525,18 +522,18 @@ if ${OBJC} ${LIB_CFLAGS} ${OBJCFLAGS} ${CPPFLAGS} ${OBJCFLAGS_$<} ${OBJCFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi -.m.moslib.o: - ${COMPILE_MOSLIB_STATUS} +.m.amigalib.o: + ${COMPILE_AMIGA_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${OBJC} -mbaserel32 ${OBJCFLAGS} ${CPPFLAGS} ${OBJCFLAGS_$<} ${OBJCFLAGS_$@} -c -o $@ $<; then \ - ${COMPILE_MOSLIB_OK}; \ + if ${OBJC} ${AMIGA_LIB_CFLAGS} ${OBJCFLAGS} ${CPPFLAGS} ${OBJCFLAGS_$<} ${OBJCFLAGS_$@} -c -o $@ $<; then \ + ${COMPILE_AMIGA_LIB_OK}; \ else \ - ${COMPILE_MOSLIB_FAILED}; \ + ${COMPILE_AMIGA_LIB_FAILED}; \ fi .m.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ @@ -562,18 +559,18 @@ if ${OBJCXX} ${LIB_CFLAGS} ${OBJCXXFLAGS} ${CPPFLAGS} ${OBJCXXFLAGS_$<} ${OBJCXXFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi -.mm.moslib.o: - ${COMPILE_MOSLIB_STATUS} +.mm.amigalib.o: + ${COMPILE_AMIGA_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${OBJCXX} -mbaserel32 ${OBJCXXFLAGS} ${CPPFLAGS} ${OBJCXXFLAGS_$<} ${OBJCXXFLAGS_$@} -c -o $@ $<; then \ - ${COMPILE_MOSLIB_OK}; \ + if ${OBJCXX} ${AMIGA_LIB_CFLAGS} ${OBJCXXFLAGS} ${CPPFLAGS} ${OBJCXXFLAGS_$<} ${OBJCXXFLAGS_$@} -c -o $@ $<; then \ + ${COMPILE_AMIGA_LIB_OK}; \ else \ - ${COMPILE_MOSLIB_FAILED}; \ + ${COMPILE_AMIGA_LIB_FAILED}; \ fi .mm.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ @@ -611,11 +608,11 @@ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi -.S.o .S.moslib.o: +.S.o .S.amigalib.o: ${COMPILE_STATUS} in="$<"; \ out="$@"; \ if ${AS} ${ASFLAGS} ${CPPFLAGS} ${ASFLAGS_$<} ${ASFLAGS_$@} -c -o $@ $<; then \ ${COMPILE_OK}; \ @@ -657,18 +654,18 @@ if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$<} ${CFLAGS_$@} -x c -c -o $@ $<; then \ ${COMPILE_LIB_OK}; \ else \ ${COMPILE_LIB_FAILED}; \ fi -.xpm.moslib.o: - ${COMPILE_MOSLIB_STATUS} +.xpm.amigalib.o: + ${COMPILE_AMIGA_LIB_STATUS} in="$<"; \ out="$@"; \ - if ${CC} -mbasel32 ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$<} ${CFLAGS_$@} -x c -c -o $@ $<; then \ - ${COMPILE_MOSLIB_OK}; \ + if ${CC} ${AMIGA_LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} ${CFLAGS_$<} ${CFLAGS_$@} -x c -c -o $@ $<; then \ + ${COMPILE_AMIGA_LIB_OK}; \ else \ - ${COMPILE_MOSLIB_FAILED}; \ + ${COMPILE_AMIGA_LIB_FAILED}; \ fi .xpm.plugin.o: ${COMPILE_PLUGIN_STATUS} in="$<"; \ out="$@"; \ @@ -687,11 +684,11 @@ done for i in "" ${SHARED_LIB}; do \ test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ - if ${MKDIR_P} ${DESTDIR}${libdir} ${INSTALL_LIB}; then \ + if ${MKDIR_P} ${DESTDIR}${libdir} @INSTALL_LIB@; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done @@ -700,10 +697,20 @@ test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ rm -fr ${DESTDIR}${prefix}/Library/Frameworks/$$i; \ if ${MKDIR_P} ${DESTDIR}${prefix}/Library/Frameworks && cp -R $$i ${DESTDIR}${prefix}/Library/Frameworks/; then \ ${INSTALL_OK}; \ + else \ + ${INSTALL_FAILED}; \ + fi \ + done + + for i in "" ${AMIGA_LIB}; do \ + test x"$$i" = x"" && continue; \ + ${INSTALL_STATUS}; \ + if ${MKDIR_P} ${DESTDIR}${amigalibdir} && ${INSTALL} -m 755 $$i ${DESTDIR}${amigalibdir}/$$i; then \ + ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done @@ -718,11 +725,11 @@ done for i in "" ${PLUGIN}; do \ test x"$$i" = x"" && continue; \ ${INSTALL_STATUS}; \ - if ${MKDIR_P} ${DESTDIR}${plugindir} && ${INSTALL} -m 755 $$i ${DESTDIR}${plugindir}/$$i; then \ + if ${MKDIR_P} ${DESTDIR}${plugindir} @INSTALL_PLUGIN@; then \ ${INSTALL_OK}; \ else \ ${INSTALL_FAILED}; \ fi \ done @@ -777,36 +784,10 @@ else \ ${INSTALL_FAILED}; \ fi \ done -install-includes: - for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ - test x"$$i" = x"" && continue; \ - ${DIR_ENTER}; \ - ${MAKE} install-includes || exit $$?; \ - ${DIR_LEAVE}; \ - done - - if test x"${INSTALL_INCLUDES_IF_SUBDIR}" = x"" -o x"${includesubdir}" = x"${INSTALL_INCLUDES_IF_SUBDIR}"; then \ - if test x"${INSTALL_INCLUDES_DESTINATION}" != x""; then \ - destination="${INSTALL_INCLUDES_DESTINATION}"; \ - else \ - destination="${DESTDIR}${includedir}/${includesubdir}"; \ - fi; \ - \ - for i in "" ${INCLUDES}; do \ - test x"$$i" = x"" && continue; \ - ${INSTALL_STATUS}; \ - if ${MKDIR_P} $$destination && ${INSTALL} -m 644 $$i $$destination/$$i; then \ - ${INSTALL_OK}; \ - else \ - ${INSTALL_FAILED}; \ - fi \ - done; \ - fi - install-extra: uninstall: uninstall-extra for i in "" ${SUBDIRS} ${SUBDIRS_AFTER}; do \ test x"$$i" = x"" && continue; \ @@ -816,11 +797,11 @@ done for i in "" ${SHARED_LIB}; do \ test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${libdir}/$$i; then \ - if : ${UNINSTALL_LIB}; then \ + if : @UNINSTALL_LIB@; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi; \ @@ -834,12 +815,12 @@ else \ ${DELETE_FAILED}; \ fi \ fi \ done - -rmdir ${DESTDIR}${prefix}/Library/Frameworks >/dev/null 2>&1 - -rmdir ${DESTDIR}${prefix}/Library >/dev/null 2>&1 + rmdir ${DESTDIR}${prefix}/Library/Frameworks >/dev/null 2>&1 || true + rmdir ${DESTDIR}${prefix}/Library >/dev/null 2>&1 || true for i in "" ${STATIC_LIB} ${STATIC_PIC_LIB}; do \ test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${libdir}/$$i; then \ if rm -f ${DESTDIR}${libdir}/$$i; then \ @@ -850,19 +831,19 @@ fi \ done for i in "" ${PLUGIN}; do \ test x"$$i" = x"" && continue; \ - if test -f ${DESTDIR}${plugindir}/$$i; then \ - if rm -f ${DESTDIR}${plugindir}/$$i; then \ + if test -e ${DESTDIR}${plugindir}/$$i; then \ + if : @UNINSTALL_PLUGIN@; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ fi \ fi \ done - -rmdir ${DESTDIR}${plugindir} >/dev/null 2>&1 + rmdir ${DESTDIR}${plugindir} >/dev/null 2>&1 || true for i in "" ${DATA}; do \ test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i; then \ if rm -f ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i; then \ @@ -871,11 +852,11 @@ ${DELETE_FAILED}; \ fi \ fi; \ rmdir "$$(dirname ${DESTDIR}${datadir}/${PACKAGE_NAME}/$$i)" >/dev/null 2>&1 || true; \ done - -rmdir ${DESTDIR}${datadir}/${PACKAGE_NAME} >/dev/null 2>&1 + rmdir ${DESTDIR}${datadir}/${PACKAGE_NAME} >/dev/null 2>&1 || true for i in "" ${PROG}; do \ test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${bindir}/$$i; then \ if rm -f ${DESTDIR}${bindir}/$$i; then \ @@ -894,11 +875,11 @@ else \ ${DELETE_FAILED}; \ fi \ fi \ done - -rmdir ${DESTDIR}${includedir}/${includesubdir} >/dev/null 2>&1 + rmdir ${DESTDIR}${includedir}/${includesubdir} >/dev/null 2>&1 || true for i in "" ${MO_FILES}; do \ test x"$$i" = x"" && continue; \ if test -f ${DESTDIR}${localedir}/$${i%.mo}/LC_MESSAGES/${localename}.mo; then \ if rm -f ${DESTDIR}${localedir}/$${i%.mo}/LC_MESSAGES/${localename}.mo; then \ @@ -928,11 +909,11 @@ ${DIR_ENTER}; \ ${MAKE} clean || exit $$?; \ ${DIR_LEAVE}; \ done - for i in "" ${DEPS} ${OBJS} ${OBJS_EXTRA} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${MORPHOS_LIB_OBJS} ${MORPHOS_LIB_OBJS_EXTRA} ${PLUGIN_OBJS} ${PROG} ${PROG_NOINST} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${FRAMEWORK} ${PLUGIN} ${PLUGIN_NOINST} ${CLEAN_LIB} ${MO_FILES} ${CLEAN}; do \ + for i in "" ${DEPS} ${OBJS} ${OBJS_EXTRA} ${LIB_OBJS} ${LIB_OBJS_EXTRA} ${AMIGA_LIB_OBJS} ${AMIGA_LIB_OBJS_EXTRA} ${PLUGIN_OBJS} ${PROG} ${PROG_NOINST} ${SHARED_LIB} ${SHARED_LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${STATIC_PIC_LIB} ${STATIC_PIC_LIB_NOINST} ${FRAMEWORK} ${PLUGIN} ${PLUGIN_NOINST} ${CLEAN_LIB} ${MO_FILES} ${CLEAN}; do \ test x"$$i" = x"" && continue; \ if test -f $$i -o -d $$i; then \ if rm -fr $$i; then \ ${DELETE_OK}; \ else \ @@ -981,13 +962,13 @@ COMPILE_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF2@.@TERM_SGR0@\n" "$<" COMPILE_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF1@!@TERM_SGR0@\n" "$<"; exit $$err COMPILE_LIB_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF3@ (lib)...@TERM_SGR0@\r" "$<" COMPILE_LIB_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF2@ (lib).@TERM_SGR0@\n" "$<" COMPILE_LIB_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF1@ (lib)!@TERM_SGR0@\n" "$<"; exit $$err -COMPILE_MOSLIB_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF3@ (moslib)...@TERM_SGR0@\r" "$<" -COMPILE_MOSLIB_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF2@ (moslib).@TERM_SGR0@\n" "$<" -COMPILE_MOSLIB_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF1@ (moslib)!@TERM_SGR0@\n" "$<"; exit $$err +COMPILE_AMIGA_LIB_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF3@ (Amiga lib)...@TERM_SGR0@\r" "$<" +COMPILE_AMIGA_LIB_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF2@ (Amiga lib).@TERM_SGR0@\n" "$<" +COMPILE_AMIGA_LIB_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF1@ (Amiga lib)!@TERM_SGR0@\n" "$<"; exit $$err COMPILE_PLUGIN_STATUS = printf "@TERM_EL@@TERM_SETAF3@Compiling @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF3@ (plugin)...@TERM_SGR0@\r" "$<" COMPILE_PLUGIN_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully compiled @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF2@ (plugin).@TERM_SGR0@\n" "$<" COMPILE_PLUGIN_FAILED = err=$$?; printf "@TERM_EL@@TERM_SETAF1@Failed to compile @TERM_BOLD@%s@TERM_SGR0@@TERM_SETAF1@ (plugin)!@TERM_SGR0@\n" "$<"; exit $$err LINK_STATUS = printf "@TERM_EL@@TERM_SETAF3@Linking @TERM_BOLD@$@@TERM_SGR0@@TERM_SETAF3@...@TERM_SGR0@\r" LINK_OK = printf "@TERM_EL@@TERM_SETAF2@Successfully linked @TERM_BOLD@$@@TERM_SGR0@@TERM_SETAF2@.@TERM_SGR0@\n"