วิธี set PATH Solaris เพื่อ configure กับ make file

ช่วงนี้มีเรื่องให้ต้อง compile โปรแกรมบน Solaris 10 x86 แล้วก็ติดปัญหาเรื่อง set compiler path หลายครั้งจนขอจดไว้ต้อง set อะไรบ้าง

พอโหลด source มา untar file เสร็จสั่ง configure ก็ขึ้นแบบนี้มาเลย

# ./configure
checking build system type... i386-pc-solaris2.10
checking host system type... i386-pc-solaris2.10
checking target system type... i386-pc-solaris2.10
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/disk2/opt/ruby':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
#

ไปค้นๆ ดู ต้องไปหา gcc ครับ ซึ่ง default ของ Solaris ในกรณีที่ไม่ได้ลง Sun Studio มันอยู่ที่ /usr/sfw/bin เราก็ export PATH ไป

# export PATH=/usr/sfw/bin:$PATH

พอสั่ง ./configure ก็จะเจอ error ว่าไม่มี make -*-

checking for prefix of external symbols... ./configure: line 18702: conftest.o: command not found
NONE
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking if make is GNU make... ./configure: line 18909: make: command not found
no
checking for safe null command for make... configure: error: no candidate for safe null command

ไปค้นๆ ดู make ไม่ได้อยู่ใน /usr/sfw/bin แต่อยู่ใน /usr/ccs/bin ต่างหาก -*-

ดังนั้นวิธีการ export ที่ถูกต้องเพื่อที่จะ configure และ make ได้คือ

# export PATH=/usr/ccs/bin:/usr/sfw/bin:$PATH

ที่นี่ก็จะ build ได้ พอ make install โปรแกรมก็จะไปอยู่ใน /usr/local แล้วเราก็ค่อยไปสร้าง softlink อีกทีครับ

One thought on “วิธี set PATH Solaris เพื่อ configure กับ make file

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.