./configure 명령에 라이브러리 경로를 추가하는 방법은 무엇입니까? /home/foo/sw/include. ./configure –help 다음을

./configure라이브러리 및 일부 포함 파일에 연결하고 싶습니다 . 내 라이브러리는에 저장되고 /home/foo/sw/lib/파일은에 저장됩니다 /home/foo/sw/include.

./configure --help 다음을 버립니다.

일부 영향력있는 환경 변수 :

  CC           C compiler command
  CFLAGS       C compiler flags
  LDFLAGS      linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
  LIBS         libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS     (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
               you have headers in a nonstandard directory <include dir>
  CPP          C preprocessor

나는 다양한 조합을 시도했다 :

./configure --prefix=/home/foo/sw -I</home/foo/sw/include> -L</home/foo/sw/lib/>
./configure --prefix=/home/foo/sw -I=/home/foo/sw/include -L=/home/foo/sw/lib/
./configure --prefix=/home/foo/sw -I/home/foo/sw/include -L/home/foo/sw/lib/
etc..

그러나 나는 구문을 올바르게 얻을 수없는 것 같습니다. 누구든지 나를 도울 수 있다면 크게 감사하겠습니다. 감사!



답변

의 의미를 놓쳤다

일부 영향력있는 환경 변수 :

따라서 환경 변수로 설정하십시오. configure는 구성 파일과 환경을 확인하여 LDFLAGS 및 CPPFLAGS를 결정합니다. 당신은 이것처럼 설정할 수 있습니다 …

export CPPFLAGS='-I/home/foo/sw/include/'
export LDFLAGS='-L/home/foo/sw/lib/'
./configure

또는 단일 라이너로 :

env CPPFLAGS='-I/home/foo/sw/include/' LDFLAGS='-L/home/foo/sw/lib/' ./configure

아래의 하위 디렉토리를 사용하지 못할 수도 있습니다. /home/foo/sw/lib/

라이브러리를 넣으면 오류 /home/foo/sw/lib/bar/가 표시 될 수 있습니다 lib not found.

그러나 여러 항목을 사용할 수 있습니다.

LDFLAGS="-L/home/foo/sw/lib/ -L/home/foo/bar/lib/"


답변