2013-03-26 4 views
0

MacPorts를 사용하여 GCC 4.7.2의 유니버설 빌드를 설정하고 있습니다. 종속성 중 하나는 libstdcxx이라는 하위 포트입니다.이 하위 포트는 빌드 한 다음 삭제합니다.fat 정적 라이브러리를 컴파일하기 위해 libstdC++ portfile을 수정하는 방법은 무엇입니까?

gcc47 포트 파일에 libstdcxx 항목을 편집하여 재구성 한 후 정적 libstdc++.a 라이브러리를 삭제하지 않도록했습니다. 나는 또한 i386 아키텍처이 파일에 지원을 추가 할

$ sudo port -n upgrade --force libstdcxx +universal 
---> Computing dependencies for libstdcxx 
... 
$ lipo -info /opt/local/lib/libstdc++.a 
input file /opt/local/lib/libstdc++.a is not a fat file 
Non-fat file: /opt/local/lib/libstdc++.a is architecture: x86_64 

:

그러나, 정적 라이브러리는 64 비트 (x86_64) 파일입니다.

뚱뚱한 정적 인 libstdc++ 라이브러리를 만들기 위해 수행해야 할 추가 단계는 무엇입니까? 아니면 MacPorts에서는 불가능합니까? 다른 하나의 옵션은 GCC 4.7.2를 두 번 재배포하고 (i386x86_64 구조 지원을 얻으려는),이 응용 프로그램의 소스와 함께이 정적 라이브러리를 연결하는 유일한 옵션입니까?

추가 - 3월 27일

브렛 헤일의 제안이 작동을하지 않은 것으로 보입니다 2013. 빌드 프로세스가 실패했습니다. 당신이 GCC 컴파일러 GCC를 구축하는 경우

:notice:configure ---> Configuring libstdcxx 
:debug:configure Using compiler 'Mac OS X clang' 
:debug:configure Executing proc-pre-org.macports.configure-configure-0 
:debug:configure Executing org.macports.configure (libstdcxx) 
:debug:configure Environment: CPATH='/opt/local/include' CXXFLAGS='-pipe -O2' CPPFLAGS='-I/opt/local/include' CFLAGS='-pipe -O2' AS_FOR_TARGET='/opt/local/bin/as' LIBRARY_PATH='/opt/local/lib' MACOSX_DEPLOYMENT_TARGET='10.8' CXX='g++ -arch x86_64 i386' CPP='gcc -arch x86_64 i386 -E\ 
' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/.CC_PRINT_OPTIONS' F90FLAGS='-pipe -O2' LD_FOR_TARGET='/opt/local/bin/ld' RANLIB_FOR_TARGET='/opt/local/bin/ranlib' LDFLAGS='-L\ 
/opt/local/lib' OBJDUMP_FOR_TARGET='/opt/local/bin/objdump' OTOOL='/opt/local/bin/otool' FCFLAGS='-pipe -O2' OBJC='/usr/bin/clang' INSTALL='/usr/bin/install -c' AR_FOR_TARGET='/opt/local/bin/ar' NM_FOR_TARGET='/opt/local/bin/nm' FFLAGS='-pipe -O2' OBJCFLAGS='-pipe -O2' CC_PRINT_OPT\ 
IONS='YES' STRIP_FOR_TARGET='/opt/local/bin/strip' CC='gcc -arch x86_64 i386' OTOOL64='/opt/local/bin/otool' 
:debug:configure Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/build" && ../gcc-4.7.2/configure --prefix=/opt/local --build=x86_64-apple-darwin12 --includedir=/opt/local/incl\ 
ude/gcc47 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/gcc47/\ 
c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/lo\ 
cal/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-ppl-version-check --enable-languages=c++ --disable-bootstrap --with-pkgversion="MacPorts gcc47 4.7.2_2+universal"' 
:debug:configure Executing command line: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/build" && ../gcc-4.7.2/configure --prefix=/opt/local --build=x86_64-apple-darwin12 --includedir=/opt/local\ 
/include/gcc47 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/g\ 
cc47/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/o\ 
pt/local/bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-ppl-version-check --enable-languages=c++ --disable-bootstrap --with-pkgversion="MacPorts gcc47 4.7.2_2+universal" 
:info:configure checking build system type... x86_64-apple-darwin12 
:info:configure checking host system type... x86_64-apple-darwin12 
:info:configure checking target system type... x86_64-apple-darwin12 
:info:configure checking for a BSD-compatible install... /usr/bin/install -c 
:info:configure checking whether ln works... yes 
:info:configure checking whether ln -s works... yes 
:info:configure checking for a sed that does not truncate output... /usr/bin/sed 
:info:configure checking for gawk... no 
:info:configure checking for mawk... no 
:info:configure checking for nawk... no 
:info:configure checking for awk... awk 
:info:configure checking for libitm support... yes 
:info:configure checking for gcc... gcc -arch x86_64 i386 
:info:configure checking for C compiler default output file name... 
:info:configure configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/build': 
:info:configure configure: error: C compiler cannot create executables 
:info:configure See `config.log' for more details. 
:info:configure Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/work/build" && ../gcc-4.7.2/configure --prefix=/opt/local --build=x86_64-apple-darwin12 --includedir=/opt/local/include/\ 
gcc47 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/gcc-4.7 --with-libiconv-prefix=/opt/local --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.7 --with-gxx-include-dir=/opt/local/include/gcc47/c++/\ 
--with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-ppl=/opt/local --with-cloog=/opt/local --enable-cloog-backend=isl --disable-cloog-version-check --enable-stage1-checking --enable-lto --enable-libstdcxx-time --with-as=/opt/local/bin/as --with-ld=/opt/local/\ 
bin/ld --with-ar=/opt/local/bin/ar --with-bugurl=https://trac.macports.org/newticket --disable-ppl-version-check --enable-languages=c++ --disable-bootstrap --with-pkgversion="MacPorts gcc47 4.7.2_2+universal" 
:info:configure Exit code: 77 
:error:configure org.macports.configure for port libstdcxx returned: configure failure: command execution failed 
:debug:configure Error code: NONE 
:debug:configure Backtrace: configure failure: command execution failed 
    while executing 
"$procedure $targetname" 
:info:configure Warning: targets not executed for libstdcxx: org.macports.activate org.macports.configure org.macports.build org.macports.destroot org.macports.install 
:notice:configure Please see the log file for port libstdcxx for details: 
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_gcc47/libstdcxx/main.log 

답변

0

것은, 당신이 -arch 옵션으로 보편적 인 객체/라이브러리를 생산하기 위해 시도 할 수 :

sudo port -n upgrade --force libstdcxx +universal \ 
configure.cc="gcc -arch x86_64 i386" configure.cxx="g++ -arch x86_64 i386" 
+0

이는 원인이 여기에 오류 로그의 조각이다 실패 할 빌드. 내 질문에 오류 로그의 관련 부분을 추가했습니다. –