This line is ok (line 16): use opengl && myconf="$myconf --with-gl" || myconf="$myconf --without-gl" But the next line overwrites the opengl-use (line 17): myconf="$myconf --without-gl"