diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-08-22 05:54:47 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-08-22 05:54:47 +0200 |
commit | 30d8bf3e2835dbb0bf6876a6a1d4dd227ba335a9 (patch) | |
tree | 6e09c7ef38b00e0088104b38152a941e17fbea4e | |
parent | a27b5d46c846f1e593b7ed475c6e315ca2051daf (diff) | |
download | sciteco-30d8bf3e2835dbb0bf6876a6a1d4dd227ba335a9.tar.gz |
automatically build Scintilla as part of SciTECO's build system:
this should simplify building SciTECO for new users
* compiler and archiver are passed down from Autoconf,
so cross-compiling should work transparently
* `make clean` will also clean the Scintilla source tree
* there is no longer any need for "source bundles" as
tar balls also contain Scintilla/Scinterm now
* building from Git is not much more difficult than building
from a tar ball
* The versions of Scintilla/Scinterm embedded as submodules
already contain all the patches necessary (currently none are
necessary), so there's no need to have patch files in the
repository
* INSTALL instructions have been rewritten
* the --with-scintilla and --with-scinterm site-config options
have been kept. But they should be rarely necessary now.
-rw-r--r-- | .gitmodules | 1 | ||||
-rw-r--r-- | INSTALL | 139 | ||||
-rw-r--r-- | Makefile.am | 12 | ||||
-rw-r--r-- | configure.ac | 8 | ||||
-rwxr-xr-x | debian/rules | 10 | ||||
-rwxr-xr-x | distribute | 46 | ||||
-rw-r--r-- | patches/README | 3 | ||||
-rw-r--r-- | scintilla.am | 22 | ||||
-rw-r--r-- | src/Makefile.am | 1 |
9 files changed, 117 insertions, 125 deletions
diff --git a/.gitmodules b/.gitmodules index 2b10380..e7c042b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,4 @@ path = scintilla url = git@github.com:rhaberkorn/scintilla-mirror.git branch = sciteco-dev + ignore = all @@ -15,92 +15,87 @@ SciTECO Build and Runtime Dependencies * Autotools, GNU C/C++ (v4.4 or later) or LLVM/gcc or LLVM/Clang * Glib 2 as a cross-platform runtime library: - https://launchpad.net/~robin-haberkorn/+archive/sciteco - * Scintilla (v3.4.2 to v3.4.4): - http://www.scintilla.org/ - * Curses interface: - * Scinterm (v1.3 or later): - http://foicica.com/scinterm/ + https://developer.gnome.org/glib/ + * When choosing the Curses interface: * NCurses (http://www.gnu.org/software/ncurses/), - PDCurses/XCurses (http://pdcurses.sourceforge.net/) or - PDCurses/Win32a (http://www.projectpluto.com/win32a.htm) + PDCurses/XCurses (http://pdcurses.sourceforge.net/), + PDCurses/Win32a (http://www.projectpluto.com/win32a.htm) or + PDCurses/EMCurses (https://github.com/rhaberkorn/emcurses) * other curses implementations might work as well but are untested - * GTK interface: + * When choosing the GTK interface: * GTK+ 2: http://www.gtk.org/ + * GObject Builder: http://www.jirka.org/gob.html * Groff (only when formatting HTML manuals) * Doxygen (only when generating developer documentation) -When you are building from a source bundle (sciteco-*-bundle.tar.gz), -you will not need to download Scintilla or Scinterm. - -Building from Source Bundle -=========================== - -The easiest way to build SciTECO is by using a source bundle: -1. Make sure you can satisfy all the build dependencies (except - Scintilla/Scinterm which is included in the bundle). -2. Unpack the source bundle. A directory "sciteco-VERSION" will - be created (VERSION is of course the release version you downloaded). -3. Build Scintilla. - For building Scintilla/GTK+ something like this should be sufficient: - # cd sciteco-VERSION/scintilla/gtk - # make - For building Scintilla/Curses something like this should be sufficient: - # cd sciteco-VERSION/scintilla/scinterm - # make - This will create sciteco-VERSION/scintilla/bin/scintilla.a -4. Build SciTECO. - An ordinary Autoconf build system is used, so something like this - should be sufficient: - # cd sciteco-VERSION/sciteco - # ./configure --with-interface=<INTERFACE> - # make - Where <INTERFACE> is the SciTECO interface to use. - It must match the Scintilla interface you have compiled. - For instance if you built Scintilla with Scinterm, you may use the - "ncurses" and "pdcurses" SciTECO interfaces. -5. To install use something like: - # sudo make install -6. You are recommended to use the included "teco.ini" as a starting point for your profile, - so copy it to "~/.teco_ini". +These dependencies are bundles with the SciTECO Git repository +and with source tar balls, so they usually do not have to be +installed by the user manually: -For more details on building Autoconf-based projects refer to the -remainder of this document. + * Scintilla (v3.4.2 to v3.4.4): + http://www.scintilla.org/ + * When choosing the Curses interface: + * Scinterm (v1.3 or later): + http://foicica.com/scinterm/ Building from Source Tar Ball or Repository =========================================== -You may also download a source tarball (sciteco-VERSION.tar.gz) +This is now the only way to build SciTECO from source. +You may either download a source tarball (sciteco-VERSION.tar.gz) or build from a cloned Git repository. -When building from Git, you must first create the ./configure script: -# autoreconf -i +Cloning the Git repository is recommended because SciTECO is not +released often -- the source tarballs you find will probably be +quite outdated. + +When cloning the repository, you should make sure you have initialized +the submodules, so that SciTECO can build a verified and prepared +version of Scintilla/Scinterm autmatically. +Just make sure you have cloned your repository as follows: + + $ git clone https://github.com/rhaberkorn/sciteco.git + $ cd sciteco/ + $ git submodule update --init --recursive + +When building from Git, you must first generate the ./configure +script using Autoconf/Automake: + + $ autoreconf -i + If you are using a source tarball ./configure is already included. +When using a source tarball you do not need to have Autoconf or +Automake installed. + +Now you are ready to configure the build system. +Make sure you have all the build and run-time dependencies +installed mentioned above (except Scintilla/Scinterm which +is bundled with SciTECO by default). +Usually as with other Autoconf projects something like this +is sufficient: + + $ ./configure + +This will configure SciTECO for the ncurses user interface. +The user interface may be changed with the "--with-interface=<INTERFACE>" +option to the ./configure command. +You may use `./configure --help` to get an overview of all available +Autoconf and SciTECO build time options. + +If ./configure runs successfully you may build SciTECO with a simple -The remainder of the build process is similar to building -from a source bundle: - * Get Scintilla and Scinterm. The latter is only required if you - would like to build a Curses version of SciTECO. - * Install Scintilla/Scinterm according to their READMEs. - Usually you unpack Scinterm into a subdirectory of Scintilla - and run make... - * But before that, apply the patches contained in the SciTECO - sources if there are any: patches/*.patch - For instance: - # cd ~/scintilla - # for patch in SCITECO_PATH/patches/*.patch; do - > patch --merge -p2 <$patch - > done - * Build SciTECO just like described above. - If you did not use the same directory layout as the source bundles - do, you may have to specify the - --with-scintilla - and - --with-scinterm - site-configuration (./configure) options to tell SciTECO where - to find Scintilla/Scinterm. - -The remainder of this document are the standard GNU installation -instructions. + $ make + +This will also automatically build Scintilla (and Scinterm if necessary). +To install SciTECO, type something like: + + $ sudo make install + +You are recommended to use the included "teco.ini" as a starting point +for your profile, so copy it to your $HOME directory at "~/.teco_ini". + +For more details on building Autoconf-based projects refer to the +remainder of this document which covers installing Autoconf-based +projects in general. Basic Installation ================== diff --git a/Makefile.am b/Makefile.am index b3aaf24..c019f96 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,13 @@ noinst_HEADERS = compat/bsd/sys/cdefs.h \ compat/bsd/sys/queue.h \ compat/bsd/sys/tree.h -EXTRA_DIST = $(wildcard @top_srcdir@/patches/*.patch) \ - README +EXTRA_DIST = README TODO -EXTRA_DIST += TODO +# Distribute entire scintilla directory and +# do some manual cleanup +EXTRA_DIST += scintilla +dist-hook: + rm -rf `find $(distdir)/scintilla -name *.o` \ + $(distdir)/scintilla/bin/scintilla.a + rm -rf `find $(distdir)/scintilla -name ".git*"` \ + `find $(distdir)/scintilla -name ".hg*"` diff --git a/configure.ac b/configure.ac index 1e13986..8b67de1 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,9 @@ AC_PROG_CC_C99 AC_PROG_GREP AC_PROG_INSTALL +# Required by the Scintilla build process: +AC_CHECK_TOOL(AR, ar) + # Emscripten uses Clang as well AM_CONDITIONAL(CLANG, [$CXX --version | $GREP -E "clang|Emscripten" >/dev/null]) @@ -99,8 +102,8 @@ esac # AC_ARG_WITH(scintilla, AS_HELP_STRING([--with-scintilla=PATH], - [Specify Scintilla's path [default=../scintilla]]), - [SCINTILLA_PATH=$withval], [SCINTILLA_PATH=../scintilla]) + [Specify Scintilla's path [default=./scintilla]]), + [SCINTILLA_PATH=$withval], [SCINTILLA_PATH=./scintilla]) SCINTILLA_PATH=`canonicalize $SCINTILLA_PATH` AC_SUBST(SCINTILLA_PATH) @@ -111,6 +114,7 @@ AC_ARG_WITH(scinterm, [Specify Scinterm's path [default=SCINTILLA_PATH/scinterm]]), [SCINTERM_PATH=$withval], [SCINTERM_PATH=$SCINTILLA_PATH/scinterm]) SCINTERM_PATH=`canonicalize $SCINTERM_PATH` +AC_SUBST(SCINTERM_PATH) AC_ARG_WITH(interface, AS_HELP_STRING([--with-interface=ncurses|pdcurses|emcurses|gtk], diff --git a/debian/rules b/debian/rules index 6c6a679..84c4bc6 100755 --- a/debian/rules +++ b/debian/rules @@ -4,19 +4,17 @@ #export DH_VERBOSE=1 %: - dh $@ -Dsciteco + dh $@ build: dh_testdir - dh_auto_build -Dscintilla/scinterm - dh_auto_configure -Dsciteco -- \ + dh_auto_configure -- \ --enable-bootstrap \ --with-interface=ncurses - dh_auto_build -Dsciteco + dh_auto_build touch $@ clean: dh_testdir - dh_auto_clean -Dscintilla/scinterm - dh_auto_clean -Dsciteco + dh_auto_clean dh_clean @@ -3,39 +3,10 @@ SCITECO_VERSION = 0.6 SCITECO_SRC = sciteco-$(SCITECO_VERSION).tar.gz -SCINTILLA_VERSION = 344 -SCINTILLA_SRC = scintilla$(SCINTILLA_VERSION).tgz - -SCINTERM_VERSION = 1.3 -SCINTERM_SRC = scinterm_$(SCINTERM_VERSION).zip - $(SCITECO_SRC): $(MAKE) dist -$(SCINTILLA_SRC): - wget -O $@ http://prdownloads.sourceforge.net/scintilla/$(SCINTILLA_SRC)?download - -$(SCINTERM_SRC): - wget -O $@ http://foicica.com/scinterm/download/$(SCINTERM_SRC) - -all : $(SCITECO_SRC) bundle debian mingw-binary - -# Create source bundle -bundle : sciteco-$(SCITECO_VERSION)-bundle.tar.gz -sciteco-$(SCITECO_VERSION)-bundle.tar.gz : $(SCITECO_SRC) $(SCINTILLA_SRC) $(SCINTERM_SRC) - mkdir sciteco-$(SCITECO_VERSION)/ - (cd sciteco-$(SCITECO_VERSION)/; \ - tar xzf ../$(SCITECO_SRC); \ - mv sciteco-$(SCITECO_VERSION) sciteco; \ - tar xzf ../$(SCINTILLA_SRC); \ - unzip -d scintilla/ ../$(SCINTERM_SRC); \ - mv scintilla/scinterm_$(SCINTERM_VERSION) scintilla/scinterm; \ - for patch in sciteco/patches/*.patch; do \ - patch --merge -p1 <$$patch; \ - done; \ - ) - tar czf $@ sciteco-$(SCITECO_VERSION)/ - rm -rf sciteco-$(SCITECO_VERSION)/ +all : $(SCITECO_SRC) debian mingw-binary # $(UBUNTU) sets the Ubuntu distribution and fixes the package's # version @@ -43,7 +14,7 @@ debian-prepare: debian-temp/ debian-temp/ : bundle mkdir debian-temp/ (cd debian-temp/; \ - cp ../sciteco-$(SCITECO_VERSION)-bundle.tar.gz \ + cp ../$(SCITECO_SRC) \ sciteco_$(SCITECO_VERSION).orig.tar.gz; \ tar xzf sciteco_$(SCITECO_VERSION).orig.tar.gz; \ cp -r ../debian sciteco-$(SCITECO_VERSION)/; \ @@ -90,11 +61,9 @@ ppa : debian-source ) mingw-binary : sciteco-$(SCITECO_VERSION)-win32.zip -sciteco-$(SCITECO_VERSION)-win32.zip : bundle - tar xzf sciteco-$(SCITECO_VERSION)-bundle.tar.gz - $(MAKE) -C sciteco-$(SCITECO_VERSION)/scintilla/scinterm \ - CXX=i686-w64-mingw32-g++ AR=i686-w64-mingw32-ar - (cd sciteco-$(SCITECO_VERSION)/sciteco; \ +sciteco-$(SCITECO_VERSION)-win32.zip : $(SCITECO_SRC) + tar xzf $(SCITECO_SRC) + (cd sciteco-$(SCITECO_VERSION); \ ./configure --host=i686-w64-mingw32 --prefix=/ \ --with-interface=pdcurses \ --with-default-scitecopath=lib \ @@ -102,7 +71,7 @@ sciteco-$(SCITECO_VERSION)-win32.zip : bundle --enable-html-manual \ CFLAGS="-g -O3" CXXFLAGS="-g -O3"; \ ) - $(MAKE) -C sciteco-$(SCITECO_VERSION)/sciteco \ + $(MAKE) -C sciteco-$(SCITECO_VERSION) \ install DESTDIR=`pwd`/temp-install rm -rf sciteco-$(SCITECO_VERSION)/ i686-w64-mingw32-strip -s temp-install/bin/* @@ -118,7 +87,6 @@ sciteco-$(SCITECO_VERSION)-win32.zip : bundle rm -rf temp-bin/ clean: - rm -rf $(SCITECO_SRC) $(SCINTILLA_SRC) $(SCINTERM_SRC) - rm -rf sciteco-$(SCITECO_VERSION)-bundle.tar.gz + rm -rf $(SCITECO_SRC) rm -rf debian-temp/ rm -rf sciteco-$(SCITECO_VERSION)/ diff --git a/patches/README b/patches/README deleted file mode 100644 index 9ce62c8..0000000 --- a/patches/README +++ /dev/null @@ -1,3 +0,0 @@ -This directory contains Scintilla/Scinterm patches. -Most of them are required for SciTECO to function properly. -Please refer to INSTALL.
\ No newline at end of file diff --git a/scintilla.am b/scintilla.am new file mode 100644 index 0000000..0d408bd --- /dev/null +++ b/scintilla.am @@ -0,0 +1,22 @@ +# Scintilla/Scinterm are cloned as submodules +# of this repository, so we may give a rule +# for building scintilla.a here + +if INTERFACE_GTK +SCINTILLA_MAKE_DIR = @SCINTILLA_PATH@/gtk +else +SCINTILLA_MAKE_DIR = @SCINTERM_PATH@ +endif + +@SCINTILLA_PATH@/bin/scintilla.a : + $(MAKE) -C $(SCINTILLA_MAKE_DIR) \ + CXX=@CXX@ AR=@AR@ + +clean-local-scintilla: + $(MAKE) -C $(SCINTILLA_MAKE_DIR) clean + +# NOTE: using a separate `clean-local-scintilla` +# target allows us to add more custom rules to the +# including Automake file +clean-local: clean-local-scintilla +.PHONY: clean-local-scintilla diff --git a/src/Makefile.am b/src/Makefile.am index 596f398..bab79e7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,5 @@ include $(top_srcdir)/bootstrap.am +include $(top_srcdir)/scintilla.am AM_CFLAGS = -Wall -std=c99 AM_CXXFLAGS = -Wall -Wno-char-subscripts |