Msys2编译Emacs

*/-->

code {color: #FF0000}
pre.src {background-color: #002b36; color: #839496;}

Msys2编译Emacs

Origin link: https://gist.github.com/nauhygon/f3b44f51b34e89bc54f8

1 Download & install MSYS2

Download MSYS2 (msys2-x86_64-20140704.exe) from this download page.

Install MSYS2 to, for example, C:\msys2 (make sure no space in path).

2 console

Optionally prettify the MSYS2 console mintty with ~/.minttyrc to make it more pleasing to eyes. Thanks to this awesome theme!

ForegroundColour=131,148,150
BackgroundColour=0,43,54
CursorColour=192,192,192
Black=7,54,66
BoldBlack=0,43,54
Red=220,50,47
BoldRed=203,75,22
Green=133,153,0
BoldGreen=88,110,117
Yellow=181,137,0
BoldYellow=101,123,131
Blue=38,139,210
BoldBlue=131,148,150
Magenta=211,54,130
BoldMagenta=108,113,196
Cyan=42,161,152
BoldCyan=147,161,161
White=238,232,213
BoldWhite=253,246,227
BoldAsFont=yes
Font=Consolas
FontHeight=12
Transparency=off
OpaqueWhenFocused=no
ScrollbackLines=200000
FontSmoothing=full
CursorType=underscore
CursorBlinks=yes
ScrollMod=off
RightClickAction=paste
ClickTargetMod=off

Remove all /c/* paths in $PATH by adding this to .bashrc and restart mintty.

This is important to avoid interference from programs installed on the same machine, especially if you have Cygwin installed.

# Remove '/c/*' from PATH if running under Msys to avoid possible
# interference from programs already installed on system. Removal
# with awk is copied from http://stackoverflow.com/a/370192.
if [ $(uname -o) == 'Msys' ]; then
export PATH=`echo ${PATH} | awk -v RS=: -v ORS=: '/c\// {next} {print}' | sed 's/:*$//'`
fi The whole .bashrc is copied here. # .bashrc # Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi ##############
### Basics ###
############## # Don't wait for job termination notification
set -o notify # Enables UTF-8 in Putty.
# See http://www.earth.li/~huggie/blog/tech/mobile/putty-utf-8-trick.html
echo -ne '\e%G\e[?47h\e%G\e[?47l' # My pretty prompt (Yay!)
PS1='\[\e[32;40m\]\u\[\e[0m\]\[\e[34;40m\]\H\[\e[0m\]\[\e[40;1m\]\w\[\e[0m\] ' ############
### PATH ###
############ # Remove '/c/*' from PATH if running under Msys to avoid possible
# interference from programs already installed on system. Removal
# with awk is copied from http://stackoverflow.com/a/370192.
if [ $(uname -o) == 'Msys' ]; then
export PATH=`echo ${PATH} | awk -v RS=: -v ORS=: '/c\// {next} {print}' | sed 's/:*$//'`
fi ###############
### Aliases ###
############### alias less='less -r'
alias rm='rm -i'
alias whence='type -a'
alias ls='ls -F --color=auto'
alias dir='ls --color=auto --format=long -L'
alias vdir='ls --color=auto --format=long'
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
alias md='mkdir'
alias pico='nano'
alias cls='clear'

3 Install packages required to build Emacs.

Follow instructions on this page first.

pacman -Syu
pacman -Sy
pacman -Sy\
--needed \
filesystem \
msys2-runtime \
bash \
libreadline \
libiconv \
libarchive \
libgpgme \
libcurl \
pacman \
ncurses \
libintl

Close mintty and restart it, do this again.

pacman -Su

Then let us install all required libs for building Emacs.

#!/usr/bin/bash
pacman -S \
autoconf \
autogen \
automake \
automake-wrapper \
diffutils \
git \
guile \
libgc \
libguile \
libltdl \
libunistring \
make \
mingw-w64-x86_64-binutils \
mingw-w64-x86_64-bzip2 \
mingw-w64-x86_64-cairo \
mingw-w64-x86_64-cloog \
mingw-w64-x86_64-crt-git \
mingw-w64-x86_64-dbus \
mingw-w64-x86_64-expat \
mingw-w64-x86_64-fontconfig \
mingw-w64-x86_64-freetype \
mingw-w64-x86_64-gcc \
mingw-w64-x86_64-gcc-libs \
mingw-w64-x86_64-gdk-pixbuf2 \
mingw-w64-x86_64-gettext \
mingw-w64-x86_64-giflib \
mingw-w64-x86_64-glib2 \
mingw-w64-x86_64-gmp \
mingw-w64-x86_64-gnutls \
mingw-w64-x86_64-harfbuzz \
mingw-w64-x86_64-headers-git \
mingw-w64-x86_64-imagemagick \
mingw-w64-x86_64-isl \
mingw-w64-x86_64-libcroco \
mingw-w64-x86_64-libffi \
mingw-w64-x86_64-libiconv \
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-libpng \
mingw-w64-x86_64-librsvg \
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-libwinpthread-git \
mingw-w64-x86_64-libxml2 \
mingw-w64-x86_64-mpc \
mingw-w64-x86_64-mpfr \
mingw-w64-x86_64-pango \
mingw-w64-x86_64-pixman \
mingw-w64-x86_64-winpthreads \
mingw-w64-x86_64-xpm-nox \
mingw-w64-x86_64-xz \
mingw-w64-x86_64-zlib \
tar \
wget

4 Get emacs source.

mkdir emacs; cd emacs
git clone http://git.savannah.gnu.org/r/emacs.git emacs
git config core.autocrlf false

5 Build Emacs!

Change target accordingly, the directory in which the freshly built Emacs binaries, libraries, and docs live.

target=/c/emacs

export PATH=/mingw64/bin:$PATH

mkdir build; cd build

(cd ../emacs; ./autogen.sh)

export PKG_CONFIG_PATH=/mingw64/lib/pkgconfig

../emacs/configure \
--host=x86_64-w64-mingw32 \
--target=x86_64-w64-mingw32 \
--build=x86_64-w64-mingw32 \
--with-gnutls \
--with-imagemagick \
--with-jpeg \
--with-png \
--with-rsvg \
--with-tiff \
--with-wide-int \
--with-xft \
--with-xml2 \
--with-xpm \
'CFLAGS=-I/mingw64/include/noX' \
prefix=$target make make install prefix=$target cp /mingw64/bin/*.dll $target

Date: 2017-01-15 15:25

Created: 2017-04-26 周三 21:49

Emacs 26.0.50 (Org mode 8.2.10)

Validate

Msys2编译Emacs的更多相关文章

  1. 在Windows下编译Emacs

    在Windows下编译Emacs Windows下编译好的Emacs主要有两个版本,一个来自http://nqmacs.sourceforge.net/,另一个来自http://www.crasseu ...

  2. 基于TDengine-ver-1.6.4.4在windows 10下cmake+msys2编译(windows cgo 使用)

    目录 基于TDengine-ver-1.6.4.4在windows 10下cmake+msys2编译(windows cgo 使用) 背景 下载地址 仓库地址 安装部署 msys2 安装 配置环境变量 ...

  3. 使用MSYS2编译64位gvim

    1. 下载安装MSYS2 在https://msys2.github.io/下载MSYS2,推荐下载x86-64版,此版本内置了MinGW32与MinGW64 安装后首先更新MSYS2系统,顺序执行下 ...

  4. CentOS5.9 编译Emacs 24

    从Emacs官方网站下载最新版解压后,执行 ./configure 得到错误信息: configure: error: The following required libraries were no ...

  5. MSYS2 编译环境配置

    博客转载自:https://medium.com/@fzubair/carnd-term2-gcc-setup-on-windows-287e1fd36845 2018/6/2 — mingw32/c ...

  6. Msys 编译 VS2013 ffmpeg

    1.新版本msys2编译ffmpeg 的时候提示无法找到cl 重新安装了msys2及vs2013环境,msys2升级更新后,执行编译提示没有发现c编译器. 开始以为是新装的msys2_shell.ba ...

  7. g++编译X265

    自己参考用: msys2 编译X265的命令 编译用工具安装 pacman -S git make tar automake autoconf libtool pkg-config mingw-w64 ...

  8. Ubuntu 14.04 安装配置备忘录

    完全在 Linux 下工作,大概有3年时间了. 之前都是用 Windows, 而把 Linux 装在虚拟机里,现在反过来,把 Windows 装在了虚拟机里,只是因为偶尔还要用网银的缘故. 以我这几年 ...

  9. 使用C#+FFmpeg+DirectX+dxva2硬件解码播放h264流

    本文门槛较高,因此行文看起来会乱一些,如果你看到某处能会心一笑请马上联系我开始摆龙门阵 如果你跟随这篇文章实现了播放器,那你会得到一个高效率,低cpu占用(单路720p视频解码播放占用1%左右cpu) ...

随机推荐

  1. OSG+Visual Studio2015项目变量设置;

    OSG源码经过CMAKE编译后: 1.配置OSG环境变量: 用户变量的PATH中添加路径 C:\OSG\bin系统变量中添加新变量OSG_FILE_PATH为 C:\OSG\data 2.VS新建项目 ...

  2. SAP Smartforms打印输出条形码 及相关问题

    最近凭证打印需要附加打印条形码,遂做了一个小例子,结果还出现了很多的小问题,按领导的话说,这就是经验! 首先:SE73 -> 系统条形码 -> 更改 -> 创建 -> 选择 N ...

  3. C++中类的静态成员变量

    1,成员变量的回顾: 1,通过对象名能够访问 public 成员变量: 2,每个对象的成员变量都是专属的: 3,成员变量不能在对象之间共享: 1,在做程序设计中,成员变量一般是私有的.至少不是公有的: ...

  4. putchar(".:-=+*#%@"[(int)(d * 5.0f)])

    前两天在玩知乎时候见到有个用C语言画心的小代码感觉还是蛮好玩的,不过,里面有行代码看了好久才懂: putchar(".:-=+*#%@"[(int)(d * 5.0f)]); ,先 ...

  5. mysql百万级别重排主键id(网上的删除重建id在大数据量下会出错)

    网上教程: 先删除旧的主键 再新建主键 :数据量少时没问题,不会出现主键自增空缺间隔的情况(如:1,2,3,5):但是大数据量时会出现如上所述问题(可能是内部mysql多进程或多线程同时操作引起问题) ...

  6. smb.conf - Samba组件的配置文件

    总览 SYNOPSIS smb.conf是Samba组件的配置文件,包含Samba程序运行时的配置信息.smb.conf被设计成可由swat (8)程序来配置和管理.本文件包含了关于smb.conf的 ...

  7. QT问题解决

    1.pro文件下各个变量的含义 https://www.zybuluo.com/breakerthb/note/582395 2.如何在pro文件中导入其他的库 https://blog.csdn.n ...

  8. translation of 《deep learning》 Chapter 1 Introduction

    原文: http://www.deeplearningbook.org/contents/intro.html Inventors have long dreamed of creating mach ...

  9. ivew 修改排序号的逻辑

    排序号修改的逻辑 1.构建修改排序号传递的参数 formInline2:{ recommendType:4, //产品类型 merchantCodes:[], //产品code discountRec ...

  10. Delphi 版本信息获取函数 GetFileVersionInfo、GetFileVersionInfoSize、VerFindFile、VerInstallFile和VerQueryValue

    一.版本信息获取函数简介和作用 获取文件版本信息的作用: 1. 避免在新版本的组件上安装旧版本的相同组件: 2. 在多语言系统环境中,操作系统根据文件版本信息里提供的语言信息在启动程序时决定使用的正确 ...