Skip to content

Commit

Permalink
Add new homebrew path for all build types [macos]
Browse files Browse the repository at this point in the history
  • Loading branch information
sumeetchhetri committed Jun 9, 2024
1 parent 571cec5 commit 531468e
Show file tree
Hide file tree
Showing 16 changed files with 367 additions and 137 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ bazel-ffead-cpp
code-snippets-build/
.bztmp
prelude
**/BUILD.bazel
**/BUILD.bazel
Cargo.lock
temp/
20 changes: 12 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ case "$host" in
is_librt_available="no"
#AC_DEFINE(OS_BSD, [], [set OS to bsd])
AC_DEFINE(OS_DARWIN, [1], [set OS to darwin])
CPPFLAGS="$CPPFLAGS -I/usr/local/opt/unixodbc/include -I/usr/local/include/ -O3"
AM_CXXFLAGS="$AM_CXXFLAGS -I/usr/local/opt/unixodbc/include -I/usr/local/include/ -O3"
LDFLAGS="$LDFLAGS -L/usr/local/opt/unixodbc/lib/ -L/usr/local/lib"
CPPFLAGS="$CPPFLAGS -I/usr/local/opt/unixodbc/include -I/usr/local/include/ -I/opt/homebrew/include -O3"
AM_CXXFLAGS="$AM_CXXFLAGS -I/usr/local/opt/unixodbc/include -I/usr/local/include/ -I/opt/homebrew/include -O3"
LDFLAGS="$LDFLAGS -L/usr/local/opt/unixodbc/lib/ -L/usr/local/lib -L/opt/homebrew/lib"
local_os_type="darwin"
AC_ARG_WITH([ssl_inc_dir],
[],
Expand Down Expand Up @@ -369,8 +369,8 @@ if test "x$mod_sdormsql" = "xyes"; then
AM_CXXFLAGS="$AM_CXXFLAGS -I${with_top_inc_dir}/postgresql -I${with_top_inc_dir}/pgsql -I${with_top_inc_dir}/unixodbc"
CPPFLAGS="$CPPFLAGS -I${with_top_inc_dir}/postgresql -I${with_top_inc_dir}/pgsql -I${with_top_inc_dir}/unixodbc"
else
AM_CXXFLAGS="$AM_CXXFLAGS -I/usr/include/postgresql -I/usr/include/pgsql -I/usr/local/include/postgresql -I/usr/local/include/pgsql -I/usr/local/include/unixodbc"
CPPFLAGS="$CPPFLAGS -I/usr/include/postgresql -I/usr/include/pgsql -I/usr/local/include/postgresql -I/usr/local/include/pgsql -I/usr/local/include/unixodbc"
AM_CXXFLAGS="$AM_CXXFLAGS -I/usr/include/postgresql -I/usr/include/pgsql -I/opt/homebrew/include/postgresql -I/opt/homebrew/include/pgsql -I/usr/local/include/postgresql -I/usr/local/include/pgsql -I/usr/local/include/unixodbc"
CPPFLAGS="$CPPFLAGS -I/usr/include/postgresql -I/usr/include/pgsql -I/opt/homebrew/include/postgresql -I/opt/homebrew/include/pgsql -I/usr/local/include/postgresql -I/usr/local/include/pgsql -I/usr/local/include/unixodbc"
fi
AC_DEFINE(INC_SDORM_SQL, [], [enable data-source-orm-sql module])
AC_DEFINE(INC_SDORM, [], [enable data-source-orm module])
Expand All @@ -392,8 +392,8 @@ if test "x$mod_sdormmongo" = "xyes"; then
AM_CXXFLAGS="$AM_CXXFLAGS -I${with_top_inc_dir}/libmongoc-1.0/ -I${with_top_inc_dir}/libbson-1.0"
CPPFLAGS="$CPPFLAGS -I${with_top_inc_dir}/libmongoc-1.0/ -I${with_top_inc_dir}/libbson-1.0"
else
AM_CXXFLAGS="$AM_CXXFLAGS -I/usr/include/libmongoc-1.0/ -I/usr/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0/ -I/usr/local/include/libbson-1.0"
CPPFLAGS="$CPPFLAGS -I/usr/include/libmongoc-1.0/ -I/usr/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0/ -I/usr/local/include/libbson-1.0"
AM_CXXFLAGS="$AM_CXXFLAGS -I/usr/include/libmongoc-1.0/ -I/usr/include/libbson-1.0 -I/opt/homebrew/include/libmongoc-1.0 -I/opt/homebrew/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0/ -I/usr/local/include/libbson-1.0"
CPPFLAGS="$CPPFLAGS -I/usr/include/libmongoc-1.0/ -I/usr/include/libbson-1.0 -I/opt/homebrew/include/libmongoc-1.0 -I/opt/homebrew/include/libbson-1.0 -I/usr/local/include/libmongoc-1.0/ -I/usr/local/include/libbson-1.0"
fi
AC_DEFINE(INC_SDORM_MONGO, [], [enable data-source-orm-mongo module])
AC_DEFINE(INC_SDORM, [], [enable data-source-orm module])
Expand Down Expand Up @@ -1206,7 +1206,11 @@ if test "x$mod_gtm" = "xyes"; then
if test -f /usr/local/include/gtmxc_types.h; then
echo 'gtm gtmxc_types.h header found..'
else
AC_CHECK_HEADER([gtmxc_types.h],,[AC_MSG_ERROR([gtm gtmxc_types.h header not found])])
if test -f /opt/homebrew/include/gtmxc_types.h; then
echo 'gtm gtmxc_types.h header found..'
else
AC_CHECK_HEADER([gtmxc_types.h],,[AC_MSG_ERROR([gtm gtmxc_types.h header not found])])
fi
fi
fi

Expand Down
3 changes: 2 additions & 1 deletion ffead-cpp-bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ function do_start() {
cpp_flags "-g"
fi
l_flags ""
add_lib_path "/usr/local/opt/openssl/lib" "/usr/local/lib"
add_lib_path "/usr/local/opt/openssl/lib" "/usr/local/lib" "/opt/homebrew/lib"
add_inc_path "/opt/homebrew/include" "/opt/homebrew/include/postgresql" "/opt/homebrew/include/pgsql" "/opt/homebrew/include/libmongoc-1.0" "/opt/homebrew/include/libbson-1.0"
add_inc_path "/usr/local/opt/openssl/include" "/usr/local/include" "/usr/include/libmongoc-1.0"
add_inc_path "/usr/include/libbson-1.0" "/usr/local/include/libmongoc-1.0" "/usr/local/include/libbson-1.0"
add_inc_path "/usr/include/postgresql" "/usr/include/pgsql" "/usr/local/include/postgresql" "/usr/local/include/pgsql"
Expand Down
3 changes: 2 additions & 1 deletion ffead-cpp-buck2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ function do_start() {
cpp_flags "-g"
fi
l_flags ""
add_lib_path "/usr/local/opt/openssl/lib" "/usr/local/lib"
add_lib_path "/usr/local/opt/openssl/lib" "/usr/local/lib" "/opt/homebrew/lib"
add_inc_path "/opt/homebrew/include" "/opt/homebrew/include/postgresql" "/opt/homebrew/include/pgsql" "/opt/homebrew/include/libmongoc-1.0" "/opt/homebrew/include/libbson-1.0"
add_inc_path "/usr/local/opt/openssl/include" "/usr/local/include" "/usr/include/libmongoc-1.0"
add_inc_path "/usr/include/libbson-1.0" "/usr/local/include/libmongoc-1.0" "/usr/local/include/libbson-1.0"
add_inc_path "/usr/include/postgresql" "/usr/include/pgsql" "/usr/local/include/postgresql" "/usr/local/include/pgsql"
Expand Down
3 changes: 2 additions & 1 deletion ffead-cpp-shellb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function do_start() {
finc_cpp_compiler "Please install a c++ compiler to proceed"
cpp_flags "-std=c++17 -Wall"
l_flags ""
add_lib_path "/usr/local/opt/openssl/lib" "/usr/local/lib"
add_lib_path "/usr/local/opt/openssl/lib" "/usr/local/lib" "/opt/homebrew/lib"
add_inc_path "/opt/homebrew/include" "/opt/homebrew/include/postgresql" "/opt/homebrew/include/pgsql" "/opt/homebrew/include/libmongoc-1.0" "/opt/homebrew/include/libbson-1.0"
add_inc_path "/usr/local/opt/openssl/include" "/usr/local/include" "/usr/include/libmongoc-1.0"
add_inc_path "/usr/include/libbson-1.0" "/usr/local/include/libmongoc-1.0" "/usr/local/include/libbson-1.0"
add_inc_path "/usr/include/postgresql" "/usr/include/pgsql" "/usr/local/include/postgresql" "/usr/local/include/pgsql"
Expand Down
40 changes: 24 additions & 16 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ endif
libssl = []
libcrypto = []
if build_machine.system().contains('darwin')
libssl = cc.find_library('ssl', required: false, dirs: ['/usr/local/opt/openssl/lib/', '/usr/local/lib'])
libcrypto = cc.find_library('crypto', required: false, dirs: ['/usr/local/opt/openssl/lib/', '/usr/local/lib'])
libssl = cc.find_library('ssl', required: false, dirs: ['/usr/local/opt/openssl/lib/', '/usr/local/lib', '/opt/homebrew/lib'])
libcrypto = cc.find_library('crypto', required: false, dirs: ['/usr/local/opt/openssl/lib/', '/usr/local/lib', '/opt/homebrew/lib'])
else
libssl = cc.find_library('ssl', required: false)
libcrypto = cc.find_library('crypto', required: false)
Expand Down Expand Up @@ -143,10 +143,14 @@ if get_option('MOD_SDORM_SQL') == true
if not cc.has_header('libpq-fe.h', args : '-I/usr/include/postgresql')
if not cc.has_header('libpq-fe.h', args : '-I/usr/include/pgsql')
if not cc.has_header('libpq-fe.h', args : '-I/usr/local/include/postgresql')
if not cc.has_header('libpq-fe.h', args : '-I/usr/local/include/pgsql')
error('libpq headers not found')
else
if cc.has_header('libpq-fe.h', args : '-I/usr/local/include/pgsql')
pqincpath = '/usr/local/include/pgsql'
else if cc.has_header('libpq-fe.h', args : '-I/opt/homebrew/include/postgresql')
pqincpath = '/opt/homebrew/include/postgresql'
else if cc.has_header('libpq-fe.h', args : '-I/opt/homebrew/include/pgsql')
pqincpath = '/opt/homebrew/include/pgsql'
else
error('libpq headers not found')
endif
else
pqincpath = '/usr/local/include/postgresql'
Expand Down Expand Up @@ -183,19 +187,23 @@ if get_option('MOD_SDORM_MONGO') == true
libbson = cc.find_library('bson-1.0', dirs: ['/usr/local/lib'])
libmongoc = cc.find_library('mongoc-1.0', dirs: ['/usr/local/lib'])
if not cc.has_header('bson.h', args : '-I/usr/include/libbson-1.0')
if not cc.has_header('bson.h', args : '-I/usr/local/include/libbson-1.0')
error('bson headers not found')
else
if cc.has_header('bson.h', args : '-I/usr/local/include/libbson-1.0')
global_includes += ['/usr/local/include/libbson-1.0']
else notif cc.has_header('bson.h', args : '-I/opt/homebrew/include/libbson-1.0')
global_includes += ['/opt/homebrew/include/libbson-1.0']
else
error('bson headers not found')
endif
else
global_includes += ['/usr/include/libbson-1.0']
endif
if not cc.has_header('mongoc.h', args : '-I/usr/include/libmongoc-1.0')
if not cc.has_header('mongoc.h', args : '-I/usr/local/include/libmongoc-1.0')
error('mongoc headers not found')
else
if cc.has_header('mongoc.h', args : '-I/usr/local/include/libmongoc-1.0')
global_includes += ['/usr/local/include/libmongoc-1.0']
else notif cc.has_header('mongoc.h', args : '-I/opt/homebrew/include/libmongoc-1.0')
global_includes += ['/opt/homebrew/include/libmongoc-1.0']
else
error('mongoc headers not found')
endif
else
global_includes += ['/usr/include/libmongoc-1.0']
Expand Down Expand Up @@ -249,7 +257,7 @@ if get_option('MOD_SOLR') == true
endif

if get_option('MOD_ELASTIC') == true
if cc.has_header('elasticlient/client.h', args : '-I/usr/local/include/')
if cc.has_header('elasticlient/client.h', args : '-I/usr/local/include/ -I/opt/homebrew/include')
conf_data.set('HAVE_ELASTIC', 1)
else
error('elasticlient headers not found')
Expand All @@ -261,7 +269,7 @@ if get_option('MOD_ELASTIC') == true
else
error('elastic lib not found')
endif
if cc.has_header('cpr/response.h', args : '-I/usr/local/include/')
if cc.has_header('cpr/response.h', args : '-I/usr/local/include/ -I/opt/homebrew/include')
conf_data.set('HAVE_CPR', 1)
else
error('cpr headers not found')
Expand All @@ -275,16 +283,16 @@ if get_option('MOD_ELASTIC') == true
endif
endif

if not cc.has_header('libcuckoo/cuckoohash_map.hh', args : '-I/usr/local/include/')
if not cc.has_header('libcuckoo/cuckoohash_map.hh', args : '-I/usr/local/include/ -I/opt/homebrew/include')
error('libcuckoo headers not found')
endif

if get_option('WITH_RAPIDJSON') == true and cc.has_header('rapidjson/document.h', args : '-I/usr/local/include/')
if get_option('WITH_RAPIDJSON') == true and cc.has_header('rapidjson/document.h', args : '-I/usr/local/include/ -I/opt/homebrew/include')
conf_data.set('HAVE_RAPID_JSON', 1)
endif

if get_option('WITH_PUGIXML') == true
if cc.has_header('pugixml.hpp', args : '-I/usr/local/include/')
if cc.has_header('pugixml.hpp', args : '-I/usr/local/include/ -I/opt/homebrew/include')
conf_data.set('HAVE_PUGI_XML', 1)
else
error('pugixml headers not found')
Expand Down
Loading

0 comments on commit 531468e

Please sign in to comment.