automake

Xcode 4.3 から autotools が削除されている件

Xcode 4.2 以前には付属していた autotools が 4.3 から削除されているみたい。そのため以下のコマンドに依存したビルドシステムはコンパイルが完遂できなくなってしまっている。

  • libtool
  • libtoolize
  • automake
  • aclocal
  • ifnames
  • autoupdate
  • autoscan
  • autoreconf
  • autom4te
  • autoheader
  • autoconf

このツールに依存したソースコードは結構多くて Homebrew でインストールに失敗するパッケージがチラホラ出ているみたい。autotools は brew のコアリポジトリには入っていないようなので、homebrew-alt から別途インストールしてしまえばよい。

$ brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/autoconf.rb
$ brew link autoconf
$ brew install https://raw.github.com/x2on/homebrew-alt/automake/duplicates/automake.rb
$ brew link automake
$ brew install https://raw.github.com/adammw/homebrew-alt/libtool/duplicates/libtool.rb
$ brew install libtool

これで autotools に依存したパッケージのビルドがうまくいくはず。 homebrew-alt はコアに入っていない Formula が結構あるので、困ったときは覗きに行くといいかも。


追記 (2012-02-28 15:37)

Homebrew のコアに取り込まれたみたい。少なくとも Homebrew でパッケージをインストールする分には問題なくなった。

Automake로 make하기

automake 구축예

  hello     +—–src            +— hello.cpp            +— hello.h            +— main.cpp 형식으로 되어 있다고 한다.

설정 파일의 준비

프로젝트 hello 직하의 디렉토리부터 하위 소스 파일이 놓여 있는 디렉토리까지 각 계층별로 Makefile.am을 작성. configure.ac를 프로젝트 디렉토리에 작성. (autoscan 하여 configure.scan 을 수정하는것이 편할 것)

hello/Makefile.am

이 디렉토리에서는 빌드할 소스가 없음으로 소스가 존재하는 서브 디렉토리를 열거   SUBDIRS = src

hello/src/Makefile.am

인스톨할 대상인 프로그램 hello를 작성하기 위해 이를 구성할 소스 파일들을 열거.   bin_PROGRAMS = hello   hello_SOURCES = hello.cpp hello.h main.cpp

hello/configure.ac

autoscan을 실행. configure.scan이 작성됨. configure.scan을 configure.ac로 이름 변경. 추가 기입.                                                  -*- Autoconf -*-   # Process this file with autoconf to produce a configure script.      AC_PREREQ(2.57)   AC_INIT(hello, 1.0, [bug-report@xxx.yyy.zz])   AM_INIT_AUTOMAKE([foreign])   AC_CONFIG_SRCDIR([src/Hello.cc])   AC_CONFIG_HEADER([config.h])      # Checks for programs.   AC_PROG_CXX   AC_PROG_CC      # Checks for libraries.      # Checks for header files.      # Checks for typedefs, structures, and compiler characteristics.   AC_C_CONST      # Checks for library functions.      AC_CONFIG_FILES([Makefile                    src/Makefile])   AC_OUTPUT 그럼 아래와 같이 될 것.   hello     +—– Makefile.am     +—– configure.ac     +—– src             +— Makefile.am             +— hello.cc             +— hello.h             +— main.cc

configure실시까지

autoheader 실행

config.h.in을 생성. ./configure 시 필요.

aclocal실행

aclocal.m4생성

automake실행

각 디렉토리에 있는 Makefile.am으로부터 Makefile.in을 생성. 그 외 인스톨 작업에 필요한 스크립트 파일을 생성   hello$ automake –add-missing –copy   configure.ac: installing `./install-sh’   configure.ac: installing `./mkinstalldirs’   configure.ac: installing `./missing’   src/Makefile.am: installing `./depcomp’   hello$

autoconf실행

configure 스크립트 생성   hello     +—– Makefile.am     +—– Makefile.in     +—– aclocal.m4     +—– auto4te.cache/     +—– config.h.in     +—– configure     +—– configure.ac     +—– decomp     +—– install-sh     +—– missing     +—– mkinstalldirs     +—– src             +— Makefile.am             +— Makefile.in             +— hello.cc             +— hello.h             +— main.cc               ltmain.sh, Makefile.in 등의 에러로 필요에 따라 <code> # autoreconf -i </code>

configure 실행

  hello     +—– Makefile     +—– Makefile.am     +—– Makefile.in     +—– aclocal.m4     +—– auto4te.cache/     +—– config.h     +—– config.h.in     +—– config.log     +—– config.status     +—– configure     +—– configure.ac     +—– decomp     +—– install-sh     +—– missing     +—– mkinstalldirs     +—– src             +— .deps/             |        +— Hello.Po             |        +— main.Po             +— Makefile             +— Makefile.am             +— Makefile.in             +— hello.cc             +— hello.h             +— main.cc

make실행

  * all     * 디폴트 타겟. 프로그램의 컴파일 링크 실시   * Makefile     * Makefile을 다시 생성   * tags     * 태크 파일(ctags/etags)을 생성   * check     * 테스트 실행   * install     * 인스톨 실시   * uninstall     * 언인스톨 실시   * clean     * 빌드시의 중간 생성물 삭제   * distclean     * Makefile을 포함하여 삭제

링크

