From dcfcda0328718c902afb977076cbe88b71219369 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 24 Feb 2004 19:23:27 +0000 Subject: [PATCH] more syncing with lvm2 build process --- configure | 55 +++++++++++++++++++++++++------------------ configure.in | 11 +++++++-- lib/.export.sym | 32 ------------------------- lib/.exported_symbols | 27 +++++++++++++++++++++ make.tmpl.in | 16 +++++++------ 5 files changed, 77 insertions(+), 64 deletions(-) delete mode 100644 lib/.export.sym create mode 100644 lib/.exported_symbols diff --git a/configure b/configure index 78d1d2a..995ad56 100755 --- a/configure +++ b/configure @@ -561,7 +561,7 @@ ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. -for ac_prog in mawk gawk nawk awk +for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -1322,7 +1322,7 @@ else int main() { /* Ultrix mips cc rejects this. */ -typedef int charset[2]; const charset x = {0,0}; +typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; @@ -1397,7 +1397,7 @@ for ac_kw in inline __inline__ __inline; do #include "confdefs.h" int main() { -} int $ac_kw foo() { +} $ac_kw foo() { ; return 0; } EOF if { (eval echo configure:1404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then @@ -1686,9 +1686,13 @@ test "$host_alias" != "$target_alias" && case "$host_os" in linux*) - CFLAGS= ;; + CFLAGS= + CLDFLAGS="-Wl,--version-script,.export.sym" + LD_DEPS=".export.sym" ;; darwin*) - CFLAGS="-no-cpp-precomp" ;; + CFLAGS="-no-cpp-precomp" + CLDFLAGS= + LD_DEPS= ;; esac @@ -1746,13 +1750,13 @@ fi; if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:1750: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1754: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -1770,7 +1774,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -1792,12 +1796,12 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1796: checking return type of signal handlers" >&5 +echo "configure:1800: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1814,7 +1818,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1822: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1833,12 +1837,12 @@ EOF echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:1837: checking for vprintf" >&5 +echo "configure:1841: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -1885,12 +1889,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:1889: checking for _doprnt" >&5 +echo "configure:1893: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1921: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -1940,12 +1944,12 @@ fi for ac_func in mkdir rmdir uname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1944: checking for $ac_func" >&5 +echo "configure:1948: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1997,17 +2001,17 @@ for ac_hdr in getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2001: checking for $ac_hdr" >&5 +echo "configure:2005: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2011: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2144,6 +2148,9 @@ fi + + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -2330,6 +2337,8 @@ s%@kerneldir@%$kerneldir%g s%@missingkernel@%$missingkernel%g s%@kernelvsn@%$kernelvsn%g s%@tmpdir@%$tmpdir%g +s%@CLDFLAGS@%$CLDFLAGS%g +s%@LD_DEPS@%$LD_DEPS%g s%@DEBUG@%$DEBUG%g s%@DM_LIB_VERSION@%$DM_LIB_VERSION%g s%@COMPAT@%$COMPAT%g diff --git a/configure.in b/configure.in index 9123e2e..5f89399 100644 --- a/configure.in +++ b/configure.in @@ -48,9 +48,13 @@ AC_CANONICAL_SYSTEM case "$host_os" in linux*) - CFLAGS= ;; + CFLAGS= + CLDFLAGS="-Wl,--version-script,.export.sym" + LD_DEPS=".export.sym" ;; darwin*) - CFLAGS="-no-cpp-precomp" ;; + CFLAGS="-no-cpp-precomp" + CLDFLAGS= + LD_DEPS= ;; esac dnl -- prefix is /usr by default, the exec_prefix default is setup later @@ -188,6 +192,9 @@ AC_SUBST(kerneldir) AC_SUBST(missingkernel) AC_SUBST(kernelvsn) AC_SUBST(tmpdir) +AC_SUBST(CFLAGS) +AC_SUBST(CLDFLAGS) +AC_SUBST(LD_DEPS) AC_SUBST(DEBUG) AC_SUBST(DM_LIB_VERSION) AC_SUBST(COMPAT) diff --git a/lib/.export.sym b/lib/.export.sym deleted file mode 100644 index 1c5b956..0000000 --- a/lib/.export.sym +++ /dev/null @@ -1,32 +0,0 @@ -Base { - global: - dm_log_init; - dm_log_init_verbose; - dm_task_create; - dm_task_destroy; - dm_task_set_name; - dm_task_set_uuid; - dm_get_library_version; - dm_task_get_driver_version; - dm_task_get_info; - dm_task_get_deps; - dm_task_get_name; - dm_task_get_names; - dm_task_get_versions; - dm_task_get_uuid; - dm_task_set_ro; - dm_task_set_newname; - dm_task_set_event_nr; - dm_task_set_major; - dm_task_set_minor; - dm_task_add_target; - dm_get_next_target; - dm_task_run; - dm_set_dev_dir; - dm_dir; - dm_format_dev; - dm_lib_release; - dm_lib_exit; - local: - *; -}; diff --git a/lib/.exported_symbols b/lib/.exported_symbols new file mode 100644 index 0000000..1b7ab16 --- /dev/null +++ b/lib/.exported_symbols @@ -0,0 +1,27 @@ +dm_log_init +dm_log_init_verbose +dm_task_create +dm_task_destroy +dm_task_set_name +dm_task_set_uuid +dm_get_library_version +dm_task_get_driver_version +dm_task_get_info +dm_task_get_deps +dm_task_get_name +dm_task_get_names +dm_task_get_versions +dm_task_get_uuid +dm_task_set_ro +dm_task_set_newname +dm_task_set_event_nr +dm_task_set_major +dm_task_set_minor +dm_task_add_target +dm_get_next_target +dm_task_run +dm_set_dev_dir +dm_dir +dm_format_dev +dm_lib_release +dm_lib_exit diff --git a/make.tmpl.in b/make.tmpl.in index 0a948b0..803d305 100644 --- a/make.tmpl.in +++ b/make.tmpl.in @@ -28,6 +28,7 @@ INSTALL = @INSTALL@ LN_S = @LN_S@ LIBS = @LIBS@ CFLAGS += @CFLAGS@ +LD_DEPS += @LD_DEPS@ # Setup directory variables prefix = $(DESTDIR)@prefix@ @@ -109,7 +110,7 @@ install: all $(SUBDIRS.install) $(SUBDIRS): $(MAKE) -C $@ -$(SUBDIRS.install): +$(SUBDIRS.install): $(SUBDIRS) $(MAKE) -C $(@:.install=) install $(SUBDIRS.clean): @@ -123,15 +124,11 @@ $(TARGETS): $(OBJECTS) %.o: %.c $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@ -%.so: $(OBJECTS) .export.sym - -%.so: %.o +$(LIB_SHARED): $(OBJECTS) $(LD_DEPS) $(CC) -shared -Wl,-soname,$(notdir $@).$(LIB_VERSION) \ -Wl,--version-script,.export.sym $(OBJECTS) -o $@ -%.a: $(OBJECTS) - -%.a: %.o +$(LIB_STATIC): $(OBJECTS) $(RM) $@ $(AR) r $@ $(OBJECTS) $(RANLIB) $@ @@ -152,6 +149,11 @@ distclean: $(SUBDIRS.distclean) config.cache config.log config.status \ Makefile make.tmpl core +.export.sym: .exported_symbols + set -e; (echo "Base {"; echo " global:"; \ + sed "s/^/ /;s/$$/;/" < $<; \ + echo " local:"; echo " *;"; echo "};") > $@ + ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) ifdef SOURCES -- 2.43.5