]> granicus.if.org Git - esp-idf/commitdiff
Merge branch 'feature/freebsd_build_system' into 'master'
authorAngus Gratton <angus@espressif.com>
Wed, 21 Aug 2019 08:18:47 +0000 (16:18 +0800)
committerAngus Gratton <angus@espressif.com>
Wed, 21 Aug 2019 08:18:47 +0000 (16:18 +0800)
build systems: Changes to work on FreeBSD

Closes IDFGH-1657

See merge request espressif/esp-idf!5821

1  2 
tools/cmake/kconfig.cmake
tools/idf.py

index 4c9c4891bfd80ea964e3f6703cca62bb61e4f3b9,66b78e2576100cd0d9f19044c8dc51226414baed..6b808deb5905349b5708397058a7a9f8186699e0
@@@ -30,30 -30,15 +30,35 @@@ function(__kconfig_init
                      "on the PATH, or an MSYS2 version of gcc on the PATH to build mconf-idf. "
                      "Consult the setup docs for ESP-IDF on Windows.")
              endif()
 -        elseif(WINPTY)
 -            set(MCONF "\"${WINPTY}\" \"${MCONF}\"")
 +        else()
 +            execute_process(COMMAND "${MCONF}" -v
 +                RESULT_VARIABLE mconf_res
 +                OUTPUT_VARIABLE mconf_out
 +                ERROR_VARIABLE mconf_err)
 +            if(${mconf_res})
 +                message(WARNING "Failed to detect version of mconf-idf. Return code was ${mconf_res}.")
 +            else()
 +                string(STRIP "${mconf_out}" mconf_out)
 +                set(mconf_expected_ver "mconf-v4.6.0.0-idf-20190628-win32")
 +                if(NOT ${mconf_out} STREQUAL "mconf-idf version ${mconf_expected_ver}")
 +                    message(WARNING "Unexpected ${mconf_out}. Expected ${mconf_expected_ver}. "
 +                                    "Please check the ESP-IDF Getting Started guide for version "
 +                                    "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH} "
 +                                    "to correct this issue")
 +                else()
 +                    message(STATUS "${mconf_out}")   # prints: mconf-idf version ....
 +                endif()
 +            endif()
 +            if(WINPTY)
 +                set(MCONF "\"${WINPTY}\" \"${MCONF}\"")
 +            endif()
          endif()
      endif()
+     if(${CMAKE_HOST_SYSTEM_NAME} MATCHES "FreeBSD")
+         set(MAKE_COMMMAND "gmake")
+     else()
+         set(MAKE_COMMMAND "make")
+     endif()
  
      if(NOT MCONF)
          # Use the existing Makefile to build mconf (out of tree) when needed
@@@ -67,9 -52,9 +72,9 @@@
          externalproject_add(mconf-idf
              SOURCE_DIR ${src_path}
              CONFIGURE_COMMAND ""
 -            BINARY_DIR "kconfig_bin"
 +            BINARY_DIR "${CMAKE_BINARY_DIR}/kconfig_bin"
              BUILD_COMMAND rm -f ${src_path}/zconf.lex.c ${src_path}/zconf.hash.c
-             COMMAND make -f ${src_path}/Makefile mconf-idf
+             COMMAND ${MAKE_COMMMAND} -f ${src_path}/Makefile mconf-idf
              BUILD_BYPRODUCTS ${MCONF}
              INSTALL_COMMAND ""
              EXCLUDE_FROM_ALL 1
diff --cc tools/idf.py
Simple merge