http://www.02.246.ne.jp/~torutk/cxx/automake/automake.html
Having fun with exporting automake variables - or how it was obviously a pyflakes bug (no, it wasn't) ...

Each line of a Makefile target is executed in a sub-shell, this has pros and cons, but at least the following side-effect can be observed:

fun:
    export FOO="wunder bar"
    echo $$FOO

This doesn’t echo “wunder bar” to the cmdline when you run make because the export happens in a different shell then the echo.

You can anyhow set environment variables using the export keyword:

export FOO="wunder bar"
fun:
    echo $FOO

This now echos “wunder bar” to the cmdline when you run make.

So what is problematic with this? The quotes. The environment variable FOO will contain the string “wunder bar” - including the quotes! This happens because export is now the automake keyword, and that means the whole part on the right of the equals sign (=) is the value of the variable named on the left hand side (FOO). And in the example above this includes the quotes.

What happened to me earlier on was that I tried to set an environment variable (PYFLAKES_BUILTINS) which got picked up by pyflakes. I used:

export PYFLAKES_BUILTINS="_"
fun:
    pyflakes file.py

Now, spot the problem.

Solution: pyflakes (correctly) didn’t behave as expected (handle _ as a built-in), because the value of the variable was “_”, instead of _.

$ export PYFLAKES_BUILTINS="_"
$ pyflakes file.py

The above snippet on the other hand works oin the shell, because the quotes (in the export line) are interpreted by the shell, and are nto part of the PYFLAKES_BUILTIN variable.

Expressing vapi dependencies in automake.

Today I ran into trouble defining dependencies between different vala files I use within presence.
Automake allows to define dependencies based on targets (like a library libui.a or sources ui.c). But how can I add a dependency on a .vapi? (This dependency might be needed, because app is using some code from libui.)

If I just add a dependency on the library level, make fails when looking for the library while generating the C-Code. Look at the following example:

app_SOURCES = main.vala
app_LIBADD = libA.a libB.a

In the above example main.vala already needs informations about libA and libB when valac is generating the C-Code. But this doesn’t work in a parallel build, when libA or libB’s vapi is not yet generated.
So I needed to tell automake/make somehow to depend on the .vapi files of libA/libB - but how? Automake doesn’t know about vapis and doesn’t provide any targets for them.

But it seems as this can be solved like this: You can tell automake to depend on the .c file corresponding to your .vala (and so .vapi) file, as the .c file is generated at the same time the vapi is generated. And - oh wonder - automake has targets for the c files generated by valac, therefor it’s possible to use the .c files as dependencies when you mention them in the _SOURCES part of the target in question.

app_SOURCES = main.vala libA.c libB.c
app_LIBADD = libA.a libB.a

Adding the .c files to the sources doesn’t do any harm, but allows app to depend on the availability of (a) the vapis and (b) the libs for libA and libB. So dependencies on both levels (code generation and linking).

Have a look at this Makefile.am for my real world example.

There is a high probability that I’ve missunderstood or forgot something. Hints and comments are welcome.
Check if your car is part of the Takata recall

If your vehicle is manufactured by BMW, Chrysler, Daimler Trucks, Ford, General Motors, Honda, Mazda, Mitsubishi, Nissan, Subaru or Toyota, you might be affected by a national recall on air bags. Check the National Highway Traffic Safety Administration’s (NHTSA) website using the VIN search tool to confirm whether your individual vehicle is affected by this recall, or by searching by VIN on a specific vehicle-maker’s site. Check back regularly as automakers confirm which vehicles are affected.

The recall found that the airbags are made with materials that can rupture over time and have been blamed for six deaths worldwide. This Takata inflator recall affects nearly 34 million vehicles.

As manufacturers supply a complete list of affected vehicles, NHTSA will include updates on its recalls page.

Reuters FYI: Cartwheeling spider

Meet the cartwheeling spider. He’s one of about 18,000 new species — some extinct, some living — that scientists have discovered in the past year. The spider crawled (or cartwheeled, as it were) to a rarefied group of the “top 10″ most exceptional animal discoveries during 2014 — others include the chicken from hell, fanged frog and this weird sea slug. You can watch the cartwheeling spider in action, over here.

And read on for more news you might have missed — who knows what you might discover:

Smart cars, stupid problems

As automakers stuff their wares with blue tooth, GPS, wifi and other forms of entertainment, the ensuing traffic problems are as irritating as they were predictable.

Yeah, but watch them try to assemble a dresser from Ikea

Ancient man made an impressive number of stone tools much earlier than researchers originally thought.

Video: Make way for penguins

A group of blue penguins arrives in the Bronx.

They didn’t bahhh-ther questioning it

German police find a lamb in a Munich brothel.

anonymous asked:

how comes the euros tend to build better engines than we do

Blasphemy! Go sit in the corner. Fucking traitor.

Really it’s because the American auto industry was supremely fucked for a couple decades. The 70′s gas crisis and all the regulations that got slapped on American automakers didn’t foster innovation. That in combination with an entirely different school of thought when it comes to performance (small and efficient vs big and torquey). I don’t know if any of this makes sense. I haven’t had my coffee yet.

TAKATA air bags!!

I want you all to be safe and encourage you to make sure your airbags are ok - there are 34 MILLION cars affected by this! Please take a sec to make sure your car isn’t one of them! 

About 33.8 million vehicles, made by 11 different automakers, have been recalled to replace frontal airbags on the driver’s side or passenger’s side, or both. The airbags, made by major parts supplier Takata, were installed in cars from model year 2002 through 2008. Some of those airbags could deploy explosively, injuring or even killing car occupants. 

Ok? did you check? ok good