Emacs 22.3のコンパイル

パピーを名犬にするための技、テクニック

モデレータ: 暇人, YoN, nyu

返信する
rsurf
記事: 86
登録日時: 09/01/03(土) 12:42

Emacs 22.3のコンパイル

投稿記事 by rsurf »

emacsの新しめのバージョンをコンパイルするときに単に"./configure"と実行すると
"devx_420.sfs"にALSAのライブラリが無い為にエラーになってしまいますが、
"./configure --without-sound"と実行するとmakefileを作製することができます。
(サウンド機能は使えませんが…)
2GB以下のテキストファイルの編集だけなら"./configure --without-sound --without-xpm --without-jpeg
--without-tiff --without-gif --without-png --without-toolkit-scroll-bars --disable-largefile"
で良いと思います。インストールに必要なディスク容量は100MB程度です。
_________________
OS:puppy-4.2.0-JP(手動frugal)+grub4dos(v0.4.3),CPU:Celeron420,RAM:2GB,
HDD:ATA320GB,MB:G31M-S2L(G31+ICH7,Audio:ALC662,LAN:RTL8111C),VGA:Onboard
rsurf
記事: 86
登録日時: 09/01/03(土) 12:42

Emacs 23.1と24.5のコンパイル

投稿記事 by rsurf »

"emacs-23.1.tar.bz2"のGUI版ではメニューからwindowsエディタライクなキー設定と日本語TTFフォントが選べるようになってました。

("devx_431JPbeta3.sfs" + "pup-431JPqs3.sfs")の環境で以下のような設定でコンパイルして以下のような設定ファイルで使用できています。

コンパイル

コード: 全て選択

./configure CFLAGS='-march=prescott -O2 -pipe -fomit-frame-pointer' \
 --without-pop --disable-largefile --without-sound --without-sync-input \
 --without-xpm --without-jpeg --without-tiff --without-gif \
 --without-png --without-rsvg  \
 --without-xaw3d --without-gpm --without-dbus \
 --without-makeinfo --with-x --without-toolkit-scroll-bars
インストール
make && make install

設定ファイル("~/.emacs")

コード: 全て選択

