macport編譯並管理debug版本代碼

sudo vim /opt/local/share/macports/Tcl/port1.0/portconfigure.tcl
 

-133 default configure.cflags    ${configure.optflags}
+133 default configure.cflags    {"-ggdb -g3 -gdwarf-2 ${configure.optflags}"}

 

Cui-CharlesmatoMacBook-Pro:macports CharlesCui$ pwd
/opt/local/etc/macports
Cui-CharlesmatoMacBook-Pro:macports CharlesCui$ sudo vim macports.conf
 

 85 # Set whether to automatically execute "clean" after "install" of ports
 86 portautoclean           no
 把autoclean設置爲no,可以保存port下載後的代碼,這樣debug的時候就能找到源碼了.

 

這樣改掉之後port安裝的所有要編譯的代碼都會以debug形式編譯出來,同時還帶有macro.

 

port安裝後的代碼存放在以下目錄中,work裏面存放的是編譯好後的源碼.

 


macport有高級的用法和配置,但我花了一上午都沒搞定,我討厭複雜的產品,文檔我也沒看懂,太複雜.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章