Search This Blog

Friday, February 22, 2008

a note about autoconf and automake

after several hours,I got autoconf and automake to work on my program,known as following(with autoconf-2.61 and automake-1.10):

1.run autoscan in the source directory,and we can get a file named configure.scan

2.
modify the configure.scan so that it makes sense to our project,

  • first of all is AC_INIT macro,i.e. our project name,version,and contact address;
  • then add a macro AM_INIT_AUTOMAKE (be careful of the red M),fill it with the project name and version,if it does not exist,then aclocal will not work properly;
  • and do not touch AC_CONFIG_HEADER ,it's for people who want make their project portable with a "config.h",so do not feed your project's header files to it;at last comes AC_OUTPUT,set it with "Makefile";
  • other macros are project specified,so we skip them here;
  • rename configure.scan to configure.ac or configure.in
3.run aclocal to generate aclocal.m4(if no aclocal.m4 generated,there must be something wrong)

4.run autoconf to generate configure

5.create a file Makefile.am,

  • set macro bin_PROGRAMS=names(it's the executable file's name,like emacs,mplayer,etc)
  • name_SOURCES=files(it's the sources files whitch the binary relies on)
  • name_LDFLAGS=flags(e.g. if we use expat, add -lexpat here)
many other macros can be useful,too,but omitted here.

6.run automake -a,touch files which it complains can not find.

7.all right,run ./configure now, we can get Makefile automatically,wonderful,isn't it?

Thursday, December 06, 2007

slime-close-parens-at-point

the default key binding of the function slime-close-parens-at-point is C-c C-q
but it's obsolete from slime-2.0_p20070816-r1,the comments in the source file are as following:

;; SLIME-CLOSE-PARENS-AT-POINT is obsolete:

;; It doesn't work correctly on the REPL, because there
;; BEGINNING-OF-DEFUN-FUNCTION and END-OF-DEFUN-FUNCTION is bound to
;; SLIME-REPL-MODE-BEGINNING-OF-DEFUN (and
;; SLIME-REPL-MODE-END-OF-DEFUN respectively) which compromises the
;; way how they're expect to work (i.e. END-OF-DEFUN does not signal
;; an UNBOUND-PARENTHESES error.)

;; Use SLIME-CLOSE-ALL-PARENS-IN-SEXP instead.


well,bind slime-close-all-parens-in-sexp to C-c C-q,and I can pretend that nothing happened in my world.

Tuesday, October 02, 2007

to thinkpaders,about tp-fancontrol

from a certain version of thinkpad_acpi,fan_control is disabled by default,as Documentation/thinkpad-acpi.txt said:

NOTE NOTE NOTE: fan control operations are disabled by default for
safety reasons. To enable them, the module parameter "fan_control=1"
must be given to thinkpad-acpi.

so the tp-fancontrol daemon won't work any more if the thinkpad_acpi module isn't told that it should enable the fan_control.

let's do that:

#vim /etc/modules.d/thinkpad_acpi

then add the following line:
options thinkpad_acpi fan_control=1

:wq

#update-modules

now tp-fancontrol should work again.