Skip to content

More Makefile/configure simplification

Juan Quintela qemu-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest81 patches 9 repliesIn review
  2. v142 patches 11 repliesSuperseded

Changes in v2 from the cover letter

- split CFLAGS into QEMU_CFLAGS and CFLAGS to enable:
make CFLAGS="-O3" foo.o
make CFLAGS=""
- We have now LIBS/libs_softmmu/libs_tools
Everything that is in libs_tools is also in libs_softmmu, namely curl and vde
- We have now LIBS and QEMU_CFLAGS per target
- all *_LIBS have been folded in the right LIBS variable
- All arch/os setup/libs/cflags moved to ./configure
- AUDIO_PT is gone, it setup to linke with -pthread, but the LDFLAGS was used only for executables in main Makefile, and none of them use sound. It was not used for the targets, that is where it would make a difference.
- aio is renamed to posix_aio

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/81strip binary is not used anywhereconfigure+0 -20 replies
2/81oss variable don't exist anymoreconfigure+0 -10 replies
3/81Use CFLAGS from enviroment, ARCH_CFLAGS hasn't been defined yetconfigure+2 -20 replies
4/81move cpu command line setting to the begginingconfigure+8 -20 replies
5/81move check_linker_flags sooner than starting of printing variablesconfigure+33 -310 replies
6/81remove not needed rt variableconfigure+1 -70 replies
7/81move checks for bswap32/bswap_32 sooner than starting of printing variablesconfigure+28 -160 replies
8/81move general CFLAGS/LDFLAGS definitions after last $cc runconfigure+33 -300 replies
9/81We want to add options at the beggining, not at the end of variablesconfigure+7 -70 replies
10/81Remove OS_{CFLAGS, LDFLAGS} and ARCH_{LDFLAGS, CFLAGS}configure+64 -630 replies
11/81move EXTRA_CFLAGS/LDFLAGS to the very beginningconfigure+8 -40 replies
12/81create compile_object/compile_prog functionsconfigure+44 -380 replies
13/81remove unused temporal filesconfigure+1 -40 replies
14/81Add CURL_CFLAGSMakefile configure+4 -10 replies
15/81__sparc_*__ is defined through -D__sparc_*__configure create_config+0 -90 replies
16/81move mingw32 code after selection of OSconfigure+8 -80 replies
17/81This variables can't be set hereconfigure+0 -30 replies
18/81refactor kqemu selection for both mingw32configure+3 -60 replies
19/81move sparc_cpu arg parsing to the beginingconfigure+24 -220 replies
20/81refactor sparc_cpu code to be in a single placeconfigure+21 -240 replies
21/81refactor $cpu selection in various placesconfigure+13 -500 replies
22/81reindent Operating System selection configureconfigure+83 -810 replies
23/81We use -lz for all binariesMakefile+1 -30 replies
24/81We want to pass LIB through configuration files nowMakefile Makefile.target configure+2 -20 replies
25/81PTHREADLIBS was used for all binariesMakefile Makefile.target configure+1 -50 replies
26/81CLOCKLIBS was used for all binariesMakefile Makefile.target configure+2 -70 replies
27/81Move to configure CONFIG_SOLARIS libraries needed alwaysMakefile Makefile.target configure+1 -50 replies
28/81Move to configure CONFIG_WIN32 libraries needed alwaysMakefile Makefile.target configure+1 -70 replies
29/81We set -Werror through configure nowMakefile.target+0 -10 replies
30/81Rename CPPFLAGS to QEMU_CFLAGSMakefile Makefile.hw Makefile.target +3 more+80 -770 replies
31/81split QEMU_CFLAGS very long lineconfigure+2 -10 replies
32/81move common QEMU_CFLAGS to configureMakefile Makefile.hw Makefile.target +1 more+5 -90 replies
33/81Refactor HELPER_CFLAGSMakefile.target configure+8 -240 replies
34/81move SDL_LIBS Win32 hack to configureMakefile.target configure+3 -40 replies
35/81Add libs_softmmu variableconfigure+3 -10 replies
36/81Add SDL_LIBS to libs_softmmuMakefile.target configure+2 -20 replies
37/81gcc generates the right dependency for this fileMakefile.target+0 -40 replies
38/81move coreaudio libraries to coreaudio selectionMakefile.target configure+5 -40 replies
39/81Move sound library selection to sound selectionMakefile.target configure+13 -220 replies
40/81files are only compiled when CONFIG_ADLIB is definedMakefile.target+0 -20 replies
41/81Test if we need -lutil in ,/configureMakefile.target configure+5 -100 replies
42/81Fold CURSES_LIBS into libsoftmmu_libsMakefile.target configure+3 -40 replies
43/81Fold VNC_TLS_LIBS into libs_softmmuMakefile.target configure+1 -50 replies
44/81Fold VNC_SASL_LIBS into libs_softmmuMakefile.target configure+1 -60 replies
45/81Fold XEN_LIBS into libs_softmmuMakefile.target configure+1 -50 replies
46/81Fold BLUEZ_LIBS into libs_softmmuMakefile.target configure+1 -60 replies
47/81Fold FDT_LIBS into libs_softmmuMakefile.target configure+1 -30 replies
48/81Fold BRLAPI_LIBS into libs_softmmuMakefile Makefile.target configure+2 -50 replies
49/81remove duplicated TARGET_GPROF codeMakefile.target+1 -60 replies
50/81\!CONFIG_USER_ONLY == CONFIG_SOFTMMUMakefile.target+4 -80 replies
51/81Introduce CONFIG_NOSOFTFLOAT and simplify Makefile.targetMakefile.target configure+6 -50 replies
52/81permit to add things to LDFLAGS for targetconfigure+7 -90 replies
53/81refactor linker_script common part and change quotingconfigure+7 -60 replies
54/81permit to add things to CFLAGS per targetconfigure+3 -10 replies
55/81fix typo, there should be bsd_user thereconfigure+2 -10 replies
56/81Move alpha CFLAGS target to configureMakefile.target configure+8 -60 replies
57/81Move ia64 QEMU_CFLAGS target to configureMakefile.target configure+3 -40 replies
58/81this bit was already generated in configureMakefile.target+0 -40 replies
59/81Fold TARGET_GPROF handling in configureMakefile.target configure+11 -100 replies
60/81Generate more conmmon CFLAGSMakefile.target configure+8 -70 replies
61/81Added CONFIG_NEED_MMU for microblaze and crisMakefile.target configure+7 -30 replies
62/81Move dis-* selection to configureMakefile.target configure+53 -410 replies
63/81Use only one KVM_CFLAGSMakefile.target+1 -20 replies
64/81Use one less HELPER_CFLAGSMakefile.target+1 -30 replies
65/81Make slirp include dir globlal in cflagsMakefile Makefile.target configure+1 -70 replies
66/81FMOD_CFLAGS is not set when CONFIG_FMOD is undefMakefile+1 -30 replies
67/81AUDIO_PT is not neededMakefile+0 -80 replies
68/81Generate CONFIG_AUDIO_PT_INT in configureMakefile configure+7 -70 replies
69/81CONFIG_POSIX makes more sense that not CONFIG_WIN32Makefile+1 -10 replies
70/81remove last 3 uses of :=, everywhere else uses += or =Makefile.target+3 -34 replies
71/81Consolidate audio flags in configureMakefile.target configure+11 -170 replies
72/81We also need TARGET_<arechname> in Makefilesconfigure create_config+2 -20 replies
73/81use TARGET_<arch name> for selectionMakefile.target+3 -110 replies
74/81Disable aio in mingw32configure+1 -00 replies
75/81Add libs_tools supportMakefile configure+3 -10 replies
76/81VDE libs are used both by tools and softmmuMakefile Makefile.target configure+3 -40 replies
77/81CURL libs are used both by tools and softmmuMakefile Makefile.target configure+3 -30 replies
78/81Add cocoa libs at Darwin selection timeMakefile.target configure+1 -50 replies
79/81convert gprof flags to style of rest of MakefileMakefile.target configure+2 -40 replies
80/81Move libsunpath to use the same style than everything elseMakefile.target configure+3 -70 replies
81/81rename aio/CONFIG_AIO to posix_aio/CONFIG_POSIX_AIOMakefile block/raw-posix.c configure+23 -235 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 00/81] More Makefile/configure simplification

