diff options
| author | Luke Lee | 2024-03-20 15:01:07 +0800 |
|---|---|---|
| committer | Luke Lee | 2024-03-20 15:08:42 +0800 |
| commit | b6400e7f180d013544b7b226d4bdbf65fbcf2874 (patch) | |
| tree | 48c7ce6533f074b2c06c35558e6f143cd6af05e8 | |
| parent | ef01b634d219bcceda17dcd61024c7a12173b88c (diff) | |
| download | emacs-local-emacs-29.2.tar.gz emacs-local-emacs-29.2.zip | |
Import build scripts from my local-master branchlocal-emacs-29.2
| -rw-r--r-- | _do_tools.env | 12 | ||||
| -rwxr-xr-x | do_build | 26 | ||||
| -rwxr-xr-x | do_clean | 5 | ||||
| -rwxr-xr-x | do_configure | 149 | ||||
| -rwxr-xr-x | do_install | 27 | ||||
| -rwxr-xr-x | do_rebuild | 4 |
6 files changed, 223 insertions, 0 deletions
diff --git a/_do_tools.env b/_do_tools.env new file mode 100644 index 00000000000..1a53bce0d1b --- /dev/null +++ b/_do_tools.env | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | export CC=gcc-11 | ||
| 2 | export CXX=g++-11 | ||
| 3 | |||
| 4 | . ~/bin/16-color.src | ||
| 5 | |||
| 6 | if which ${CC} && which ${CXX} >/dev/null 2>&1; then | ||
| 7 | echo -e ${GREEN}* Using compiler version ${CC} ...${RESTORE} | ||
| 8 | else | ||
| 9 | echo -e ${YELLOW}* Compiler version ${CC} not found, using default version...${RESTORE} | ||
| 10 | export CC=gcc | ||
| 11 | export CXX=g++ | ||
| 12 | fi | ||
diff --git a/do_build b/do_build new file mode 100755 index 00000000000..e4d07c3b98e --- /dev/null +++ b/do_build | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | source _do_tools.env | ||
| 4 | |||
| 5 | COLOR=${GREEN} | ||
| 6 | mkdir -p buildlog | ||
| 7 | CPUNUM=`cat /proc/cpuinfo|egrep ^processor|wc -l` | ||
| 8 | |||
| 9 | echo -e ${COLOR}Making bootstrap using ${CPUNUM} threads ...${RESTORE} | ||
| 10 | #read | ||
| 11 | |||
| 12 | # Add NATIVE_FULL_AOT (ahead of time native compilation) for emacs28 | ||
| 13 | #time make bootstrap NATIVE_FULL_AOT=1 -j 8 2>&1 | tee buildlog/make_bootstrap_`datetime`.log | ||
| 14 | time make bootstrap NATIVE_FULL_AOT=1 -j ${CPUNUM} 2>&1 | tee buildlog/make_bootstrap_`datetime`.log | ||
| 15 | if [ ${PIPESTATUS[0]} -ne 0 ]; then | ||
| 16 | COLOR=${RED} | ||
| 17 | echo -e ${COLOR}Error: build system return fail signal !${RESTORE} | ||
| 18 | fi | ||
| 19 | #time make -j 8 | ||
| 20 | #read | ||
| 21 | |||
| 22 | echo -e ${COLOR}Making autoloads ...${RESTORE} | ||
| 23 | cd lisp | ||
| 24 | { make autoloads NATIVE_FULL_AOT=1 && cd .. | tee ../buildlog/make_lisp_autoloads_`datetime`.log; } && \ | ||
| 25 | echo -e ${COLOR}'Done. You can try running the installation script : "do_install".'${RESTORE} | ||
| 26 | #make install | ||
diff --git a/do_clean b/do_clean new file mode 100755 index 00000000000..de759f41331 --- /dev/null +++ b/do_clean | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | . ~/bin/16-color.src | ||
| 3 | echo -e ${GREEN}Cleanning ...${RESTORE} | ||
| 4 | make distclean | ||
| 5 | find -name *.elc -exec rm -f '{}' \; | ||
diff --git a/do_configure b/do_configure new file mode 100755 index 00000000000..7efb02a4fa4 --- /dev/null +++ b/do_configure | |||
| @@ -0,0 +1,149 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | |||
| 3 | # To build a version that works on Synaptics's server: | ||
| 4 | # | ||
| 5 | # 1. INSTALL_DIR=/home/lylee/local do_configure | ||
| 6 | # 2. do_build | ||
| 7 | # 3. INSTALL_DIR=/home/lylee/local do_install | ||
| 8 | # 4. cd /home/lylee/local | ||
| 9 | # 5. chown -R 1225.1050 * # 'chown -R lylee.toolbox *' on server | ||
| 10 | # 6. cd /home/lylee | ||
| 11 | # 7. tar cvfJ local.txz local | ||
| 12 | # 8. scp local.txz lylee@falcon:~ | ||
| 13 | # 9. ssh lylee@falcon | ||
| 14 | # 10. tar xvf local.txz | ||
| 15 | # 11. PATH=/home/lylee/local/bin:$PATH | ||
| 16 | # 12. emacs -nw | ||
| 17 | |||
| 18 | source _do_tools.env | ||
| 19 | |||
| 20 | rm -f aclocal.m4 | ||
| 21 | |||
| 22 | echo -e ${GREEN}Configuring ...${RESTORE} | ||
| 23 | |||
| 24 | [ "$INSTALL_DIR" == "" ] && INSTALL_DIR=/usr/local | ||
| 25 | |||
| 26 | do_config_linux() { | ||
| 27 | echo -e ${GREEN}+ Autoconfig on Linux ...${RESTORE} | ||
| 28 | ## Original configuration that copied from running /usr/bin/emacs | ||
| 29 | #./configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-optimize-sibling-calls' | ||
| 30 | #./configure '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' 'LDFLAGS=-Wl,-z,relro '' | ||
| 31 | # by default on 64-bit machine we have --with-wide-int | ||
| 32 | case `uname -v` in | ||
| 33 | *buntu*) | ||
| 34 | ./configure "--prefix=$INSTALL_DIR" '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu' \ | ||
| 35 | '--with-native-compilation' \ | ||
| 36 | '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' \ | ||
| 37 | '--localstatedir=/var/lib' '--infodir=/usr/share/info' \ | ||
| 38 | '--mandir=/usr/share/man' '--with-pop=yes' \ | ||
| 39 | "--with-gif" "--with-jpeg" "--with-png" "--with-rsvg" "--with-tiff" "--with-xft" "--with-libotf" "--with-xpm" "--with-m17n-flt" "--with-gpm" \ | ||
| 40 | '--with-x=yes' '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars' \ | ||
| 41 | '--with-modules' \ | ||
| 42 | '--with-cairo' '--with-mailutils' \ | ||
| 43 | '--with-xml2' \ | ||
| 44 | 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O3 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall' \ | ||
| 45 | '--enable-link-time-optimization' \ | ||
| 46 | 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro' \ | ||
| 47 | 'CPPFLAGS=-D_FORTIFY_SOURCE=2' "$@" ;; | ||
| 48 | |||
| 49 | *) | ||
| 50 | if [ "$SYNA" == "1" ]; then | ||
| 51 | PNG="--without-png" | ||
| 52 | TIFF="--without-tiff" | ||
| 53 | GNUTLS="--without-gnutls" | ||
| 54 | else | ||
| 55 | PNG="--with-png" | ||
| 56 | TIFF="--with-tiff" | ||
| 57 | GNUTLS="--with-gnutls" | ||
| 58 | fi | ||
| 59 | ./configure "--prefix=$INSTALL_DIR" "--build=x86_64-redhat-linux-gnu" "--host=x86_64-redhat-linux-gnu" \ | ||
| 60 | '--with-native-compilation' \ | ||
| 61 | "--program-prefix=" "--disable-dependency-tracking" "--sysconfdir=/etc" "--includedir=/usr/include" \ | ||
| 62 | "--localstatedir=/var" "--sharedstatedir=/var/lib" "--with-dbus" \ | ||
| 63 | "--with-gif" "--with-jpeg" $PNG "--with-rsvg" $TIFF "--with-xft" "--with-libotf" "--with-xpm" "--with-m17n-flt" "--with-gpm" \ | ||
| 64 | "--with-x=yes" "--with-x-toolkit=gtk3" '--with-toolkit-scroll-bars' $GNUTLS \ | ||
| 65 | '--with-modules' \ | ||
| 66 | '--with-cairo' '--with-mailutils' \ | ||
| 67 | "build_alias=x86_64-redhat-linux-gnu" "host_alias=x86_64-redhat-linux-gnu" \ | ||
| 68 | "CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic \ | ||
| 69 | -LDFLAGS=-Wl,-z,relro" "$@" ;; | ||
| 70 | esac | ||
| 71 | |||
| 72 | } | ||
| 73 | |||
| 74 | do_config_cygwin() { | ||
| 75 | echo -e ${GREEN}+ Autoconfig on Cygwin...${RESTORE} | ||
| 76 | # tested in cygwin under /opt/src/emacs.git/do_configure | ||
| 77 | #### Cygwin | ||
| 78 | # original Emacs configuration under Cygwin distribution | ||
| 79 | #./configure '--srcdir=/usr/src/emacs-23.3-3/src/emacs-23.3' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--datadir=/usr/share' '--localstatedir=/var' '--sysconfdir=/etc' '--datarootdir=/usr/share' '--docdir=/usr/share/doc/emacs' '-C' 'CC=gcc' 'CFLAGS=-g -O2' 'LDFLAGS=-L/usr/lib/ncursesw -Wl,--large-address-aware' 'LIBS=' 'CPPFLAGS=-I/usr/include/ncursesw' | ||
| 80 | #./configure '--srcdir=/usr/src/emacs-23.2-3/src/emacs-23.2' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--datadir=/usr/share' '--localstatedir=/var' '--sysconfdir=/etc' '--datarootdir=/usr/share' '--docdir=/usr/share/doc/emacs' '-C' 'CPPFLAGS=-I/usr/include/ncursesw' 'LDFLAGS=-L/usr/lib/ncursesw' 'CC=gcc' 'CFLAGS=-g -O2 -pipe ' 'LIBS='' | ||
| 81 | |||
| 82 | # `configure | ||
| 83 | # --srcdir=/home/kbrown/src/cygemacs/emacs-24.4-2.x86_64/src/emacs-24.4 | ||
| 84 | # --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin | ||
| 85 | # --libexecdir=/usr/libexec --datadir=/usr/share --localstatedir=/var | ||
| 86 | # --sysconfdir=/etc --libdir=/usr/lib --datarootdir=/usr/share | ||
| 87 | # --docdir=/usr/share/doc/emacs --htmldir=/usr/share/doc/emacs/html -C | ||
| 88 | # --without-gconf --without-gsettings 'CFLAGS=-ggdb -O2 -pipe | ||
| 89 | # -Wimplicit-function-declaration | ||
| 90 | # -fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-24.4-2.x86_64/build=/usr/src/debug/emacs-24.4-2 | ||
| 91 | # -fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-24.4-2.x86_64/src/emacs-24.4=/usr/src/debug/emacs-24.4-2' | ||
| 92 | # CPPFLAGS= LDFLAGS=' | ||
| 93 | |||
| 94 | # ./configure '--prefix=/usr/local' '--localstatedir=/var' '--sysconfdir=/etc' '-C' 'CC=gcc' 'CFLAGS=-g -O2' 'LDFLAGS=-L/usr/lib/ncursesw -Wl,--large-address-aware' 'LIBS=' 'CPPFLAGS=-I/usr/include/ncursesw' | ||
| 95 | |||
| 96 | case "$1" in | ||
| 97 | X|x) | ||
| 98 | # '--with-x-toolkit=gtk3' # this will fail | ||
| 99 | echo -e ${GREEN}++ Configure for Cygwin X ...${RESTORE} | ||
| 100 | ./configure --prefix=$INSTALL_DIR --exec-prefix=$INSTALL_DIR --bindir=$INSTALL_DIR/bin --sbindir=$INSTALL_DIR/sbin \ | ||
| 101 | --libexecdir=$INSTALL_DIR/libexec --datadir=$INSTALL_DIR/share --localstatedir=/var --sysconfdir=/etc \ | ||
| 102 | --libdir=/usr/lib --datarootdir=$INSTALL_DIR/share --docdir=$INSTALL_DIR/share/doc/emacs \ | ||
| 103 | --htmldir=$INSTALL_DIR/share/doc/emacs/html -C --without-gconf --without-gsettings \ | ||
| 104 | "--with-gif" "--with-jpeg" "--with-png" "--with-rsvg" "--with-tiff" "--with-Xft" \ | ||
| 105 | "--with-libotf" "--with-xpm" "--with-m17n-flt" "--with-gpm" \ | ||
| 106 | '--with-toolkit-scroll-bars' \ | ||
| 107 | 'CFLAGS=-ggdb -O2 -pipe -Wimplicit-function-declaration' CPPFLAGS= LDFLAGS= | ||
| 108 | ;; | ||
| 109 | |||
| 110 | nox|noX|no-X|no-x) | ||
| 111 | # Build no-X support | ||
| 112 | echo -e ${GREEN}++ Configure for Cygwin no-X ...${RESTORE} | ||
| 113 | ./configure --with-x=no \ | ||
| 114 | 'CFLAGS=-ggdb -O2 -pipe -Wimplicit-function-declaration' CPPFLAGS= LDFLAGS= | ||
| 115 | ;; | ||
| 116 | |||
| 117 | *) # w32|W32|win32|Win32) | ||
| 118 | # by default we build win32 version | ||
| 119 | echo -e ${GREEN}++ Configure for Cygwin Win32 ...${RESTORE} | ||
| 120 | # ./configure --with-w32 | ||
| 121 | ./configure --with-w32 \ | ||
| 122 | "--with-gif" "--with-jpeg" "--with-png" "--with-rsvg" "--with-tiff" "--with-xft" \ | ||
| 123 | 'CFLAGS=-ggdb -O2 -pipe -Wimplicit-function-declaration' CPPFLAGS= LDFLAGS= | ||
| 124 | ;; | ||
| 125 | esac | ||
| 126 | } | ||
| 127 | |||
| 128 | do_config() { | ||
| 129 | case `uname` in | ||
| 130 | Linux*) do_config_linux "$@" ;; | ||
| 131 | CYGWIN*) do_config_cygwin "$@" ;; | ||
| 132 | esac | tee buildlog/configure-`datetime`.log | ||
| 133 | } | ||
| 134 | |||
| 135 | do_autogen() { | ||
| 136 | echo -e ${GREEN}+ Autogen...${RESTORE} | ||
| 137 | ./autogen.sh | ||
| 138 | return $? | ||
| 139 | } | ||
| 140 | |||
| 141 | mkdir -p buildlog | ||
| 142 | |||
| 143 | #./autogen.sh | ||
| 144 | |||
| 145 | # do_config || { ./autogen.sh && do_config; } | ||
| 146 | ## The above line may not work since running "./configure" successfully doesn't mean it's not out-of-date, so always run ./autogen.sh as follows | ||
| 147 | ## Always run autogen.sh to create new ./configure script. | ||
| 148 | |||
| 149 | { if [ "$1" == "-n" ]; then shift; else do_autogen; fi; } && do_config "$@" || { echo -e ${RED}Failed configuring !${RESTORE}; exit 1; } | ||
diff --git a/do_install b/do_install new file mode 100755 index 00000000000..14d680a17bb --- /dev/null +++ b/do_install | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | source _do_tools.env | ||
| 3 | |||
| 4 | DATETIME=`~/bin/datetime` | ||
| 5 | |||
| 6 | [ "$INSTALL_DIR" == "" ] && INSTALL_DIR=/usr/local | ||
| 7 | CPUNUM=`cat /proc/cpuinfo|egrep ^processor|wc -l` | ||
| 8 | |||
| 9 | [ `id -u` != 0 ] && SUDO=sudo || SUDO="" | ||
| 10 | |||
| 11 | mkdir -p buildlog | ||
| 12 | $SUDO make install NATIVE_FULL_AOT=1 -j ${CPUNUM} 2>&1 | tee buildlog/make_install_${DATETIME}.log | ||
| 13 | if [ ${PIPESTATUS[0]} -ne 0 ]; then | ||
| 14 | echo -e ${RED}'Install failed!'${RESTORE} | ||
| 15 | else | ||
| 16 | if [[ "$1" != "-n" ]]; then | ||
| 17 | echo -e ${GREEN}"Tagging git with tag name \"luke_install_`hostname`_${DATETIME}\""${RESTORE} | ||
| 18 | git tag luke_install_`hostname`_${DATETIME} | ||
| 19 | else | ||
| 20 | echo -e ${GREEN}"Installation completed, no tagging"${RESTORE} | ||
| 21 | fi | ||
| 22 | fi | ||
| 23 | #unlink $INSTALL_DIR/bin/ctags | ||
| 24 | #unlink $INSTALL_DIR/bin/etags | ||
| 25 | ver=$(./src/emacs --version|head -n 1|cut -d' ' -f 3) | ||
| 26 | $SUDO mv $INSTALL_DIR/bin/ctags $INSTALL_DIR/bin/ctags-$ver | ||
| 27 | $SUDO mv $INSTALL_DIR/bin/etags $INSTALL_DIR/bin/etags-$ver | ||
diff --git a/do_rebuild b/do_rebuild new file mode 100755 index 00000000000..2623ef7c6c6 --- /dev/null +++ b/do_rebuild | |||
| @@ -0,0 +1,4 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | . ~/bin/16-color.src | ||
| 3 | ./do_clean | ||
| 4 | ./do_configure && ./do_build | ||