;;(load (expand-file-name "/mnt/home/EXT/puppy.emacs.usr"))
(custom-set-variables
 '(browse-url-browser-function (quote browse-url-firefox))
 '(browse-url-firefox-program "/mnt/home/EXT/firefox/firefox")
 '(column-number-mode t)
 '(cua-mode t nil (cua-base))
 '(current-language-environment "UTF-8")
 '(indent-tabs-mode t)
 '(inhibit-startup-screen t)
 '(scroll-bar-mode nil)
 '(tab-always-indent nil)
 '(tab-stop-list (quote (4 8 12 16 20 24 28 64 72 80 88 96 104 112 120)))
 '(tab-width 4)
 '(tool-bar-mode nil)
 '(tooltip-mode nil))
(custom-set-faces
 '(default ((t (:inherit nil :stipple nil :background "#333366" :foreground "white" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :foundry "unknown" :family "IPA モナー Pゴシック")))))
;; url jump
(global-set-key [mouse-8] 'browse-url-at-mouse)
(global-set-key [mouse-6] 'browse-url-at-mouse)
(global-set-key [mouse-2] 'browse-url-at-mouse)
(global-set-key [f9] 'browse-url-at-point)
;; 起動時のウィンドウサイズ
(add-to-list 'default-frame-alist '(width . 120))
(add-to-list 'default-frame-alist '(height . 40))
_________________
OS:pup-431JPqs3.sfs pup-431JP-sfs3.sfs(手動frugal on ext3)+grub4dos(v0.4.3),CPU:Celeron420,RAM:2GB,HDD:SATA500GB,MB:G31M-S2L(bios F9,G31+ICH7,Audio:ALC662,LAN:RTL8111C(r8168.ko)),VGA:Onboard(Xorg)
_________________

(2015/07/28 emacs-24.5の説明追加)
インストールに必要なディスク容量は100MB程度です。
emacs本体サイズは(8357320バイト)→upx3.91最高圧縮で(27.85%=2405448バイト)程度なのですが
同梱lispスクリプトや関連ドキュメント等の物量が大きい+不要なファイルがどれか判別が難しいです。

マウスでのXのコピーペーストとクリップボード系の^c^vがどこでも使えるようになりました。
オンラインでのlispパッケージ管理みたいな機能が付きました(Option→Manage Emacs Packages)
設定値に記述場所やキーワードが増えました。
Xftフォントの相性?が減った。Xftの書式でフォント指定が可能(メニューからの選択ではptサイズの独自書式になる)。
本当の本体は「temacs」で「emacs」は初期スクリプト実行後を実行モジュール化した合成品です。
Ewwというテキストブラウザが付きました(Tools→Browse the Web)が、
文字コード自動判定でエラーを起こすとUTF-8扱いにする処理の為、日本語版Windowsで作ったeuc系sjis系文字の
ページは見れない確率が高いです(.htmlのcharsetにCP51932とかCP932とか正確に書かれていないので
範囲外の文字を含みやすい、割り込み広告バナーのサーバが他の文字コードで上書きする等)。
~/.emacs.d/url下に関連ファイルが作られます。
画像がたまにちらつく。
矩形選択が可能になりました。

GUI版の方が使える機能や消費メモリの点で有利ですがコンパイル可能環境が結構狭いです。

pup571では「puppy_precise_5.7.1JP.sfs」+「devx_precise_5.7.1.sfs」の組み合わせで

コード: 全て選択

Configured for `i686-pc-linux-gnu'.	(オプション指定無しで有効な機能 v24.5)
  Where should the build process find the source code?    .
  What compiler should emacs be built with?               gcc -std=gnu99 -g3 -O2
  Should Emacs use the GNU version of malloc?             yes
      (Using Doug Lea's new malloc from the GNU C Library.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    x11
  What toolkit should Emacs use?                          GTK2
  Where do we find X Windows header files?                Standard dirs
  Where do we find X Windows libraries?                   Standard dirs
  Does Emacs use -lXaw3d?                                 no
  Does Emacs use -lXpm?                                   yes
  Does Emacs use -ljpeg?                                  yes
  Does Emacs use -ltiff?                                  yes
  Does Emacs use a gif library?                           yes -lgif
  Does Emacs use a png library?                           yes -lpng12 -lz -lm
  Does Emacs use -lrsvg-2?                                yes
  Does Emacs use imagemagick?                             no
  Does Emacs support sound?                               yes
  Does Emacs use -lgpm?                                   no
  Does Emacs use -ldbus?                                  yes
  Does Emacs use -lgconf?                                 yes
  Does Emacs use GSettings?                               yes
  Does Emacs use a file notification library?             yes -lgio (gfile)
  Does Emacs use access control lists?                    yes -lacl
  Does Emacs use -lselinux?                               no
  Does Emacs use -lgnutls?                                yes
  Does Emacs use -lxml2?                                  yes
  Does Emacs use -lfreetype?                              yes
  Does Emacs use -lm17n-flt?                              no
  Does Emacs use -lotf?                                   no
  Does Emacs use -lxft?                                   yes
  Does Emacs directly use zlib?                           yes
  Does Emacs use toolkit scroll bars?                     yes
emacs-24.5 動作OK
emacs-23.4 メニュー操作時に全画面固まる(「^[ALT][BS]」可)
emacs-23.3b コンパイルエラー(ヘッダ不足)(ubuntu precise のパッケージ最終ver)
emacs-23.1 コンパイルエラー(ツール不足)(pup431q3で使用中)

pup431q3では「pup-431JPqs3.sfs」+「devx_431JPbeta3.sfs」の組み合わせで
emacs-24.5 コンパイルエラー(コンソール用で--without-xなら動作OK)
emacs-23.4 メニュー操作時に固まる(実行時xlibエラー)
emacs-23.3b 同上
emacs-23.2b 同上


以下のような設定でコンパイルして以下のような設定ファイルで使用できています。

emacs-24.5 GUI版 pup571 用(制限無しでも多くの機能が使えますが専用ソフトの方が使い易いので)

コード: 全て選択

./configure CFLAGS='-march=core2 -O2 -pipe' \
 --without-all --disable-largefile --disable-acl --with-xim --with-xft --with-zlib --with-compress-install
make bootstrap # clean + cコンパイル + lispバイトコンパイル(*.el→*.elc) 本来不要な筈ですが(*.etc)のサイズが増えるのでソース(*.el)と同期が取れていないかも
make install-strip # 実行モジュールにstripコマンドを掛けてインストール
emacs-24.5コンソール版 pup431q3 用

コード: 全て選択

./configure CFLAGS='-march=prescott -O2 -pipe -fomit-frame-pointer' \
 --without-all --disable-largefile --disable-acl --without-x --with-zlib --with-compress-install
make bootstrap && make install-strip
アンインストール(make uninstall)で消えないファイル(find /usr -type f -regex '.*emacs.*elc?\(\.gz\)?$' -printf '%s "%p"\n' | sort -n)
106 "/usr/local/share/emacs/site-lisp/subdirs.el"
3813 "/usr/share/emacs/site-lisp/autoconf/autotest-mode.el"
11246 "/usr/share/emacs/site-lisp/cmake-mode.el"
297105 "/usr/share/emacs/site-lisp/psvn.el"
~/.emacs
~/.emacs.d/下

本来bootstrapオプションは不要な筈ですがサイズが変わるので付けた方が良いかもしれません(無しでも普通に使えます)。

コード: 全て選択

Cnt=0;Siz=0;for Lin in $(find /usr -type f -regex '.*emacs.*\.elc?\(\.gz\)?$' -printf '%s\n')
do((Siz+=Lin));((Cnt++));done;echo "$Cnt" 個 "$Siz" バイト
3030 個 71234626 バイト bootstrapオプション有り
3030 個 71085667 バイト 同無し

urxvtを別名でリンクしてEmacs用にキー割り当てを変更します(C-a等の代替キーが有るのでやらなくても良い)

コード: 全て選択

infocmp -L rxvt # 端末情報表示($TERMのxtermでは無くrxvt定義が使われている。urxvt定義があればそれが優先)
ln -sf '/usr/bin/urxvt' ~/'my-applications/bin/Erxvt' # 別名で専用に作成し ~/.Xresourcesで[Home][End]関連キー変更
「~/.Xresources」に追加

コード: 全て選択

! Emacs -nw 用([home][end]をterminfoと合わせる修正、C-はEmacsコマンド、cutcharsはマウスダブルクリック時の区切り文字)
Erxvt.keysym.Home: \033[7~
Erxvt.keysym.End: \033[8~
Erxvt.keysym.S-Home: \033[7$
Erxvt.keysym.S-End: \033[8$
Erxvt.keysym.C-Home: \033<
Erxvt.keysym.C-End: \033>
Erxvt.cutchars: @*;{}
起動用スクリプト例「em.sh」引数"con"かpup431q3ならコンソールモード

コード: 全て選択

#!/bin/bash

Files='"./url.txt" "./work.txt"'
cd ~/my-documents

Consol=0
[[ $1 = con ]] && Consol=1
[[ $Consol = 0 ]] && [[ $( < '/etc/rc.d/PUPSTATE' ) = */pup-431JPqs3.sfs\'* ]] && Consol=1
if [[ $Consol = 1 ]]; then # コンソール版
# 背景、文字、カーソル、強調色は基本8色以外をurxvtで設定。suspend-frameは使えない起動形式。
  Ropt='-cr "#FFAA88" -hc "#3322FF" -bg "#333388" -fg "#FFFFEE" -vb -bc -sl 0 -sb \
-geometry "146x60+732+1" -fn "xft:Ume Gothic:pixelsize=16"'
  Eopt='-nw --debug-init'
  eval "setsid Erxvt $Ropt -e emacs $Eopt $Files" & # コンソール版
  exit
fi
eval "setsid emacs $Files" & # GUI版
exit
「~/.emacs」

コード: 全て選択

(if window-system
	(load (expand-file-name "~/my-documents/emacs245.gui")) ; GUI版
	(load (expand-file-name "~/my-documents/emacs245.con"))) ; コンソール版
「~/my-documents/emacs245.gui」

コード: 全て選択

(custom-set-variables
 '(transient-mark-mode t)
 '(browse-url-browser-function 'browse-url-generic)
 '(browse-url-generic-program "opera")
 '(column-number-mode t)
 '(cua-mode t nil (cua-base)) ; 一部Windowsぽいキーアサイン
 '(current-language-environment "Japanese")
;; '(current-language-environment "UTF-8") ; sjis,eucjp判別力が弱くなる
 '(indent-tabs-mode t)
 '(inhibit-startup-screen t) ; 起動画面OFF
;; '(save-place t nil (saveplace)) ; ファイル毎にカーソル位置記憶(オートセーブ強制ON)
 '(scroll-bar-mode nil)
 '(show-paren-mode t) ; 対応するカッコをハイライト表示する
 '(tab-always-indent nil)
 '(tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120))
 '(tab-width 4)
 '(tool-bar-mode nil) ; ツールバーを消す
 '(tooltip-mode nil)
 '(auto-save-default nil) ; オートセーブOff(リンク切れ中間ファイル(.#name->root/tmp_name)は作成される(バグ?))
;; '(shr-external-browser 'browse-url-generic) ; Ewwから「&」
)

;; テキストエンコーディングとしてUTF-8を優先的に使用する
;; 「utf-8」の部分を「cp932」とするとCP932優先となる
(prefer-coding-system 'utf-8-unix) ; Diredに影響(ファイル名EUCが優先ぽい)

(setq dired-listing-switches "-Al --group-directories-first --time-style=iso") ; Dired(ls opt)
(setq dired-dwim-target t) ; Dired 2画面時に相手が初期ターゲット
(setq visible-bell t) ; 警告をビープ音では無く行点滅で表現 (gui)
;;(setq-default indent-tabs-mode nil) ; When pushing [TAB],  input WhiteSpaces.

(global-whitespace-mode t) ; 空白文字表示+色 v24.5 (gui)
(setq whitespace-style '(face spaces space-mark tabs tab-mark newline newline-mark))
(set-face-foreground 'whitespace-space "#7777AA")
(set-face-background 'whitespace-tab "#444466")
(set-face-foreground 'whitespace-newline "#7777AA")

(fset 'yes-or-no-p 'y-or-n-p) ; yes/no を y/n へ簡略化
(global-set-key "\C-x\C-b" 'buffer-menu) ; バッファ一覧が切替式
;; url jump
(global-set-key [mouse-8] 'browse-url-at-mouse) ; firefoxの一部ver対応で(6,7)ボタンを(8,9)に設定する場合用
(global-set-key [mouse-6] 'browse-url-at-mouse)
(global-set-key [f9] 'browse-url-at-point)

(custom-set-faces
 '(default ((t (:inherit nil :stipple nil :inverse-video nil :box nil :strike-through nil :overline nil :underline nil )))))

;; 起動時のウィンドウ位置(px単位)とサイズ(文字単位)とフォント(Xft)と背景/文字色 v24.5
(setq initial-frame-alist
 '((left . 830)(top . 1)(width . 150)(height . 55)(font . "Ume Gothic:pixelsize=16")
  (background-color . "#333366") (foreground-color . "white"))
)
「~/my-documents/emacs245.con」

コード: 全て選択

(custom-set-variables
 '(transient-mark-mode t)
 '(browse-url-browser-function 'browse-url-generic)
; '(browse-url-generic-program "firefox")
 '(browse-url-generic-program "opera")
 '(column-number-mode t)
 '(cua-mode t nil (cua-base)) ; 一部Windowsぽいキーアサイン
 '(current-language-environment "Japanese")
 '(indent-tabs-mode t)
 '(inhibit-startup-screen t) ; 起動画面OFF
 '(scroll-bar-mode nil)
 '(show-paren-mode t) ; 対応するカッコをハイライト表示する
 '(tab-always-indent nil)
 '(tab-stop-list '(4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120))
 '(tab-width 4)
 '(auto-save-default nil) ; オートセーブOff(リンク切れ中間ファイル(.#name->root/tmp_name)は作成される(バグ?))
 '(electric-indent-mode nil) ; ペースト時のインデントOFF
 '(xterm-mouse-mode t) ; 左クリックでカーソル移動、ホイールスクロール、ドラッグで範囲指定、右Wクリックでカット、中ボタンペーストはエラー(Xカットバッファは[SHIFT]押しながらドラッグまたは2、3連クリックでコピー、中ボタンでペースト(普通のマウス対応には「gpm(General Purpose Mouse interface)」が必要だが複数の追加モジュールが必要になる))
)
;; pup431ではホイール設定が必要(pup571では不要(同じキー割り当てになる)、コンパイルオプションの差?)
(require 'mwheel)
(mouse-wheel-mode t)

;; テキストエンコーディングとしてUTF-8を優先的に使用する
(prefer-coding-system 'utf-8-unix) ; Diredに影響(ファイル名eucが優先ぽい)

(setq dired-listing-switches "-Al --group-directories-first --time-style=iso") ; Dired(ls opt)
(setq dired-dwim-target t) ; Dired 2画面時に相手が初期ターゲット

(global-whitespace-mode t) ; 空白文字表示+色
(setq whitespace-style '(face spaces space-mark tabs tab-mark newline newline-mark))
(set-face-background 'whitespace-space "black")
(set-face-foreground 'whitespace-space "red")
(set-face-background 'whitespace-tab "blue")
(set-face-background 'whitespace-newline "red")
(setq whitespace-display-mappings
 '(
  (space-mark ?  [?□]) ; 全角スペース(□に置換)
  (space-mark ?  [? ]) ; 半角スペース(マウスドラッグで拾わない為に空白文字使用)
  (newline-mark ?\n [? ?\n]) ; 改行記号(同上)
 ))
(setq whitespace-space-regexp "\\([  ]+\\)") ; 着色対象(半+全角スペース)

(fset 'yes-or-no-p 'y-or-n-p) ; yes/no を y/n へ簡略化
(global-set-key "\C-x\C-b" 'buffer-menu) ; バッファ一覧を切替式
(global-set-key [f9] 'browse-url-at-point) ; url jump(端末版はマウスだと2回呼び出してしまう)

(custom-set-faces
 '(custom-rogue ((t (:background "white" :foreground "magenta"))))
 '(font-lock-comment-face ((t (:foreground "yellow"))))
 '(link ((t (:foreground "cyan" :underline "cyan"))))
 '(minibuffer-prompt ((t (:foreground "cyan"))))
 '(mode-line-inactive ((t (:inherit mode-line :background "white" :foreground "red")))))
_________________
OS:[pup-431JPqs3.sfs+fixmenus_on_locale-20100425|puppy_precise_5.7.1JP.sfs](手動frugal_ext4)+grub4dos(v0.4.4) CPU:Celeron_E3400 RAM:DDR2_2GB HDD:HGST_SATA1TB MB:G31M-S2L(G31+ICH7 BIOS:F10f Audio:ALC662 LAN:RTL8111C(r8168.ko) VGA:Onboard(Xorg,1920x1080,96dpi))
返信する