Do I have to call a project where many assistant script worthy Chief Executive with various command-line options available, the script Executable thinks that is in the same directory, so the executable call in the script looks like must autotools the IMO the simplest solution with: Under the For example, you create a macro: If this path is found then this macro creates Configure .ac To convert your script .en files, then the replacement will be: src / Makefile.am < / p> src / script1.sh src / script2.sh ./ my_program . This, however, is not very flexible, if the program is installed in the / usr / bin directory, and not in the current directory, what will happen? ./ my_program or just my_program Transfers the call of executable with, depending on whether the executable is already installed or not?
m4 / create a new m4 macro that finds the path to your program, and sets it in a variable.
MY_PROGRAM_PATH_CHECK ([action-if-found], MY_PROGRAM_PATH variable.
MY_PROGRAM_PATH_CHECK (, [AC_MSG_ERROR (did not [my_program path, woot?]) AC_SUBST (MY_PROGRAM_PATH) AC_CONFIG_FILES ( [Src / script1.sh], [chmod + x Src / script1.sh]) AC_CONFIG_FILES ([src / script2.sh], [chmod + x src / script2.sh])
bin_SCRIPTS = script1. sh script2.sh
@ MY_PROGRAM_PATH @ / my_program --option1
@ MY_PROGRAM_PATH @ / my_program --option2 < / Code>
Comments
Post a Comment