Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
2c9b0d37
Commit
2c9b0d37
authored
May 01, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only check optimization flags when useful
parent
4a78361e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
148 additions
and
94 deletions
+148
-94
configure.ac
configure.ac
+144
-76
m4/vlc.m4
m4/vlc.m4
+1
-5
vlc-config.in.in
vlc-config.in.in
+3
-13
No files found.
configure.ac
View file @
2c9b0d37
...
...
@@ -1050,79 +1050,157 @@ AS_IF([test "${enable_coverage}" != "no"], [
VLC_SAVE_FLAGS
dnl
dnl Enable/disable optimizations
dnl
AC_ARG_ENABLE(optimizations,
[AS_HELP_STRING([--disable-optimizations],
[disable compiler optimizations (default enabled)])],,
[enable_optimizations="yes"])
AS_IF([test "${enable_optimizations}" != "no"], [
enable_optimizations="speed"
])
dnl Check for various optimization flags
AC_CACHE_CHECK([if \$CC accepts -O4],
[ac_cv_c_o4],
[CFLAGS="${CFLAGS_save} -O4"
AC_TRY_COMPILE([],,ac_cv_c_o4=yes, ac_cv_c_o4=no)])
if test "${ac_cv_c_o4}" != "no" -a "x${enable_debug}" = "xno"; then
CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O4"
else
AC_CACHE_CHECK([if \$CC accepts -O3],
[ac_cv_c_o3],
[CFLAGS="${CFLAGS_save} -O3"
AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
if test "${ac_cv_c_o3}" != "no" -a "x${enable_debug}" = "xno"; then
CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O3"
else
AC_CACHE_CHECK([if \$CC accepts -O2],
[ac_cv_c_o2],
[CFLAGS="${CFLAGS_save} -O2"
AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
if test "${ac_cv_c_o2}" != "no"; then
CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O2"
else
AC_CACHE_CHECK([if \$CC accepts -O],
[ac_cv_c_o],
[CFLAGS="${CFLAGS_save} -O"
AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
if test "${ac_cv_c_o}" != "no"; then
CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -O"
fi
fi
fi
fi
AS_IF([test "${enable_optimizations}" != "no"], [
C_O=""
dnl -O4 and -O3 only in production builds
AS_IF([test "{enable_debug}" = "no"], [
AC_CACHE_CHECK([if $CC accepts -O4], [ac_cv_c_o4], [
CFLAGS="${CFLAGS_save} -O4"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_o4=yes
], [
ac_cv_c_o4=no
])
])
AS_IF([test "${ac_cv_c_o4}" != "no"], [
C_O="-O4"
], [
AC_CACHE_CHECK([if $CC accepts -O3], [ac_cv_c_o3], [
CFLAGS="${CFLAGS_save} -O3"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_o3=yes
], [
ac_cv_c_o3=no
])
])
AS_IF([test "${ac_cv_c_o3}" != "no"], [
C_O="-O3"
])
])
])
dnl Check for -ffast-math
AC_CACHE_CHECK([if \$CC accepts -ffast-math],
[ac_cv_c_fast_math],
[CFLAGS="${CFLAGS_save} -ffast-math"
AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
if test "${ac_cv_c_fast_math}" != "no"; then
CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -ffast-math"
fi
dnl -O2 and -O in both production and debug builds
AS_IF([test "x$C_O" = "x"], [
AC_CACHE_CHECK([if \$CC accepts -O2], [ac_cv_c_o2], [
CFLAGS="${CFLAGS_save} -O2"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_o2=yes
], [
ac_cv_c_o2=no
])
])
AS_IF([test "${ac_cv_c_o2}" != "no"], [
C_O="-O2"
], [
AC_CACHE_CHECK([if \$CC accepts -O], [ac_cv_c_o], [
CFLAGS="${CFLAGS_save} -O"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_o=yes
], [
ac_cv_c_o=no
])
])
AS_IF([test "${ac_cv_c_o}" != "no"], [
C_O="-O"
])
])
])
dnl Check for -funroll-loops
AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
[ac_cv_c_unroll_loops],
[CFLAGS="${CFLAGS_save} -funroll-loops"
AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
if test "${ac_cv_c_unroll_loops}" != "no"; then
CFLAGS_OPTIM_SPEED="${CFLAGS_OPTIM_SPEED} -funroll-loops"
fi
VLC_RESTORE_FLAGS
CFLAGS="${CFLAGS} ${C_O}"
CXXFLAGS="${CXXFLAGS} ${C_O}"
OBJCFLAGS="${OBJCFLAGS} ${C_O}"
VLC_SAVE_FLAGS
dnl Check for -ffast-math
AC_CACHE_CHECK([if $CC accepts -ffast-math], [ac_cv_c_fast_math], [
CFLAGS="${CFLAGS_save} -ffast-math"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_fast_math=yes
], [
ac_cv_c_fast_math=no
])
])
AS_IF([test "${ac_cv_c_fast_math}" != "no"], [
VLC_RESTORE_FLAGS
CFLAGS="${CFLAGS} -ffast-math"
CXXFLAGS="${CXXFLAGS} -ffast-math"
OBJCFLAGS="${OBJCFLAGS} -ffast-math"
VLC_SAVE_FLAGS
])
dnl Check for -fomit-frame-pointer
AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
[ac_cv_c_omit_frame_pointer],
[CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
if test "${ac_cv_c_omit_frame_pointer}" != "no"; then
if test "${SYS}" != "darwin"; then
CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
else
dnl On darwin we explicitely disable it.
CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fno-omit-frame-pointer"
fi
fi
dnl Check for -funroll-loops
AC_CACHE_CHECK([if $CC accepts -funroll-loops], [ac_cv_c_unroll_loops], [
CFLAGS="${CFLAGS_save} -funroll-loops"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_unroll_loops=yes
], [
ac_cv_c_unroll_loops=no
])
])
AS_IF([test "${ac_cv_c_unroll_loops}" != "no"], [
VLC_RESTORE_FLAGS
CFLAGS="${CFLAGS} -funroll-loops"
CXXFLAGS="${CXXFLAGS} -funroll-loops"
OBJCFLAGS="${OBJCFLAGS} -funroll-loops"
VLC_SAVE_FLAGS
])
AS_IF([test "$enable_debug" = "no"], [
dnl Check for -fomit-frame-pointer
AC_CACHE_CHECK([if $CC accepts -fomit-frame-pointer],
[ac_cv_c_omit_frame_pointer], [
CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_c_omit_frame_pointer=yes
], [
ac_cv_c_omit_frame_pointer=no
])
])
AS_IF([test "${ac_cv_c_omit_frame_pointer}" != "no"], [
VLC_RESTORE_FLAGS
AS_IF([test "${SYS}" != "darwin"], [
CFLAGS="${CFLAGS} -fomit-frame-pointer"
CXXFLAGS="${CXXFLAGS} -fomit-frame-pointer"
], [
dnl On darwin we explicitely disable it.
CFLAGS="${CFLAGS} -fno-omit-frame-pointer"
CXXFLAGS="${CXXFLAGS} -fno-omit-frame-pointer"
OBJCFLAGS="${OBJCFLAGS} -fno-omit-frame-pointer"
])
VLC_SAVE_FLAGS
])
])
])
dnl Check for Darwin plugin linking flags
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error],
[ac_cv_ld_darwin],
[CFLAGS="${CFLAGS_save} -bundle -undefined error"
AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test "${ac_cv_ld_darwin}" != "no"; then
AS_IF([test "${SYS}" = "darwin"], [
AC_CACHE_CHECK([if $CC accepts -bundle -undefined error],
[ac_cv_ld_darwin], [
CFLAGS="${CFLAGS_save} -bundle -undefined error"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [
ac_cv_ld_darwin=yes
], [
ac_cv_ld_darwin=no
])
])
AS_IF([test "${ac_cv_ld_darwin}" != "no"], [
VLC_ADD_LDFLAGS([plugin],[-bundle -undefined error])
fi
])
])
dnl Checks for __attribute__(aligned()) directive
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
...
...
@@ -1570,16 +1648,6 @@ if test "${enable_optimize_memory}" = "yes"; then
AC_DEFINE(OPTIMIZE_MEMORY, 1, Define if you want to optimize memory usage over performance)
fi
dnl
dnl Enable/disable optimizations
dnl
AC_ARG_ENABLE(optimizations,
[AS_HELP_STRING([--disable-optimizations],
[disable compiler optimizations (default enabled)])])
if test "${enable_optimizations}" != "no"; then
enable_optimizations="speed"
fi
dnl
dnl Allow running as root (useful for people running on embedded platforms)
dnl
...
...
m4/vlc.m4
View file @
2c9b0d37
...
...
@@ -92,15 +92,11 @@ AC_DEFUN([VLC_OUTPUT_VLC_CONFIG_IN], [
rm -f vlc-config.in
sed -ne '/#@1@#/q;p' < "${srcdir}/vlc-config.in.in" \
| sed -e "s/@gprof@/${enable_gprof}/" \
-e "s/@cprof@/${enable_cprof}/" \
| sed \
-e "s/@optim@/${enable_optimizations}/" \
-e "s/@debug@/${enable_debug}/" \
-e "s/@PLUGINS@/${PLUGINS}/" \
-e "s/@BUILTINS@/${BUILTINS}/" \
-e "s/@CFLAGS_TUNING@/${CFLAGS_TUNING}/" \
-e "s/@CFLAGS_OPTIM_SPEED@/${CFLAGS_OPTIM_SPEED}/" \
-e "s/@CFLAGS_OPTIM_NODEBUG@/${CFLAGS_OPTIM_NODEBUG}/" \
> vlc-config.in
dnl Switch/case loop
...
...
vlc-config.in.in
View file @
2c9b0d37
...
...
@@ -5,9 +5,6 @@ exec_prefix="@exec_prefix@"
exec_prefix_set=no
datarootdir="@datarootdir@"
debug="@debug@"
gprof="@gprof@"
cprof="@cprof@"
optim="@optim@"
plugins="@PLUGINS@ "
...
...
@@ -21,8 +18,6 @@ ldflags=""
libs=""
cflags_tuning="@CFLAGS_TUNING@"
cflags_optim_speed="@CFLAGS_OPTIM_SPEED@"
cflags_optim_nodebug="@CFLAGS_OPTIM_NODEBUG@"
#
# Do not touch below this place unless you really know what you are doing
...
...
@@ -84,14 +79,9 @@ cppflags="${cppflags} -D_FILE_OFFSET_BITS=64 -D__USE_UNIX98 -D_REENTRANT -D_THRE
# Various additional defines
#
if [ "${optim}" = speed ]; then
cflags="${cflags} ${cflags_optim_speed} ${cflags_tuning}"
cxxflags="${cxxflags} ${cflags_optim_speed} ${cflags_tuning}"
objcflags="${objcflags} ${cflags_optim_speed} ${cflags_tuning}"
if [ "${debug}" != yes -a "${gprof}" != yes -a "${cprof}" != yes ]; then
cflags="${cflags} ${cflags_optim_nodebug}"
cxxflags="${cxxflags} ${cflags_optim_nodebug}"
objcflags="${objcflags} ${cflags_optim_nodebug}"
fi
cflags="${cflags} ${cflags_tuning}"
cxxflags="${cxxflags} ${cflags_tuning}"
objcflags="${objcflags} ${cflags_tuning}"
fi
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment