# HG changeset patch # User John W. Eaton # Date 1371059450 14400 # Node ID cbfe5d38ff2ccd66862bd71481549e296060a2d9 # Parent ace9dd211c998f660b122f54cbef39dcbf41acef use configure script to generate Makefile diff -r ace9dd211c99 -r cbfe5d38ff2c Makefile --- a/Makefile Mon Jun 10 15:46:00 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,449 +0,0 @@ -# This file is part of MXE. -# See index.html for further information. - -PWD := $(shell pwd) - -## Configuration variables. - -# Set the following configuration variables with a configure script? - -# Current valid values are mingw (cross) and gnu-linux (native). -MXE_SYSTEM := mingw -#MXE_SYSTEM := gnu-linux - -# Set to "no" if doing a cross compile build. -MXE_NATIVE_BUILD := no -#MXE_NATIVE_BUILD := yes - -# Set to "yes" to use the versions of GCC and binutils already -# installed on your system. NOTE: building a copy of GCC for a -# native build does not appear to work correctly yet, so for now you -# must set USE_SYSTEM_GCC to yes if MXE_NATIVE_BUILD is set to yes. -USE_SYSTEM_GCC := no -#USE_SYSTEM_GCC := yes - -# Should match what config.guess prints for your system. -# If cross compiling, you must set it manually. -ifeq ($(MXE_NATIVE_BUILD),yes) - TARGET := $(shell tools/config.guess) -else - TARGET := i686-pc-mingw32 -endif -BUILD_SYSTEM := $(shell tools/config.guess) - -# Enable shared or static libs, or perhaps both. At least one -# package uses --with instead of --enable. Probably it doesn't -# make sense to disable both... -BUILD_SHARED := yes -BUILD_STATIC := no - -USE_PIC_FLAG := no -#USE_PIC_FLAG := yes - -# Attempt to build Octave and dependencies with 64-bit indexing enabled. -ENABLE_64 := no -#ENABLE_64 := yes - -## end of configuration variables. - -ifneq ($(MXE_NATIVE_BUILD),yes) - HOST_AND_BUILD_CONFIGURE_OPTIONS := \ - --host='$(TARGET)' --build='$(BUILD_SYSTEM)' -endif - -# are we doing a native mingw build ? -ifeq ($(MXE_NATIVE_BUILD),yes) - ifeq ($(MXE_SYSTEM),mingw) - MXE_NATIVE_MINGW_BUILD := yes - endif -endif - -# These can't be chosen arbitrarily. The way things are configured now, -# GCC expects to find cross-compiler include files in $(PREFIX)/$(TARGET). -# and it's not clear to me how to change that. -BUILD_TOOLS_PREFIX := $(PWD)/usr -HOST_PREFIX := $(PWD)/usr/$(TARGET) - -ifeq ($(BUILD_SHARED),yes) - ifeq ($(BUILD_STATIC),yes) - ENABLE_SHARED_OR_STATIC := --enable-shared --enable-static - WITH_SHARED_OR_STATIC := --with-shared --with-static - else - ENABLE_SHARED_OR_STATIC := --enable-shared --disable-static - WITH_SHARED_OR_STATIC := --with-shared --without-static - endif -else - ENABLE_SHARED_OR_STATIC := --disable-shared --enable-static - WITH_SHARED_OR_STATIC := --without-shared --with-static -endif - -ifeq ($(USE_PIC_FLAG),yes) - MXE_CC_PICFLAG := -fPIC - MXE_CXX_PICFLAG := -fPIC - MXE_F77_PICFLAG := -fPIC -endif - -JOBS := 1 -SOURCEFORGE_MIRROR := freefr.dl.sourceforge.net -PKG_MIRROR := s3.amazonaws.com/mxe-pkg -PKG_CDN := d1yihgixbnrglp.cloudfront.net - -SHELL := bash - -INSTALL := $(shell ginstall --help >/dev/null 2>&1 && echo g)install -PATCH := $(shell gpatch --help >/dev/null 2>&1 && echo g)patch -SED := $(shell gsed --help >/dev/null 2>&1 && echo g)sed -WGET := wget --no-check-certificate \ - --user-agent=$(shell wget --version | \ - $(SED) -n 's,GNU \(Wget\) \([0-9.]*\).*,\1/\2,p') - -REQUIREMENTS := bash bzip2 gcc $(MAKE) openssl $(PATCH) $(PERL) \ - $(SED) unzip wget xz - -LIBTOOL := libtool -LIBTOOLIZE := libtoolize -BUILD_TOOLS := $(patsubst src/%.mk, %, $(wildcard src/build-*.mk)) -# Building flex for native mingw fails, so disable it. -ifeq ($(MXE_NATIVE_MINGW_BUILD),yes) - BUILD_TOOLS := $(filter-out build-flex, $(BUILD_TOOLS)) -endif - -STAMP_DIR := $(PWD)/installed-packages -MSYS_INFO_DIR := $(PWD)/msys-info -LOG_DIR := $(PWD)/log -TIMESTAMP := $(shell date +%Y%m%d_%H%M%S) -PKG_DIR := $(PWD)/pkg -TMP_DIR = $(PWD)/tmp-$(1) -TOP_DIR := $(PWD) -MAKEFILE := $(TOP_DIR)/Makefile -PKGS := $(filter-out $(BUILD_TOOLS), $(shell $(SED) -n 's/^.* id="\([^"]*\)-package">.*$$/\1/p' '$(TOP_DIR)/index.html')) - -ifeq ($(MXE_NATIVE_MINGW_BUILD),yes) - PATH := $(HOST_PREFIX)/bin:$(PATH) -endif -PATH := $(BUILD_TOOLS_PREFIX)/bin:$(PATH) - -CONFIGURE_CPPFLAGS := CPPFLAGS='-I$(HOST_PREFIX)/include' -CONFIGURE_LDFLAGS := LDFLAGS='-L$(HOST_PREFIX)/lib' - -ifeq ($(MXE_NATIVE_BUILD),yes) - MXE_TOOL_PREFIX := - MXE_AR := ar - MXE_RANLIB := ranlib - MXE_CC := gcc - MXE_CXX := g++ - MXE_F77 := gfortran - MXE_DLLTOOL := dlltool - MXE_NM := nm - MXE_STRIP := strip - ifeq ($(MXE_SYSTEM),mingw) - MXE_WINDRES := windres - else - MXE_WINDRES := true - endif - MXE_PKG_CONFIG := pkg-config - MXE_QMAKE := qmake -else - MXE_TOOL_PREFIX := $(TARGET)- - MXE_AR := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)ar' - MXE_RANLIB := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)ranlib' - MXE_CC := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)gcc' - MXE_CXX := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)g++' - MXE_F77 := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)gfortran' - MXE_DLLTOOL := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)dlltool' - MXE_NM := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)nm' - MXE_STRIP := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)strip' - ifeq ($(MXE_SYSTEM),mingw) - MXE_WINDRES := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)windres' - else - MXE_WINDRES := true - endif - MXE_PKG_CONFIG := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)pkg-config' - MXE_QMAKE := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)qmake' -endif - -ifeq ($(MXE_SYSTEM),mingw) - MAKE_SHARED_FROM_STATIC_OPTIONS := --windowsdll -endif - -HOST_BINDIR := $(HOST_PREFIX)/bin -HOST_LIBDIR := $(HOST_PREFIX)/lib -HOST_INCDIR := $(HOST_PREFIX)/include - -ifeq ($(MXE_SYSTEM),mingw) - ifneq ($(MXE_NATIVE_BUILD),yes) - MSYS_BASE_URL := http://sourceforge.net/projects/mingw/files/MSYS/Base - MSYS_BASE_VER := 1.0.13 - MSYS_BASE_DIR := $(TOP_DIR)/msys-base - MSYS_BASE_PACKAGES := $(addprefix msys-,bash coreutils diffutils file findutils gawk grep gzip less libiconv libintl libmagic make msys-core regex sed tar termcap) - - NOTEPAD_BASE_DIR := $(TOP_DIR)/notepad++ - endif -else - LD_LIBRARY_PATH := '$(HOST_LIBDIR)' - export LD_LIBRARY_PATH - MXE_CPPFLAGS := '-I$(HOST_INCDIR)' - MXE_LDFLAGS := '-L$(HOST_LIBDIR)' -endif - -LN := ln -LN_S := $(LN) -s -LN_SF := $(LN_S) -f -ifeq ($(MXE_SYSTEM),mingw) - ifeq ($(MXE_NATIVE_BUILD),yes) - LN := cp - LN_S := $(LN) - LN_SF := $(LN_S) - endif -endif - -OCTAVE_FORGE_BASE_URL := 'http://sourceforge.net/projects/octave/files/Octave Forge Packages/Individual Package Releases' -OCTAVE_FORGE_PACKAGES := $(addprefix of-,miscellaneous struct optim specfun general signal communications image io statistics control) - -MAKE_SHARED_FROM_STATIC := \ - $(TOP_DIR)/tools/make-shared-from-static $(MAKE_SHARED_FROM_STATIC_OPTIONS) - -CMAKE_TOOLCHAIN_FILE := $(HOST_PREFIX)/share/cmake/mxe-conf.cmake - -# unexport any environment variables that might cause trouble -unexport AR CC CFLAGS C_INCLUDE_PATH CPATH CPLUS_INCLUDE_PATH CPP -unexport CPPFLAGS CROSS CXX CXXCPP CXXFLAGS EXEEXT EXTRA_CFLAGS -unexport EXTRA_LDFLAGS LD LDFLAGS LIBRARY_PATH LIBS NM -unexport OBJC_INCLUDE_PATH PKG_CONFIG QMAKESPEC RANLIB STRIP - -SHORT_PKG_VERSION = \ - $(word 1,$(subst ., ,$($(1)_VERSION))).$(word 2,$(subst ., ,$($(1)_VERSION))) - -UNPACK_ARCHIVE = \ - $(if $(filter %.tgz, $(1)),tar xzf '$(1)', \ - $(if $(filter %.tar.gz, $(1)),tar xzf '$(1)', \ - $(if $(filter %.tar.bz2, $(1)),tar xjf '$(1)', \ - $(if $(filter %.tar.lzma,$(1)),xz -dc -F lzma '$(1)' | tar xf -, \ - $(if $(filter %.tar.xz,$(1)),xz -dc '$(1)' | tar xf -, \ - $(if $(filter %.zip, $(1)),unzip -q '$(1)', \ - $(error Unknown archive format: $(1)))))))) - -UNPACK_PKG_ARCHIVE = \ - $(call UNPACK_ARCHIVE,$(PKG_DIR)/$($(1)_FILE)) - -PKG_CHECKSUM = \ - openssl sha1 '$(PKG_DIR)/$($(1)_FILE)' 2>/dev/null | $(SED) -n 's,^.*\([0-9a-f]\{40\}\)$$,\1,p' - -CHECK_PKG_ARCHIVE = \ - [ '$($(1)_CHECKSUM)' == "`$$(call PKG_CHECKSUM,$(1))`" ] - -DOWNLOAD_PKG_ARCHIVE = \ - mkdir -p '$(PKG_DIR)' && \ - $(if $($(1)_URL_2), \ - ( $(WGET) -T 30 -t 3 -O- '$($(1)_URL)' || \ - $(WGET) -O- '$($(1)_URL_2)' || \ - $(WGET) -O- '$(PKG_MIRROR)/$($(1)_FILE)' || \ - $(WGET) -O- '$(PKG_CDN)/$($(1)_FILE)' ), \ - ( $(WGET) -O- '$($(1)_URL)' || \ - $(WGET) -O- '$(PKG_MIRROR)/$($(1)_FILE)' || \ - $(WGET) -O- '$(PKG_CDN)/$($(1)_FILE)' )) \ - $(if $($(1)_FIX_GZIP), \ - | gzip -d | gzip -9n, \ - ) \ - > '$(PKG_DIR)/$($(1)_FILE)' || rm -f '$(PKG_DIR)/$($(1)_FILE)' - -ifeq ($(IGNORE_SETTINGS),yes) - $(info [ignore settings.mk]) -else ifeq ($(wildcard $(PWD)/settings.mk),$(PWD)/settings.mk) - include $(PWD)/settings.mk -else - $(info [create settings.mk]) - $(shell { \ - echo '#JOBS = $(JOBS)'; \ - echo '#PKGS ='; \ - } >'$(PWD)/settings.mk') -endif - -.PHONY: all -all: octave - -.PHONY: all-packages -all-packages: $(PKGS) - -$(PKGS): $(BUILD_TOOLS) - -.PHONY: msys-base -msys-base: $(MSYS_BASE_PACKAGES) - -.PHONY: octave-forge-packages -octave-forge-packages: $(OCTAVE_FORGE_PACKAGES) - -.PHONY: check-requirements -define CHECK_REQUIREMENT - @if ! $(1) --help &>/dev/null; then \ - echo; \ - echo 'Missing requirement: $(1)'; \ - echo; \ - echo 'Please have a look at "index.html" to ensure'; \ - echo 'that your system meets all requirements.'; \ - echo; \ - exit 1; \ - fi - -endef -define CHECK_REQUIREMENT_VERSION - @if ! $(1) --version | head -1 | grep ' \($(2)\)$$' >/dev/null; then \ - echo; \ - echo 'Wrong version of requirement: $(1)'; \ - echo; \ - echo 'Please have a look at "index.html" to ensure'; \ - echo 'that your system meets all requirements.'; \ - echo; \ - exit 1; \ - fi - -endef -check-requirements: $(STAMP_DIR)/check-requirements -$(STAMP_DIR)/check-requirements: $(MAKEFILE) - @echo '[check requirements]' - $(foreach REQUIREMENT,$(REQUIREMENTS),$(call CHECK_REQUIREMENT,$(REQUIREMENT))) - @[ -d '$(STAMP_DIR)' ] || mkdir -p '$(STAMP_DIR)' - @if test "$(USE_SYSTEM_GCC)" = yes; then \ - $(INSTALL) -d '$(BUILD_TOOLS_PREFIX)/bin' ; \ - $(INSTALL) -m 755 tools/config.guess '$(BUILD_TOOLS_PREFIX)/bin/config.guess' ; \ - $(INSTALL) -m 755 tools/config.sub '$(BUILD_TOOLS_PREFIX)/bin/config.sub' ; \ - fi - @touch '$@' - -define newline - - -endef -$(eval $(subst #,$(newline),$(shell \ - $(SED) -n \ - 's/^.* id="\([A-Za-z0-9_+-]*\)-version">\([^<]*\)<.*$$/\1_VERSION := \2#/p' \ - '$(TOP_DIR)/index.html' \ -))) - -include $(patsubst %,$(TOP_DIR)/src/%.mk,$(BUILD_TOOLS)) -include $(patsubst %,$(TOP_DIR)/src/%.mk,$(PKGS)) - -.PHONY: download -download: $(addprefix download-,$(PKGS)) $(addprefix download-,$(BUILD_TOOLS)) - -define PKG_RULE -.PHONY: download-$(1) -download-$(1): $(addprefix download-,$($(1)_DEPS)) - if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \ - $(call DOWNLOAD_PKG_ARCHIVE,$(1)); \ - $(call CHECK_PKG_ARCHIVE,$(1)) || { echo 'Wrong checksum!'; exit 1; }; \ - fi - -.PHONY: $(1) -$(1): $(STAMP_DIR)/$(1) -$(STAMP_DIR)/$(1): $(TOP_DIR)/src/$(1).mk \ - $(wildcard $(TOP_DIR)/src/$(1)-*.patch) \ - $(wildcard $(TOP_DIR)/src/$(1)-test*) \ - $(addprefix $(STAMP_DIR)/,$($(1)_DEPS)) \ - | check-requirements - @[ -d '$(LOG_DIR)/$(TIMESTAMP)' ] || mkdir -p '$(LOG_DIR)/$(TIMESTAMP)' - @if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \ - echo '[download] $(1)'; \ - touch '$(LOG_DIR)/$(TIMESTAMP)/$(1)-download'; \ - ln -sf '$(TIMESTAMP)/$(1)-download' '$(LOG_DIR)/$(1)-download'; \ - ($(call DOWNLOAD_PKG_ARCHIVE,$(1))) &> '$(LOG_DIR)/$(1)-download'; \ - if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \ - echo; \ - echo 'Wrong checksum of package $(1)!'; \ - echo '------------------------------------------------------------'; \ - tail -n 10 '$(LOG_DIR)/$(1)-download' | $(SED) -n '/./p'; \ - echo '------------------------------------------------------------'; \ - echo '[log] $(LOG_DIR)/$(1)-download'; \ - echo; \ - exit 1; \ - fi; \ - fi - $(if $(value $(1)_BUILD), - @echo '[build] $(1)' - ,) - @touch '$(LOG_DIR)/$(TIMESTAMP)/$(1)' - @ln -sf '$(TIMESTAMP)/$(1)' '$(LOG_DIR)/$(1)' - @if ! (time $(MAKE) -f '$(MAKEFILE)' 'build-only-$(1)') &> '$(LOG_DIR)/$(1)'; then \ - echo; \ - echo 'Failed to build package $(1)!'; \ - echo '------------------------------------------------------------'; \ - tail -n 10 '$(LOG_DIR)/$(1)' | $(SED) -n '/./p'; \ - echo '------------------------------------------------------------'; \ - echo '[log] $(LOG_DIR)/$(1)'; \ - echo; \ - exit 1; \ - fi - @echo '[done] $(1)' - -.PHONY: build-only-$(1) -build-only-$(1): PKG = $(1) -build-only-$(1): - $(if $(value $(1)_BUILD), - rm -rf '$(2)' - mkdir -p '$(2)' - cd '$(2)' && $(call UNPACK_PKG_ARCHIVE,$(1)) - cd '$(2)/$($(1)_SUBDIR)' - $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/$(1)-*.patch)), - (cd '$(2)/$($(1)_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH)) - $$(call $(1)_BUILD,$(2)/$($(1)_SUBDIR),$(TOP_DIR)/src/$(1)-test) - (du -k -d 0 '$(2)' 2>/dev/null || du -k --max-depth 0 '$(2)') | $(SED) -n 's/^\(\S*\).*/du: \1 KiB/p' - rm -rfv '$(2)' - ,) - [ -d '$(STAMP_DIR)' ] || mkdir -p '$(STAMP_DIR)' - touch '$(STAMP_DIR)/$(1)' -endef -$(foreach PKG,$(PKGS),$(eval $(call PKG_RULE,$(PKG),$(call TMP_DIR,$(PKG))))) -$(foreach TOOL,$(BUILD_TOOLS),$(eval $(call PKG_RULE,$(TOOL),$(call TMP_DIR,$(TOOL))))) - -.PHONY: clean -clean: - rm -rf $(call TMP_DIR,*) $(BUILD_TOOLS_PREFIX) - rm -rf $(STAMP_DIR) $(MSYS_INFO_DIR) $(LOG_DIR) - rm -rf $(MSYS_BASE_DIR) $(NOTEPAD_BASE_DIR) - rm -rf native-tools cross-tools octave gnuplot - -.PHONY: clean-pkg -clean-pkg: - rm -f $(patsubst %,'%', \ - $(filter-out \ - $(foreach PKG,$(PKGS),$(PKG_DIR)/$($(PKG)_FILE)), \ - $(wildcard $(PKG_DIR)/*))) - -.PHONY: update -define UPDATE - $(if $(2), - $(if $(filter $(2),$($(1)_IGNORE)), - $(info IGNORED $(1) $(2)), - $(if $(filter $(2),$($(1)_VERSION)), - $(info . $(1) $(2)), - $(info NEW $(1) $($(1)_VERSION) --> $(2)) - $(SED) -i 's/\( id="$(1)-version"\)>[^<]*/\1>$(2)/' '$(TOP_DIR)/index.html' - $(MAKE) -f '$(MAKEFILE)' 'update-checksum-$(1)' \ - || { $(SED) -i 's/\( id="$(1)-version"\)>[^<]*/\1>$($(1)_VERSION)/' '$(TOP_DIR)/index.html'; \ - exit 1; })), - $(error Unable to update version number of package $(1))) - -endef -update: - $(foreach PKG,$(PKGS),$(call UPDATE,$(PKG),$(shell $($(PKG)_UPDATE)))) - -update-checksum-%: - $(call DOWNLOAD_PKG_ARCHIVE,$*) - $(SED) -i 's/^\([^ ]*_CHECKSUM *:=\).*/\1 '"`$(call PKG_CHECKSUM,$*)`"'/' '$(TOP_DIR)/src/$*.mk' - -cleanup-style: - @$(foreach FILE,$(wildcard $(addprefix $(TOP_DIR)/,Makefile index.html CNAME src/*.mk src/*test.* tools/*)),\ - $(SED) ' \ - s/\r//g; \ - s/[ \t]\+$$//; \ - s,^#!/bin/bash$$,#!/usr/bin/env bash,; \ - $(if $(filter %Makefile,$(FILE)),,\ - s/\t/ /g; \ - ) \ - ' < $(FILE) > $(TOP_DIR)/tmp-cleanup-style; \ - diff -u $(FILE) $(TOP_DIR)/tmp-cleanup-style >/dev/null \ - || { echo '[cleanup] $(FILE)'; \ - cp $(TOP_DIR)/tmp-cleanup-style $(FILE); }; \ - rm -f $(TOP_DIR)/tmp-cleanup-style; \ - ) - diff -r ace9dd211c99 -r cbfe5d38ff2c Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.in Wed Jun 12 13:50:50 2013 -0400 @@ -0,0 +1,447 @@ +# This file is part of MXE. +# See index.html for further information. + +PWD := $(shell pwd) + +## Configuration variables. + +# Set the following configuration variables with a configure script? + +# Current valid values are mingw (cross) and gnu-linux (native). +MXE_SYSTEM := @MXE_SYSTEM@ + +# Set to "no" if doing a cross compile build. +MXE_NATIVE_BUILD := @MXE_NATIVE_BUILD@ + +# Set to "yes" to use the versions of GCC and binutils already +# installed on your system. NOTE: building a copy of GCC for a +# native build does not appear to work correctly yet, so for now you +# must set USE_SYSTEM_GCC to yes if MXE_NATIVE_BUILD is set to yes. +USE_SYSTEM_GCC := @USE_SYSTEM_GCC@ + +# Should match what config.guess prints for your system. +# If cross compiling, you must set it manually. +ifeq ($(MXE_NATIVE_BUILD),yes) + TARGET := $(shell tools/config.guess) +else + TARGET := i686-pc-mingw32 +endif +BUILD_SYSTEM := $(shell tools/config.guess) + +# Enable shared or static libs, or perhaps both. At least one +# package uses --with instead of --enable. Probably it doesn't +# make sense to disable both... +BUILD_SHARED := @BUILD_SHARED@ + +USE_PIC_FLAG := @BUILD_STATIC@ + +# Attempt to build Octave and dependencies with 64-bit indexing +# enabled (experimental; requires 64-bit system and compiler). +ENABLE_64 := @ENABLE_64@ + +# Attempt to build LLVM and enable Octave's experimental JIT compiler. +ENABLE_JIT := @ENABLE_JIT@ + +## end of configuration variables. + +ifneq ($(MXE_NATIVE_BUILD),yes) + HOST_AND_BUILD_CONFIGURE_OPTIONS := \ + --host='$(TARGET)' --build='$(BUILD_SYSTEM)' +endif + +# are we doing a native mingw build ? +ifeq ($(MXE_NATIVE_BUILD),yes) + ifeq ($(MXE_SYSTEM),mingw) + MXE_NATIVE_MINGW_BUILD := yes + endif +endif + +# These can't be chosen arbitrarily. The way things are configured now, +# GCC expects to find cross-compiler include files in $(PREFIX)/$(TARGET). +# and it's not clear to me how to change that. +BUILD_TOOLS_PREFIX := $(PWD)/usr +HOST_PREFIX := $(PWD)/usr/$(TARGET) + +ifeq ($(BUILD_SHARED),yes) + ifeq ($(BUILD_STATIC),yes) + ENABLE_SHARED_OR_STATIC := --enable-shared --enable-static + WITH_SHARED_OR_STATIC := --with-shared --with-static + else + ENABLE_SHARED_OR_STATIC := --enable-shared --disable-static + WITH_SHARED_OR_STATIC := --with-shared --without-static + endif +else + ENABLE_SHARED_OR_STATIC := --disable-shared --enable-static + WITH_SHARED_OR_STATIC := --without-shared --with-static +endif + +ifeq ($(USE_PIC_FLAG),yes) + MXE_CC_PICFLAG := -fPIC + MXE_CXX_PICFLAG := -fPIC + MXE_F77_PICFLAG := -fPIC +endif + +JOBS := 1 +SOURCEFORGE_MIRROR := freefr.dl.sourceforge.net +PKG_MIRROR := s3.amazonaws.com/mxe-pkg +PKG_CDN := d1yihgixbnrglp.cloudfront.net + +SHELL := bash + +INSTALL := $(shell ginstall --help >/dev/null 2>&1 && echo g)install +PATCH := $(shell gpatch --help >/dev/null 2>&1 && echo g)patch +SED := $(shell gsed --help >/dev/null 2>&1 && echo g)sed +WGET := wget --no-check-certificate \ + --user-agent=$(shell wget --version | \ + $(SED) -n 's,GNU \(Wget\) \([0-9.]*\).*,\1/\2,p') + +REQUIREMENTS := bash bzip2 gcc $(MAKE) openssl $(PATCH) $(PERL) \ + $(SED) unzip wget xz + +LIBTOOL := libtool +LIBTOOLIZE := libtoolize +BUILD_TOOLS := $(patsubst src/%.mk, %, $(wildcard src/build-*.mk)) +# Building flex for native mingw fails, so disable it. +ifeq ($(MXE_NATIVE_MINGW_BUILD),yes) + BUILD_TOOLS := $(filter-out build-flex, $(BUILD_TOOLS)) +endif + +STAMP_DIR := $(PWD)/installed-packages +MSYS_INFO_DIR := $(PWD)/msys-info +LOG_DIR := $(PWD)/log +TIMESTAMP := $(shell date +%Y%m%d_%H%M%S) +PKG_DIR := $(PWD)/pkg +TMP_DIR = $(PWD)/tmp-$(1) +TOP_DIR := $(PWD) +MAKEFILE := $(TOP_DIR)/Makefile +PKGS := $(filter-out $(BUILD_TOOLS), $(shell $(SED) -n 's/^.* id="\([^"]*\)-package">.*$$/\1/p' '$(TOP_DIR)/index.html')) + +ifeq ($(MXE_NATIVE_MINGW_BUILD),yes) + PATH := $(HOST_PREFIX)/bin:$(PATH) +endif +PATH := $(BUILD_TOOLS_PREFIX)/bin:$(PATH) + +CONFIGURE_CPPFLAGS := CPPFLAGS='-I$(HOST_PREFIX)/include' +CONFIGURE_LDFLAGS := LDFLAGS='-L$(HOST_PREFIX)/lib' + +ifeq ($(MXE_NATIVE_BUILD),yes) + MXE_TOOL_PREFIX := + MXE_AR := ar + MXE_RANLIB := ranlib + MXE_CC := gcc + MXE_CXX := g++ + MXE_F77 := gfortran + MXE_DLLTOOL := dlltool + MXE_NM := nm + MXE_STRIP := strip + ifeq ($(MXE_SYSTEM),mingw) + MXE_WINDRES := windres + else + MXE_WINDRES := true + endif + MXE_PKG_CONFIG := pkg-config + MXE_QMAKE := qmake +else + MXE_TOOL_PREFIX := $(TARGET)- + MXE_AR := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)ar' + MXE_RANLIB := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)ranlib' + MXE_CC := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)gcc' + MXE_CXX := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)g++' + MXE_F77 := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)gfortran' + MXE_DLLTOOL := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)dlltool' + MXE_NM := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)nm' + MXE_STRIP := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)strip' + ifeq ($(MXE_SYSTEM),mingw) + MXE_WINDRES := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)windres' + else + MXE_WINDRES := true + endif + MXE_PKG_CONFIG := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)pkg-config' + MXE_QMAKE := '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)qmake' +endif + +ifeq ($(MXE_SYSTEM),mingw) + MAKE_SHARED_FROM_STATIC_OPTIONS := --windowsdll +endif + +HOST_BINDIR := $(HOST_PREFIX)/bin +HOST_LIBDIR := $(HOST_PREFIX)/lib +HOST_INCDIR := $(HOST_PREFIX)/include + +ifeq ($(MXE_SYSTEM),mingw) + ifneq ($(MXE_NATIVE_BUILD),yes) + MSYS_BASE_URL := http://sourceforge.net/projects/mingw/files/MSYS/Base + MSYS_BASE_VER := 1.0.13 + MSYS_BASE_DIR := $(TOP_DIR)/msys-base + MSYS_BASE_PACKAGES := $(addprefix msys-,bash coreutils diffutils file findutils gawk grep gzip less libiconv libintl libmagic make msys-core regex sed tar termcap) + + NOTEPAD_BASE_DIR := $(TOP_DIR)/notepad++ + endif +else + LD_LIBRARY_PATH := '$(HOST_LIBDIR)' + export LD_LIBRARY_PATH + MXE_CPPFLAGS := '-I$(HOST_INCDIR)' + MXE_LDFLAGS := '-L$(HOST_LIBDIR)' +endif + +LN := ln +LN_S := $(LN) -s +LN_SF := $(LN_S) -f +ifeq ($(MXE_SYSTEM),mingw) + ifeq ($(MXE_NATIVE_BUILD),yes) + LN := cp + LN_S := $(LN) + LN_SF := $(LN_S) + endif +endif + +OCTAVE_FORGE_BASE_URL := 'http://sourceforge.net/projects/octave/files/Octave Forge Packages/Individual Package Releases' +OCTAVE_FORGE_PACKAGES := $(addprefix of-,miscellaneous struct optim specfun general signal communications image io statistics control) + +MAKE_SHARED_FROM_STATIC := \ + $(TOP_DIR)/tools/make-shared-from-static $(MAKE_SHARED_FROM_STATIC_OPTIONS) + +CMAKE_TOOLCHAIN_FILE := $(HOST_PREFIX)/share/cmake/mxe-conf.cmake + +# unexport any environment variables that might cause trouble +unexport AR CC CFLAGS C_INCLUDE_PATH CPATH CPLUS_INCLUDE_PATH CPP +unexport CPPFLAGS CROSS CXX CXXCPP CXXFLAGS EXEEXT EXTRA_CFLAGS +unexport EXTRA_LDFLAGS LD LDFLAGS LIBRARY_PATH LIBS NM +unexport OBJC_INCLUDE_PATH PKG_CONFIG QMAKESPEC RANLIB STRIP + +SHORT_PKG_VERSION = \ + $(word 1,$(subst ., ,$($(1)_VERSION))).$(word 2,$(subst ., ,$($(1)_VERSION))) + +UNPACK_ARCHIVE = \ + $(if $(filter %.tgz, $(1)),tar xzf '$(1)', \ + $(if $(filter %.tar.gz, $(1)),tar xzf '$(1)', \ + $(if $(filter %.tar.bz2, $(1)),tar xjf '$(1)', \ + $(if $(filter %.tar.lzma,$(1)),xz -dc -F lzma '$(1)' | tar xf -, \ + $(if $(filter %.tar.xz,$(1)),xz -dc '$(1)' | tar xf -, \ + $(if $(filter %.zip, $(1)),unzip -q '$(1)', \ + $(error Unknown archive format: $(1)))))))) + +UNPACK_PKG_ARCHIVE = \ + $(call UNPACK_ARCHIVE,$(PKG_DIR)/$($(1)_FILE)) + +PKG_CHECKSUM = \ + openssl sha1 '$(PKG_DIR)/$($(1)_FILE)' 2>/dev/null | $(SED) -n 's,^.*\([0-9a-f]\{40\}\)$$,\1,p' + +CHECK_PKG_ARCHIVE = \ + [ '$($(1)_CHECKSUM)' == "`$$(call PKG_CHECKSUM,$(1))`" ] + +DOWNLOAD_PKG_ARCHIVE = \ + mkdir -p '$(PKG_DIR)' && \ + $(if $($(1)_URL_2), \ + ( $(WGET) -T 30 -t 3 -O- '$($(1)_URL)' || \ + $(WGET) -O- '$($(1)_URL_2)' || \ + $(WGET) -O- '$(PKG_MIRROR)/$($(1)_FILE)' || \ + $(WGET) -O- '$(PKG_CDN)/$($(1)_FILE)' ), \ + ( $(WGET) -O- '$($(1)_URL)' || \ + $(WGET) -O- '$(PKG_MIRROR)/$($(1)_FILE)' || \ + $(WGET) -O- '$(PKG_CDN)/$($(1)_FILE)' )) \ + $(if $($(1)_FIX_GZIP), \ + | gzip -d | gzip -9n, \ + ) \ + > '$(PKG_DIR)/$($(1)_FILE)' || rm -f '$(PKG_DIR)/$($(1)_FILE)' + +ifeq ($(IGNORE_SETTINGS),yes) + $(info [ignore settings.mk]) +else ifeq ($(wildcard $(PWD)/settings.mk),$(PWD)/settings.mk) + include $(PWD)/settings.mk +else + $(info [create settings.mk]) + $(shell { \ + echo '#JOBS = $(JOBS)'; \ + echo '#PKGS ='; \ + } >'$(PWD)/settings.mk') +endif + +.PHONY: all +all: octave + +.PHONY: all-packages +all-packages: $(PKGS) + +$(PKGS): $(BUILD_TOOLS) + +.PHONY: msys-base +msys-base: $(MSYS_BASE_PACKAGES) + +.PHONY: octave-forge-packages +octave-forge-packages: $(OCTAVE_FORGE_PACKAGES) + +.PHONY: check-requirements +define CHECK_REQUIREMENT + @if ! $(1) --help &>/dev/null; then \ + echo; \ + echo 'Missing requirement: $(1)'; \ + echo; \ + echo 'Please have a look at "index.html" to ensure'; \ + echo 'that your system meets all requirements.'; \ + echo; \ + exit 1; \ + fi + +endef +define CHECK_REQUIREMENT_VERSION + @if ! $(1) --version | head -1 | grep ' \($(2)\)$$' >/dev/null; then \ + echo; \ + echo 'Wrong version of requirement: $(1)'; \ + echo; \ + echo 'Please have a look at "index.html" to ensure'; \ + echo 'that your system meets all requirements.'; \ + echo; \ + exit 1; \ + fi + +endef +check-requirements: $(STAMP_DIR)/check-requirements +$(STAMP_DIR)/check-requirements: $(MAKEFILE) + @echo '[check requirements]' + $(foreach REQUIREMENT,$(REQUIREMENTS),$(call CHECK_REQUIREMENT,$(REQUIREMENT))) + @[ -d '$(STAMP_DIR)' ] || mkdir -p '$(STAMP_DIR)' + @if test "$(USE_SYSTEM_GCC)" = yes; then \ + $(INSTALL) -d '$(BUILD_TOOLS_PREFIX)/bin' ; \ + $(INSTALL) -m 755 tools/config.guess '$(BUILD_TOOLS_PREFIX)/bin/config.guess' ; \ + $(INSTALL) -m 755 tools/config.sub '$(BUILD_TOOLS_PREFIX)/bin/config.sub' ; \ + fi + @touch '$@' + +define newline + + +endef +$(eval $(subst #,$(newline),$(shell \ + $(SED) -n \ + 's/^.* id="\([A-Za-z0-9_+-]*\)-version">\([^<]*\)<.*$$/\1_VERSION := \2#/p' \ + '$(TOP_DIR)/index.html' \ +))) + +include $(patsubst %,$(TOP_DIR)/src/%.mk,$(BUILD_TOOLS)) +include $(patsubst %,$(TOP_DIR)/src/%.mk,$(PKGS)) + +.PHONY: download +download: $(addprefix download-,$(PKGS)) $(addprefix download-,$(BUILD_TOOLS)) + +define PKG_RULE +.PHONY: download-$(1) +download-$(1): $(addprefix download-,$($(1)_DEPS)) + if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \ + $(call DOWNLOAD_PKG_ARCHIVE,$(1)); \ + $(call CHECK_PKG_ARCHIVE,$(1)) || { echo 'Wrong checksum!'; exit 1; }; \ + fi + +.PHONY: $(1) +$(1): $(STAMP_DIR)/$(1) +$(STAMP_DIR)/$(1): $(TOP_DIR)/src/$(1).mk \ + $(wildcard $(TOP_DIR)/src/$(1)-*.patch) \ + $(wildcard $(TOP_DIR)/src/$(1)-test*) \ + $(addprefix $(STAMP_DIR)/,$($(1)_DEPS)) \ + | check-requirements + @[ -d '$(LOG_DIR)/$(TIMESTAMP)' ] || mkdir -p '$(LOG_DIR)/$(TIMESTAMP)' + @if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \ + echo '[download] $(1)'; \ + touch '$(LOG_DIR)/$(TIMESTAMP)/$(1)-download'; \ + ln -sf '$(TIMESTAMP)/$(1)-download' '$(LOG_DIR)/$(1)-download'; \ + ($(call DOWNLOAD_PKG_ARCHIVE,$(1))) &> '$(LOG_DIR)/$(1)-download'; \ + if ! $(call CHECK_PKG_ARCHIVE,$(1)); then \ + echo; \ + echo 'Wrong checksum of package $(1)!'; \ + echo '------------------------------------------------------------'; \ + tail -n 10 '$(LOG_DIR)/$(1)-download' | $(SED) -n '/./p'; \ + echo '------------------------------------------------------------'; \ + echo '[log] $(LOG_DIR)/$(1)-download'; \ + echo; \ + exit 1; \ + fi; \ + fi + $(if $(value $(1)_BUILD), + @echo '[build] $(1)' + ,) + @touch '$(LOG_DIR)/$(TIMESTAMP)/$(1)' + @ln -sf '$(TIMESTAMP)/$(1)' '$(LOG_DIR)/$(1)' + @if ! (time $(MAKE) -f '$(MAKEFILE)' 'build-only-$(1)') &> '$(LOG_DIR)/$(1)'; then \ + echo; \ + echo 'Failed to build package $(1)!'; \ + echo '------------------------------------------------------------'; \ + tail -n 10 '$(LOG_DIR)/$(1)' | $(SED) -n '/./p'; \ + echo '------------------------------------------------------------'; \ + echo '[log] $(LOG_DIR)/$(1)'; \ + echo; \ + exit 1; \ + fi + @echo '[done] $(1)' + +.PHONY: build-only-$(1) +build-only-$(1): PKG = $(1) +build-only-$(1): + $(if $(value $(1)_BUILD), + rm -rf '$(2)' + mkdir -p '$(2)' + cd '$(2)' && $(call UNPACK_PKG_ARCHIVE,$(1)) + cd '$(2)/$($(1)_SUBDIR)' + $(foreach PKG_PATCH,$(sort $(wildcard $(TOP_DIR)/src/$(1)-*.patch)), + (cd '$(2)/$($(1)_SUBDIR)' && $(PATCH) -p1 -u) < $(PKG_PATCH)) + $$(call $(1)_BUILD,$(2)/$($(1)_SUBDIR),$(TOP_DIR)/src/$(1)-test) + (du -k -d 0 '$(2)' 2>/dev/null || du -k --max-depth 0 '$(2)') | $(SED) -n 's/^\(\S*\).*/du: \1 KiB/p' + rm -rfv '$(2)' + ,) + [ -d '$(STAMP_DIR)' ] || mkdir -p '$(STAMP_DIR)' + touch '$(STAMP_DIR)/$(1)' +endef +$(foreach PKG,$(PKGS),$(eval $(call PKG_RULE,$(PKG),$(call TMP_DIR,$(PKG))))) +$(foreach TOOL,$(BUILD_TOOLS),$(eval $(call PKG_RULE,$(TOOL),$(call TMP_DIR,$(TOOL))))) + +.PHONY: clean +clean: + rm -rf $(call TMP_DIR,*) $(BUILD_TOOLS_PREFIX) + rm -rf $(STAMP_DIR) $(MSYS_INFO_DIR) $(LOG_DIR) + rm -rf $(MSYS_BASE_DIR) $(NOTEPAD_BASE_DIR) + rm -rf native-tools cross-tools octave gnuplot + +.PHONY: clean-pkg +clean-pkg: + rm -f $(patsubst %,'%', \ + $(filter-out \ + $(foreach PKG,$(PKGS),$(PKG_DIR)/$($(PKG)_FILE)), \ + $(wildcard $(PKG_DIR)/*))) + +.PHONY: update +define UPDATE + $(if $(2), + $(if $(filter $(2),$($(1)_IGNORE)), + $(info IGNORED $(1) $(2)), + $(if $(filter $(2),$($(1)_VERSION)), + $(info . $(1) $(2)), + $(info NEW $(1) $($(1)_VERSION) --> $(2)) + $(SED) -i 's/\( id="$(1)-version"\)>[^<]*/\1>$(2)/' '$(TOP_DIR)/index.html' + $(MAKE) -f '$(MAKEFILE)' 'update-checksum-$(1)' \ + || { $(SED) -i 's/\( id="$(1)-version"\)>[^<]*/\1>$($(1)_VERSION)/' '$(TOP_DIR)/index.html'; \ + exit 1; })), + $(error Unable to update version number of package $(1))) + +endef +update: + $(foreach PKG,$(PKGS),$(call UPDATE,$(PKG),$(shell $($(PKG)_UPDATE)))) + +update-checksum-%: + $(call DOWNLOAD_PKG_ARCHIVE,$*) + $(SED) -i 's/^\([^ ]*_CHECKSUM *:=\).*/\1 '"`$(call PKG_CHECKSUM,$*)`"'/' '$(TOP_DIR)/src/$*.mk' + +cleanup-style: + @$(foreach FILE,$(wildcard $(addprefix $(TOP_DIR)/,Makefile index.html CNAME src/*.mk src/*test.* tools/*)),\ + $(SED) ' \ + s/\r//g; \ + s/[ \t]\+$$//; \ + s,^#!/bin/bash$$,#!/usr/bin/env bash,; \ + $(if $(filter %Makefile,$(FILE)),,\ + s/\t/ /g; \ + ) \ + ' < $(FILE) > $(TOP_DIR)/tmp-cleanup-style; \ + diff -u $(FILE) $(TOP_DIR)/tmp-cleanup-style >/dev/null \ + || { echo '[cleanup] $(FILE)'; \ + cp $(TOP_DIR)/tmp-cleanup-style $(FILE); }; \ + rm -f $(TOP_DIR)/tmp-cleanup-style; \ + ) + diff -r ace9dd211c99 -r cbfe5d38ff2c configure.ac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configure.ac Wed Jun 12 13:50:50 2013 -0400 @@ -0,0 +1,119 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.62]) +AC_INIT([MXE-Octave], [0.0.1], [http://octave.org/bugs.html], [mxe-octave]) + +AC_CONFIG_SRCDIR([src/octave.mk]) +AC_CONFIG_AUX_DIR([tools]) + +### Check for bootstrap tools. This list is probably not complete yet. + +AC_PROG_AWK +AC_PROG_GREP +AC_PROG_LN_S +AC_PROG_MKDIR_P +AC_PROG_INSTALL +AC_PROG_CC +AC_PROG_CPP +AC_PROG_GCC_TRADITIONAL + +dnl PKG_PROG_PKG_CONFIG +dnl OCTAVE_PROG_FIND +dnl OCTAVE_PROG_SED +dnl OCTAVE_PROG_PERL +dnl OCTAVE_PROG_GPERF +dnl OCTAVE_PROG_FLEX +dnl OCTAVE_PROG_BISON +dnl OCTAVE_PROG_MAKEINFO +dnl OCTAVE_PROG_TEXI2DVI +dnl OCTAVE_PROG_TEXI2PDF +dnl OCTAVE_PROG_GHOSTSCRIPT +dnl OCTAVE_PROG_GNUPLOT +dnl OCTAVE_PROG_PAGER +dnl OCTAVE_PROG_PYTHON +dnl OCTAVE_CHECK_LIB_TERMLIB + +### Define the path to the shell on the host system. Most systems will +### ensure /bin/sh is the default shell so this can be safely ignored by +### almost everyone. However, when building for Android, for example, +### this will need to be set. +SHELL_PATH=/bin/sh +AC_ARG_WITH([shell], + [AS_HELP_STRING([--with-shell=SHELL], + [use SHELL as the shell interpreter (default: /bin/sh)])]) +case $with_shell in + no) + AC_MSG_ERROR([A shell interpreter is required]) + ;; + yes | "") + ;; + *) + SHELL_PATH=$with_shell + ;; +esac +AC_DEFINE_UNQUOTED([SHELL_PATH], ["$SHELL_PATH"], + [Define this to be the path to the shell command interpreter.]) + +### If possible, use a 64-bit integer type for array dimensions and indexing. + +ENABLE_64=no +AC_ARG_ENABLE(64, + [AS_HELP_STRING([--enable-64], + [(EXPERIMENTAL) use 64-bit integers for array dimensions and indexing])], + [if test "$enableval" = yes; then ENABLE_64=yes; fi], []) +AC_SUBST(ENABLE_64) + +BUILD_SHARED=yes +AC_ARG_ENABLE(shared, + [AS_HELP_STRING([--disable-shared], [Disable shared libraries])], + [], [if test "$enableval" = no; then BUILD_SHARED=no; fi]) +AC_SUBST(BUILD_SHARED) + +BUILD_STATIC=no +AC_ARG_ENABLE(static, + [AS_HELP_STRING([--enable-static], [Enable static libraries])], + [if test "$enableval" = yes; then BUILD_STATIC=yes; fi], []) +AC_SUBST(BUILD_STATIC) + +ENABLE_JIT=yes +AC_ARG_ENABLE([jit], + [AS_HELP_STRING([--enable-jit], + [(EXPERIMENTAL) enable Octave JIT compiler])], + [if test "$enableval" = yes; then ENABLE_JIT=yes; fi], []) +AC_SUBST(ENABLE_JIT) + +MXE_NATIVE_BUILD=false +AC_ARG_ENABLE([native-build], + [AS_HELP_STRING([--enable-native-build], + [Enable native build (default is cross compile)])], + [if test "$enableval" = yes; then MXE_NATIVE_BUILD=yes; fi], []) +AC_SUBST(MXE_NATIVE_BUILD) + +USE_SYSTEM_GCC=$MXE_NATIVE_BUILD +AC_ARG_ENABLE([system-gcc], + [AS_HELP_STRING([--enable-system-gcc], + [Use GCC already installed on system])], + [if test "$enableval" = yes; then USE_SYSTEM_GCC=yes; fi], []) +AC_SUBST(USE_SYSTEM_GCC) + +USE_PIC_FLAG=no +AC_ARG_ENABLE([pic-flag], + [AS_HELP_STRING([--enable-pic-flag], [Compile with PIC flag])], + [if test "$enableval" = yes; then USE_PIC_FLAG=yes; fi], []) +AC_SUBST(USE_PIC_FLAG) + +### Default is to cross compile for mingw. + +echo $host_alias +if test -n "$host_alias"; then + MXE_SYSTEM=$host_alias +else + MXE_SYSTEM=mingw +fi +AC_SUBST(MXE_SYSTEM) + +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT + +### End of configure. diff -r ace9dd211c99 -r cbfe5d38ff2c src/octave.mk --- a/src/octave.mk Mon Jun 10 15:46:00 2013 -0400 +++ b/src/octave.mk Wed Jun 12 13:50:50 2013 -0400 @@ -7,7 +7,10 @@ $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := octave-$($(PKG)_VERSION).tar.gz $(PKG)_URL := ftp://alpha.gnu.org/gnu/octave/$($(PKG)_FILE) -$(PKG)_DEPS := arpack blas curl fftw fltk fontconfig gcc glpk gnuplot graphicsmagick hdf5 lapack llvm pcre pstoedit qhull qrupdate qscintilla qt readline suitesparse texinfo zlib +$(PKG)_DEPS := arpack blas curl fftw fltk fontconfig gcc glpk gnuplot graphicsmagick hdf5 lapack pcre pstoedit qhull qrupdate qscintilla qt readline suitesparse texinfo zlib +ifeq ($(ENABLE_JIT),yes) + $(PKG)_DEPS += llvm +endif ifeq ($(MXE_NATIVE_BUILD),yes) $(PKG)_CONFIGURE_ENV := LD_LIBRARY_PATH="'$(LD_LIBRARY_PATH)'" diff -r ace9dd211c99 -r cbfe5d38ff2c tools/install-sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/install-sh Wed Jun 12 13:50:50 2013 -0400 @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-11-20.07; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: