[LLVMdev] A patch for refine the cmake system and also configure
Gabor Greif
ggreif at gmail.com
Thu Aug 27 08:29:19 PDT 2009
On Aug 27, 4:20 pm, 罗勇刚(Yonggang Luo) <yonggang... at hotmail.com> wrote:
> > What do you want to improve exactly? Do you experience
> > problems?
>
> not only iterator.h but also DataTypes.h
Okay, I understand. You want to strip more files.
>
> I also put back iterator.h because at the trunk of llvm, iterator.h.in
> and iterator.h.cmake still there:(
Yeah, they came nack from dead by a reverse merge, because Bill pulled
the
brakes after the buildbots coughed hard. I did not even notice this
amidst
the confusion :-/ (<http://lists.cs.uiuc.edu/pipermail/llvm-commits/
Week-of-Mon-20090824/085690.html>)
I will try to clean this up today. Sigh.
Let me finish my part and then think about next steps. Too many things
can
go wrong here.
Cheers,
Gabor
> My improvement is now we didn't to generate DataTyes.h,
> we just need to generate config.h,
> And everything is configured at config.h, but not in seperate files.:)
>
> Also DataTypes.h
> and iterator.hn
>
> at the config.h.cmake
> I did the these changes. So at iterator.h, we can import the necessary
> defines from config.h.
>
> /**************************************
> ** Created by Kevin from config.h.in **
> ***************************************/
> +#ifdef LLVM_IMPORT_ITERATOR_CONFIG
>
> +/* Define to 1 if you have the `bidirectional_iterator' struct*/
> +#cmakedefine HAVE_BI_ITERATOR ${HAVE_BI_ITERATOR}
> +
> +/* Define to 1 if you have the standard `iterator' struct */
> +#cmakedefine HAVE_STD_ITERATOR ${HAVE_STD_ITERATOR}
> +
> +/* Define to 1 if you have the `forward_iterator' struct*/
> +#cmakedefine HAVE_FWD_ITERATOR ${HAVE_FWD_ITERATOR}
> +
> +#elif defined(LLVM_IMPORT_DATATYPES_CONFIG)
> +
> +/* Define to 1 if you have the <sys/types.h> header file. */
> +#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H}
> +
> +/* Define to 1 if you have the <inttypes.h> header file. */
> +#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H}
> +
> +/* Define to 1 if you have the <stdint.h> header file. */
> +#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
> +
> +/* Define to 1 if the system has the type `uint64_t'. */
> +#cmakedefine HAVE_UINT64_T ${HAVE_UINT64_T}
> +
> +/* Define to 1 if the system has the type `u_int64_t'. */
> +#cmakedefine HAVE_U_INT64_T ${HAVE_U_INT64_T}
> +
> +#else
> +
> /* Define if dlopen(0) will open the symbols of the program */
> #undef CAN_DLOPEN_SELF
>
> Just using
> +#define LLVM_IMPORT_ITERATOR_CONFIG
> +#include "llvm/Config/config.h"
> +#undef LLVM_IMPORT_ITERATOR_CONFIG
> in iterator.h, we can import the macro define
> +/* Define to 1 if you have the `bidirectional_iterator' struct*/
> +#cmakedefine HAVE_BI_ITERATOR ${HAVE_BI_ITERATOR}
> +
> +/* Define to 1 if you have the standard `iterator' struct */
> +#cmakedefine HAVE_STD_ITERATOR ${HAVE_STD_ITERATOR}
> +
> +/* Define to 1 if you have the `forward_iterator' struct*/
> +#cmakedefine HAVE_FWD_ITERATOR ${HAVE_FWD_ITERATOR}
>
> also
> just using
> +#define LLVM_IMPORT_DATATYPES_CONFIG
> +#include "llvm/Config/config.h"
> +#undef LLVM_IMPORT_DATATYPES_CONFIG
>
> we can import
>
> +/* Define to 1 if you have the <sys/types.h> header file. */
> +#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H}
> +
> +/* Define to 1 if you have the <inttypes.h> header file. */
> +#cmakedefine HAVE_INTTYPES_H ${HAVE_INTTYPES_H}
> +
> +/* Define to 1 if you have the <stdint.h> header file. */
> +#cmakedefine HAVE_STDINT_H ${HAVE_STDINT_H}
> +
> +/* Define to 1 if the system has the type `uint64_t'. */
> +#cmakedefine HAVE_UINT64_T ${HAVE_UINT64_T}
> +
> +/* Define to 1 if the system has the type `u_int64_t'. */
> +#cmakedefine HAVE_U_INT64_T ${HAVE_U_INT64_T}
>
> And because I add
> Index: cmake/modules/CheckSymbols.cmake
> so that we can using check_type_exists in cmake to identify
> HAVE_U_INT64_T
> and
> HAVE_UINT64_T
> and also
> +#cmakedefine HAVE_BI_ITERATOR ${HAVE_BI_ITERATOR}
> +
> +/* Define to 1 if you have the standard `iterator' struct */
> +#cmakedefine HAVE_STD_ITERATOR ${HAVE_STD_ITERATOR}
> +
> +/* Define to 1 if you have the `forward_iterator' struct*/
> +#cmakedefine HAVE_FWD_ITERATOR ${HAVE_FWD_ITERATOR}
>
> That's why I submit the patch.
> This can simplify the config progress.
> And because we using the macro define
>
> LLVM_IMPORT_DATATYPES_CONFIG
> LLVM_IMPORT_ITERATOR_CONFIG
>
> we can seperate llvm/Config/config.h to three(3) different part.
> and at default, we are using the last part. that's the else part.
>
> And also if there is any other place need config in Config.h,
> we can also do it like these.
> we can focus on only one file config.h, that's all, and we doesn't
> need to care about iterator.h.cmake or DataTypes.h.cmake.
> _______________________________________________
> LLVM Developers mailing list
> LLVM... at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
More information about the llvm-dev
mailing list