porting: Linux to Freebsd

Robert Huff roberthuff at rcn.com
Mon Jun 8 13:53:32 UTC 2009


Alexander Leidinger writes:

>  > 	First problem:
>  
>  Looks like bash-isms in configure.

	for (i = 0; i < 10; i++) hit_forehead_with_desk();

	I had already figured out replacing "make" with "gmake"; this
should have been obvious.

>  
>  > 	When following the instructions here
>  > "http://ctp2.darkdust.net/anonsvn/branches/linux/doc/README.linux" I
>  > get to step 2 ("configure") and get this:
>  >
>  > test: x/usr/bin/byacc: unexpected operator
>  
>  Some possibilities:
>    - In the test for byacc they maybe forgot quotes to protect an empty value.
>    - wrong operator used in test
>    - unknown bashism

	Right: I re-ran under bash, and got the same problems.
	Looking at configure.ac, I see:

AC_PATH_PROG(YACC,byacc,no)
if test "x$YACC" == "xno"
then
   AC_MSG_ERROR([

        byacc could not be found!

        Make sure byacc is in your path.
 
   ])
else
   YACC="${YACC}"
   YFLAGS="-d -v"
   AC_SUBST(YACC)
   AC_SUBST(YFLAGS)
   AC_DEFINE(AUTOMAKE_INVOKES_YACC,1,[Defined when automake runs yacc and renames the output files])
fi


>  > checking for acroread... /usr/local/bin/acroread
>  > ./configure: ${CFLAGS/...}: Bad substitution
>  
>  Looks like bashism. Someone tries to substitute something in CFLAGS,  
>  but this kind of advanced substitution is not supported in a posix  
>  compliant sh. You can test this assumption by installing bash and  
>  runnging "bash ./configure" instead. If it is true, you need to fix  
>  configure.in or configure.ac.

	Relevant bit is:

for ac_remove_CFLAG in "-O1" "-O2" "-O3" ; do
	CFLAGS=${CFLAGS//${ac_remove_CFLAG}/}
	CPPFLAGS=${CPPFLAGS//${ac_remove_CFLAG}/}
	CXXFLAGS=${CXXFLAGS//${ac_remove_CFLAG}/}
done


				Robert Huff



More information about the freebsd-ports mailing list