Hi

I have not built master for a while, and now find GNU specific extensions
that are not portable. Since it is not the first time I address them, 
I would like to send a reminder about it:

1) bash-specific syntax
Do not write:
        test $foo == "bar" 
But instead write:
        test $foo = "bar" 

The = operator is POSIX compliant. The == operator works in bash end ksh.

2) GNU sed specific flag
Do not write:
        sed -i 's/foo/bar/' buz
But instead write:
        sed  's/foo/bar/' buz > buz.new && mv buz.new buz

The -i  flags is a GNU extension that is not implemented in BSD sed.

3) GNU make specific syntax
Do not write:
foo.c:  foo.x foo.h
        ${RPCGEN} $<
But instead write:
foo.c:  foo.x foo.h
        ${RPCGEN} foo.x
Or even:
foo.c:  foo.x foo.h
        ${RPCGEN} ${@:.c=.c}

$< does not work everywhere in non GNU make. If I understand 
autoconf doc correctly, it does not work outside of generic rules (.c.o:)


-- 
Emmanuel Dreyfus
m...@netbsd.org
_______________________________________________
Gluster-devel mailing list
Gluster-devel@gluster.org
http://supercolony.gluster.org/mailman/listinfo/gluster-devel

Reply via email to