Hi

I compiled natively on x86_64 linux and crosscompiled it for windows. Compilation in a different build directory also works.

v2:
- split CFLAGS into QEMU_CFLAGS and CFLAGS to enable:
make CFLAGS="-O3" foo.o
make CFLAGS=""
- We have now LIBS/libs_softmmu/libs_tools
Everything that is in libs_tools is also in libs_softmmu, namely curl and vde
- We have now LIBS and QEMU_CFLAGS per target
- all *_LIBS have been folded in the right LIBS variable
- All arch/os setup/libs/cflags moved to ./configure
- AUDIO_PT is gone, it setup to linke with -pthread, but the LDFLAGS was used only for executables in main Makefile, and none of them use sound. It was not used for the targets, that is where it would make a difference.
- aio is renamed to posix_aio

v1:
- CPPFLAGS is gone, long life to CFLAGS
- Refactor common CFLAGS setup to ./configure
- Use same CFLAGS for all configure tests
- ARCH/OS_CFLAGS/LDFLAGS are gone, we add to CFLAGS as we find more options
- new functions complie_prog() compile_object(), test case compilation is done with one function
- LIBS: Start LIBS reorganization, common stuff moved to ./configure
- libs_softmmu created for libraries that are only for softmmu
- moved compilation tests out of the creation of configuration files, make things way easier.
- Moved sparc_cpu setup to a single place
- minor cleanups/refactors/.. here and there

