-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,
I would like to ask for inclusion regarding two issues:
 1) respect LDFLAGS env during linking
 2) don't enforce any optimization/debug flags by default
Both are default policies in most OSes.
Best regards,
Kacper Kowalik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iJwEAQECAAYFAkx007UACgkQIiMqcbOVdxSs5AP/dm1owWb2UirxCvAJu0oK7+r+
Bew10/KLKcYnh3P0VEKjFVR7TmQsxkC/1N+zZ+c9/4/7Bg8i4FEKy9xazKbD4tPB
21f9UFL4wPXy7m84E7TkOQjA7o23CH8GuFg54xe09sfHfH9EZ6VLAgg4xYhjYsoI
LzsXwMU8Pnlw8PsKVto=
=nuY7
-----END PGP SIGNATURE-----
* Respect user LDFLAGS
* GDB_FLAGS -> GDB_CFLAGS to retain convention
* introduce --enable-optimization
* set GDB_CFLAGS only if --enable-debug
* set OPT_CFLAGS only if --enable-optimization

--- openais-1.1.4/services/Makefile.am
+++ openais-1.1.4/services/Makefile.am
@@ -78,13 +78,13 @@
 
 else
 service_amf.lcrso: $(AMF_OBJECTS)
-	$(CC) $(CFLAGS) -shared -Wl,-soname=$@ $^ -o $@
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$@ $^ -o $@
 
 service_%.lcrso: %.o
-	$(CC) $(CFLAGS) -shared -Wl,-soname=$@ $^ -o $@
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$@ $^ -o $@
 
 %.lcrso: %.o
-	$(CC) $(CFLAGS) -shared -Wl,-soname=$@ $^ -o $@
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$@ $^ -o $@
 endif
 
 %.o: %.c
--- openais-1.1.4/configure.ac
+++ openais-1.1.4/configure.ac
@@ -166,9 +166,13 @@
 	[ default="no" ])
 
 AC_ARG_ENABLE([debug],
-	[ --enable-debug          : enable debug build. ],
+	[  --enable-debug          : enable debug build. ],
 	[ default="no" ])
 
+AC_ARG_ENABLE([optimization],
+	[  --enable-optimization   : enable optimization flags. ],
+	[ default="no" ])
+
 AC_ARG_ENABLE([coverage],
 	[  --enable-coverage       : coverage analysis of the codebase. ],
 	[ default="no" ])
@@ -244,20 +248,22 @@
 ENV_CPPFLAGS="$CPPFLAGS"
 ENV_LDFLAGS="$LDFLAGS"
 
+# optimize build
+if test "x${enable_optimization}" = xyes; then
+	OPT_CFLAGS="-O3"
+fi
+
 # debug build stuff
 if test "x${enable_debug}" = xyes; then
 	AC_DEFINE_UNQUOTED([DEBUG], [1], [Compiling Debugging code])
 	OPT_CFLAGS="-O0"
 	PACKAGE_FEATURES="$PACKAGE_FEATURES debug"
-else
-	OPT_CFLAGS="-O3"
-fi
-
-# gdb flags
-if test "x${GCC}" = xyes; then
-	GDB_FLAGS="-ggdb3"
-else
-	GDB_FLAGS="-g"
+	# gdb flags
+	if test "x${GCC}" = xyes; then
+		GDB_CFLAGS="-ggdb3"
+	else
+		GDB_CFLAGS="-g"
+	fi
 fi
 
 # extra warnings
@@ -313,7 +319,7 @@
 fi
 
 # final build of *FLAGS
-CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS $OS_CFLAGS \
+CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_CFLAGS $OS_CFLAGS \
 	$COVERAGE_CFLAGS $EXTRA_WARNINGS $WERROR_CFLAGS"
 CPPFLAGS="$ENV_CPPFLAGS $OS_CPPFLAGS"
 LDFLAGS="$ENV_LDFLAGS $COVERAGE_LDFLAGS $OS_LDFLAGS"
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to