Index: buildsys.mk.in ================================================================== --- buildsys.mk.in +++ buildsys.mk.in @@ -88,15 +88,18 @@ OBJS7 = ${OBJS6:.mm=.o} OBJS8 = ${OBJS7:.py=.pyc} OBJS9 = ${OBJS8:.xpm=.o} OBJS += ${OBJS9:.S=.o} +LIB_OBJS = ${OBJS:.o=.lib.o} +PLUGIN_OBJS = ${OBJS:.o=.plugin.o} + MO_FILES = ${LOCALES:.po=.mo} .SILENT: .SUFFIXES: -.SUFFIXES: .beam .c .cc .cxx .d .dep .erl .mo .m .mm .o .po .py .pyc .xpm .S +.SUFFIXES: .beam .c .cc .cxx .d .dep .erl .lib.o .mo .m .mm .o .plugin.o .po .py .pyc .xpm .S .PHONY: all subdirs pre-depend depend install install-extra uninstall uninstall-extra clean distclean all: for i in subdirs depend ${STATIC_LIB} ${STATIC_LIB_NOINST} ${LIB} ${LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${PROG} ${PROG_NOINST} locales; do \ ${MAKE} ${MFLAGS} $$i || exit 1; \ @@ -167,28 +170,28 @@ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi -${LIB} ${LIB_NOINST}: ${EXT_DEPS} ${OBJS} +${LIB} ${LIB_NOINST}: ${EXT_DEPS} ${LIB_OBJS} case $@ in \ *.a) \ ${MAKE} ${MFLAGS} STATIC_LIB=${LIB} LIB= $@ || exit 1 \ ;; \ *) \ ${LINK_STATUS}; \ - if ${LD} -o $@ ${OBJS} ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ + if ${LD} -o $@ ${LIB_OBJS} ${LIB_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi \ ;; \ esac -${PLUGIN} ${PLUGIN_NOINST}: ${EXT_DEPS} ${OBJS} +${PLUGIN} ${PLUGIN_NOINST}: ${EXT_DEPS} ${PLUGIN_OBJS} ${LINK_STATUS} - if ${LD} -o $@ ${OBJS} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ + if ${LD} -o $@ ${PLUGIN_OBJS} ${PLUGIN_LDFLAGS} ${LDFLAGS} ${LIBS}; then \ ${LINK_OK}; \ else \ ${LINK_FAILED}; \ fi @@ -208,18 +211,46 @@ if ${CC} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi +.c.lib.o: + ${COMPILE_LIB_STATUS} + if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_LIB_OK}; \ + else \ + ${COMPILE_LIB_FAILED}; \ + fi +.c.plugin.o: + ${COMPILE_PLUGIN_STATUS} + if ${CC} ${PLUGIN_CFLAGS} ${CFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_PLUGIN_OK}; \ + else \ + ${COMPILE_PLUGIN_FAILED}; \ + fi .cc.o .cxx.o: ${COMPILE_STATUS} if ${CXX} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi +.cc.lib.o .cxx.lib.o: + ${COMPILE_LIB_STATUS} + if ${CXX} ${LIB_CFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_LIB_OK}; \ + else \ + ${COMPILE_LIB_FAILED}; \ + fi +.cc.plugin.o .cxx.plugin.o: + ${COMPILE_PLUGIN_STATUS} + if ${CXX} ${PLUGIN_CFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_PLUGIN_OK}; \ + else \ + ${COMPILE_PLUGIN_FAILED}; \ + fi .d.o: ${COMPILE_STATUS} if test x"$(basename ${DC})" = x"dmd"; then \ if ${DC} ${DFLAGS} -c -of$@ $<; then \ @@ -248,18 +279,46 @@ if ${OBJC} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi +.m.lib.o: + ${COMPILE_LIB_STATUS} + if ${OBJC} ${LIB_CFLAGS} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_LIB_OK}; \ + else \ + ${COMPILE_LIB_FAILED}; \ + fi +.m.plugin.o: + ${COMPILE_PLUGIN_STATUS} + if ${OBJC} ${PLUGIN_CFLAGS} ${OBJCFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_PLUGIN_OK}; \ + else \ + ${COMPILE_PLUGIN_FAILED}; \ + fi .mm.o: ${COMPILE_STATUS} if ${OBJCXX} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi +.mm.lib.o: + ${COMPILE_LIB_STATUS} + if ${OBJCXX} ${LIB_CFLAGS} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_LIB_OK}; \ + else \ + ${COMPILE_LIB_FAILED}; \ + fi +.mm.plugin.o: + ${COMPILE_PLUGIN_STATUS} + if ${OBJCXX} ${PLUGIN_CFLAGS} ${OBJCXXFLAGS} ${OBJCFLAGS} ${CXXFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_PLUGIN_OK}; \ + else \ + ${COMPILE_PLUGIN_FAILED}; \ + fi .po.mo: ${COMPILE_STATUS} if ${MSGFMT} -c -o $@ $<; then \ ${COMPILE_OK}; \ @@ -280,18 +339,46 @@ if ${CC} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi +.xpm.lib.o: + ${COMPILE_LIB_STATUS} + if ${CC} ${LIB_CFLAGS} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + ${COMPILE_LIB_OK}; \ + else \ + ${COMPILE_LIB_FAILED}; \ + fi +.xpm.plugin.o: + ${COMPILE_PLUGIN_STATUS} + if ${CC} ${PLUGIN_CFLAGS} ${CFLAGS} ${CPPFLAGS} -x c -c -o $@ $<; then \ + ${COMPILE_PLUGIN_OK}; \ + else \ + ${COMPILE_PLUGIN_FAILED}; \ + fi .S.o: ${COMPILE_STATUS} if ${AS} ${ASFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ ${COMPILE_OK}; \ else \ ${COMPILE_FAILED}; \ fi +.S.lib.o: + ${COMPILE_LIB_STATUS} + if ${AS} ${LIB_CFLAGS} ${ASFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_LIB_OK}; \ + else \ + ${COMPILE_LIB_FAILED}; \ + fi +.S.plugin.o: + ${COMPILE_PLUGIN_STATUS} + if ${AS} ${PLUGIN_CFLAGS} ${ASFLAGS} ${CPPFLAGS} -c -o $@ $<; then \ + ${COMPILE_PLUGIN_OK}; \ + else \ + ${COMPILE_PLUGIN_FAILED}; \ + fi install: ${LIB} ${STATIC_LIB} ${PLUGIN} ${PROG} install-extra for i in ${SUBDIRS}; do \ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} install || exit 1; \ @@ -470,11 +557,11 @@ ${DIR_ENTER}; \ ${MAKE} ${MFLAGS} clean || exit 1; \ ${DIR_LEAVE}; \ done - for i in ${DEPS} ${OBJS} ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${CLEAN_LIB} ${MO_FILES} ${CLEAN}; do \ + for i in ${DEPS} ${OBJS} ${LIB_OBJS} ${PLUGIN_OBJS} ${PROG} ${PROG_NOINST} ${LIB} ${LIB_NOINST} ${STATIC_LIB} ${STATIC_LIB_NOINST} ${PLUGIN} ${PLUGIN_NOINST} ${CLEAN_LIB} ${MO_FILES} ${CLEAN}; do \ if test -f $$i -o -d $$i; then \ if rm -fr $$i; then \ ${DELETE_OK}; \ else \ ${DELETE_FAILED}; \ @@ -505,10 +592,16 @@ DEPEND_OK = printf "\033[K\033[0;32mSuccessfully generated dependencies.\033[0m\n" DEPEND_FAILED = printf "\033[K\033[0;31mFailed to generate dependencies!\033[0m\n"; exit 1 COMPILE_STATUS = printf "\033[K\033[0;33mCompiling \033[1;33m$<\033[0;33m...\033[0m\r" COMPILE_OK = printf "\033[K\033[0;32mSuccessfully compiled \033[1;32m$<\033[0;32m.\033[0m\n" COMPILE_FAILED = printf "\033[K\033[0;31mFailed to compile \033[1;31m$<\033[0;31m!\033[0m\n"; exit 1 +COMPILE_LIB_STATUS = printf "\033[K\033[0;33mCompiling \033[1;33m$<\033[0;33m (lib)...\033[0m\r" +COMPILE_LIB_OK = printf "\033[K\033[0;32mSuccessfully compiled \033[1;32m$<\033[0;32m (lib).\033[0m\n" +COMPILE_LIB_FAILED = printf "\033[K\033[0;31mFailed to compile \033[1;31m$<\033[0;31m (lib)!\033[0m\n"; exit 1 +COMPILE_PLUGIN_STATUS = printf "\033[K\033[0;33mCompiling \033[1;33m$<\033[0;33m (plugin)...\033[0m\r" +COMPILE_PLUGIN_OK = printf "\033[K\033[0;32mSuccessfully compiled \033[1;32m$<\033[0;32m (plugin).\033[0m\n" +COMPILE_PLUGIN_FAILED = printf "\033[K\033[0;31mFailed to compile \033[1;31m$<\033[0;31m (plugin)!\033[0m\n"; exit 1 LINK_STATUS = printf "\033[K\033[0;33mLinking \033[1;33m$@\033[0;33m...\033[0m\r" LINK_OK = printf "\033[K\033[0;32mSuccessfully linked \033[1;32m$@\033[0;32m.\033[0m\n" LINK_FAILED = printf "\033[K\033[0;31mFailed to link \033[1;31m$@\033[0;31m!\033[0m\n"; exit 1 INSTALL_STATUS = printf "\033[K\033[0;33mInstalling \033[1;33m$$i\033[0;33m...\033[0m\r" INSTALL_OK = printf "\033[K\033[0;32mSuccessfully installed \033[1;32m$$i\033[0;32m.\033[0m\n" Index: m4/buildsys.m4 ================================================================== --- m4/buildsys.m4 +++ m4/buildsys.m4 @@ -18,19 +18,10 @@ dnl CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) dnl ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE dnl POSSIBILITY OF SUCH DAMAGE. dnl -AC_DEFUN([BUILDSYS_LIB], [ - AC_ARG_ENABLE(shared, - AS_HELP_STRING([--disable-shared], [don't build shared libraries])) - - AS_IF([test x"$enable_shared" = x"no"], - [BUILDSYS_STATIC_LIB_ONLY], - [BUILDSYS_SHARED_LIB]) -]) - AC_DEFUN([BUILDSYS_PROG_IMPLIB], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_MSG_CHECKING(whether we need an implib) case "$host_os" in cygwin* | mingw*) @@ -53,126 +44,89 @@ AC_REQUIRE([AC_CANONICAL_HOST]) AC_MSG_CHECKING(for shared library system) case "$host_os" in darwin*) AC_MSG_RESULT(Darwin) - LIB_CPPFLAGS='-DPIC' - LIB_CFLAGS='-fPIC' + LIB_CFLAGS='-fPIC -DPIC' LIB_LDFLAGS='-dynamiclib -current_version ${LIB_MAJOR}.${LIB_MINOR} -compatibility_version ${LIB_MAJOR}' LIB_PREFIX='lib' LIB_SUFFIX='.dylib' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' - PLUGIN_CPPFLAGS='-DPIC' - PLUGIN_CFLAGS='-fPIC' + PLUGIN_CFLAGS='-fPIC -DPIC' PLUGIN_LDFLAGS='-bundle -undefined dynamic_lookup' PLUGIN_SUFFIX='.impl' 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' CLEAN_LIB='' ;; solaris*) AC_MSG_RESULT(Solaris) - LIB_CPPFLAGS='-DPIC' - LIB_CFLAGS='-fPIC' - LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}' + LIB_CFLAGS='-fPIC -DPIC' + LIB_LDFLAGS='-shared -Wl,-soname=${LIB}.${LIB_MAJOR}.${LIB_MINOR}' LIB_PREFIX='lib' LIB_SUFFIX='.so' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' - PLUGIN_CPPFLAGS='-DPIC' - PLUGIN_CFLAGS='-fPIC' - PLUGIN_LDFLAGS='-shared -fPIC' + PLUGIN_CFLAGS='-fPIC -DPIC' + PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.so' 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}' CLEAN_LIB='' ;; openbsd* | mirbsd*) AC_MSG_RESULT(OpenBSD) - LIB_CPPFLAGS='-DPIC' - LIB_CFLAGS='-fPIC' - LIB_LDFLAGS='-shared -fPIC' + LIB_CFLAGS='-fPIC -DPIC' + LIB_LDFLAGS='-shared' LIB_PREFIX='lib' LIB_SUFFIX='.so.${LIB_MAJOR}.${LIB_MINOR}' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' - PLUGIN_CPPFLAGS='-DPIC' - PLUGIN_CFLAGS='-fPIC' - PLUGIN_LDFLAGS='-shared -fPIC' + PLUGIN_CFLAGS='-fPIC -DPIC' + PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.so' INSTALL_LIB='${INSTALL} -m 755 $$i ${DESTDIR}${libdir}/$$i' UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i' CLEAN_LIB='' ;; cygwin* | mingw*) AC_MSG_RESULT(Win32) - LIB_CPPFLAGS='-DPIC' LIB_CFLAGS='' LIB_LDFLAGS='-shared -Wl,--out-implib,${LIB}.a' LIB_PREFIX='lib' LIB_SUFFIX='.dll' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' - PLUGIN_CPPFLAGS='' PLUGIN_CFLAGS='' PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.dll' 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' CLEAN_LIB='${LIB}.a' ;; *) AC_MSG_RESULT(GNU) - LIB_CPPFLAGS='-DPIC' - LIB_CFLAGS='-fPIC' - LIB_LDFLAGS='-shared -fPIC -Wl,-soname=${LIB}.${LIB_MAJOR}' + LIB_CFLAGS='-fPIC -DPIC' + LIB_LDFLAGS='-shared -Wl,-soname=${LIB}.${LIB_MAJOR}' LIB_PREFIX='lib' LIB_SUFFIX='.so' LDFLAGS_RPATH='-Wl,-rpath,${libdir}' - PLUGIN_CPPFLAGS='-DPIC' - PLUGIN_CFLAGS='-fPIC' - PLUGIN_LDFLAGS='-shared -fPIC' + PLUGIN_CFLAGS='-fPIC -DPIC' + PLUGIN_LDFLAGS='-shared' PLUGIN_SUFFIX='.so' 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' CLEAN_LIB='' ;; esac - AC_SUBST(LIB_CPPFLAGS) AC_SUBST(LIB_CFLAGS) AC_SUBST(LIB_LDFLAGS) AC_SUBST(LIB_PREFIX) AC_SUBST(LIB_SUFFIX) AC_SUBST(LDFLAGS_RPATH) - AC_SUBST(PLUGIN_CPPFLAGS) AC_SUBST(PLUGIN_CFLAGS) AC_SUBST(PLUGIN_LDFLAGS) AC_SUBST(PLUGIN_SUFFIX) AC_SUBST(INSTALL_LIB) - AC_SUBST(UNINSTALL_LIB) - AC_SUBST(CLEAN_LIB) -]) - -AC_DEFUN([BUILDSYS_STATIC_LIB_ONLY], [ - AC_REQUIRE([AC_PROG_RANLIB]) - AC_PATH_TOOL(AR, ar) - - LIB_CPPFLAGS='' - LIB_CFLAGS='' - LIB_LDFLAGS='' - LIB_PREFIX='lib' - LIB_SUFFIX='.a' - LDFLAGS_RPATH='' - INSTALL_LIB='${INSTALL} -m 644 $$i ${DESTDIR}${libdir}/$$i' - UNINSTALL_LIB='rm -f ${DESTDIR}${libdir}/$$i' - CLEAN_LIB='' - - AC_SUBST(LIB_CPPFLAGS) - AC_SUBST(LIB_CFLAGS) - AC_SUBST(LIB_LDFLAGS) - AC_SUBST(LIB_PREFIX) - AC_SUBST(LIB_SUFFIX) - AC_SUBST(LDFLAGS_RPATH) - AC_SUBST(INSTALL_LIB) AC_SUBST(UNINSTALL_LIB) AC_SUBST(CLEAN_LIB) ]) AC_DEFUN([BUILDSYS_TOUCH_DEPS], [