Comments?

ToDo:
- move all the handling of options to the start of the file
- change meanining of options to:
foo="no" -> don't even try
foo="" -> try to detect, and go with detected result
foo="yes" -> detect, and if it is not found, just exit with an error message.
Distributions really want to be able to tell:
./configure --enable-kvm --enable-vnc-tls ...
And if it didn't found anything, just exit. Packager would sort the right BuildRequires at this point.
- Start thinking how to enable/disable drivers

Later, Juan.

Juan Quintela (81):
strip binary is not used anywhere
oss variable don't exist anymore
Use CFLAGS from enviroment, ARCH_CFLAGS hasn't been defined yet move cpu command line setting to the beggining
move check_linker_flags sooner than starting of printing variables remove not needed rt variable
move checks for bswap32/bswap_32 sooner than starting of printing
variables
move general CFLAGS/LDFLAGS definitions after last $cc run We want to add options at the beggining, not at the end of variables Remove OS_{CFLAGS,LDFLAGS} and ARCH_{LDFLAGS,CFLAGS}
move EXTRA_CFLAGS/LDFLAGS to the very beginning
create compile_object/compile_prog functions
remove unused temporal files
Add CURL_CFLAGS
__sparc_*__ is defined through -D__sparc_*__
move mingw32 code after selection of OS
This variables can't be set here
refactor kqemu selection for both mingw32
move sparc_cpu arg parsing to the begining
refactor sparc_cpu code to be in a single place
refactor $cpu selection in various places
reindent Operating System selection configure
We use -lz for all binaries
We want to pass LIB through configuration files now PTHREADLIBS was used for all binaries
CLOCKLIBS was used for all binaries
Move to configure CONFIG_SOLARIS libraries needed always Move to configure CONFIG_WIN32 libraries needed always
We set -Werror through configure now
Rename CPPFLAGS to QEMU_CFLAGS
split QEMU_CFLAGS very long line
move common QEMU_CFLAGS to configure
Refactor HELPER_CFLAGS
move SDL_LIBS Win32 hack to configure
Add libs_softmmu variable
Add SDL_LIBS to libs_softmmu
gcc generates the right dependency for this file
move coreaudio libraries to coreaudio selection
Move sound library selection to sound selection
files are only compiled when CONFIG_ADLIB is defined
Test if we need -lutil in ,/configure
Fold CURSES_LIBS into libsoftmmu_libs
Fold VNC_TLS_LIBS into libs_softmmu
Fold VNC_SASL_LIBS into libs_softmmu
Fold XEN_LIBS into libs_softmmu
Fold BLUEZ_LIBS into libs_softmmu
Fold FDT_LIBS into libs_softmmu
Fold BRLAPI_LIBS into libs_softmmu
remove duplicated TARGET_GPROF code
\!CONFIG_USER_ONLY == CONFIG_SOFTMMU
Introduce CONFIG_NOSOFTFLOAT and simplify Makefile.target permit to add things to LDFLAGS for target
refactor linker_script common part and change quoting permit to add things to CFLAGS per target
fix typo, there should be bsd_user there
Move alpha CFLAGS target to configure
Move ia64 QEMU_CFLAGS target to configure
this bit was already generated in configure
Fold TARGET_GPROF handling in configure
Generate more conmmon CFLAGS
Added CONFIG_NEED_MMU for microblaze and cris
Move dis-* selection to configure
Use only one KVM_CFLAGS
Use one less HELPER_CFLAGS
Make slirp include dir globlal in cflags
FMOD_CFLAGS is not set when CONFIG_FMOD is undef
AUDIO_PT is not needed
Generate CONFIG_AUDIO_PT_INT in configure
CONFIG_POSIX makes more sense that not CONFIG_WIN32 remove last 3 uses of :=, everywhere else uses += or = Consolidate audio flags in configure
We also need TARGET_<arechname> in Makefiles
use TARGET_<arch name> for selection
Disable aio in mingw32
Add libs_tools support
VDE libs are used both by tools and softmmu
CURL libs are used both by tools and softmmu
Add cocoa libs at Darwin selection time
convert gprof flags to style of rest of Makefile
Move libsunpath to use the same style than everything else rename aio/CONFIG_AIO to posix_aio/CONFIG_POSIX_AIO

 Makefile                   |   59 +---
 Makefile.hw                |    4 +-
 Makefile.target            |  275 ++------------
 block/raw-posix.c          |   26 +-
 configure                  |  864 +++++++++++++++++++++++++-------------------
 create_config              |    8 -
 pc-bios/optionrom/Makefile |    6 +-
 rules.mak                  |    6 +-
 8 files changed, 555 insertions(+), 693 deletions(-)