![]() |
|
FreeBSD Ports and Packages Installation and upgrading of ports and packages on FreeBSD. |
![]() |
|
Thread Tools | Display Modes |
|
|||
![]()
Hi
I am trying out FreeBSD and don't know much scripting - I am trying to build some programs from the ports. Now in linux I could do something like ./configure --abcdef --ghijkl then "make install", and the docs for various programs also tell me how to config in this way. What is the equivalent for FreeBSD ports? I have tried something like "make config" or "make showconfig" but it doesn't give the equivalent functionality or sometimes it just says "no options" evne though the program's site says there are. Well I noticed that there is no configure script in the ports directories which is why ./configure doesn't work, but when building stuff I can see that it has extracted the script elsewhere and is running it. So how do I pass the options to that script? I have also ventured into the makefile, for example this one Code:
.if !defined(WITHOUT_NLS) USE_ICONV= yes CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ LIBS="-L${LOCALBASE}/lib -liconv" CONFIGURE_ARGS+= --enable-nls PLIST_SUB+= NLS:="" .else CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ LIBS="-L${LOCALBASE}/lib" CONFIGURE_ARGS+= --disable-nls PLIST_SUB+= NLS:="@comment " .endif .if !defined(WITHOUT_REMEMBER) CONFIGURE_ARGS+= --enable-remember .else CONFIGURE_ARGS+= --disable-remember .endif .if !defined(WITHOUT_SLIT) CONFIGURE_ARGS+= --enable-slit .else CONFIGURE_ARGS+= --disable-slit .endif Thanks for all help. |
|
||||
![]()
On most ports, you run
# make && make install . The port will ask you what settings you want, and save your answers in a config file for next time (/var/db/ports/portname/config, I think)Some ports have not been updated to use this system, and for them you will need to set the variables you have seen. The syntax is # make WITHOUT_FEATURE="yes" WITH_FEATURE="yes" USE_PROG_VERSION="2.3" install . You can also use the -D argument to make if you prefer. (make -DWITH_FEATURE )There are a number of ways to automate things. Ports that use the config system automate themselves. for the others, there are a number of different options. If you are using portupgrade to manage your ports, then it has a /usr/local/etc/pkgtools.conf file to automate things. The portsconf ports allows you to automatically set ports variables in it's config file. A very clever way is by slightly misusing /etc/make.conf - carpetsmoker at this forum has an example - to insert make variables depending on the port you are building. Edit carpetsmoker's make.conf
__________________
The only dumb question is a question not asked. The only dumb answer is an answer not given. Last edited by robbak; 30th September 2008 at 11:44 PM. |
|
||||
![]()
Generally you should stick to the options that ports provide, whether through the 'config' target or the -DWITH_FOO knobs that Robbak mentined. The CONFIGURE_ARGS variable should get passed onto ./configure when a port uses it, so
# make CONFIGURE_ARGS+="--custom-args" would likely allow you to modify the configure arguments used for the port directly, if the port Makefile doesn't give you proper way of controlling he build options you need (for some odd reason). Generally there should be no need to manipulate the configure script directly.When in doubt or curiosity about what something does in ports, open /usr/ports/Mk/ and start reading. Best way to find out, even compared to the manual!
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
||||
![]()
Thanks for pointing that out, I didn't realize that. But that does makes me very happy, that I don't manually adjust configure args...
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Good Bash/Scripting book? | cwhitmore | Programming | 10 | 22nd December 2017 03:59 PM |
Makefile Problem | BadWolf | Programming | 4 | 15th March 2009 01:58 PM |
Shell scripting resources | J65nko | Programming | 0 | 23rd December 2008 09:57 PM |
Shell Scripting with BSD | chavez243 | Programming | 9 | 3rd December 2008 03:03 AM |
Change Makefile options in ports | shep | FreeBSD Ports and Packages | 5 | 18th August 2008 07:58 AM |