2013년 11월 25일 월요일

ndk 툴체인 만들기

>> make-standalone-toolchain.sh

#!/bin/bash

export ANDROID_NDK=android-ndk-r9   #your ndk path
export ANDROID_NDK_TOOLCHAIN_ROOT=android-toolchain-14  #dir to install
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh \
  --system=linux-x86_64 \   #remove if you have 32
  --toolchain=arm-linux-androideabi-4.6 \
  --platform=android-14 \
  --install-dir=$ANDROID_NDK_TOOLCHAIN_ROOT

curl라이브러리 안드로이드 ndk빌드

jni/Application.mk >>
NDK_TOOLCHAIN_VERSION=4.6
APP_PROJECT_PATH := $(shell pwd)
APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/packages/Android/Android.mk

lib/curl_config.h
include/curl/curlbuild.h

Android.mk 에서 build the curl binary 아래부분은 지워준다

ndk-build

so파일을 만들고 싶다면 build-static-library를 build-shared-library로 바꿀것..

2013년 11월 1일 금요일

우분투 12버전의 C 포함

Are you using Ubuntu 12.04? There is a known problem that puts the files in a non standard location. You'll also need to do:

export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
export CPLUS_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)

somewhere before you build (say in your .bashrc).

2013년 10월 13일 일요일

우분투 12.04에서 xorg.conf 생성

루트에서 파일 생성(뭐 로그파일 지워야 한다고 나오면 지우고 다시 명령어 입력)
# X -configure

복사
# cp /root/xorg.conf.new /etc/X11/xorg.conf

우분투에서 인텔 그래픽 드라이버 업데이트

sudo add-apt-repository ppa:glasen/inteldriver
sudo apt-get update
sudo apt-get install xorg-xserver-video-intel

2013년 10월 12일 토요일

우분투에서 nvidia 삭제하고 원래대로 복구하기

먼저 nvidia와 관련된 모든 패키지를 삭제한다

$ sudo apt-get remove --purge nvidia-*

그 후 다른 패키지가 있나 검색해본다

$ sudo dpkg -l | grep -i nvidia

nvidia가 삭제된 것으로만 끝나면 해상도 및 각종 문제가 남아있다
원래대로 복구해줘야 한다

$ sudo apt-get install ubuntu-desktop

때때로 nouveau 드라이버를 nvidia에서 막는 경우가 있으므로 이를 복구시켜준다

$ echo 'nouveau' | sudo tee -a /etc/modules

마지막으로 구제불능이 되버린 xorg.conf를 환생시키기 위해 삭제해준다

$ sudo rm /etc/X11/xorg.conf


우분투 해상도 문제

아래의 해상도는 예제이므로 절대 자신의 해상도를 넘어서는 숫자를 넣지 말것!!

우분투 12.04에서 해상도가 갑자기 변경되어버렸을시 돌리고 싶다면..
(X윈도우 상에서 가능)

$ cvt 1920 1080
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

방금 cvt명령에서 나온 결과물에서 Modeline 뒷부분을 복사해서 아래처럼 붙여넣어준다

$ xrandr --newmode "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

적용 가능한 디스플레이 확인..

$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 720, maximum 8192 x 8192
LVDS1 connected 1280x720+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
   640x480        59.9
   1280x720_60.00   59.9*
VGA1 disconnected (normal left inverted right x axis y axis)
   1920x1280_60.00   60.0
   640x480_60.00   59.4
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)
  1920x1080_60.00 (0x73)  173.0MHz
        h: width  1920 start 2048 end 2248 total 2576 skew    0 clock   67.2KHz
        v: height 1080 start 1083 end 1088 total 1120           clock   60.0Hz

VGA1은 잘못 추가한것... LVDS1이 커넥되어있으므로 그것을 추가해야 한다

$ xrandr --addmode LVDS1 "1920x1080_60.00"

$ xrandr --output LVDS1 --mode "1920x1080_60.00"

위의 명령어를 넣어서 해상도가 적용되면 완료된 것이다