mirror of
https://github.com/curl/curl.git
synced 2026-08-15 10:54:08 +03:00
build: sync curlx build variables and script
Between src and tests, both in autotools and cmake. Closes #17675
This commit is contained in:
parent
614febca51
commit
11c211c33c
10 changed files with 36 additions and 37 deletions
|
|
@ -76,12 +76,13 @@ CLEANFILES =
|
|||
|
||||
if USE_UNITY
|
||||
if USE_CPPFLAG_CURL_STATICLIB
|
||||
curl_CURLX =
|
||||
curlx_src =
|
||||
else
|
||||
curl_CURLX = $(CURLX_CFILES)
|
||||
# These are part of the libcurl static lib. Add them here when linking shared.
|
||||
curlx_src = $(CURLX_CFILES)
|
||||
endif
|
||||
curltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curl_cfiles_gen) $(curl_CURLX)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --srcdir $(srcdir) --include $(CURL_CFILES) $(curl_cfiles_gen) $(curl_CURLX) > curltool_unity.c
|
||||
curltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curl_cfiles_gen) $(curlx_src)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --srcdir $(srcdir) --include $(CURL_CFILES) $(curl_cfiles_gen) $(curlx_src) > curltool_unity.c
|
||||
|
||||
nodist_curl_SOURCES = curltool_unity.c
|
||||
curl_SOURCES =
|
||||
|
|
@ -112,8 +113,8 @@ libcurltool_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
|
|||
libcurltool_la_CFLAGS =
|
||||
libcurltool_la_LDFLAGS = -static $(LIBCURL_PC_LIBS_PRIVATE)
|
||||
if USE_UNITY
|
||||
libcurltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curl_CURLX)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(CURL_CFILES) $(curl_CURLX) > libcurltool_unity.c
|
||||
libcurltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curlx_src)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(CURL_CFILES) $(curlx_src) > libcurltool_unity.c
|
||||
|
||||
nodist_libcurltool_la_SOURCES = libcurltool_unity.c
|
||||
libcurltool_la_SOURCES =
|
||||
|
|
|
|||
|
|
@ -22,22 +22,21 @@
|
|||
#
|
||||
###########################################################################
|
||||
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, CURLX_SRCS, TESTFILES variables
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, CURLX_CFILES, TESTFILES variables
|
||||
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
|
||||
set(_bundle_extra "")
|
||||
if(LIB_SELECTED STREQUAL LIB_SHARED)
|
||||
list(APPEND _bundle_extra ${CURLX_SRCS}) # Not exported from the libcurl shared build. Build a copy.
|
||||
if(LIB_SELECTED STREQUAL LIB_STATIC)
|
||||
set(CURLX_CFILES "") # Already exported from the libcurl static build. Skip them.
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT "${BUNDLE_SRC}"
|
||||
COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl"
|
||||
--include ${_bundle_extra} --test ${TESTFILES}
|
||||
--include ${CURLX_CFILES} --test ${TESTFILES}
|
||||
${CURL_MK_UNITY_OPTION} --srcdir "${CMAKE_CURRENT_SOURCE_DIR}" > "${BUNDLE_SRC}"
|
||||
DEPENDS
|
||||
"${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc"
|
||||
${FIRSTFILES} ${_bundle_extra} ${TESTFILES}
|
||||
${FIRSTFILES} ${CURLX_CFILES} ${TESTFILES}
|
||||
VERBATIM)
|
||||
|
||||
add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE_SRC}")
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|||
-I$(top_srcdir)/lib/curlx \
|
||||
-I$(srcdir)
|
||||
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, CURLX_SRCS, TESTFILES variables
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, CURLX_CFILES, TESTFILES variables
|
||||
include Makefile.inc
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt $(FIRSTFILES) $(TESTFILES)
|
||||
|
|
@ -54,14 +54,14 @@ AM_CPPFLAGS += -DCURL_STATICLIB
|
|||
endif
|
||||
AM_CPPFLAGS += -DCURL_NO_OLDIES
|
||||
|
||||
bundle_extra =
|
||||
if USE_CPPFLAG_CURL_STATICLIB
|
||||
curlx_src =
|
||||
else
|
||||
# These are part of the libcurl static lib. Add them here when linking shared.
|
||||
bundle_extra += $(CURLX_SRCS)
|
||||
curlx_src = $(CURLX_CFILES)
|
||||
endif
|
||||
$(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(bundle_extra) $(TESTFILES)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(bundle_extra) --test $(TESTFILES) > $(BUNDLE_SRC)
|
||||
$(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(curlx_src) $(TESTFILES)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(curlx_src) --test $(TESTFILES) > $(BUNDLE_SRC)
|
||||
|
||||
noinst_PROGRAMS = $(BUNDLE)
|
||||
nodist_SOURCES = $(BUNDLE_SRC)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ BUNDLE_SRC = clients.c
|
|||
# Files referenced from the bundle source
|
||||
FIRSTFILES = first.c first.h
|
||||
|
||||
CURLX_SRCS = \
|
||||
CURLX_CFILES = \
|
||||
../../lib/curlx/multibyte.c \
|
||||
../../lib/curlx/timediff.c \
|
||||
../../lib/curlx/wait.c
|
||||
|
|
|
|||
|
|
@ -22,13 +22,12 @@
|
|||
#
|
||||
###########################################################################
|
||||
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES, STUB_GSS variables
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_CFILES, TESTFILES, STUB_GSS variables
|
||||
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
|
||||
set(_bundle_extra "")
|
||||
if(LIB_SELECTED STREQUAL LIB_SHARED)
|
||||
list(APPEND _bundle_extra ${CURLX_SRCS}) # Not exported from the libcurl shared build. Build a copy.
|
||||
if(LIB_SELECTED STREQUAL LIB_STATIC)
|
||||
set(CURLX_CFILES "") # Already exported from the libcurl static build. Skip them.
|
||||
endif()
|
||||
|
||||
add_custom_command(OUTPUT "lib1521.c"
|
||||
|
|
@ -40,11 +39,11 @@ add_custom_command(OUTPUT "lib1521.c"
|
|||
|
||||
add_custom_command(OUTPUT "${BUNDLE_SRC}"
|
||||
COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl"
|
||||
--include ${UTILS} ${_bundle_extra} --test ${TESTFILES} "lib1521.c"
|
||||
--include ${UTILS} ${CURLX_CFILES} --test ${TESTFILES} "lib1521.c"
|
||||
${CURL_MK_UNITY_OPTION} --srcdir "${CMAKE_CURRENT_SOURCE_DIR}" > "${BUNDLE_SRC}"
|
||||
DEPENDS
|
||||
"${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc"
|
||||
${FIRSTFILES} ${UTILS} ${_bundle_extra} ${TESTFILES} "lib1521.c"
|
||||
${FIRSTFILES} ${UTILS} ${CURLX_CFILES} ${TESTFILES} "lib1521.c"
|
||||
VERBATIM)
|
||||
|
||||
add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE_SRC}")
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|||
-I$(srcdir) \
|
||||
-I$(top_srcdir)/tests/unit
|
||||
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES, STUB_GSS variables
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_CFILES, TESTFILES, STUB_GSS variables
|
||||
include Makefile.inc
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt .checksrc $(FIRSTFILES) $(UTILS) $(TESTFILES) \
|
||||
|
|
@ -84,14 +84,14 @@ libstubgss_la_LIBADD =
|
|||
libstubgss_la_DEPENDENCIES =
|
||||
endif
|
||||
|
||||
bundle_extra =
|
||||
if USE_CPPFLAG_CURL_STATICLIB
|
||||
curlx_src =
|
||||
else
|
||||
# These are part of the libcurl static lib. Add them here when linking shared.
|
||||
bundle_extra += $(CURLX_SRCS)
|
||||
curlx_src = $(CURLX_CFILES)
|
||||
endif
|
||||
$(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(bundle_extra) $(TESTFILES) lib1521.c
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) $(bundle_extra) --test $(TESTFILES) lib1521.c > $(BUNDLE_SRC)
|
||||
$(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(curlx_src) $(TESTFILES) lib1521.c
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) $(curlx_src) --test $(TESTFILES) lib1521.c > $(BUNDLE_SRC)
|
||||
|
||||
noinst_PROGRAMS = $(BUNDLE)
|
||||
nodist_SOURCES = $(BUNDLE_SRC)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ FIRSTFILES = first.c first.h
|
|||
# Common files used by test programs
|
||||
UTILS = memptr.c testutil.c testutil.h testtrace.c testtrace.h test.h ../unit/curlcheck.h
|
||||
|
||||
CURLX_SRCS = \
|
||||
CURLX_CFILES = \
|
||||
../../lib/curlx/warnless.c \
|
||||
../../lib/curlx/multibyte.c \
|
||||
../../lib/curlx/timediff.c \
|
||||
|
|
|
|||
|
|
@ -22,17 +22,17 @@
|
|||
#
|
||||
###########################################################################
|
||||
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES variables
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_CFILES, TESTFILES variables
|
||||
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
|
||||
|
||||
add_custom_command(OUTPUT "${BUNDLE_SRC}"
|
||||
COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl"
|
||||
--include ${UTILS} ${CURLX_SRCS} --test ${TESTFILES}
|
||||
--include ${UTILS} ${CURLX_CFILES} --test ${TESTFILES}
|
||||
${CURL_MK_UNITY_OPTION} --srcdir "${CMAKE_CURRENT_SOURCE_DIR}" > "${BUNDLE_SRC}"
|
||||
DEPENDS
|
||||
"${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc"
|
||||
${FIRSTFILES} ${UTILS} ${CURLX_SRCS} ${TESTFILES}
|
||||
${FIRSTFILES} ${UTILS} ${CURLX_CFILES} ${TESTFILES}
|
||||
VERBATIM)
|
||||
|
||||
add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE_SRC}")
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|||
-I$(top_srcdir)/lib/curlx \
|
||||
-I$(srcdir)
|
||||
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES variables
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_CFILES, TESTFILES variables
|
||||
include Makefile.inc
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt .checksrc $(FIRSTFILES) $(UTILS) $(TESTFILES)
|
||||
|
|
@ -55,8 +55,8 @@ if DOING_NATIVE_WINDOWS
|
|||
AM_CPPFLAGS += -DCURL_STATICLIB
|
||||
endif
|
||||
|
||||
$(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(CURLX_SRCS) $(TESTFILES)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) $(CURLX_SRCS) --test $(TESTFILES) > $(BUNDLE_SRC)
|
||||
$(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(CURLX_CFILES) $(TESTFILES)
|
||||
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) $(CURLX_CFILES) --test $(TESTFILES) > $(BUNDLE_SRC)
|
||||
|
||||
noinst_PROGRAMS = $(BUNDLE)
|
||||
nodist_SOURCES = $(BUNDLE_SRC)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ FIRSTFILES = first.c first.h
|
|||
# Common files used by test programs
|
||||
UTILS = getpart.c getpart.h util.c
|
||||
|
||||
CURLX_SRCS = \
|
||||
CURLX_CFILES = \
|
||||
../../lib/curlx/base64.c \
|
||||
../../lib/curlx/inet_pton.c \
|
||||
../../lib/curlx/multibyte.c \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue