2010-02-06 124 views
3

我在Snow Leopard上遇到Python 2.6.4的構建問題。Mac OS 10.6/Snow Leopard上的Python構建問題

  • 的Mac OS X 10.6
  • Yonah的CPU,32位
  • GCC-4.2.1

更新我

通過去除所有解決來自CFLAGS的非標準包含和庫(發生了在那裏是一個uuid/uuid.h ......)。儘管如此,儘管下面描述的錯誤,它編譯,與/usr/include/hfs/hfs_format.h:765成爲一個熱點。對於有問題的好奇或足智多謀,源文件:

$ cat /usr/include/hfs/hfs_format.h 
... 
748 #include <uuid/uuid.h> 
749 
750 /* JournalInfoBlock - Structure that describes where our journal lives */ 
751 
752 // the original size of the reserved field in the JournalInfoBlock was 
753 // 32*sizeof(u_int32_t). To keep the total size of the structure the 
754 // same we subtract the size of new fields (currently: ext_jnl_uuid and 
755 // machine_uuid). If you add additional fields, place them before the 
756 // reserved field and subtract their size in this macro. 
757 // 
758 #define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48) 
759 
760 struct JournalInfoBlock { 
761   u_int32_t  flags; 
762   u_int32_t  device_signature[8]; // signature used to locate device. 
763   u_int64_t  offset;  // byte offset to the journal on the device 
764   u_int64_t  size;   // size in bytes of the journal 
765   uuid_string_t ext_jnl_uuid; 
766   char   machine_serial_num[48]; 
767   char   reserved[JIB_RESERVED_SIZE]; 
768 } __attribute__((aligned(2), packed)); 
769 typedef struct JournalInfoBlock JournalInfoBlock; 
... 

我離開的問題開放的,因爲構建產生太多的警告,但此錯誤仍然困擾我有點...

$ cat Makefile 
... 
126 MACOSX_DEPLOYMENT_TARGET=10.3 # => 10.6 
... 
更新II

爲了擺脫關於部署目標的警告,我在編譯之前編輯的


原始的問題

當試圖從源代碼構建Python 2.6.4,我碰到一個錯誤:

似乎在Python/mactoolboxglue.c根。提示歡迎!


我也得到了很多這些類型的警告:

/usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for \ 
Intel with Mac OS X Deployment Target < 10.4 is invalid. 
gcc -c -arch ppc -arch i386 -isysroot/-fno-strict-aliasing -DNDEBUG -g \ 
-fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include \ 
-DPy_BUILD_CORE -o Objects/structseq.o Objects/structseq.c 
In file included from /usr/include/architecture/i386/math.h:626, 
      from /usr/include/math.h:28, 
      from Include/pyport.h:235, 
      from Include/Python.h:58, 
      from Objects/structseq.c:4: 
+1

'/usr/include/AvailabilityMacros.h:108:14:警告:#warning後樓爲\ 英特爾與Mac OS X部署目標<10.4爲invalid.'這些錯誤所致默認情況下,Python ./configure腳本將MACOSX_DEPLOYMENT_TARGET設置爲10.3。看到我的答案如何擺脫這些。 – 2010-02-06 01:14:18

+0

而不是編輯生成文件中,做'出口MACOSX_DEPLOYMENT_TARGET = 10.6'之前運行'。/ configure'。 – 2010-02-06 04:05:49

回答

4

嘗試增加--universal-archs=32-bitconfigure參數。

編輯:您可能還需要設置環境變量MACOSX_DEPLOYMENT_TARGET=10.6並明確使用10.6 SDK:

export MACOSX_DEPLOYMENT_TARGET=10.6 
./configure --universal-archs=32-bit --enable-universalsdk=/Developer/SDKs/MacOSX10.6.sdk ... 

還有與10.6建立一些Python配置的問題。如果您重新使用構建目錄,請確保清除之前運行的所有緩存文件可能已遺留下來。

順便說一句,如果你只是需要一個32位版本,你可能使用2.6.4 OS X安裝程序從python.org

+0

配置:錯誤:無法識別的選項:--dep目標= 10.6 //但是我發現MACOSX_DEPLOYMENT_TARGET = 10.3設置在生成文件;改變了它,現在輸出看起來好多了;再次感謝! – chang 2010-02-06 02:19:55

+0

對不起,我張貼在急速。 --dep-target是安裝程序構建腳本的參數,未配置。是的,在調用configure之前設置環境變量是正確的。解決答案。 – 2010-02-06 03:58:47

1

看來,你是不是遇到了此問題只有一個:

不知道這是否有相同的根源:

http://trac.macports.org/ticket/21282

向下滾動到最後的意見,這似乎表明了一個積極的結果。 (這裏重複爲方便起見):

... //從trac.macports.org報價:

「嘗試重命名,移動或刪除/opt/local/include/uuid/uuid.h」 ... //最終報價

+0

我不使用macports,但我會通讀該線程(再次;),謝謝... – chang 2010-02-06 00:31:58

相關問題