Macos – How to execute a multiple line configure command using Mac OS X terminal

macmacos

I am reading a nice article about upgrading php on mac os x mountain lion.

At the Install part of the document the author says that the user must execute a multiple line configure command.
What is the easiest way to do it, using mac os terminal?
Thank you.

PS : I have executed yesterday the configure command without the parameters.
Can this action cause any problems with the re-execution of configure command (with parameters this time)?

Best Answer

In Mac OS X the default shell (Terminal.app calls) is Bash. In this case, you can use the \ character to continue a line if needed. This is shown in the tutorial you link to. Other assistance may be gained from reading about Mac OSX Shell Scripting Basics.

./configure  \
--prefix=/usr  \
--mandir=/usr/share/man  \
--infodir=/usr/share/info  \
--sysconfdir=/private/etc  \

etc

Typically you only need to run the configure command once with your options, then make for subsequent builds. You could put the commands into a script to run, of which you can then just run that one file to execute your commands:

makeProg.sh

#!/bin/sh

cd /prog/dir

./configure  \
 --prefix=/usr  \
 --mandir=/usr/share/man  \
 --infodir=/usr/share/info  \
 --sysconfdir=/private/etc  \

make
Related Question