본문 바로가기
【🧰 SW Info & Tips】/🦿 Automake & Autoconf

[autoconf] Macro 정리 (Canonicalizing)

반응형
▣ 원문 출처: http://funkylocker.tistory.com/entry/autoconf-Macro-정리-Canonicalizing
 

AC_CANONICAL_SYSTEM
시스템 타입을 결정하고, 일반 시스템 타입명의 출력 인자를 설정한다.
유저는 AC_CANONICAL_BUILD, AC_CANONICAL_HOST, AC_CANONICAL_TARGET 사용을 권장.

AC_CANONICAL_BUILD
일반적인 빌드 시스템 타입 변수, build, build_cpu, build_vendor, build_os 를 연산한다.
configure 시 --build 옵션을 통해 해당 변수에 값을 대입할 수 있다.

AC_CANONICAL_HOST
일반적인 호스트 시스템 타입 변수, host, host_cpu, host_vendor, host_os 를 연산한다.
configure 시 --host 옵션을 통해 해당 변수에 값을 대입할 수 있다.

AC_CANONICAL_TARGET
일반적인 타겟 시스템 타입 변수, target, target_cpu, target_vendor, target_os 를 연산한다.
configure 시 --target 옵션을 통해 해당 변수에 값을 대입할 수 있다.


=======================================================================================================
사용 예제.

[configure.ac]
# get system information
AC_CANONICAL_SYSTEM

# set os type
case ${host_os} in
    "")
    # 아무 것도 없는 경우
    ;;
    i?86*)
    # i386, i686 등 일반적인 OS
    ;;
    solaris*)
    # 솔라리스
    ;;
    # defualt
    *)
    ;;
esac


# get host information
AC_CANONICAL_HOST

# case 매크로
AS_CASE ([$host],
    [alpha*-*-*-*], [CYCLE_OBJ=rpcc.o],
    [i?86-*-*],        [CYCLE_OBJ=rdtsc.o],
    [CYCLE_OBJ=""]
)
# CYCLE_OBJ 변수 생성
AC_SUBST([CYCLE_OBJ])

반응형

'【🧰 SW Info & Tips】 > 🦿 Automake & Autoconf' 카테고리의 다른 글

GNU 빌드시스템 (2)  (0) 2020.10.24
GNU 빌드시스템 (1)  (0) 2020.10.24
[autotools] Manual  (0) 2011.10.07
[automake] libtool  (0) 2011.10.07
[autotools] automake, autoconf 사용법  (0) 2011.10.07